File 0001-Fix-EFI-grub2.patch of Package transactional-update.16291

commit 5f85dfd7b9060760cf70d9dede4dfdaf7ad9274a
Author: Ignaz Forster <iforster@suse.com>
Date:   Thu Mar 26 09:08:05 2020 +0100

    Mount efivarfs on EFI systems
    
    If the EFI variables are not available, pbl will attach incorrect parameters
    to grub2-install, writing the binary to a wrong location [boo#1162320].

diff -ru transactional-update-2.20.3.orig/sbin/transactional-update.in transactional-update-2.20.3/sbin/transactional-update.in
--- transactional-update-2.20.3.orig/sbin/transactional-update.in	2020-08-18 23:54:22.679603907 +0200
+++ transactional-update-2.20.3/sbin/transactional-update.in	2020-08-18 23:54:35.207644530 +0200
@@ -1097,6 +1097,15 @@
         log_error "ERROR: mount of sys failed!"
         quit 1
     fi
+    if [ -e /sys/firmware/efi/efivars ]; then
+	# If available the EFI variables have to be visible, otherwise pbl will
+	# set an incorrect installation location [boo#1162320].
+	mount -t efivarfs efivarfs ${SNAPSHOT_DIR}/sys/firmware/efi/efivars
+	if [ $? -ne 0 ]; then
+	    log_error "ERROR: mount of efivarfs failed!"
+	    quit 1
+	fi
+    fi
     if [ ${ETC_IS_OVERLAY} -eq 1 ]; then
 	lowerdir="${fstab_upper///sysroot\/var//var}:"
 	lowerdir+="`parse_lowerdirs_for_mount "/.snapshots/${BASE_SNAPSHOT_ID}/snapshot"`"
openSUSE Build Service is sponsored by