From: Álvaro Fernández Rojas Date: Wed, 31 Jan 2024 10:43:55 +0000 (+0100) Subject: base-files: sysupgrade: allow overriding config restore X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=4b3c1251a4b511c36b6fdbb6f249ccd3114b00c5;p=openwrt%2Fstaging%2Fmans0n.git 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 --- 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