瀏覽代碼

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 <[email protected]>
Felix Fietkau 8 年之前
父節點
當前提交
3eb839b579
共有 1 個文件被更改,包括 3 次插入1 次删除
  1. 3 1
      target/linux/ramips/base-files/lib/ramips.sh

+ 3 - 1
target/linux/ramips/base-files/lib/ramips.sh

@@ -737,7 +737,9 @@ ramips_board_detect() {
 		name="youku-yk1"
 		name="youku-yk1"
 		;;
 		;;
 	*)
 	*)
-		name="generic"
+		name="$(strings /proc/device-tree/compatible | head -1)"
+		name="${name##*,}"
+		name="${name:-generic}"
 		;;
 		;;
 	esac
 	esac