[openwrt/openwrt] uboot-envtools: add wrapper scripts for alternate config

LEDE Commits lede-commits at lists.infradead.org
Thu Apr 8 08:21:20 BST 2021


ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/b7154fabf07e870a204a25d8e74472b57e55b040

commit b7154fabf07e870a204a25d8e74472b57e55b040
Author: Bjørn Mork <bjorn at mork.no>
AuthorDate: Tue Apr 6 11:43:04 2021 +0200

    uboot-envtools: add wrapper scripts for alternate config
    
    Now that we can create an alternate configuration file, add two
    wrapper scripts for simple access to it using the alternate
    alternate application names `fw_printsys' and `fw_setsys'.
    
    Signed-off-by: Bjørn Mork <bjorn at mork.no>
---
 package/boot/uboot-envtools/Makefile          | 2 ++
 package/boot/uboot-envtools/files/fw_printsys | 2 ++
 package/boot/uboot-envtools/files/fw_setsys   | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/package/boot/uboot-envtools/Makefile b/package/boot/uboot-envtools/Makefile
index 03dc6c678d..02bca9cea3 100644
--- a/package/boot/uboot-envtools/Makefile
+++ b/package/boot/uboot-envtools/Makefile
@@ -68,6 +68,8 @@ define Package/uboot-envtools/install
 	$(INSTALL_DIR) $(1)/usr/sbin
 	$(INSTALL_BIN) $(PKG_BUILD_DIR)/tools/env/fw_printenv $(1)/usr/sbin
 	$(LN) fw_printenv $(1)/usr/sbin/fw_setenv
+	$(INSTALL_BIN) ./files/fw_printsys $(1)/usr/sbin
+	$(INSTALL_BIN) ./files/fw_setsys $(1)/usr/sbin
 	$(INSTALL_DIR) $(1)/lib
 	$(INSTALL_DATA) ./files/uboot-envtools.sh $(1)/lib
 	$(INSTALL_DIR) $(1)/etc/uci-defaults
diff --git a/package/boot/uboot-envtools/files/fw_printsys b/package/boot/uboot-envtools/files/fw_printsys
new file mode 100644
index 0000000000..0c4c4ab257
--- /dev/null
+++ b/package/boot/uboot-envtools/files/fw_printsys
@@ -0,0 +1,2 @@
+#!/bin/sh
+[ -e /etc/fw_sys.config ] && exec /usr/sbin/fw_printenv -c /etc/fw_sys.config "$@"
diff --git a/package/boot/uboot-envtools/files/fw_setsys b/package/boot/uboot-envtools/files/fw_setsys
new file mode 100644
index 0000000000..1cdb1a70f7
--- /dev/null
+++ b/package/boot/uboot-envtools/files/fw_setsys
@@ -0,0 +1,2 @@
+#!/bin/sh
+[ -e /etc/fw_sys.config ] && exec /usr/sbin/fw_setenv -c /etc/fw_sys.config "$@"



More information about the lede-commits mailing list