0
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2025-02-24 16:28:46 +00:00
Jakob Haufe fa0a7e00e8 octeon: ubnt-edgerouter: fix sysupgrade config backup/restore
er is missing from platform_copy_config() and octeon_move_config(), so
config is lost on every sysupgrade.

(cherry-picked from commit 77037b09f3ce3284c8486b73cfaaceac53241990)
Signed-off-by: Jakob Haufe <sur5r@sur5r.net>
Link: https://github.com/openwrt/openwrt/pull/16518
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-09-28 18:33:21 +02:00

34 lines
586 B
Plaintext

# Copyright (C) 2014 OpenWrt.org
move_config() {
. /lib/upgrade/common.sh
local device="$1"
[ -n "$device" ] && [ -b "$device" ] && {
mount -t vfat "$device" /mnt
[ -f "/mnt/$BACKUP_FILE" ] && mv -f "/mnt/$BACKUP_FILE" /
umount /mnt
}
}
octeon_move_config() {
. /lib/functions.sh
case "$(board_name)" in
erlite|\
ubnt,usg)
move_config "/dev/sda1"
;;
itus,shield-router)
move_config "/dev/mmcblk1p1"
;;
er|\
ubnt,edgerouter-4|\
ubnt,edgerouter-6p)
move_config "/dev/mmcblk0p1"
;;
esac
}
boot_hook_add preinit_mount_root octeon_move_config