diff options
author | Adrian Schmutzler <freifunk@adrianschmutzler.de> | 2019-10-22 21:46:57 +0200 |
---|---|---|
committer | John Crispin <john@phrozen.org> | 2019-10-27 14:24:22 +0100 |
commit | 0130022baec0a90c6cb039a5cbe9b9c65c01672f (patch) | |
tree | 93815b43aaf2d13863c0beb78e95cf443c29606a /target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware | |
parent | c36ef5970b0342f01f1f3bfc7452b86992c7201b (diff) | |
download | upstream-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/tiny/base-files/etc/hotplug.d/firmware')
-rw-r--r-- | target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom new file mode 100644 index 0000000000..3da95cc161 --- /dev/null +++ b/target/linux/ath79/tiny/base-files/etc/hotplug.d/firmware/10-ath9k-eeprom @@ -0,0 +1,38 @@ +#!/bin/sh + +[ -e /lib/firmware/$FIRMWARE ] && exit 0 + +. /lib/functions/caldata.sh + +board=$(board_name) + +case "$FIRMWARE" in +"ath9k-eeprom-pci-0000:00:00.0.bin") + case $board in + buffalo,whr-g301n|\ + tplink,tl-wr841-v5|\ + tplink,tl-wr941-v4) + caldata_extract "art" 0x1000 0xeb8 + ;; + netgear,wnr1000-v2|\ + netgear,wnr2000-v3|\ + netgear,wnr612-v2|\ + on,n150r|\ + tplink,tl-mr3220-v1|\ + tplink,tl-mr3420-v1|\ + tplink,tl-wr740n-v1|\ + tplink,tl-wr740n-v3|\ + tplink,tl-wr741-v1|\ + tplink,tl-wr743nd-v1|\ + tplink,tl-wr841-v7) + caldata_extract "art" 0x1000 0x1000 + ;; + pqi,air-pen) + caldata_extract "art" 0x1000 0x7d2 + ;; + *) + caldata_die "board $board is not supported yet" + ;; + esac + ;; +esac |