forked from openwrt/openwrt
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Showing
18 changed files
with
314 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
. /lib/functions/uci-defaults.sh | ||
|
||
board_config_update | ||
|
||
board=$(board_name) | ||
boardname="${board##*,}" | ||
|
||
case "$board" in | ||
glinet,gl-ar300m-nand) | ||
ucidef_set_led_netdev "lan" "LAN" "gl-ar300m:green:lan" "eth0" | ||
;; | ||
esac | ||
|
||
board_config_flush | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/bin/sh | ||
|
||
. /lib/functions/system.sh | ||
. /lib/functions/uci-defaults.sh | ||
|
||
ath79_setup_interfaces() | ||
{ | ||
local board="$1" | ||
|
||
case "$board" in | ||
*) | ||
ucidef_set_interfaces_lan_wan "eth0" "eth1" | ||
;; | ||
esac | ||
} | ||
|
||
ath79_setup_macs() | ||
{ | ||
local board="$1" | ||
|
||
case "$board" in | ||
esac | ||
|
||
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac | ||
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac | ||
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac | ||
} | ||
|
||
board_config_update | ||
board=$(board_name) | ||
ath79_setup_interfaces $board | ||
ath79_setup_macs $board | ||
board_config_flush | ||
|
||
exit 0 |
20 changes: 20 additions & 0 deletions
20
target/linux/ath79/nand/base-files/lib/upgrade/platform.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
} |
Oops, something went wrong.