diff options
| author | Curt Brune <[email protected]> | 2017-04-24 13:37:27 -0700 |
|---|---|---|
| committer | Curt Brune <[email protected]> | 2017-04-26 07:45:11 -0700 |
| commit | da698f467020bee044abeb047abcd87cbb51d2c0 (patch) | |
| tree | f2ebb2c8730df6e797758031137dd7a37f8c4536 /installer | |
| parent | 2d6d90ac5a92ff4697f5013a8927cba9ed536fec (diff) | |
Set the UEFI boot loader statically
The 50_onie_grub GRUB fragment is intended to be executed by a NOS as
part of the NOS's /etc/grub.d scripts.
For UEFI systems this fragment has a dependence on the the ONIE file
/etc/machine.conf for the definition of the UEFI boot loader.
However, when the NOS is running ONIE's /etc/machine.conf is
unavailable.
For ONIE today, the UEFI boot loader has two possible values:
- grubx64.efi
- grubaa64.efi
These names are defined in the CPU architecture dependent Makefile
fragments in build-config/arch/<arch>.mk in the $(GRUB_IMAGE_NAME)
variable.
This patch passes the $(GRUB_IMAGE_NAME) value all the way through the
build system and sets the value statically in 50_onie_grub.
Closes: #505
Signed-off-by: Curt Brune <[email protected]>
Diffstat (limited to 'installer')
| -rwxr-xr-x | installer/grub-arch/grub.d/50_onie_grub | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/installer/grub-arch/grub.d/50_onie_grub b/installer/grub-arch/grub.d/50_onie_grub index ffe1feb0..5cdfe8c9 100755 --- a/installer/grub-arch/grub.d/50_onie_grub +++ b/installer/grub-arch/grub.d/50_onie_grub @@ -32,11 +32,11 @@ default_chainloader="+1" [ "${onie_firmware}" = "coreboot" ] && default_chainloader=/grub/i386-coreboot/core.elf uefi_root=/boot/efi -onie_uefi_grub=EFI/onie/${onie_grub_image_name} -if [ -d "/sys/firmware/efi/efivars" ] && [ -r "${uefi_root}/${onie_uefi_grub}" ] ; then - uefi_uuid=$(grub-probe --target=fs_uuid "${uefi_root}/${onie_uefi_grub}") || { +onie_uefi_loader="EFI/onie/%%UEFI_BOOT_LOADER%%" +if [ -d "/sys/firmware/efi/efivars" ] && [ -r "${uefi_root}/${onie_uefi_loader}" ] ; then + uefi_uuid=$(grub-probe --target=fs_uuid "${uefi_root}/${onie_uefi_loader}") || { echo "ERROR: grub-probe failed" > /dev/stderr - echo "ERROR: failing cmd: grub-probe --target=fs_uuid ${uefi_root}/${onie_uefi_grub}" > /dev/stderr + echo "ERROR: failing cmd: grub-probe --target=fs_uuid ${uefi_root}/${onie_uefi_loader}" > /dev/stderr exit 1 } cat <<EOF @@ -45,7 +45,7 @@ menuentry ONIE { set root='(hd0,gpt1)' search --no-floppy --fs-uuid --set=root ${uefi_uuid} echo 'Loading ONIE ...' - chainloader /${onie_uefi_grub} + chainloader /${onie_uefi_loader} } EOF else @@ -73,7 +73,7 @@ add_diag_bootcmd() cat <<EOF >> $grub_cfg diag_menu="$diag_label" EOF - if [ -d "/sys/firmware/efi/efivars" ] && [ -f "${uefi_root}/$onie_uefi_grub" ] ; then + if [ -d "/sys/firmware/efi/efivars" ] && [ -f "${uefi_root}/$onie_uefi_loader" ] ; then # UEFI firmware diag_uefi_grub=$(efibootmgr -v | grep $diag_label | sed -e 's/.*)\/File(//' -e 's/)//' -e 's/\\/\//g') if [ -f "$uefi_root/$diag_uefi_grub" ] ; then |
