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 tf /sysupgrade.tgz | grep ucentral) 2> /dev/null
+	[ $? -eq 0 ] && {
 		echo "- config restore -"
 		cp /etc/passwd /etc/group /etc/shadow /tmp
 		cd /
-- 
2.25.1

