summaryrefslogtreecommitdiffstats
path: root/client/engine
diff options
context:
space:
mode:
authorIrina Gómez <irinagomez@us.es>2019-10-17 13:37:46 +0200
committerIrina Gómez <irinagomez@us.es>2019-10-17 13:37:46 +0200
commit97914e0a9439c3a8ed36873a1da665d970396c4d (patch)
tree7260b076d41265843fd8055c4d0683045690167e /client/engine
parent20e5aaade52753a1de631fcd10b8116a8597e555 (diff)
#802 #889 Fix problem when windows is updated. ogCopyEfiBootLoader and ogRestoreEfiBootLoader: \ * It saves directory Microsoft/Boot of ESP in directory ogBoot into system partition. \ * When it is creating a image, if in ESP exists the directories Microsoft y Part-X-Y it copy Part-X-Y. \ * When it restore a image, it rename directory Microsoft of ESP to Microsoft.
Diffstat (limited to 'client/engine')
-rw-r--r--client/engine/UEFI.lib15
1 files changed, 9 insertions, 6 deletions
diff --git a/client/engine/UEFI.lib b/client/engine/UEFI.lib
index cd7168e7..1a8bb952 100644
--- a/client/engine/UEFI.lib
+++ b/client/engine/UEFI.lib
@@ -129,14 +129,14 @@ BOOTLABEL=$(printf "Part-%02d-%02d" $1 $2)
OSVERSION=$(ogGetOsVersion $1 $2)
case $OSVERSION in
*Windows\ 10*)
- for f in $EFIDIR/EFI/{$BOOTLABEL,Microsoft}/Boot/bootmgfw.efi; do
+ for f in $EFIDIR/EFI/{Microsoft,$BOOTLABEL}/Boot/bootmgfw.efi; do
[ -r $f ] && LOADER=$f
done
[ -n "$LOADER" ] || ogRaiseError $OG_ERR_NOTOS "$1 $2 ($OSVERSION, EFI)" || return $?
# Si existe el directorio Boot lo borramos
- [ -d $MNTDIR/Boot ] && rm -rf $MNTDIR/Boot
+ [ -d $MNTDIR/ogBoot ] && rm -rf $MNTDIR/ogBoot
DIRLOADER=$(realpath "${LOADER%/*}/..")
- cp -r ${DIRLOADER}/Boot $MNTDIR
+ cp -r ${DIRLOADER}/Boot $MNTDIR/ogBoot
;;
esac
}
@@ -413,13 +413,16 @@ OSVERSION=$(ogGetOsVersion $1 $2)
case $OSVERSION in
*Windows\ 10*)
BOOTLABEL=$(printf "Part-%02d-%02d" $1 $2)
- LOADER=$(ogGetPath $MNTDIR/Boot/bootmgfw.efi)
+ LOADER=$(ogGetPath $MNTDIR/ogBoot/bootmgfw.efi)
[ -n "$LOADER" ] || ogRaiseError $OG_ERR_NOTOS "$1 $2 ($OSVERSION, EFI)" || return $?
- [ -r $EFIDIR/$BOOTLABEL ] && rm -rf $EFIDIR/$BOOTLABEL
+ [ -r $EFIDIR/EFI/$BOOTLABEL ] && rm -rf $EFIDIR/EFI/$BOOTLABEL
mkdir -p $EFIDIR/EFI/$BOOTLABEL
- cp -r "${LOADER%/*}" $EFIDIR/EFI/$BOOTLABEL
+ cp -r "${LOADER%/*}" $EFIDIR/EFI/$BOOTLABEL/Boot
# Nombre OpenGnsys para cargador
cp $LOADER $EFIDIR/EFI/$BOOTLABEL/Boot/ogloader.efi
+
+ # Si existe subcarpeta Microsoft en la partición EFI la renombramos
+ [ "$(ogGetPath $EFIDIR/EFI/Microsoft)" == "" ] || mv $EFIDIR/EFI/{Microsoft,Microsoft.backup.og}
;;
esac
}