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 2f2fbea
Showing 1 changed file with 8 additions and 25 deletions.
33 changes: 8 additions & 25 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
chroot_run /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 @@ -475,29 +479,8 @@ generate_gpgkeys() {
# Other arch-specific bootloader changes
# shellcheck disable=SC2031
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
;;
aarch64)
# Our aarch64 is UEFI only.
install_uefi
;;
ppc64le)
# to populate PReP Boot, i.e. support pseries
chroot_run /sbin/grub2-install --target=powerpc-ieee1275 --boot-directory $rootfs/boot --no-nvram "${disk}${PREPPN}"
install_grub_cfg
x86_64|aarch64|ppc64le)
install_via_bootupd
;;
s390x)
ostree config --repo $rootfs/ostree/repo set sysroot.bootloader zipl
Expand Down

0 comments on commit 2f2fbea

Please sign in to comment.