image: integrate the secure initramfs generator
This change wires the secure initramfs generator into the image
pipeline. It also introduces a load address for the initrd in FITs and
aligns kernel config handling for initramfs compression.
- include/image.mk:
* Rewrite Image/SecureInitramfs as a traced shell block with clearer
variables and debug output.
* Add explicit `secure-initramfs` phony target and run it before
`kernel_prepare`.
* Keep existing initramfs kernel/ramdisk artifacts flow intact.
Closes: PCF-1893
Tracked-by: FEAT-29
Signed-off-by: Mohamed-nour Toumi <mohamed.toumi_ext@softathome.com>
This commit is contained in:
parent
b8ba3aecc3
commit
0832a9abc7
@ -158,12 +158,26 @@ define prepare_generic_squashfs
|
|||||||
endef
|
endef
|
||||||
|
|
||||||
define Image/SecureInitramfs
|
define Image/SecureInitramfs
|
||||||
UNSTRIPPED_FOLDER=$(STAGING_DIR_ROOT) \
|
@{ \
|
||||||
BINARIES_PATH=$(CONFIG_TARGET_INIT_PATH) \
|
set -eu; \
|
||||||
$(TOPDIR)/scripts/gen-secure-initramfs.sh build \
|
comp="$(call get_initramfs_compression,CONFIG_TARGET_SECURE_INITRAMFS_COMPRESSION_)"; \
|
||||||
$(call get_initramfs_compression,CONFIG_TARGET_SECURE_INITRAMFS_COMPRESSION_) \
|
out="$(BIN_DIR)/$(IMG_SECURE_INITRAMFS)"; \
|
||||||
$(BIN_DIR)/$(IMG_SECURE_INITRAMFS) \
|
initramfs_dir="$(STAGING_DIR_IMAGE)/initramfs"; \
|
||||||
$(STAGING_DIR_IMAGE)/initramfs $(TARGET_DIR)
|
rootfs_dir="$(TARGET_DIR)"; \
|
||||||
|
echo "[SecureInitramfs] UNSTRIPPED_FOLDER=$(STAGING_DIR_ROOT)"; \
|
||||||
|
echo "[SecureInitramfs] BINARIES_PATH=$(CONFIG_TARGET_INIT_PATH)"; \
|
||||||
|
printf '[SecureInitramfs] COMPRESSION => %q\n' "$$$$comp"; \
|
||||||
|
printf '[SecureInitramfs] OUTPUT => %q\n' "$$$$out"; \
|
||||||
|
printf '[SecureInitramfs] INITRAMFS => %q\n' "$$$$initramfs_dir"; \
|
||||||
|
printf '[SecureInitramfs] ROOTFS => %q\n' "$$$$rootfs_dir"; \
|
||||||
|
PS4='+ [SecureInitramfs] $${0##*/}:$${LINENO}: '; set -x; \
|
||||||
|
UNSTRIPPED_FOLDER="$(STAGING_DIR_ROOT)" \
|
||||||
|
BINARIES_PATH="$(CONFIG_TARGET_INIT_PATH)" \
|
||||||
|
"$(TOPDIR)/scripts/gen-secure-initramfs.sh" build \
|
||||||
|
"$$$$comp" \
|
||||||
|
"$$$$out" \
|
||||||
|
"$$$$initramfs_dir" "$$$$rootfs_dir"; \
|
||||||
|
}
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define Image/BuildKernel/Initramfs
|
define Image/BuildKernel/Initramfs
|
||||||
@ -956,7 +970,7 @@ define BuildImage
|
|||||||
image_prepare:
|
image_prepare:
|
||||||
|
|
||||||
ifeq ($(IB),)
|
ifeq ($(IB),)
|
||||||
.PHONY: download prepare compile compile-dtb clean image_prepare kernel_prepare install install-images
|
.PHONY: download prepare compile compile-dtb clean image_prepare kernel_prepare install install-images secure-initramfs
|
||||||
compile:
|
compile:
|
||||||
$(call Build/Compile)
|
$(call Build/Compile)
|
||||||
|
|
||||||
@ -975,13 +989,16 @@ define BuildImage
|
|||||||
mkdir -p $(BIN_DIR) $(KDIR)/tmp
|
mkdir -p $(BIN_DIR) $(KDIR)/tmp
|
||||||
endif
|
endif
|
||||||
|
|
||||||
kernel_prepare: image_prepare
|
secure-initramfs:
|
||||||
|
ifeq ($(CONFIG_TARGET_SECURE_INITRAMFS),y)
|
||||||
|
$(call Image/SecureInitramfs)
|
||||||
|
endif
|
||||||
|
kernel_prepare: secure-initramfs image_prepare
|
||||||
$(call Image/Build/targz)
|
$(call Image/Build/targz)
|
||||||
$(call Image/Build/cpiogz)
|
$(call Image/Build/cpiogz)
|
||||||
$(call Image/BuildKernel)
|
$(call Image/BuildKernel)
|
||||||
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(if $(IB),,$(call Image/BuildKernel/Initramfs)))
|
$(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(if $(IB),,$(call Image/BuildKernel/Initramfs)))
|
||||||
$(call Image/InstallKernel)
|
$(call Image/InstallKernel)
|
||||||
$(if $(CONFIG_TARGET_SECURE_INITRAMFS),$(call Image/SecureInitramfs))
|
|
||||||
|
|
||||||
$(foreach device,$(TARGET_DEVICES),$(call Device,$(device)))
|
$(foreach device,$(TARGET_DEVICES),$(call Device,$(device)))
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user