aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum
diff options
context:
space:
mode:
authorAdrian Schmutzler <freifunk@adrianschmutzler.de>2019-10-22 21:46:57 +0200
committerJohn Crispin <john@phrozen.org>2019-10-27 14:24:22 +0100
commit0130022baec0a90c6cb039a5cbe9b9c65c01672f (patch)
tree93815b43aaf2d13863c0beb78e95cf443c29606a /target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum
parentc36ef5970b0342f01f1f3bfc7452b86992c7201b (diff)
downloadupstream-0130022baec0a90c6cb039a5cbe9b9c65c01672f.tar.gz
upstream-0130022baec0a90c6cb039a5cbe9b9c65c01672f.tar.bz2
upstream-0130022baec0a90c6cb039a5cbe9b9c65c01672f.zip
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 <freifunk@adrianschmutzler.de>
Diffstat (limited to 'target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum')
-rw-r--r--target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum15
1 files changed, 15 insertions, 0 deletions
diff --git a/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum
new file mode 100644
index 0000000000..22c9483e74
--- /dev/null
+++ b/target/linux/ath79/generic/base-files/etc/uci-defaults/09_fix-checksum
@@ -0,0 +1,15 @@
+#!/bin/sh
+. /lib/functions.sh
+
+fix_seama_header() {
+ local kernel_size=$(sed -n 's/mtd[0-9]*: \([0-9a-f]*\).*"kernel".*/\1/p' /proc/mtd)
+ [ "$kernel_size" ] && mtd -c 0x$kernel_size fixseama firmware
+}
+
+board=$(board_name)
+
+case "$board" in
+qihoo,c301)
+ fix_seama_header
+ ;;
+esac