Browse Source

x86: sysupgrade: explicitly rescan disk after writing partition table

This should ensure that the kernel partition can be mounted in
platform_copy_config when its size has changed.

Signed-off-by: Matthias Schiffer <[email protected]>
Matthias Schiffer 8 years ago
parent
commit
dac07ca05b
1 changed files with 6 additions and 0 deletions
  1. 6 0
      target/linux/x86/base-files/lib/upgrade/platform.sh

+ 6 - 0
target/linux/x86/base-files/lib/upgrade/platform.sh

@@ -70,6 +70,12 @@ platform_do_upgrade() {
 
 
 	if [ -n "$diff" ]; then
 	if [ -n "$diff" ]; then
 		get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync
 		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
 		return 0
 	fi
 	fi