base-files: fix error message during boot
[openwrt/openwrt.git] / package / base-files / files / lib / preinit / 10_sysinfo
index 42fd5b6..be1e6ae 100644 (file)
@@ -3,7 +3,7 @@ do_sysinfo_generic() {
        mkdir -p /tmp/sysinfo
        [ -e /tmp/sysinfo/board_name ] || \
                echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name
-       [ -e /tmp/sysinfo/model ] || \
+       [ -n /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \
                echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model
 }