Enable initramfs images by default?

I'm trying to get initramfs images to build by default (e.g. the Fritz!Box 7362 SL needs an initramfs image to flash OpenWrt from stock but that image is not built by default). As such, enabling CONFIG_TARGET_ROOTFS_INITRAMFS=y in ~/.openwrt/defconfig won't do, since I'd like to send in a patch for inclusion in master.

I know some targets are having initramfs images built by default, so it should be possible.

I was told to enable the ramdisk flag in FEATURES in target/linux/lantiq/xrx200/target.mk but that does not enable CONFIG_TARGET_ROOTFS_INITRAMFS. Ideally, the ramdisk should be LZMA compressed as well (as per the commit's flashing instructions).

Can someone tell me where which nuts and bolts I need to turn?

Bumpty ...

I tried following changes and worked:

diff --git a/config/Config-images.in b/config/Config-images.in
index 9daaf74915..8f90a18a23 100644
--- a/config/Config-images.in
+++ b/config/Config-images.in
@@ -18,6 +18,7 @@ menu "Target Images"
                        default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_ramips
                        default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_apm821xx
                        default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_mpc85xx
+                       default TARGET_INITRAMFS_COMPRESSION_LZMA if TARGET_lantiq
                        default TARGET_INITRAMFS_COMPRESSION_NONE
                        depends on TARGET_ROOTFS_INITRAMFS
                        help
diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk
index 4f682bf486..4d92b25bcb 100644
--- a/target/linux/lantiq/xrx200/target.mk
+++ b/target/linux/lantiq/xrx200/target.mk
@@ -1,7 +1,7 @@
 ARCH:=mips
 SUBTARGET:=xrx200
 BOARDNAME:=XRX200
-FEATURES:=squashfs atm nand
+FEATURES:=squashfs atm nand ramdisk
 CPU_TYPE:=24kc

 DEFAULT_PACKAGES+=kmod-leds-gpio \
2 Likes

Thanks @musashino! That works wonders :slight_smile: . Are you fine with my mentioning your solution in my patch or would you rather send in a patch yourself?

Yes :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.