[source] base-files: add generic board_name function to functions.sh
LEDE Commits
lede-commits at lists.infradead.org
Thu Dec 14 09:43:41 PST 2017
jow pushed a commit to source.git, branch lede-17.01:
https://git.lede-project.org/f173464f13102e6901c60de417b50b44d93bcbde
commit f173464f13102e6901c60de417b50b44d93bcbde
Author: Felix Fietkau <nbd at nbd.name>
AuthorDate: Fri Mar 17 16:12:27 2017 +0100
base-files: add generic board_name function to functions.sh
This will be used to replace all those nasty board specific scripts
that do basically the same thing
Signed-off-by: Felix Fietkau <nbd at nbd.name>
(cherry picked from commit ec991424749b9eed37d01bc8adb9fb22fb0c98a7)
---
package/base-files/files/lib/functions.sh | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 992d88f..bea5f0f 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -353,4 +353,8 @@ user_exists() {
grep -qs "^${1}:" ${IPKG_INSTROOT}/etc/passwd
}
+board_name() {
+ [ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic"
+}
+
[ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh
More information about the lede-commits
mailing list