diff options
| author | Felix Fietkau | 2017-11-07 09:22:47 +0000 |
|---|---|---|
| committer | Felix Fietkau | 2017-11-16 11:52:55 +0000 |
| commit | 3eb839b5795e6f8d6461f94dbc4217c3641e7f19 (patch) | |
| tree | 45c497127e7303cd5a58ec5837c66f7d0e3f6841 | |
| parent | b15c5639299152f526ee95e333198632e0827470 (diff) | |
| download | openwrt-3eb839b5795e6f8d6461f94dbc4217c3641e7f19.tar.gz | |
ramips: extract board name from device tree as a fallback
This makes it possible to avoid more duplication when adding support for
a new board
Signed-off-by: Felix Fietkau <nbd@nbd.name>
| -rwxr-xr-x | target/linux/ramips/base-files/lib/ramips.sh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/target/linux/ramips/base-files/lib/ramips.sh b/target/linux/ramips/base-files/lib/ramips.sh index b71a130cbe..76ca3d1306 100755 --- a/target/linux/ramips/base-files/lib/ramips.sh +++ b/target/linux/ramips/base-files/lib/ramips.sh @@ -737,7 +737,9 @@ ramips_board_detect() { name="youku-yk1" ;; *) - name="generic" + name="$(strings /proc/device-tree/compatible | head -1)" + name="${name##*,}" + name="${name:-generic}" ;; esac |