From d242992f6571a15566839d6ee8dfa11024a37561 Mon Sep 17 00:00:00 2001 From: coolsnowwolf Date: Wed, 11 Dec 2024 19:28:11 +0800 Subject: [PATCH] base-files: allow override model name from uboot env --- package/base-files/files/lib/preinit/02_sysinfo | 3 ++- package/boot/uboot-envtools/files/ramips | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/lib/preinit/02_sysinfo b/package/base-files/files/lib/preinit/02_sysinfo index 65b50968e2c423..f0ed0ff9fcff2f 100644 --- a/package/base-files/files/lib/preinit/02_sysinfo +++ b/package/base-files/files/lib/preinit/02_sysinfo @@ -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 diff --git a/package/boot/uboot-envtools/files/ramips b/package/boot/uboot-envtools/files/ramips index f2bc3555f7df6f..51e84fa0515ec0 100644 --- a/package/boot/uboot-envtools/files/ramips +++ b/package/boot/uboot-envtools/files/ramips @@ -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|\