[source] ramips: extract board name from device tree as a fallback

LEDE Commits lede-commits at lists.infradead.org
Thu Nov 16 03:53:38 PST 2017


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/3eb839b5795e6f8d6461f94dbc4217c3641e7f19

commit 3eb839b5795e6f8d6461f94dbc4217c3641e7f19
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Tue Nov 7 10:22:47 2017 +0100

    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 at nbd.name>
---
 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 b71a130..76ca3d1 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
 



More information about the lede-commits mailing list