Add Kernel Image install support

This commit is contained in:
dchvs 2021-03-03 22:53:37 -06:00
parent d6f6f6956c
commit 4c1ccb84dc
3 changed files with 38 additions and 0 deletions

View File

@ -158,6 +158,9 @@ dtbs: scripts
dtbs_install:
$(Q)$(MAKE) $(dtbinst)=$(boot)/dts
kernel_install:
$(Q)$(MAKE) $(kernelinst)=$(boot)/
Image-dtb Image.gz-dtb: vmlinux scripts dtbs
$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@

View File

@ -254,6 +254,7 @@ modbuiltin := -f $(srctree)/scripts/Makefile.modbuiltin obj
# Usage:
# $(Q)$(MAKE) $(dtbinst)=dir
dtbinst := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.dtbinst obj
kernelinst := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.kernelinst obj
###
# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.clean obj=

View File

@ -0,0 +1,34 @@
# ==========================================================================
# Installing Image file
#
# Installs Image file from INSTALL_IMAGE_PATH directory or the default location:
#
# ==========================================================================
src := $(obj)
PHONY := __kernel_install
__kernel_install:
export kernelinst-root ?= $(obj)
include include/config/auto.conf
include scripts/Kbuild.include
include $(src)/Makefile
PHONY += __kernel_install_prep
__kernel_install_prep:
ifeq ("$(kernelinst-root)", "$(obj)")
$(Q)mkdir -p $(INSTALL_PATH)
endif
# Helper targets for Installing Kernel into the boot directory
quiet_cmd_kernel_install = INSTALL $(2)
cmd_kernel_install = mkdir -p $(2); cp $(kernelinst-root)$(2) $(3);
install-dir = $(patsubst $(kernelinst-root)%,$(INSTALL_PATH)%,$(obj))
__kernel_install:
$(call cmd,kernel_install,Image,$(install-dir))
.PHONY: __kernel_install