[LEDE-DEV] [PATCH v2 2/3] base-files: put board_name into separate file
Roman Yeryomin
leroi.lists at gmail.com
Tue May 9 02:17:00 PDT 2017
Signed-off-by: Roman Yeryomin <roman at advem.lv>
---
package/base-files/files/lib/functions.sh | 4 +---
package/base-files/files/lib/functions/board.sh | 6 ++++++
2 files changed, 7 insertions(+), 3 deletions(-)
create mode 100644 package/base-files/files/lib/functions/board.sh
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index 2b6415a..2aaafcf 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -353,8 +353,6 @@ user_exists() {
grep -qs "^${1}:" ${IPKG_INSTROOT}/etc/passwd
}
-board_name() {
- [ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic"
-}
+. /lib/functions/board.sh
[ -z "$IPKG_INSTROOT" -a -f /lib/config/uci.sh ] && . /lib/config/uci.sh
diff --git a/package/base-files/files/lib/functions/board.sh b/package/base-files/files/lib/functions/board.sh
new file mode 100644
index 0000000..d33edc8
--- /dev/null
+++ b/package/base-files/files/lib/functions/board.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+board_name()
+{
+ [ -e /tmp/sysinfo/board_name ] && cat /tmp/sysinfo/board_name || echo "generic"
+}
--
2.7.4
More information about the Lede-dev
mailing list