econet: update en75_chboot to use OpenWrt board_name

Instead of using the name from /proc/cpuinfo, use board_name from
/lib/functions.sh

Signed-off-by: Caleb James DeLisle <cjd@cjdns.fr>
Link: https://github.com/openwrt/openwrt/pull/21023
Signed-off-by: Robert Marko <robimarko@gmail.com>
This commit is contained in:
Caleb James DeLisle 2025-12-02 20:37:24 +00:00 committed by Robert Marko
parent 72f43ac220
commit 4e0dfa6e27

View file

@ -3,6 +3,8 @@
set -e set -e
. /lib/functions.sh
part= part=
offset_blocks= offset_blocks=
block_size= block_size=
@ -99,8 +101,8 @@ switch() {
} }
main() { main() {
machine=$(sed -n -e 's/^machine\s\+:\s\+//p' < /proc/cpuinfo) case "$(board_name)" in
if [ "$machine" = "TP-Link Archer VR1200v (v2)" ]; then tplink,archer-vr1200v-v2)
# 03fe0000 # 03fe0000
part=$(part_named '"reserve"') part=$(part_named '"reserve"')
offset_blocks=0 offset_blocks=0
@ -108,7 +110,8 @@ main() {
code_offset=0 code_offset=0
code_openwrt=0000000101000002 code_openwrt=0000000101000002
code_factory=0000000101010003 code_factory=0000000101010003
elif [ "$machine" = "Nokia G-240G-E" ]; then ;;
nokia,g240g-e)
part=$(part_named '"flag"') part=$(part_named '"flag"')
offset_blocks=0 offset_blocks=0
block_size=$((1024 * 128)) block_size=$((1024 * 128))
@ -116,7 +119,8 @@ main() {
code_openwrt=000000000000000000000001000000010000000000000000 code_openwrt=000000000000000000000001000000010000000000000000
code_factory=000000000000000100000001000000010000000000000000 code_factory=000000000000000100000001000000010000000000000000
read_mask=000000000000000X00000000000000000000000000000000 read_mask=000000000000000X00000000000000000000000000000000
elif [ "$machine" = "SmartFiber XP8421-B" ]; then ;;
smartfiber,xp8421-b)
# 0dfc0000 # 0dfc0000
part=$(part_named '"reservearea"') part=$(part_named '"reservearea"')
offset_blocks=12 offset_blocks=12
@ -124,7 +128,8 @@ main() {
code_offset=0 code_offset=0
code_openwrt=30000000 code_openwrt=30000000
code_factory=31000000 code_factory=31000000
elif [ "$machine" = "Zyxel PMG5617GA" ]; then ;;
tplink,zyxel-pmg5617ga)
# 00060fff # 00060fff
part=$(part_named '"reservearea"') part=$(part_named '"reservearea"')
offset_blocks=3 offset_blocks=3
@ -132,10 +137,12 @@ main() {
code_offset=4095 code_offset=4095
code_openwrt=30 code_openwrt=30
code_factory=31 code_factory=31
else ;;
*)
echo "Unsupported machine: $machine" echo "Unsupported machine: $machine"
exit 1 exit 1
fi ;;
esac
if [ "$1" = "factory" ]; then if [ "$1" = "factory" ]; then
switch factory switch factory