[openwrt/openwrt] base-files: sysupgrade: allow overriding config restore

LEDE Commits lede-commits at lists.infradead.org
Mon Mar 4 07:33:51 PST 2024


noltari pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/4b3c1251a4b511c36b6fdbb6f249ccd3114b00c5

commit 4b3c1251a4b511c36b6fdbb6f249ccd3114b00c5
Author: Álvaro Fernández Rojas <noltari at gmail.com>
AuthorDate: Wed Jan 31 11:43:55 2024 +0100

    base-files: sysupgrade: allow overriding config restore
    
    Some platforms like Raspberry Pi require patching some backup files like
    cmdline.txt in order to set the correct root PARTUUID.
    
    Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
 package/base-files/files/sbin/sysupgrade | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/base-files/files/sbin/sysupgrade b/package/base-files/files/sbin/sysupgrade
index 720f3da3fa..ed8871b892 100755
--- a/package/base-files/files/sbin/sysupgrade
+++ b/package/base-files/files/sbin/sysupgrade
@@ -307,7 +307,11 @@ if [ -n "$CONF_RESTORE" ]; then
 
 	[ "$VERBOSE" -gt 1 ] && TAR_V="v" || TAR_V=""
 	v "Restoring config files..."
-	tar -C / -x${TAR_V}zf "$CONF_RESTORE"
+	if [ "$(type -t platform_restore_backup)" == 'platform_restore_backup' ]; then
+		platform_restore_backup "$TAR_V"
+	else
+		tar -C / -x${TAR_V}zf "$CONF_RESTORE"
+	fi
 	exit $?
 fi
 




More information about the lede-commits mailing list