On 10/22/19 12:46 PM, Adrian Schmutzler wrote:
While most of the target's contents are split into subtargets, the
base-files are maintained for the target as a whole.
However, OpenWrt already implements a mechanism that will use (and
even prefer) files in the subtargets' directories. This can be
exploited to make several scripts subtarget-specific and thus save
some space (especially helpful for the tiny devices).
The only script remaining in parent base-files is
/etc/hotplug.d/ieee80211/00-wifi-migration, everything else is
moved/split.
Note that this will increase overall code lines, but reduce code
per subtarget.
base-files ipk size reduction:
master (generic) 49135 B
split (generic) 48533 B (- 0.6 kiB)
split (tiny) 43337 B (- 5.7 kiB)
split (nand) 44423 B (- 4.6 kiB)
Tested on TL-WR1043ND v4 (generic) and TL-WR841N v12 (tiny).
Signed-off-by: Adrian Schmutzler <freif...@adrianschmutzler.de>
---
Having looked into this in detail during my work to implement SPI-NAND
support for the ath79 target[1], I continue to strongly support this
approach.
In my opinion, it provide several, significant benefits, including:
* Smaller file systems, already critical for "tiny" devices
* "Boilerplate" code maintained in one place
* Easier merge/rebase when devices are added, renamed, or removed
* Consistency of code organization when subtargets are involved
* Code changes' impact restricted to only intended devices
* Improved access to code history for a target and subtarget
Note that even a few kB of increased file size can increase the size
of the file system by a full JFFS erase block, pushing a device from
"supported" to not supportable.
Jeff Kletsky
[1] https://github.com/openwrt/openwrt/pull/2184
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel