I have a WR740N (4/32) that I did the USB mod on and I want to set up extroot on it.
I've already tried installing a regular prebuilt openwrt release for the model and it works fine.
How many packages do I need to remove to fit the required packages for extroot? From what I've read the required ones are:
I can partition the flash drive with gparted on a pc so I don't believe I need to include parted into the base firmware.
I presume it would be wise to keep the most used packages in the base firmware since (I'm guessing) the built in flash is much faster than > "With fat32 formatted USB flash drive, I got 24MB/s read and 14MB/s write"
I can connect using SSH just fine so I don't need Luci in the base install either.
Also, in the make menuconfig the "ramdisk" was preselected in the filesystem, is this required? Wouldn't I just need squashfs and nothing else?
EXTRoot - using an external flash drive connected to the USB to get extra storage.
I just need to fit the bare minimum to mount the USB then I can put whatever needed packages on the USB drive itself where there's ample space
I know what extroot is, but you aren't going to "fit the bare minimum to mount the USB" into 4 MB, you aren't even going to fit the bare minimum to get it booting in the first place. …and even if you would, the whole thing would explode (OOM) once the wireless drivers get loaded into 32 MB RAM.
If there were easy cooking recipes, these devices were still supported - and even the hard decisions won't get it fit into 4 MB anymore.
If you are willing to make even harder decisions, be my guest, but that's going to be your homework.
How hard could it be squeezing down ~5.3MB to 4MB? When I don't need any networking capability other than a connection through SSH on the internal flash?
I don't need wireless either.
(Ofc with extroot I mean external swap as well)
Where does the space get used up on then? Does the kernel use most of it?
I was under the impression that the increase in size on newer versions was because of larger packages.
Luci already is ~500kB
4096 KB physical flash
128 KB bootloader && bootloader-env
64 KB wifi calibration
320 KB free space hard-required to mount an overlay (5 free erase blocks, at 64 KB each)
=======
3564 KB would be your maximum firmware size (less in practice, padding, et al)
If you're coming from "~5.3 MB", you have a long way to go - and I can't really take it serious, if you're raising "Luci already is ~500kB", that has long left the building - and you still have a mountain of space to recover.
I don't buy it... I can believe that it's not possible just that your reasons seem exaggerated...
Again I need 0 networking. 0 wifi
Just:
USB mount; SSH access
And after more digging I found this thread of someone claiming to have built 21.02 with Luci for 4MB flash: https://ashus.ashus.net/thread-192.html
And that still has networking, which I don't need in the base firmware.
Also, couldn't I use squashfs on the USB drive and therefor avoid having to add the kmod-fs-ext4 package? kmod-usb2 also isn't absolutely critical SquashFS isn't recommended with USB
That would boil it down to just block-mount and kmod-usb-storage-extras. And there's Luci that I can remove.
PS. From what I've read it seems the bootloader takes up only 64KB
What you'll likely find is that if you can get an image to fit, you will need to remove so much stuff that it will no longer be functional at a practical level.
That said, in order to attempt this in any meaningful way, you'll need to spin up the full toolchain and change compile time options, remove packages, etc. The image builder (online or local) alone is not sufficient for this task.
Then, if you succeed in building an image that fits, you will need to pivot to extroot and install any 'must have' packages that you had to omit from the initial build. If that succeeds, see how far you get before you get an OOM error and kernel panic because of the extremely limited RAM.
All this effort for a 15 year old low end router, if it actually works, will probably get you 50Mbps or so of routing bandwidth... seems like you'll be investing more personal energy and time than it is worth, when a properly supported device with sufficient flash storage and RAM can be purchased new or on the used market for ~$25 USD. For that matter, before you're done with the WR740N, you might even spend half of that or more on the actual electrical energy required to compile an image that can physically be loaded onto the device.
if you don't need Wi-Fi, then just change the flash memory to a 16MB chip, having previously written the DUMP taken from the original chip to it (without a correct recording of the Wi-Fi setup block, it won't work) and you can already try to assemble the firmware version you need with the necessary packages. There is still information on the Internet and there are ready-made assemblies for 16MB flash.
Good luck.
Depends on compile time (and how many times you need to repeat the process) multiplied by the power consumption of your computer and then multiplied by your electrical costs. It may be an exaggeration, but in all seriousness it is possible to increase your electrical bill enough to make it a net loss.