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

Support creation of EFI system partition on systems with older parted #2830

Merged
merged 1 commit into from Jul 12, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 7 additions & 1 deletion usr/share/rear/format/USB/default/300_format_usb_disk.sh
Expand Up @@ -147,7 +147,13 @@ if is_true "$FORMAT_EFI" ; then
# Set the right flag for the EFI partition:
LogPrint "Setting 'esp' flag on EFI partition $RAW_USB_DEVICE$current_partition_number"
if ! parted -s $RAW_USB_DEVICE set $current_partition_number esp on ; then
Error "Failed to set 'esp' flag on EFI partition $RAW_USB_DEVICE$current_partition_number"
LogPrintError "Failed to set 'esp' flag on EFI partition $RAW_USB_DEVICE$current_partition_number"
# parted 3.2 added the support for 'esp' keyword. Thus, parted 3.1 in RHEL 7 does not support it yet so try a fallback
# that sets the corresponding partition type using sgdisk.
if ! sgdisk $RAW_USB_DEVICE --typecode="$current_partition_number:EF00" ; then
Error "Failed to set 'esp' flag using sgdisk as fallback on EFI partition $RAW_USB_DEVICE$current_partition_number"
fi
LogPrintError "Set 'esp' flag using sgdisk as fallback on EFI partition $RAW_USB_DEVICE$current_partition_number"
fi
# Partition 1 is the EFI system partition (vfat partition) on which EFI/BOOT/BOOTX86.EFI resides
# so the number of the partition that can be set up next has to be one more (i.e. now 2):
Expand Down