Skip to content

Commit 67e722f

Browse files
nazariigmssonicbld
authored andcommitted
[installer] Create a blank grubenv if doesn't exist. (sonic-net#17414)
- Why I did it To fix BIOS firmware update after fresh image installation from ONiE - How I did it Initialized empty GRUB environment file after ONiE installation - How to verify it Install image from ONiE Run BIOS firmware upgrade Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
1 parent e2ae581 commit 67e722f

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

installer/default_platform.conf

+8-16
Original file line numberDiff line numberDiff line change
@@ -264,14 +264,6 @@ demo_install_grub()
264264
exit 1
265265
}
266266
267-
# Create a blank environment block file.
268-
if [ ! -f "$onie_initrd_tmp/$demo_mnt/grub/grubenv" ]; then
269-
grub-editenv "$onie_initrd_tmp/$demo_mnt/grub/grubenv" create || {
270-
echo "ERROR: grub-editenv failed on: $blk_dev"
271-
exit 1
272-
}
273-
fi
274-
275267
if [ "$demo_type" = "DIAG" ] ; then
276268
# Install GRUB in the partition also. This allows for
277269
# chainloading the DIAG image from another OS.
@@ -354,14 +346,6 @@ demo_install_uefi_grub()
354346
}
355347
rm -f $grub_install_log
356348
357-
# Create a blank environment block file.
358-
if [ ! -f "$demo_mnt/grub/grubenv" ]; then
359-
grub-editenv "$demo_mnt/grub/grubenv" create || {
360-
echo "ERROR: grub-editenv failed on: $blk_dev"
361-
exit 1
362-
}
363-
fi
364-
365349
# Configure EFI NVRAM Boot variables. --create also sets the
366350
# new boot number as active.
367351
grub=$(find /boot/efi/EFI/$demo_volume_label/ -name grub*.efi -exec basename {} \;)
@@ -631,6 +615,14 @@ EOF
631615
umount $demo_mnt
632616
else
633617
cp $grub_cfg $onie_initrd_tmp/$demo_mnt/grub/grub.cfg
618+
619+
# Create a blank environment block file.
620+
if [ ! -f "$onie_initrd_tmp/$demo_mnt/grub/grubenv" ]; then
621+
grub-editenv "$onie_initrd_tmp/$demo_mnt/grub/grubenv" create || {
622+
echo "ERROR: grub-editenv failed on: $blk_dev"
623+
exit 1
624+
}
625+
fi
634626
fi
635627
636628
cd /

0 commit comments

Comments
 (0)