Ext4 image not generated by the source code

Hi,

I want to compile an image for zbt we3526 from source code with ext4 filesystem. I did select ext4 in menuconfig under target images but the ext4 image did not get created. Only initramfs and squashfs images can be created. Does anyone know why?

The goal was to save some scripts under root and I need the file to be persistent. Squashfs does not have any empty space for root and tmpfs is volatile so I am counting on ext4. Please let me know if there are other solutions to this issue, thanks!

Here is the output, after 48% it moved on to generate the initramfs image and never came back for ext4

echo '{ "metadata_version": "1.0", "supported_devices":["zbtlink,zbt-we3526"], "version": { "dist": "OpenWrt", "version": "SNAPSHOT", "revision": "r11407-70d5989c9c", "target": "ramips/mt7621", "board": "zbtlink_zbt-we3526" } }' | fwtool -I - /home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin
[ ! -s "/home/coop-2/openwrt/key-build" -o ! -s "/home/coop-2/openwrt/key-build.ucert" -o ! -s "/home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin" ] || { cp "/home/coop-2/openwrt/key-build.ucert" "/home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin.ucert" ; usign -S -m "/home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin" -s "/home/coop-2/openwrt/key-build" -x "/home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin.sig" ; ucert -A -c "/home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin.ucert" -x "/home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin.sig" ; fwtool -S "/home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin.ucert" "/home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin" ; }

WARNING: Image file /home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin is too big

cp /home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin /home/coop-2/openwrt/bin/targets/ramips/mt7621/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin

cp: cannot stat '/home/coop-2/openwrt/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7621/tmp/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin': No such file or directory

make[5]: [Makefile:199: /home/coop-2/openwrt/bin/targets/ramips/mt7621/openwrt-ramips-mt7621-zbtlink_zbt-we3526-ext4-sysupgrade.bin] Error 1 (ignored)

Creating filesystem with parameters:
Size: 10485760
Block size: 1024
Blocks per group: 8192
Inodes per group: 1280
Inode size: 256
Journal blocks: 0
Label: rootfs
Blocks: 10240
Block groups: 2
Reserved blocks: 1020
Reserved block group size: 63
error: ext4_allocate_best_fit_partial: failed to allocate 11 blocks, out of space?

did the build fail? logs?

Looks like a job for custom files:
https://openwrt.org/faq/include_tailored_custom_configuration_files

Does this suit your needs?

The file is actually a python backend script, not a config file, is it possible to include a python script as a config file?

Actually I just noticed it had an error saying the image is too big... I will google more on it

But that makes no sense because I did not include any extra libraries, only the system-required libraries are installed

1 Like

Use overlay file system and microSD card with this device. You'll get LOTS of bonus storage and probably apps will run a bit faster compared to integrated SPI flash memory.

1 Like