#
-# Copyright (C) 2014 OpenWrt.org
+# Copyright (C) 2021 OpenWrt.org
#
platform_get_rootfs() {
fi
}
+platform_copy_config_helper() {
+ local device=$1
+
+ mount -t vfat "$device" /mnt
+ cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
+ umount /mnt
+}
+
platform_copy_config() {
case "$(board_name)" in
erlite)
- mount -t vfat /dev/sda1 /mnt
- cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
- umount /mnt
+ platform_copy_config_helper /dev/sda1
;;
itus,shield-router)
- mount -t vfat /dev/mmcblk1p1 /mnt
- cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
- umount /mnt
+ platform_copy_config_helper /dev/mmcblk1p1
;;
- ubnt,edgerouter-4 | \
+ ubnt,edgerouter-4|\
ubnt,edgerouter-6p)
- mount -t vfat /dev/mmcblk0p1 /mnt
- cp -af "$UPGRADE_BACKUP" "/mnt/$BACKUP_FILE"
- umount /mnt
+ platform_copy_config_helper /dev/mmcblk0p1
;;
esac
}