Commit Graph

19 Commits (c3e420f28cf1ed229753f94bafdb0d5851748af3)

Author SHA1 Message Date
Jo-Philipp Wich 1012701014 x86: generalize partition discovery for sysupgrade
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>
8 years ago
Jo-Philipp Wich 924fb794bd x86: search PARTUUID in any block device
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Jo-Philipp Wich 9f422eba7c x86: make sysupgrade work without partx
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
8 years ago
Hauke Mehrtens 8a7b28071f x86: fix platform_export_bootpart() for Xen virtual disks
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
8 years ago
Jo-Philipp Wich 4aeeead303 x86: preserve partition table on sysupgrade
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
9 years ago
Jo-Philipp Wich 02e2548b84 x86: use PARTUUID instead explicitly specifying the device by default
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
9 years ago
John Crispin f933a741a9 target/linux/*/base-files/lib/upgrade/platform.sh - wrong check for ARGC
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
10 years ago
Felix Fietkau b95bdc8ab5 kernel/base-files: clean up old code related to refreshing mtd partitions, it is no longer used anywhere
Signed-off-by: Felix Fietkau <nbd@openwrt.org>

SVN-Revision: 37282
11 years ago
Jo-Philipp Wich f600ec5b3b x86: allow both old and new grub signatures in sysupgrade
SVN-Revision: 33898
12 years ago
Felix Fietkau 95e642632a x86: correct image magic for grub2 images
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
12 years ago
Vasilis Tsiligiannis 1978c07539 Fix sysupgrade for squashfs, jffs2 and ext4 images
* use 'fsync' with 'dd' for image writing
	* save config to boot partition

SVN-Revision: 32465
12 years ago
Nicolas Thill 1fc7da0306 sysupgrade: fix typo in platform_do_upgrade() on x86 (closes: #7068), thanks to acinonyx
SVN-Revision: 20703
14 years ago
Florian Fainelli e1a4f69cb5 sysupgrade: Get target device from kernel cmdline, patch from acinonyx
SVN-Revision: 20538
14 years ago
Jo-Philipp Wich 817d27bcdc sysupgrade: Dump image to sda device instead of hda (patch by Acinonyx)
SVN-Revision: 20514
14 years ago
Jo-Philipp Wich 5231811851 sysupgrade-ext2 sync before writing image, not after Sysupgrade for ext2 currently flushes the filesystem buffers after an image is written to the disk. This should happen before the image is written.
SVN-Revision: 16867
15 years ago
Felix Fietkau 065306a9a8 fix small logic error in x86 sysupgrade script, which prevented upgrades from jffs2 to squashfs (#3321)
SVN-Revision: 12672
16 years ago
Felix Fietkau f47a4a58c5 fix sysupgrade support for brcm-2.4 and brcm47xx make mtd refresh based config append optional (leave enabled on x86)
SVN-Revision: 12657
16 years ago
Travis Kemen 7346ef83e1 fix sysupgrade endian issues
SVN-Revision: 11900
16 years ago
Gabor Juhos 438dfe5c6f get rid of per-profile base-files
SVN-Revision: 9069
17 years ago