From 0130022baec0a90c6cb039a5cbe9b9c65c01672f Mon Sep 17 00:00:00 2001 From: Adrian Schmutzler Date: Tue, 22 Oct 2019 21:46:57 +0200 Subject: ath79: split base-files into subtargets 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 --- .../ath79/tiny/base-files/lib/upgrade/platform.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh (limited to 'target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh') diff --git a/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh new file mode 100644 index 0000000000..b02ab9a080 --- /dev/null +++ b/target/linux/ath79/tiny/base-files/lib/upgrade/platform.sh @@ -0,0 +1,20 @@ +# +# Copyright (C) 2011 OpenWrt.org +# + +PART_NAME=firmware +REQUIRE_IMAGE_METADATA=1 + +platform_check_image() { + return 0 +} + +platform_do_upgrade() { + local board=$(board_name) + + case "$board" in + *) + default_do_upgrade "$1" + ;; + esac +} -- cgit v1.2.3