2
0
forked from Ivasoft/openwrt

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>
This commit is contained in:
Jo-Philipp Wich
2016-05-24 12:07:02 +02:00
parent 3193053df7
commit 1012701014
3 changed files with 55 additions and 26 deletions

View File

@@ -2,10 +2,12 @@
# Copyright (C) 2012-2015 OpenWrt.org
move_config() {
local partdev
. /lib/upgrade/platform.sh
if platform_export_bootpart; then
mount -t ext4 -o rw,noatime "$BOOTPART" /mnt
if platform_export_bootdevice && platform_export_partdevice partdev 1; then
mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt
mv -f /mnt/sysupgrade.tgz /
umount /mnt
fi