x86: generate EFI platform bootable images
[openwrt/staging/wigyori.git] / target / linux / x86 / base-files / lib / preinit / 79_move_config
index 143ca5147b5693a5b8068dc10eb71b5066777160..338398c9479dc29ca4b26fa244da9119703fba52 100644 (file)
@@ -2,19 +2,19 @@
 # Copyright (C) 2012-2015 OpenWrt.org
 
 move_config() {
-       local partdev
+       local partdev parttype=ext4
 
        . /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 /
-                       fi
-                       umount /mnt
+               mkdir -p /boot
+               part_magic_fat "/dev/$partdev" && parttype=vfat
+               mount -t $parttype -o rw,noatime "/dev/$partdev" /boot
+               if [ -f "/boot/$BACKUP_FILE" ]; then
+                       mv -f "/boot/$BACKUP_FILE" /
                fi
+               mount --bind /boot/boot /boot
        fi
 }
 
 boot_hook_add preinit_mount_root move_config
-