@@ -13,7 +13,7 @@ FEATURES:=squashfs ext4 vdi vmdk pcmcia targz
SUBTARGETS=generic xen_domu geode 64
MAINTAINER:=Felix Fietkau <nbd@openwrt.org>
-DEFAULT_PACKAGES += partx-utils
+DEFAULT_PACKAGES += partx-utils dmidecode
KERNEL_PATCHVER:=4.4
new file mode 100644
@@ -0,0 +1,18 @@
+do_sysinfo_x86() {
+ local manufacturer productname boardname
+
+ [ -x /usr/sbin/dmidecode ] || return
+
+ manufacturer="$(dmidecode -s system-manufacturer 2>/dev/null)"
+ productname="$(dmidecode -s system-product-name 2>/dev/null)"
+
+ [ -n "$manufacturer" -a -n "$productname" ] || return
+
+ boardname="$(printf "%s %s" "$manufacturer" "$productname" | tr 'A-Z' 'a-z' | tr -cs 'a-z0-9_-' '-')"
+
+ mkdir -p /tmp/sysinfo
+ echo "$boardname" > /tmp/sysinfo/board_name
+ echo "$manufacturer $productname" > /tmp/sysinfo/model
+}
+
+boot_hook_add preinit_main do_sysinfo_x86
Use the DMI data available in sysfs to extract manufacturer and model info and write it to /tmp/sysinfo/. The data will be picked up by board_detect and can be used by e.g. LuCI to display a more appropriate model description. On an APU board the files will contain the following values: # cat /tmp/sysinfo/model PC Engines APU # cat /tmp/sysinfo/board_name pc-engines-apu Signed-off-by: Jo-Philipp Wich <jo@mein.io> --- target/linux/x86/Makefile | 2 +- target/linux/x86/base-files/lib/preinit/20_sysinfo | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 target/linux/x86/base-files/lib/preinit/20_sysinfo