base-files: allow override model name from uboot env

This commit is contained in:
coolsnowwolf 2024-12-11 19:28:11 +08:00
parent 41e0c30d82
commit d242992f65
2 changed files with 4 additions and 2 deletions
package
base-files/files/lib/preinit
boot/uboot-envtools/files

View File

@ -1,10 +1,11 @@
do_sysinfo_generic() {
[ -d /proc/device-tree ] || return
mkdir -p /tmp/sysinfo
[ -d /proc/device-tree ] || return
[ -e /tmp/sysinfo/board_name ] || \
echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name
[ ! -e /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \
echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model
[ -z "$(fw_printenv model_name)" ] || fw_printenv model_name > /tmp/sysinfo/model
}
boot_hook_add preinit_main do_sysinfo_generic

View File

@ -16,7 +16,8 @@ alfa-network,ac1200rm|\
alfa-network,awusfree1|\
alfa-network,quad-e4g|\
alfa-network,r36m-e4g|\
alfa-network,tube-e4g)
alfa-network,tube-e4g|\
huasifei,mt7621dtu)
ubootenv_add_uci_config "/dev/mtd1" "0x0" "0x1000" "0x1000"
;;
allnet,all0256n-4m|\