@@ -8,7 +8,7 @@ menu "Target Images"
menuconfig TARGET_ROOTFS_INITRAMFS
bool "ramdisk"
- default y if USES_INITRAMFS
+ default y if (USES_INITRAMFS || USES_SELECTIVE_INITRAMFS)
help
Embed the root filesystem into the kernel (initramfs).
@@ -382,6 +382,7 @@ define Device/Init
SUPPORTED_DEVICES :=
IMAGE_METADATA :=
+ NEEDS_INITRAMFS :=
FILESYSTEMS := $(TARGET_FILESYSTEMS)
endef
@@ -538,7 +539,15 @@ define Device/Build/artifact
endef
define Device/Build
- $(if $(CONFIG_TARGET_ROOTFS_INITRAMFS),$(call Device/Build/initramfs,$(1)))
+ifdef CONFIG_TARGET_ROOTFS_INITRAMFS
+ifneq ($(CONFIG_USES_SELECTIVE_INITRAMFS),y)
+ $(call Device/Build/initramfs,$(1))
+else
+ ifdef NEEDS_INITRAMFS
+ $(call Device/Build/initramfs,$(1))
+ endif
+endif
+endif
$(call Device/Build/kernel,$(1))
$$(eval $$(foreach compile,$$(COMPILE), \
@@ -32,6 +32,7 @@ sub target_config_features(@) {
/^fpu$/ and $ret .= "\tselect HAS_FPU\n";
/^spe_fpu$/ and $ret .= "\tselect HAS_SPE_FPU\n";
/^ramdisk$/ and $ret .= "\tselect USES_INITRAMFS\n";
+ /^selective-ramdisk$/ and $ret .= "\tselect USES_SELECTIVE_INITRAMFS\n";
/^powerpc64$/ and $ret .= "\tselect powerpc64\n";
/^nommu$/ and $ret .= "\tselect NOMMU\n";
/^mips16$/ and $ret .= "\tselect HAS_MIPS16\n";
@@ -46,6 +46,9 @@ config USES_DEVICETREE
config USES_INITRAMFS
bool
+config USES_SELECTIVE_INITRAMFS
+ bool
+
config USES_SQUASHFS
bool
Currently it's not possible to enable building of initramfs images for the devices which need them, leading to production of initramfs images for every device under target which has FEATURES += ramdisk. So this patch adds a possibility to enable FEATURES += selective-ramdisk and then the device which needs ramdisk can just define NEEDS_INITRAMFS=1. Signed-off-by: Petr Štetiar <ynezz@true.cz> --- config/Config-images.in | 2 +- include/image.mk | 11 ++++++++++- scripts/target-metadata.pl | 1 + target/Config.in | 3 +++ 4 files changed, 15 insertions(+), 2 deletions(-)