aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@nbd.name>2017-11-07 10:22:47 +0100
committerFelix Fietkau <nbd@nbd.name>2017-11-16 12:52:55 +0100
commit3eb839b5795e6f8d6461f94dbc4217c3641e7f19 (patch)
tree45c497127e7303cd5a58ec5837c66f7d0e3f6841
parentb15c5639299152f526ee95e333198632e0827470 (diff)
downloadupstream-3eb839b5795e6f8d6461f94dbc4217c3641e7f19.tar.gz
upstream-3eb839b5795e6f8d6461f94dbc4217c3641e7f19.tar.bz2
upstream-3eb839b5795e6f8d6461f94dbc4217c3641e7f19.zip
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-xtarget/linux/ramips/base-files/lib/ramips.sh4
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