base-files: upgrade: log with date prefix
authorYousong Zhou <yszhou4tech@gmail.com>
Tue, 3 Nov 2020 02:20:26 +0000 (10:20 +0800)
committerYousong Zhou <yszhou4tech@gmail.com>
Wed, 11 Nov 2020 13:29:55 +0000 (21:29 +0800)
And log to stderr

Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
package/base-files/files/lib/upgrade/common.sh
package/base-files/files/lib/upgrade/stage2

index 2eb26ba44b05338418c921c959db14b32b41025d..2ae83f5bfb545d078efc2fa129b35c1cb46b0d2d 100644 (file)
@@ -64,7 +64,7 @@ ask_bool() {
 }
 
 v() {
-       [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$@"
+       [ -n "$VERBOSE" ] && [ "$VERBOSE" -ge 1 ] && echo "$(date) upgrade: $@" >&2
 }
 
 json_string() {
index a4fef42134c87e311b3142289d1e32dcfb6614ed..211a3f4b33d1adea8ad9e6a2b1b7cea506b98af7 100755 (executable)
@@ -42,7 +42,7 @@ switch_to_ramfs() {
                mtd partx losetup mkfs.ext4 nandwrite flash_erase       \
                ubiupdatevol ubiattach ubiblock ubiformat               \
                ubidetach ubirsvol ubirmvol ubimkvol                    \
-               snapshot snapshot_tool                                  \
+               snapshot snapshot_tool date                             \
                $RAMFS_COPY_BIN
        do
                local file="$(command -v "$binary" 2>/dev/null)"