From: Michael Prokop Date: Mon, 31 May 2021 07:23:36 +0000 (+0200) Subject: Merge remote-tracking branch 'origin/pr/174' X-Git-Tag: v0.97~1 X-Git-Url: https://git.grml.org/?p=grml-debootstrap.git;a=commitdiff_plain;h=e11e7b238ea8bc70269d7dd08120681dad702c96;hp=9ae6b12a4f1f903c85b2803ea3d5d457f5849ee0 Merge remote-tracking branch 'origin/pr/174' --- diff --git a/chroot-script b/chroot-script index b0737ca..8104df1 100755 --- a/chroot-script +++ b/chroot-script @@ -595,8 +595,18 @@ efi_setup() { echo "Mounting $EFI on /boot/efi" mount "$EFI" /boot/efi || return 1 + # if efivarfs kernel module is loaded, but efivars isn't, + # then we need to mount efivarfs for efibootmgr usage + if ! ls /sys/firmware/efi/efivars/* &>/dev/null ; then + echo "Mounting efivarfs on /sys/firmware/efi/efivars" + mount -t efivarfs efivarfs /sys/firmware/efi/efivars + fi + echo "Invoking efibootmgr" efibootmgr || return 1 + + umount /sys/firmware/efi/efivars &>/dev/null || true + } # grub configuration/installation {{{ diff --git a/grml-debootstrap b/grml-debootstrap index 6c0d625..52d428f 100755 --- a/grml-debootstrap +++ b/grml-debootstrap @@ -996,9 +996,14 @@ format_efi_partition() { # check for EFI support or try to enable it {{{ efi_support() { local efivars_loaded=false + # this is for kernels versions before v3.10, which didn't provide efivarfs yet if modprobe efivars &>/dev/null ; then efivars_loaded=true fi + # kernel versions v3.10 and newer usually provide efivarfs + if modprobe efivarfs &>/dev/null ; then + efivars_loaded=true + fi if [ -d /sys/firmware/efi ] ; then einfo "EFI support detected." ; eend 0