cb02a376b3
Advantages: - preserves existing partition layout. On the hard-drive. Only the boot and rootfs partition will be overwritten. Disadvantages: - The upgrade process takes much longer to run. from 2-3 seconds to 15-25 seconds. Please note that sysupgrade will refuse to upgrade, if the existing installation has an incompatible partition layout. Future changes to the bootfs and/or rootfs partition size will likely cause breakage to the sysupgrade procedure. In these cases, the ext4-rootfs.img.gz has to be written manually onto the disk. Please don't forget to backup your configuration in this cases. Note2: This patch requires "base-files: upgrade: make get_partitions() endian agnostic" Note3: If your current installation does not host the two changes, sysupgrading will wipe the existing partition layout. Don't forget to backup your data! Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
88 lines
1 KiB
Bash
Executable file
88 lines
1 KiB
Bash
Executable file
#!/bin/sh
|
|
|
|
PART_NAME=firmware
|
|
|
|
platform_check_image() {
|
|
local board=$(board_name)
|
|
|
|
[ "$#" -gt 1 ] && return 1
|
|
|
|
case "$board" in
|
|
mbl)
|
|
mbl_do_platform_check "$1"
|
|
return $?;
|
|
;;
|
|
|
|
mr24|\
|
|
mx60)
|
|
merakinand_do_platform_check $board "$1"
|
|
return $?;
|
|
;;
|
|
|
|
wndr4700)
|
|
nand_do_platform_check $board "$1"
|
|
return $?;
|
|
;;
|
|
|
|
*)
|
|
;;
|
|
esac
|
|
|
|
echo "Sysupgrade is not yet supported on $board."
|
|
return 1
|
|
}
|
|
|
|
platform_pre_upgrade() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
mr24|\
|
|
mx60)
|
|
merakinand_do_upgrade "$1"
|
|
;;
|
|
|
|
wndr4700)
|
|
nand_do_upgrade "$1"
|
|
;;
|
|
|
|
*)
|
|
;;
|
|
esac
|
|
}
|
|
|
|
platform_do_upgrade() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
mbl)
|
|
mbl_do_upgrade "$ARGV"
|
|
;;
|
|
|
|
*)
|
|
default_do_upgrade "$ARGV"
|
|
;;
|
|
esac
|
|
}
|
|
|
|
platform_copy_config() {
|
|
local board=$(board_name)
|
|
|
|
case "$board" in
|
|
mbl)
|
|
mbl_copy_config
|
|
;;
|
|
|
|
*)
|
|
;;
|
|
esac
|
|
}
|
|
|
|
disable_watchdog() {
|
|
killall watchdog
|
|
( ps | grep -v 'grep' | grep '/dev/watchdog' ) && {
|
|
echo 'Could not disable watchdog'
|
|
return 1
|
|
}
|
|
}
|
|
|
|
append sysupgrade_pre_upgrade disable_watchdog
|