Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[action] [PR:17414] [installer] Create a blank grubenv if doesn't exist #17965

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions installer/default_platform.conf
Original file line number Diff line number Diff line change
Expand Up @@ -264,14 +264,6 @@ demo_install_grub()
exit 1
}

# Create a blank environment block file.
if [ ! -f "$onie_initrd_tmp/$demo_mnt/grub/grubenv" ]; then
grub-editenv "$onie_initrd_tmp/$demo_mnt/grub/grubenv" create || {
echo "ERROR: grub-editenv failed on: $blk_dev"
exit 1
}
fi

if [ "$demo_type" = "DIAG" ] ; then
# Install GRUB in the partition also. This allows for
# chainloading the DIAG image from another OS.
Expand Down Expand Up @@ -354,14 +346,6 @@ demo_install_uefi_grub()
}
rm -f $grub_install_log

# Create a blank environment block file.
if [ ! -f "$demo_mnt/grub/grubenv" ]; then
grub-editenv "$demo_mnt/grub/grubenv" create || {
echo "ERROR: grub-editenv failed on: $blk_dev"
exit 1
}
fi

# Configure EFI NVRAM Boot variables. --create also sets the
# new boot number as active.
grub=$(find /boot/efi/EFI/$demo_volume_label/ -name grub*.efi -exec basename {} \;)
Expand Down Expand Up @@ -631,6 +615,14 @@ EOF
umount $demo_mnt
else
cp $grub_cfg $onie_initrd_tmp/$demo_mnt/grub/grub.cfg

# Create a blank environment block file.
if [ ! -f "$onie_initrd_tmp/$demo_mnt/grub/grubenv" ]; then
grub-editenv "$onie_initrd_tmp/$demo_mnt/grub/grubenv" create || {
echo "ERROR: grub-editenv failed on: $blk_dev"
exit 1
}
fi
fi

cd /
Expand Down
Loading