aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/sunxi/base-files/lib/upgrade/platform.sh
Commit message (Collapse)AuthorAgeFilesLines
* treewide: use new procd sysupgrade $UPGRADE_BACKUP variableRafał Miłecki2019-09-121-1/+1
| | | | | | | | | | | It's a variable set by procd that should replace hardcoded /tmp/sysupgrade.tgz. This change requires the most recent procd with the commit 0f3c136 ("sysupgrade: set UPGRADE_BACKUP env variable"). Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit 641f6b6c26cb9ab5e1198810015e5f4b2b5b34ad)
* treewide: when copying a backup file always specify dest nameRafał Miłecki2019-09-121-1/+1
| | | | | | | | $CONF_TAR shouldn't be assumed to always point to the sysupgrade.tgz. This change makes code more generic and allows refactoring $CONF_TAR. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit 62dbe361a1b1ed1506bc0387bff55eddcb619e49)
* treewide: sysupgrade: pass "save_partitions" option to the "sysupgrade" methodRafał Miłecki2019-09-041-1/+1
| | | | | | | | This explicitly lets stage2 know if partitions should be preserved. No more "touch /tmp/sysupgrade.always.overwrite.bootdisk.partmap" hack. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> (cherry picked from commit b6f4cd57e19a8cfcd9ff52582b65164ce6213c3d)
* base-files: improve lib/upgrade/common.shKlaus Kudielka2019-05-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently, upgrade device autodetection has been added to the mvebu target. This exposes some shortcomings of the generic export_bootdevice function, e.g. on the Turris Omnia: export_bootdevice silently reports the root partition to be the boot device. This makes the sysupgrade process fail at several places. Fix this by clearly distinguishing between /proc/cmdline arguments which specify the boot disk, and those which specify the root partition. Only in the latter case, strip off the partition, and do it consistently. root=PARTUUID=<pseudo PARTUUID for MBR> (any partition) and root=/dev/* (any partition) are accepted. The root of the problem is that the *existing* export_bootdevice in /lib/upgrade/common.sh behaves differently, if the kernel is booted with root=/dev/..., or if it is booted with root=PARTUUID=... In the former case, it reports back major/minor of the root partition, in the latter case it reports back major/minor of the complete boot disk. Targets, which boot with root=/dev/... *and* use export_bootdevice / export_partdevice, have added workarounds to this behaviour, by specifying *negative* increments to the export_partdevice function. Consequently, those targets have to be adapted to use positive increments, otherwise they are broken by the change to export_bootdevice. Fixes: 4e8345ff68 ("mvebu: base-files: autodetect upgrade device") Signed-off-by: Klaus Kudielka <klaus.kudielka@gmail.com> Tested-by: Tomasz Maciej Nowak <tomek_n@o2.pl>
* sunxi: sysupgrade: sync with x86Matthias Schiffer2017-05-291-49/+71
| | | | | | | | | | | | sunxi sysupgrade was based on the x86 implementation; sync fixes and other changes from the current x86 version: x86: fix sysupgrades on disks with 4k block size x86: sysupgrade: move partition table change check to platform_check_image x86: sysupgrade: refactor platform_do_upgrade x86: sysupgrade: explicitly rescan disk after writing partition table Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* sunxi: sysupgrade: don't write partitions twiceMatthias Schiffer2017-05-291-1/+1
| | | | | | | | | | | | | | When existing partitions are retained, the dd call writing the uboot image in the space before the first partition was accidentally writing the whole image, making the code for individual partitions redundant. Limit the copy to 1016KiB (the first 8KiB are skipped, and the first partition starts at 1024KiB). In addition, conv=notrunc is replaced with conv=fsync. It seems this was an oversight, as notrunc doesn't make sense for block devices and all other dd commands use conv=fsync. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* sunxi: add sysupgrade supportYousong Zhou2017-01-051-0/+67
Enalbe builtin support for FAT filesystem as we need to mount boot partition to store sysupgrade.tgz there Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>