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

create_disk: Use bootupd to install uefi if configured #1695

Merged
merged 1 commit into from
Sep 21, 2020
Merged
Show file tree
Hide file tree
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
26 changes: 20 additions & 6 deletions src/create_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -314,8 +314,7 @@ EOF
# be overridden below
bootloader_backend=none

# Helper to install UEFI on supported architectures
install_uefi() {
install_uefi_without_bootupd() {
# See also https://github.com/ostreedev/ostree/pull/1873#issuecomment-524439883
# In the future it'd be better to get this stuff out of the OSTree commit and
# change our build process to download+extract it separately.
Expand All @@ -339,7 +338,21 @@ install_uefi() {
done
)
done
}

install_uefi() {
if test -d "${deploy_root}"/usr/lib/bootupd/updates; then
# https://github.com/coreos/fedora-coreos-tracker/issues/510
# See also https://github.com/ostreedev/ostree/pull/1873#issuecomment-524439883
/usr/bin/bootupctl backend install --src-root="${deploy_root}" "${rootfs}"
else
install_uefi_without_bootupd
fi
# We have a "static" grub config file that basically configures grub to look
# in the partition labeled "boot".
local target_efi="$rootfs/boot/efi"
local grubefi=$(find "${target_efi}/EFI/" -maxdepth 1 -type d | grep -v BOOT)
local vendor_id="${grubefi##*/}"
local vendordir="${target_efi}/EFI/${vendor_id}"
mkdir -p "${vendordir}"
cat > ${vendordir}/grub.cfg << 'EOF'
Expand All @@ -348,8 +361,10 @@ set prefix=($prefix)
configfile $prefix/grub2/grub.cfg
boot
EOF
}

# copy the grub config and any other files we might need
# copy the grub config and any other files we might need
install_grub_cfg() {
mkdir -p $rootfs/boot/grub2
cp -v $grub_script $rootfs/boot/grub2/grub.cfg
}
Expand All @@ -367,6 +382,7 @@ x86_64)
--boot-directory $rootfs/boot \
$disk
fi
install_grub_cfg
;;
aarch64)
# Our aarch64 is UEFI only.
Expand All @@ -375,9 +391,7 @@ aarch64)
ppc64le)
# to populate PReP Boot, i.e. support pseries
grub2-install --target=powerpc-ieee1275 --boot-directory $rootfs/boot --no-nvram "${disk}${PREPPN}"
mkdir -p $rootfs/boot/grub2
# copy the grub config and any other files we might need
cp $grub_script $rootfs/boot/grub2/grub.cfg
install_grub_cfg
;;
s390x)
bootloader_backend=zipl
Expand Down
1 change: 1 addition & 0 deletions src/vmdeps-aarch64.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# For grub install when creating images and pxe install
grub2 grub2-tools-extra
bootupd

# For creating bootable UEFI media on aarch64
shim-aa64 grub2-efi-aa64
1 change: 1 addition & 0 deletions src/vmdeps-x86_64.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# For grub install when creating images without anaconda
grub2
bootupd

# For creating bootable UEFI media on x86_64
shim-x64 grub2-efi-x64