summaryrefslogtreecommitdiffstats
path: root/rules/kernel.make
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2010-02-22 11:08:51 +0100
committerMarc Kleine-Budde <mkl@pengutronix.de>2010-03-03 15:58:19 +0100
commit6b76526f69343d31838528769ffca8365a5638e0 (patch)
treec4e5b31c588e9eabef6d59a50f8180ecc95f1590 /rules/kernel.make
parente8c3f9ba464bd81bb42bf07a277b463855b0cfbd (diff)
downloadptxdist-6b76526f69343d31838528769ffca8365a5638e0.tar.gz
ptxdist-6b76526f69343d31838528769ffca8365a5638e0.tar.xz
[kernel] prepare for "late" installation of kernel image
This patch moves the installation of the kernel image from the targetinstall stage into the images stage. This is a preparation for the "whole rootfs in initrd in kernel image" use case, where first the root file system is build and bundled into a cpio and then linked into the kernel image. We define some new symbols: - IMAGE_KERNEL: It's automatically activated if the kernel is build. When active the kernel is install to "images/linuximage". - IMAGE_KERNEL_INSTALL_EARLY: default "y". When active the kernel is copied to "images/linuximage" during targetinstall. - IMAGE_KERNEL_INSTALL_LATE: If selected the kernel is installed later, during the "images" stage. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'rules/kernel.make')
-rw-r--r--rules/kernel.make40
1 files changed, 13 insertions, 27 deletions
diff --git a/rules/kernel.make b/rules/kernel.make
index 6c1be8a22..7462a31d1 100644
--- a/rules/kernel.make
+++ b/rules/kernel.make
@@ -48,12 +48,12 @@ endif
#
# support the different kernel image formats
#
-KERNEL_IMAGE_PATH-$(PTXCONF_KERNEL_IMAGE_BZ) += $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/bzImage
-KERNEL_IMAGE_PATH-$(PTXCONF_KERNEL_IMAGE_U) += $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/uImage
-KERNEL_IMAGE_PATH-$(PTXCONF_KERNEL_IMAGE_VM) += $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/vmImage
-KERNEL_IMAGE_PATH-$(PTXCONF_KERNEL_IMAGE_Z) += $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/zImage
-KERNEL_IMAGE_PATH-$(PTXCONF_KERNEL_IMAGE_VMLINUX) += $(KERNEL_DIR)/vmlinux
-KERNEL_IMAGE_PATH-$(PTXCONF_KERNEL_IMAGE_RAW) += $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/Image
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_BZ) += $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/bzImage
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_RAW) += $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/Image
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_U) += $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/uImage
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_VM) += $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/vmImage
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_Z) += $(KERNEL_DIR)/arch/$(PTXCONF_KERNEL_ARCH_STRING)/boot/zImage
+KERNEL_IMAGE_PATH_$(PTXCONF_KERNEL_IMAGE_VMLINUX) += $(KERNEL_DIR)/vmlinux
# ----------------------------------------------------------------------------
# Get
@@ -176,17 +176,8 @@ $(STATEDIR)/kernel.install:
$(STATEDIR)/kernel.targetinstall:
@$(call targetinfo)
-# # we _always_ need the kernel in the image dir
- @for i in $(KERNEL_IMAGE_PATH-y); do \
- if [ -f $$i ]; then \
- install -m 644 $$i $(IMAGEDIR)/linuximage; \
- fi; \
- done
-
- @if test \! -e $(IMAGEDIR)/linuximage; then \
- echo "$(PTXCONF_KERNEL_IMAGE) not found, maybe bzImage on ARM"; \
- exit 1; \
- fi
+# delete the kernel image, it might be out-of-date
+ @rm -f $(IMAGEDIR)/linuximage
ifneq ($(PTXCONF_KERNEL_INSTALL)$(PTXCONF_KERNEL_VMLINUX),)
@$(call install_init, kernel)
@@ -200,18 +191,10 @@ ifneq ($(PTXCONF_KERNEL_INSTALL)$(PTXCONF_KERNEL_VMLINUX),)
@$(call install_copy, kernel, 0, 0, 0755, /boot);
ifdef PTXCONF_KERNEL_INSTALL
- @for i in $(KERNEL_IMAGE_PATH-y); do \
- if [ -f $$i ]; then \
- $(call install_copy, kernel, 0, 0, 0644, $$i, /boot/$(KERNEL_IMAGE), n); \
- fi; \
- done
+ $(call install_copy, kernel, 0, 0, 0644, $(KERNEL_IMAGE_PATH_y), /boot/$(KERNEL_IMAGE), n)
endif
-
-#
# install the ELF kernel image for debugging purpose
-# e.g. oprofile
-#
ifdef PTXCONF_KERNEL_VMLINUX
@$(call install_copy, kernel, 0, 0, 0644, $(KERNEL_DIR)/vmlinux, /boot/vmlinux, n)
endif
@@ -219,7 +202,6 @@ endif
@$(call install_finish, kernel)
endif
-
ifdef PTXCONF_KERNEL_MODULES_INSTALL
@rm -rf $(KERNEL_PKGDIR)
@cd $(KERNEL_DIR) && $(KERNEL_PATH) $(KERNEL_ENV) $(MAKE) \
@@ -233,6 +215,10 @@ endif
# Target-Install-post
# ----------------------------------------------------------------------------
+ifdef PTXCONF_IMAGE_KERNEL_INSTALL_EARLY
+$(STATEDIR)/kernel.targetinstall.post: $(IMAGEDIR)/linuximage
+endif
+
$(STATEDIR)/kernel.targetinstall.post:
@$(call targetinfo)