Files
wlan-ap/patches/base/0013-base-files-ignore-sysupgrade-that-was-not-ours.patch
Piotr Dymacz 93f603e27c base-files: fix foreign sysupgrade detection
Backups are gzipped, include the missing 'z' parameter in 'tar' call.
While at it, make 'grep' call quiet (add 'q' parameter).

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-11-14 07:47:20 +01:00

28 lines
954 B
Diff

From 9fb93fbd42f8f1f3036580b6666b40ab343509f8 Mon Sep 17 00:00:00 2001
From: John Crispin <john@phrozen.org>
Date: Thu, 17 Jun 2021 08:47:51 +0200
Subject: [PATCH 13/43] base-files: ignore sysupgrade that was not ours
Signed-off-by: John Crispin <john@phrozen.org>
---
package/base-files/files/lib/preinit/80_mount_root | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/package/base-files/files/lib/preinit/80_mount_root b/package/base-files/files/lib/preinit/80_mount_root
index 3f75411a43..7cf16e68e0 100644
--- a/package/base-files/files/lib/preinit/80_mount_root
+++ b/package/base-files/files/lib/preinit/80_mount_root
@@ -17,7 +17,8 @@ missing_lines() {
do_mount_root() {
mount_root
boot_run_hook preinit_mount_root
- [ -f /sysupgrade.tgz ] && {
+ (tar tzf /sysupgrade.tgz | grep -q ucentral) 2> /dev/null
+ [ $? -eq 0 ] && {
echo "- config restore -"
cp /etc/passwd /etc/group /etc/shadow /tmp
cd /
--
2.25.1