Browse Source

- rootfs: add /etc/model; add get_boxmodel function

master
vanhofen 4 years ago
parent
commit
2763d10a13
  1. 4
      make/target-files.mk
  2. 14
      skel-root/general/scripts/init.functions

4
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 $(@)

14
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="$*"

Loading…
Cancel
Save