1
0
mirror of https://git.openwrt.org/openwrt/openwrt.git synced 2024-10-20 06:28:12 +02:00
openwrt/target/linux/sunxi
Klaus Kudielka ad62247800 base-files: improve lib/upgrade/common.sh
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>
2019-05-11 16:37:11 +02:00
..
base-files base-files: improve lib/upgrade/common.sh 2019-05-11 16:37:11 +02:00
cortexa7 sunxi: Add support for SY8106A voltage regulator 2019-01-27 01:04:52 +01:00
cortexa8 sunxi: Add support for kernel 4.19 2019-01-13 17:35:14 +01:00
cortexa53 sunxi: fix: A64 unstable timer 2019-02-17 19:22:39 +01:00
image sunxi: add support for Orange Pi PC Plus 2019-03-09 18:55:15 +01:00
patches-4.14 kernel: bump 4.14 to 4.14.105 2019-03-07 16:32:23 +01:00
patches-4.19 sunxi: Remove already applied patch 2019-04-08 20:34:27 +02:00
profiles treewide: use wpad-basic for not small flash targets 2018-10-16 15:07:41 +01:00
config-4.14 sunxi: add spi flash support to kernel 2019-01-26 23:11:49 +01:00
config-4.19 sunxi: Add support for SY8106A voltage regulator 2019-01-27 01:04:52 +01:00
Makefile build: add a config option for enabling a testing version of the target kernel 2019-05-11 11:37:10 +02:00
modules.mk sunxi: fix build of rtc package when module not available 2017-09-18 18:36:26 +02:00