aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/x86/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)
* x86: sysupgrade: explicitly rescan disk after writing partition tableMatthias Schiffer2017-05-291-0/+6
| | | | | | | This should ensure that the kernel partition can be mounted in platform_copy_config when its size has changed. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* x86: sysupgrade: refactor platform_do_upgradeMatthias Schiffer2017-05-291-33/+36
| | | | | | | By returning early when no upgrade device can be found and handling the SAVE_PARTITIONS=0 case differently, we can get rid of two levels of if. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* x86: sysupgrade: move partition table change check to platform_check_imageMatthias Schiffer2017-05-291-4/+25
| | | | | | | The staged sysupgrade will prevent us from using ask_bool in platform_do_upgrade; therefore, the check is moved to platform_check_image. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
* x86: fix sysupgrades on disks with 4k block sizeFelix Fietkau2017-01-251-9/+2
| | | | | | | Even when the disk uses 4k blocks, the partition table still uses units of 512 byte sectors. Always use ibs=512 for the offsets Signed-off-by: Felix Fietkau <nbd@nbd.name>
* base-files: export x86 platform upgrade functions to common.shYousong Zhou2017-01-051-94/+3
| | | | Signed-off-by: Yousong Zhou <yszhou4tech@gmail.com>
* x86: generalize partition discovery for sysupgradeJo-Philipp Wich2016-05-241-23/+50
| | | | | | | | | | | | | | | Generalize the partition discovery in sysupgrade in order to fix sysupgrade and config backup/recovery on MMC block devices which use a different naming scheme compared to mtdblock or sd* devices. The change also adds the find applet to the ramdisk utilities so that upgrade code can rely on it. The commit is based on the initial submission by Russell Senior at http://patchwork.ozlabs.org/patch/625440/ . Signed-off-by: Russell Senior <russell@personaltelco.net> Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* x86: search PARTUUID in any block deviceJo-Philipp Wich2016-03-301-1/+2
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* x86: make sysupgrade work without partxJo-Philipp Wich2016-03-301-6/+28
| | | | Signed-off-by: Jo-Philipp Wich <jo@mein.io>
* x86: fix platform_export_bootpart() for Xen virtual disksHauke Mehrtens2016-04-171-1/+1
| | | | | | | | | | | | | Virtual disk devices in a Xen virtual machine (DomU) can be /dev/xvda, /dev/xvdb and so on with partitions like /dev/xdva1. Devices named like this where not considered before. This resulted in a non working sysupgrade, because the boot partition could not be found. Signed-off-by: Alexander Dahl <alex@netz39.de> Suggested-by: Matthias Schiffer <mschiffer@universe-factory.net> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> SVN-Revision: 49190
* x86: preserve partition table on sysupgradeJo-Philipp Wich2016-02-091-2/+49
| | | | | | | | | | | | | | With this patch sysupgrade will write directly to the partitions instead of to the main disk. The UUID is copied from the image to the MBR as well. This prevents the mbr from being completely overwritten and losing the partition table. The -p option has been added to maintain the original behavior and overwite the entire disk with the new image. Tests have been added to ensure that the image partitions match up with the active partitions. Signed-off-by: Rob Mosher <nyt-openwrt@countercultured.net> SVN-Revision: 48682
* x86: use PARTUUID instead explicitly specifying the device by defaultJo-Philipp Wich2015-03-241-24/+46
| | | | | | | | | | | | | This changes the x86 image generation to match x86_64, using the PARTUUID for the rootfs instead of explicitly configuring the device. It unbreaks KVM with VirtIO, which uses /dev/vda2 instead of /dev/sda2. Tested in QEMU/KVM with VirtIO, VirtualBox and VMware. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net> SVN-Revision: 44966
* target/linux/*/base-files/lib/upgrade/platform.sh - wrong check for ARGCJohn Crispin2014-06-021-1/+1
| | | | | | | | | | | | | | | | | | | ARGC is a 'C-ism', but not known/valid in shell-syntax - insert the correct var $# (=number of args) here. under normal conditions this had no impact, but we should at least correct it. the error was observable like this: root@box:~ [ -e "/etc/functions.sh" ] && . /etc/functions.sh root@box:~ [ -e "/lib/functions.sh" ] && . /lib/functions.sh root@box:~ . /lib/upgrade/platform.sh root@box:~ . /lib/upgrade/common.sh root@box:~ platform_check_image /tmp/myfirmware.bin ash: bad number root@box:~ echo $? 0 Signed-off-by: Bastian Bittorf <bittorf@bluebottle.com> SVN-Revision: 40915
* kernel/base-files: clean up old code related to refreshing mtd partitions, ↵Felix Fietkau2013-07-141-6/+0
| | | | | | | | it is no longer used anywhere Signed-off-by: Felix Fietkau <nbd@openwrt.org> SVN-Revision: 37282
* x86: allow both old and new grub signatures in sysupgradeJo-Philipp Wich2012-10-231-1/+1
| | | | SVN-Revision: 33898
* x86: correct image magic for grub2 imagesFelix Fietkau2012-10-221-1/+1
| | | | | | | | | Sysupgrade broke on x86 when grub2 superceded grub. This patch corrects tha magic_word to be expected in grub2 combined images. Signed-off-by: Russell Senior <russell@personaltelco.net> SVN-Revision: 33890
* Fix sysupgrade for squashfs, jffs2 and ext4 imagesVasilis Tsiligiannis2012-06-191-16/+33
| | | | | | | * use 'fsync' with 'dd' for image writing * save config to boot partition SVN-Revision: 32465
* sysupgrade: fix typo in platform_do_upgrade() on x86 (closes: #7068), thanks ↵Nicolas Thill2010-04-041-1/+1
| | | | | | to acinonyx SVN-Revision: 20703
* sysupgrade: Get target device from kernel cmdline, patch from acinonyxFlorian Fainelli2010-03-281-1/+5
| | | | SVN-Revision: 20538
* sysupgrade: Dump image to sda device instead of hda (patch by Acinonyx)Jo-Philipp Wich2010-03-271-1/+1
| | | | SVN-Revision: 20514
* sysupgrade-ext2 sync before writing image, not after Sysupgrade for ext2 ↵Jo-Philipp Wich2009-07-161-1/+1
| | | | | | currently flushes the filesystem buffers after an image is written to the disk. This should happen before the image is written. SVN-Revision: 16867
* fix small logic error in x86 sysupgrade script, which prevented upgrades ↵Felix Fietkau2008-09-231-1/+1
| | | | | | from jffs2 to squashfs (#3321) SVN-Revision: 12672
* fix sysupgrade support for brcm-2.4 and brcm47xx make mtd refresh based ↵Felix Fietkau2008-09-231-0/+2
| | | | | | config append optional (leave enabled on x86) SVN-Revision: 12657
* fix sysupgrade endian issuesTravis Kemen2008-07-221-1/+1
| | | | SVN-Revision: 11900
* get rid of per-profile base-filesGabor Juhos2007-09-291-0/+27
SVN-Revision: 9069