openwrt/target/linux/apm821xx
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
dts apm821xx: dts overhaul 2019-01-24 15:53:03 +01:00
files/arch/powerpc/platforms/44x apm821xx: fix atheros PCIe cards on the MR24 2016-07-25 10:38:48 +02:00
image apm821xx: MBL: set DEVICE_TYPE to NAS 2019-03-25 21:19:39 +01:00
nand apm821xx: add support for the Netgear WNDAP620 and WNDAP660 2018-11-26 12:05:46 +01:00
patches-4.14 kernel: bump 4.14 to 4.14.114 2019-05-02 12:59:26 +02:00
patches-4.19 kernel: bump 4.19 to 4.19.34 2019-04-08 14:53:39 +02:00
sata apm821xx: sata: boot-part feature integration 2019-01-01 16:39:59 +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
config-4.14 apm821xx: 4.14: sync config 2019-01-13 11:31:43 +01:00
config-4.19 apm821xx: add linux 4.19 apm821xx patches 2018-12-27 14:36:23 +01:00