diff --git a/src/create_disk.sh b/src/create_disk.sh index 8ffa798821..a2bd16efec 100755 --- a/src/create_disk.sh +++ b/src/create_disk.sh @@ -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" @@ -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