x86: keep /boot mounted for kexec
authorDaniel Golle <daniel@makrotopia.org>
Fri, 5 May 2017 03:56:10 +0000 (05:56 +0200)
committerJo-Philipp Wich <jo@mein.io>
Wed, 13 Dec 2017 14:24:47 +0000 (15:24 +0100)
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
(cherry picked from commit 63571cb56c7ff2692b5c9aa78133c3f4996e2ac5)

target/linux/x86/base-files/lib/preinit/79_move_config

index 143ca51..7b34d9e 100644 (file)
@@ -7,11 +7,14 @@ move_config() {
        . /lib/upgrade/common.sh
 
        if export_bootdevice && export_partdevice partdev 1; then
        . /lib/upgrade/common.sh
 
        if export_bootdevice && export_partdevice partdev 1; then
-               if mount -t ext4 -o rw,noatime "/dev/$partdev" /mnt; then
-                       if [ -f /mnt/sysupgrade.tgz ]; then
-                               mv -f /mnt/sysupgrade.tgz /
+               mkdir -p /boot
+               if mount -t ext4 -o ro,noatime "/dev/$partdev" /boot; then
+                       if [ -f /boot/sysupgrade.tgz ]; then
+                               mount /boot -o remount,rw,noatime
+                               mv -f /boot/sysupgrade.tgz /
+                               mount /boot -o remount,ro,noatime
                        fi
                        fi
-                       umount /mnt
+                       mount --bind /boot/boot /boot
                fi
        fi
 }
                fi
        fi
 }