Skip to content

Commit

Permalink
Switching how we detect efi boot device for convert script
Browse files Browse the repository at this point in the history
Signed-off-by: Fabian Arrotin <[email protected]>
  • Loading branch information
arrfab committed Jan 17, 2023
1 parent 2f38cd1 commit 5258ec5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 6 additions & 0 deletions adhoc-init-node.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
---
- hosts: all
vars_prompt:
- name: "warning_message"
prompt: "[WARNING] : have you called this script with --limit to apply only to some nodes/groups ? CTRL+C if not the case"
private: no
become: True
gather_facts: True

tasks:
- block:
- name: Find our public ip
Expand Down
7 changes: 4 additions & 3 deletions templates/convert-to-rhel
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@ else
else
if [ -d /sys/firmware/efi ] ; then
f_log "UEFI system detected, forcing efibootmanager"
efi_dev=$(mount|grep "boot/efi"|awk '{print $1}')
f_log "Detected EFI boot device is [${efi_dev:0:-1}]"
efi_dev=$(lsblk -dno pkname $(mount|grep "boot/efi"|awk '{print $1}'))
f_log "Detected EFI boot device is [/dev/${efi_dev}]"
grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg
efibootmgr --create --disk=${efi_dev:0:-1} --part=1 --label="Red Hat Enterprise Linux" --loader='EFI\redhat\shimx64.efi' >> $logfile
efibootmgr --create --disk=/dev/${efi_dev} --part=1 --label="Red Hat Enterprise Linux" --loader='EFI\redhat\shimx64.efi' >> $logfile
if [ "$?" -ne "0" ] ; then
f_log "ERROR, not able to configure efibootmgr so machine will not reboot"
exit 1
fi
fi
exit 2
Expand Down

0 comments on commit 5258ec5

Please sign in to comment.