Skip to content

Commit

Permalink
Update 310_include_uefi_tools.sh
Browse files Browse the repository at this point in the history
Simpler code in 310_include_uefi_tools.sh to fix
jsmeix@9bb0735#commitcomment-24177948
and some general cleanup.
  • Loading branch information
jsmeix committed Sep 11, 2017
1 parent e7271e8 commit 6e05b6f
Showing 1 changed file with 23 additions and 25 deletions.
48 changes: 23 additions & 25 deletions usr/share/rear/prep/default/310_include_uefi_tools.sh
@@ -1,33 +1,31 @@
# If noefi is set, we can ignore UEFI altogether
if grep -qw 'noefi' /proc/cmdline; then
return
fi
#
# 310_include_uefi_tools.sh
# Copy UEFI binaries we might need into the ReaR recovery system.
#

# If no /boot/[eE][fF][iI] directory can be found we might not be able to copy the UEFI binaries.
if [[ ! -d /boot/[eE][fF][iI] ]]; then
# If 'noefi' is set on the kernel commandline, ignore UEFI altogether:
grep -qw 'noefi' /proc/cmdline && return

# If no /boot/[eE][fF][iI] directory can be found
# we might not be able to copy the UEFI binaries:
if ! test -d /boot/[eE][fF][iI] ; then
if is_true $USING_UEFI_BOOTLOADER; then
Error "USING_UEFI_BOOTLOADER = 1 but there is no directory at /boot/efi or /boot/EFI" # abort
Error "USING_UEFI_BOOTLOADER is set but there is no directory /boot/efi or /boot/EFI"
fi
return # skip
fi

# We copy the UEFI binaries we might need
REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}"
dosfsck
efibootmgr
)

PROGS=( "${PROGS[@]}"
gdisk
parted
uefivars
)
return
fi

# Copy UEFI binaries we might need:
REQUIRED_PROGS=( "${REQUIRED_PROGS[@]}" dosfsck efibootmgr )
PROGS=( "${PROGS[@]}" gdisk parted uefivars )
MODULES=( "${MODULES[@]}" efivars )

if [[ -f /sbin/elilo ]]; then
if test -f /sbin/elilo ; then
# this is probably SLES
PROGS=( "${PROGS[@]}" elilo perl )
COPY_AS_IS=( "${COPY_AS_IS[@]}" /etc/elilo.conf /usr/lib64/crt0-efi-x86_64.o /usr/lib64/elf_x86_64_efi.lds \
/usr/lib64/libefi.a /usr/lib64/libgnuefi.a )
COPY_AS_IS=( "${COPY_AS_IS[@]}"
/etc/elilo.conf
/usr/lib64/crt0-efi-x86_64.o
/usr/lib64/elf_x86_64_efi.lds
/usr/lib64/libefi.a
/usr/lib64/libgnuefi.a )
fi

0 comments on commit 6e05b6f

Please sign in to comment.