Skip to content

Commit

Permalink
create_disk: Use bootupd for BIOS too
Browse files Browse the repository at this point in the history
This uses the new https://github.com/coreos/bootupd/ 0.2.11 release.
  • Loading branch information
cgwalters committed Sep 20, 2023
1 parent 4479a8d commit ddbd785
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions src/create_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -396,11 +396,15 @@ cat > $rootfs/.coreos-aleph-version.json << EOF
}
EOF

install_uefi() {
install_via_bootupd() {
# https://github.com/coreos/fedora-coreos-tracker/issues/510
# See also https://github.com/ostreedev/ostree/pull/1873#issuecomment-524439883
# Unshare mount ns to work around https://github.com/coreos/bootupd/issues/367
unshare -m /usr/bin/bootupctl backend install --src-root="${deploy_root}" "${rootfs}"
bootupd_args=()
if [ "${x86_bios_bootloader}" = 1 ]; then
bootupd_args+=("--device=$disk")
fi
unshare -m /usr/bin/bootupctl backend install --src-root="${deploy_root}" "${bootupd_args[@]}" "${rootfs}"
# We have a "static" grub config file that basically configures grub to look
# in the RAID called "md-boot", if it exists, or the partition labeled "boot".
local target_efi="$rootfs/boot/efi"
Expand Down Expand Up @@ -477,22 +481,10 @@ generate_gpgkeys() {
case "$arch" in
x86_64)
# UEFI
install_uefi
if [ "${x86_bios_bootloader}" = 1 ]; then
# And BIOS grub in addition. See also
# https://github.com/coreos/fedora-coreos-tracker/issues/32
# Install BIOS/PReP bootloader using the target system's grub2-install,
# see https://github.com/coreos/coreos-assembler/issues/3156
chroot_run /sbin/grub2-install \
--target i386-pc \
--boot-directory $rootfs/boot \
--modules mdraid1x \
"$disk"
fi
install_via_bootupd
;;
aarch64)
# Our aarch64 is UEFI only.
install_uefi
install_via_bootupd
;;
ppc64le)
# to populate PReP Boot, i.e. support pseries
Expand Down

0 comments on commit ddbd785

Please sign in to comment.