openwrt/package
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
boot uboot-tegra: bump to 2019.04 2019-05-05 21:11:01 +02:00
devel kernel: Remove support for kernel 3.18 2019-05-03 22:41:38 +02:00
firmware ath10k-firmware: update Candela Tech firmware images 2019-03-30 10:36:31 +01:00
kernel ramips: mt7620: fix dependencies 2019-05-11 01:05:11 +02:00
libs elfutils: Fix compile with uClibc-ng 2019-05-05 21:11:01 +02:00
network netifd: update to latest git HEAD 2019-05-08 22:15:19 +02:00
system procd: fix compile issue 2019-05-09 18:33:39 +02:00
utils adm5120: Remove unmaintained target 2019-05-03 21:27:12 +02:00
Makefile build: add ABI_VERSION to binary package names 2019-01-19 14:32:12 +01:00