0023-x86-sysupgrade-explicitly-rescan-disk-after-writing-partition-table.patch 1.0 KB

1234567891011121314151617181920212223242526
  1. From: Matthias Schiffer <mschiffer@universe-factory.net>
  2. Date: Wed, 3 May 2017 09:08:29 +0200
  3. Subject: x86: sysupgrade: explicitly rescan disk after writing partition table
  4. This should ensure that the kernel partition can be mounted in
  5. platform_copy_config when its size has changed.
  6. Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
  7. diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh
  8. index 4fa71999be7be3972676a1019488972dccd57fa2..439ba8f5125d97932248ff966340165a84e1b24a 100644
  9. --- a/target/linux/x86/base-files/lib/upgrade/platform.sh
  10. +++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
  11. @@ -70,6 +70,12 @@ platform_do_upgrade() {
  12. if [ -n "$diff" ]; then
  13. get_image "$@" | dd of="/dev/$diskdev" bs=4096 conv=fsync
  14. +
  15. + # Separate removal and addtion is necessary; otherwise, partition 1
  16. + # will be missing if it overlaps with the old partition 2
  17. + partx -d - "/dev/$diskdev"
  18. + partx -a - "/dev/$diskdev"
  19. +
  20. return 0
  21. fi