[openwrt/openwrt] base-files: add syslog logging for v function

LEDE Commits lede-commits at lists.infradead.org
Sun Jun 20 18:16:17 PDT 2021


aparcar pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/bb2b7156a4b55a5599ac45adbe46b2d6bd046036

commit bb2b7156a4b55a5599ac45adbe46b2d6bd046036
Author: Florian Eckert <fe at dev.tdt.de>
AuthorDate: Mon Feb 1 11:02:30 2021 +0100

    base-files: add syslog logging for v function
    
    The logging output should not only be displayed in the calling shell
    session but also in the syslog. A sysupgrade and a configuration
    import, export can thus be traced in the syslog.
    
    Signed-off-by: Florian Eckert <fe at dev.tdt.de>
---
 package/base-files/files/lib/upgrade/common.sh | 1 +
 package/base-files/files/lib/upgrade/stage2    | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/lib/upgrade/common.sh b/package/base-files/files/lib/upgrade/common.sh
index b8ae2ecb7e..5c85d986f9 100644
--- a/package/base-files/files/lib/upgrade/common.sh
+++ b/package/base-files/files/lib/upgrade/common.sh
@@ -71,6 +71,7 @@ _vn() {
 
 v() {
 	_v "$(date) upgrade: $@"
+	logger -p info -t upgrade "$@"
 }
 
 vn() {
diff --git a/package/base-files/files/lib/upgrade/stage2 b/package/base-files/files/lib/upgrade/stage2
index cb42c956c5..ba728004e9 100755
--- a/package/base-files/files/lib/upgrade/stage2
+++ b/package/base-files/files/lib/upgrade/stage2
@@ -45,7 +45,7 @@ switch_to_ramfs() {
 		mtd partx losetup mkfs.ext4 nandwrite flash_erase	\
 		ubiupdatevol ubiattach ubiblock ubiformat		\
 		ubidetach ubirsvol ubirmvol ubimkvol			\
-		snapshot snapshot_tool date				\
+		snapshot snapshot_tool date logger			\
 		$RAMFS_COPY_LOSETUP $RAMFS_COPY_LVM			\
 		$RAMFS_COPY_BIN
 	do



More information about the lede-commits mailing list