[source] x86: sysupgrade: explicitly rescan disk after writing partition table

LEDE Commits lede-commits at lists.infradead.org
Mon May 29 14:57:11 PDT 2017


neoraider pushed a commit to source.git, branch master:
https://git.lede-project.org/dac07ca05bab5ba61e109d05b66acc394c497016

commit dac07ca05bab5ba61e109d05b66acc394c497016
Author: Matthias Schiffer <mschiffer at universe-factory.net>
AuthorDate: Wed May 3 09:08:29 2017 +0200

    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 <mschiffer at universe-factory.net>
---
 target/linux/x86/base-files/lib/upgrade/platform.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/target/linux/x86/base-files/lib/upgrade/platform.sh b/target/linux/x86/base-files/lib/upgrade/platform.sh
index 4fa7199..439ba8f 100644
--- a/target/linux/x86/base-files/lib/upgrade/platform.sh
+++ b/target/linux/x86/base-files/lib/upgrade/platform.sh
@@ -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
 



More information about the lede-commits mailing list