From: Felix Fietkau Date: Tue, 7 Nov 2017 09:22:47 +0000 (+0100) Subject: ramips: extract board name from device tree as a fallback X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=3eb839b5795e6f8d6461f94dbc4217c3641e7f19;p=openwrt%2Fstaging%2Fmans0n.git 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 --- 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