From b5f94355a0547b2ea47d558dfe6ea5566d3f8dfb Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Fri, 2 Aug 2024 13:03:03 +0800 Subject: [PATCH] target/bcm27xx: fix custom boot config reset on upgrade Fix #1721 --- .../linux/bcm27xx/base-files/lib/upgrade/platform.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh b/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh index df7c0b2cd3..769ddaccce 100644 --- a/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh +++ b/target/linux/bcm27xx/base-files/lib/upgrade/platform.sh @@ -93,3 +93,15 @@ platform_do_upgrade() { echo "Writing new UUID to /dev/$diskdev..." get_image "$@" | dd of="/dev/$diskdev" bs=1 skip=440 count=4 seek=440 conv=fsync } + +platform_copy_config() { + local partdev + + if export_partdevice partdev 1; then + mkdir -p /boot + [ -f /boot/kernel.img ] || mount -t vfat -o rw,noatime "/dev/$partdev" /boot + tar -C / -zxvf "$UPGRADE_BACKUP" boot/cmdline.txt boot/config.txt + sync + umount /boot + fi +}