Skip to content
Permalink
Browse files

Fix custom initramfs generation

  • Loading branch information...
rkunze committed Apr 29, 2018
1 parent 947be99 commit c1fca4b0cac0a5df0152463299e7c860847e896f
Showing with 6 additions and 7 deletions.
  1. +3 −4 fs/initramfs/initramfs.mk
  2. +3 −3 linux/linux.mk
@@ -9,20 +9,19 @@ ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS_ROOTFS),y)
ROOTFS_INITRAMFS_DEPENDENCIES += rootfs-cpio
endif

ROOTFS_INITRAMFS_POST_TARGETS += linux-rebuild-with-initramfs

ROOTFS_INITRAMFS_DEPENDENCIES += $(BINARIES_DIR)/initramfs.cpio

# The generic fs infrastructure isn't very useful here.

rootfs-initramfs: $(ROOTFS_INITRAMFS_DEPENDENCIES) $(BINARIES_DIR)/initramfs.cpio $(ROOTFS_INITRAMFS_POST_TARGETS)
rootfs-initramfs: $(ROOTFS_INITRAMFS_DEPENDENCIES) linux-rebuild-with-initramfs

rootfs-initramfs-show-depends:
@echo $(ROOTFS_INITRAMFS_DEPENDENCIES)

.PHONY: rootfs-initramfs rootfs-initramfs-show-depends

ifeq ($(BR2_TARGET_ROOTFS_INITRAMFS_ROOTFS),y)
$(BINARIES_DIR)/initramfs.cpio: $(BINARIES_DIR)/rootfs.cpio
$(BINARIES_DIR)/initramfs.cpio: rootfs-cpio
ln -sf rootfs.cpio $(BINARIES_DIR)/initramfs.cpio
endif

@@ -271,8 +271,8 @@ define LINUX_KCONFIG_FIXUP_CMDS
# replaced later by the real cpio archive, and the kernel will be
# rebuilt using the linux-rebuild-with-initramfs target.
$(if $(BR2_TARGET_ROOTFS_INITRAMFS),
touch $(BINARIES_DIR)/rootfs.cpio
$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,"$${BR_BINARIES_DIR}/rootfs.cpio",$(@D)/.config)
touch $(BINARIES_DIR)/initramfs.cpio
$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_SOURCE,"$${BR_BINARIES_DIR}/initramfs.cpio",$(@D)/.config)
$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_UID,0,$(@D)/.config)
$(call KCONFIG_SET_OPT,CONFIG_INITRAMFS_ROOT_GID,0,$(@D)/.config))
$(if $(BR2_ROOTFS_DEVICE_CREATION_STATIC),,
@@ -494,7 +494,7 @@ $(eval $(kconfig-package))
.PHONY: linux-rebuild-with-initramfs
linux-rebuild-with-initramfs: $(LINUX_DIR)/.stamp_target_installed
linux-rebuild-with-initramfs: $(LINUX_DIR)/.stamp_images_installed
linux-rebuild-with-initramfs: rootfs-cpio
linux-rebuild-with-initramfs: $(BINARIES_DIR)/initramfs.cpio
linux-rebuild-with-initramfs:
@$(call MESSAGE,"Rebuilding kernel with initramfs")
# Build the kernel.

0 comments on commit c1fca4b

Please sign in to comment.
You can’t perform that action at this time.