lantiq: use the compatible string as board name
[openwrt/openwrt.git] / target / linux / lantiq / base-files / lib / preinit / 01_preinit_board.sh
index aef946036eb1613b2da609805c64b5189d5780a7..bbbac97baea96801c80be1fc590348c653c81503 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 lantiq_board_detect() {
-       name=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"`
+       name="$(strings /proc/device-tree/compatible | head -1)"
        model=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"`
        [ -z "$name" ] && name="unknown"
        [ -z "$model" ] && model="unknown"