Create real tight custom images (for 4 MB flash warriors)

Hello,

I recently upgraded my mobile router to 19.7.1 and now have troubles to create a image with travelmate included. The thingie is limited to 4 megs of flash so my task began logically here: https://openwrt.org/docs/guide-user/additional-software/saving_space

but even following all ideas given

Action Packages
remove pppoe -ppp -ppp-mod-pppoe
remove IPv6 -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only
remove dhcp server -odhcpd
remove iptables -iptables
remove opkg -opkg
add LuCI minimal uhttpd uhtt

which results for me in a:

make image PROFILE="wr512-3gn-4M" PACKAGES="uhttpd uhttpd-mod-ubus libiwinfo-lua luci-base luci-app-firewall luci-mod-admin-full luci-theme-bootstrap -ppp -ppp-mod-pppoe -kmod-ppp -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only travelmate luci-app-travelmate -dnsmasq -opkg -iptables -odhcpd"

still will output that the file is too big

WARNING: Image file 4/32/4/REAL/4/20/2/19.07.1_imagebuilder/openwrt-imagebuilder-19.07.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kc_musl/linux-ramips_rt305x/tmp/openwrt-19.07.1-ramips-rt305x-wr512-3gn-4M-squashfs-sysupgrade.bin is too big
cp: cannot stat '4/32/4/REAL/4/20/2/19.07.1_imagebuilder/openwrt-imagebuilder-19.07.1-ramips-rt305x.Linux-x86_64/build_dir/target-mipsel_24kc_musl/linux-ramips_rt305x/tmp/openwrt-19.07.1-ramips-rt305x-wr512-3gn-4M-squashfs-sysupgrade.bin': No such file or directory

Any more ideas how to save some more kilos to create a really tight image? :floppy_disk:

1 Like

Well, maybe, but you're probably not going to like it. :sweat_smile:
Build the whole system from scratch, enabling only what you need. Optimise the kernel for size, not for speed (the userspace is optimised for size by default). Build-in as many kernel modules as possible. Integrate the configuration in the image itself. Is this a 4/32 device? If so, forget about LuCI.
Good luck! :wink:

2 Likes

So what I did for now was to edit my .config file and added this settings to save some bytes:

# CONFIG_KERNEL_CRASHLOG is not set
# CONFIG_KERNEL_DEBUG_INFO is not set
# CONFIG_KERNEL_DEBUG_KERNEL is not set
# CONFIG_PACKAGE_kmod-ppp is not set
# CONFIG_PACKAGE_ppp is not set
# CONFIG_IPV6 is not set

beside that I only used the rules from the docs:

Action Packages
remove pppoe -ppp -ppp-mod-pppoe
remove IPv6 -ip6tables -odhcp6c -kmod-ipv6 -kmod-ip6tables -odhcpd-ipv6only
remove dhcp server -odhcpd
remove iptables -iptables
remove opkg -opkg
add LuCI minimal uhttpd uhtt

and removed packages for pppoe, IPv6, iptables, opkg and added the minimal luci - still the file output is too big. The same settings (even with iptables and opkg) worked well in lede 17.x and openwrt 18.x for me :thinking:

I don't even no how much to big the file is. Maybe it's really just a few bytes and smashing out one more unused or bearable package can do the trick?

All of them are :motorized_wheelchair: :motorized_wheelchair: :motorized_wheelchair: :motorized_wheelchair:

this I can't - rather go back to 18.x then :roll_eyes:

same problem on my TPlink WA901nd v3 ... for me is hard to build custom firmware.

the solution ... change router ... i buy EA8300 after 3 week search ..

I tried to buy to be quiet a few years, the time that the new wifi and 10g rj45 technology is developing well on the domestic router.

the openwrt community is really good, they are good advisers for a noob like me

1 Like

I think you may need to remove Luci and uhttpd too...

I need luci to use travelmate on the go.

I'm guess I back to openwrt 18 for now where everything works and hope their will be a openwrt-lite/tiny/whatever which aims to run on our beloved 4/32 devices which are running great since decades and hopefully for another decade or two!

No real solution. Just to get rid of working devices is participating in the planned obsolescence and clearly not carrying about the future (of others?)... I rather keep my devices running :running_man:

3 Likes

We have been discussing 4/32 ad nauseam.
All you can do with those devices is listed here: https://openwrt.org/supported_devices/openwrt_on_432_devices

There will be no further releases for 4/32 devices after 19.07, and therefore no special images for 4/32 devices.

Accepting this situation and buying a new device with sufficient resources will make you happier than desperately trying to revive a dead horse.

7 Likes

The thing is: the horse is still very much alive :horse: and runs much better than on it's first days (with vendor/stock firmware). Even you and others don't like it that they are alive...

Let's face it. It just works great©® No need to make it greater or blow unnecessary things in which are not needed/working anyways. The latest release which runs perfect is from beginning January this year (2020) is called openwrt 18.06.6. The newer release from end of January called openwrt 19.07.1 on the other hand is quite useless for this little athletes :racehorse:

The usability constraints of OpenWrt 19.07 on 4/32 devices put them out of reach of most people. I told you what you have to live with if want to tread down that path. The choice is yours.

1 Like

there is nothing to stop reselling it to someone with less need than you.

on the other hand, planning a purchase for a new router with more space, and of perf, will allow you to see the future.

I bought my 1st router (the WA901nd) without necessarily seeing the problems, but it is clear that if I had known, I would have taken a bigger version, to be quiet for a few years.

we can make mistakes, the important thing is not to repeat the same.

especially since I personally think that today, we have crossed a milestone for performance, and that few people will need more power and bit rate than 1200 mbps.

so you are quiet for a while with a new router.

I have been looking for a long time to improve mine, I made up my mind, and my horse is still not dead, he will just be retired

I have some 4mb routers running 18.x and Luci is included. Not sure why 19.x wouldn’t fit with some effort and for the time being OP can simply use 18.x as base as those 4mb images have Luci.

1 Like

there are many kinds of limited resources in the world. one of the most important is people's time. if one can purchase a $20 router and use it for probably a decade then this is the right solution to avoid wasted resources.

3 Likes

If the device has usb port, perhaps removing the usb modules in imagebuilder?
Or use ext root to increase your storage?

Much to the contrary. It's a bony octogenarian on life support that you keep trying to resuscitate.

It's your octogenarian of course so you're free to do with it as you wish (including ignoring sane advice). Feels good, doesn't it? :wink:

2 Likes

Feel your pain with WA901nd v3, I built a custom image successfully with openvpn-ssl, but Luci had to go :frowning:

i have changed my WA901 for EA8300

is very very good, and super easy for install firmware

This caught my eye as I still mess with an old MR3020 once in a while. Mostly as a temp client or trying out new things. My first comment is that if they 4MB doesn't get you, eventually the 32MB ram will. Most of the things I've tried usually hit an unstable situation that becomes very challenging to identify. (due to low memory issue). My basic config was usually travelmate, openvpn and some button switch configs (similar to slide-switch pgk function).

To try and combat it, I made my image tiny, with no Luci (similar to what you are trying) and then setup ext root with Swap partition. I also setup hold button shutdown action to prevent errors on the ext root drive. This configuration upon button switching includes a script that mounts the 4MB ROM and modifies the config section. This way if Ext root doesn't enable for some reason, it will still load the last working config. But, I still agree with others...I ended up moving on from this unless I have a very basic need. (AR300M is my travel router now).

mount -t jffs2 /dev/mtdblock3 /overlay-boot
DEST="/etc/config"
ROMDEST="/overlay-boot/upper/etc/config"

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