x86: sysupgrade: explicitly rescan disk after writing partition table
authorMatthias Schiffer <mschiffer@universe-factory.net>
Wed, 3 May 2017 07:08:29 +0000 (09:08 +0200)
committerMatthias Schiffer <mschiffer@universe-factory.net>
Mon, 29 May 2017 21:50:34 +0000 (23:50 +0200)
This should ensure that the kernel partition can be mounted in
platform_copy_config when its size has changed.

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
target/linux/x86/base-files/lib/upgrade/platform.sh

index 4fa71999be7be3972676a1019488972dccd57fa2..439ba8f5125d97932248ff966340165a84e1b24a 100644 (file)
@@ -70,6 +70,12 @@ platform_do_upgrade() {
 
        if [ -n "$diff" ]; then
                get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync
+
+               # Separate removal and addtion is necessary; otherwise, partition 1
+               # will be missing if it overlaps with the old partition 2
+               partx -d - "/dev/$diskdev"
+               partx -a - "/dev/$diskdev"
+
                return 0
        fi