Skip to content

Commit

Permalink
base-files: allow override model name from uboot env
Browse files Browse the repository at this point in the history
  • Loading branch information
coolsnowwolf committed Dec 11, 2024
1 parent 41e0c30 commit d242992
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package/base-files/files/lib/preinit/02_sysinfo
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion package/boot/uboot-envtools/files/ramips
Original file line number Diff line number Diff line change
Expand Up @@ -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|\
Expand Down

0 comments on commit d242992

Please sign in to comment.