From 3eb839b5795e6f8d6461f94dbc4217c3641e7f19 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 7 Nov 2017 10:22:47 +0100 Subject: [PATCH] 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 --- target/linux/ramips/base-files/lib/ramips.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.25.1