mvebu: make sysupgrade compatible with existing scripts
This commit is contained in:
parent
2ee0e86dbe
commit
0669f927c1
@ -17,7 +17,7 @@ move_config() {
|
||||
esac
|
||||
mkdir -p /boot
|
||||
mount -o rw,noatime "/dev/$partdev" /boot
|
||||
[ -f "/boot/$BACKUP_FILE" ] && mv -f "/boot/$BACKUP_FILE" /
|
||||
[ -f /boot/sysupgrade.tgz ] && mv -f /boot/sysupgrade.tgz /
|
||||
umount /boot
|
||||
fi
|
||||
}
|
||||
|
||||
@ -49,7 +49,7 @@ platform_do_upgrade_sdcard() {
|
||||
|
||||
sync
|
||||
|
||||
if [ "$UPGRADE_OPT_SAVE_PARTITIONS" = "1" ]; then
|
||||
if [ "$SAVE_PARTITIONS" = "1" ]; then
|
||||
get_partitions "/dev/$diskdev" bootdisk
|
||||
|
||||
#extract the boot sector from the image
|
||||
@ -106,7 +106,7 @@ platform_copy_config_sdcard() {
|
||||
if export_partdevice partdev 1; then
|
||||
mkdir -p /boot
|
||||
[ -f /boot/kernel.img ] || mount -o rw,noatime /dev/$partdev /boot
|
||||
cp -af "$UPGRADE_BACKUP" "/boot/$BACKUP_FILE"
|
||||
cp -af "$CONF_TAR" /boot/
|
||||
sync
|
||||
umount /boot
|
||||
fi
|
||||
|
||||
@ -15,10 +15,10 @@ preinit_mount_udpu() {
|
||||
if [ -b "${mmcdev}p4" ]; then
|
||||
mkdir /misc
|
||||
mount -t f2fs ${mmcdev}p4 /misc
|
||||
[ -f "/misc/$BACKUP_FILE" ] && {
|
||||
[ -f /misc/sysupgrade.tgz ] && {
|
||||
echo "- Restoring configuration files -"
|
||||
tar xzf "/misc/$BACKUP_FILE" -C /
|
||||
rm -f "/misc/$BACKUP_FILE"
|
||||
tar xzf /misc/sysupgrade.tgz -C /
|
||||
rm -f /misc/sysupgrade.tgz"
|
||||
sync
|
||||
}
|
||||
[ -f "/misc/firmware/recovery.itb" ] && {
|
||||
|
||||
@ -149,8 +149,8 @@ platform_do_upgrade_uDPU() {
|
||||
|
||||
platform_copy_config_uDPU() {
|
||||
# Config is saved on the /misc partition and copied on the rootfs after the reboot
|
||||
if [ -f "$UPGRADE_BACKUP" ]; then
|
||||
cp -f "$UPGRADE_BACKUP" "/misc/$BACKUP_FILE"
|
||||
if [ -f /tmp/sysupgrade.tgz ]; then
|
||||
cp -f /tmp/sysupgrade.tgz /misc/
|
||||
sync
|
||||
fi
|
||||
}
|
||||
|
||||
@ -27,12 +27,12 @@ preinit_mount_syscfg() {
|
||||
fi
|
||||
mkdir /tmp/syscfg
|
||||
mount -t ubifs ubi1:syscfg /tmp/syscfg
|
||||
[ -f "/tmp/syscfg/$BACKUP_FILE" ] && {
|
||||
[ -f "/tmp/syscfg/$CONF_TAR" ] && {
|
||||
echo "- config restore -"
|
||||
cd /
|
||||
mv "/tmp/syscfg/$BACKUP_FILE" /tmp
|
||||
tar xzf "/tmp/$BACKUP_FILE"
|
||||
rm -f "/tmp/$BACKUP_FILE"
|
||||
mv "/tmp/syscfg/$CONF_TAR" /tmp
|
||||
tar xzf "/tmp/$CONF_TAR"
|
||||
rm -f "/tmp/$CONF_TAR"
|
||||
sync
|
||||
}
|
||||
;;
|
||||
|
||||
@ -93,6 +93,6 @@ platform_do_upgrade_linksys() {
|
||||
}
|
||||
|
||||
platform_copy_config_linksys() {
|
||||
cp -f "$UPGRADE_BACKUP" "/tmp/syscfg/$BACKUP_FILE"
|
||||
cp -f /tmp/sysupgrade.tgz /tmp/syscfg/sysupgrade.tgz
|
||||
sync
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user