From 2763d10a13b2bcaab04fbd17bfcce922400a37d6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 5 Jun 2021 12:50:15 +0200 Subject: [PATCH] - rootfs: add /etc/model; add get_boxmodel function --- make/target-files.mk | 4 ++++ skel-root/general/scripts/init.functions | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/make/target-files.mk b/make/target-files.mk index 6b9441b9..6d0a0a45 100644 --- a/make/target-files.mk +++ b/make/target-files.mk @@ -10,6 +10,7 @@ files-etc: \ $(TARGET_sysconfdir)/group \ $(TARGET_sysconfdir)/hosts \ $(TARGET_sysconfdir)/issue.net \ + $(TARGET_sysconfdir)/model \ $(TARGET_sysconfdir)/nsswitch.conf \ $(TARGET_sysconfdir)/passwd \ $(TARGET_sysconfdir)/profile \ @@ -40,6 +41,9 @@ $(TARGET_sysconfdir)/hosts: $(TARGET_sysconfdir)/issue.net: $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/issue.net $(@) +$(TARGET_sysconfdir)/model: + echo $(BOXMODEL) > $(@) + $(TARGET_sysconfdir)/nsswitch.conf: $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/nsswitch.conf $(@) diff --git a/skel-root/general/scripts/init.functions b/skel-root/general/scripts/init.functions index ac61295b..089c5f8a 100644 --- a/skel-root/general/scripts/init.functions +++ b/skel-root/general/scripts/init.functions @@ -71,6 +71,20 @@ load_module() fi } +get_boxmodel() +{ + if [ -e /proc/stb/info/vumodel ]; then + model=$(cat /proc/stb/info/vumodel) + elif [ -e /proc/stb/info/model ]; then + model=$(cat /proc/stb/info/model) + elif [ -e /etc/model ]; then + model=$(cat /etc/model) + else + model="unknown" + fi + printf ${model} +} + display_msg() { msg="$*"