@@ -119,7 +119,7 @@ rootfs_args=$(getconfig_def "rootfs-args" "")
119
119
120
120
bootfs=$( getconfig " bootfs" )
121
121
composefs=$( getconfig_def " composefs" " " )
122
- grub_script =$( getconfig " grub-script " )
122
+ bootupd_epoch =$( getconfig " bootupd-epoch " )
123
123
ostree_container=$( getconfig " ostree-container" )
124
124
commit=$( getconfig " ostree-commit" )
125
125
ref=$( getconfig " ostree-ref" )
@@ -396,51 +396,10 @@ cat > $rootfs/.coreos-aleph-version.json << EOF
396
396
}
397
397
EOF
398
398
399
- install_uefi () {
400
- # https://github.com/coreos/fedora-coreos-tracker/issues/510
401
- # See also https://github.com/ostreedev/ostree/pull/1873#issuecomment-524439883
402
- # Unshare mount ns to work around https://github.com/coreos/bootupd/issues/367
403
- unshare -m /usr/bin/bootupctl backend install --src-root=" ${deploy_root} " " ${rootfs} "
404
- # We have a "static" grub config file that basically configures grub to look
405
- # in the RAID called "md-boot", if it exists, or the partition labeled "boot".
406
- local target_efi=" $rootfs /boot/efi"
407
- local grubefi
408
- grubefi=$( find " ${target_efi} /EFI/" -maxdepth 1 -type d | grep -v BOOT)
409
- local vendor_id=" ${grubefi##*/ } "
410
- local vendordir=" ${target_efi} /EFI/${vendor_id} "
411
- mkdir -p " ${vendordir} "
412
- cat > " ${vendordir} /grub.cfg" << 'EOF '
413
- if [ -e (md/md-boot) ]; then
414
- # The search command might pick a RAID component rather than the RAID,
415
- # since the /boot RAID currently uses superblock 1.0. See the comment in
416
- # the main grub.cfg.
417
- set prefix=md/md-boot
418
- else
419
- if [ -f ${config_directory}/bootuuid.cfg ]; then
420
- source ${config_directory}/bootuuid.cfg
421
- fi
422
- if [ -n "${BOOT_UUID}" ]; then
423
- search --fs-uuid "${BOOT_UUID}" --set prefix --no-floppy
424
- else
425
- search --label boot --set prefix --no-floppy
426
- fi
427
- fi
428
- set prefix=($prefix)/grub2
429
- configfile $prefix/grub.cfg
430
- boot
431
- EOF
432
- install_grub_cfg
399
+ bootloader_install_nons390x_bootupd_epoch_1 () {
433
400
}
434
401
435
- # copy the grub config and any other files we might need
436
- install_grub_cfg () {
437
- # 0700 to match the RPM permissions which I think are mainly in case someone has
438
- # manually set a grub password
439
- mkdir -p $rootfs /boot/grub2
440
- chmod 0700 $rootfs /boot/grub2
441
- printf " %s\n" " $grub_script " | \
442
- sed -E ' s@(^# CONSOLE-SETTINGS-START$)@\1' " ${platform_grub_cmds: +\\ n${platform_grub_cmds} } " ' @' \
443
- > $rootfs /boot/grub2/grub.cfg
402
+ install_platforms_json () {
444
403
# Copy platforms table if it's non-empty for this arch
445
404
# shellcheck disable=SC2031
446
405
if jq -e " .$arch " < " $platforms_json " > /dev/null; then
@@ -472,32 +431,28 @@ generate_gpgkeys() {
472
431
rm -rf " ${tmp_home} "
473
432
}
474
433
434
+ # Hard require epoch 1, but leave space for future versions
435
+ case " ${bootupd_epoch} " in
436
+ 1)
437
+ ;;
438
+ * ) echo " Unhandled ${bootupd_epoch} 1>&2; exit 1"
439
+ ;;
440
+ esac
441
+
475
442
# Other arch-specific bootloader changes
476
443
# shellcheck disable=SC2031
477
444
case " $arch " in
478
- x86_64)
479
- # UEFI
480
- install_uefi
445
+ x86_64|aarch64|ppc64le)
446
+ # For background on bootupd, see https://github.com/coreos/fedora-coreos-tracker/issues/510
447
+ # This requires bootupd 0.2.11 in the target system, and handles both BIOS and UEFI for x86_64 for example.
448
+ bootupd_args=()
481
449
if [ " ${x86_bios_bootloader} " = 1 ]; then
482
- # And BIOS grub in addition. See also
483
- # https://github.com/coreos/fedora-coreos-tracker/issues/32
484
- # Install BIOS/PReP bootloader using the target system's grub2-install,
485
- # see https://github.com/coreos/coreos-assembler/issues/3156
486
- chroot_run /sbin/grub2-install \
487
- --target i386-pc \
488
- --boot-directory $rootfs /boot \
489
- --modules mdraid1x \
490
- " $disk "
450
+ bootupd_args+=(" --device=$disk " )
451
+ fi
452
+ chroot_run env /usr/bin/bootupctl backend install --with-static-configs --src-root=" ${deploy_root} " " ${bootupd_args[@]} " " ${rootfs} "
453
+ if test -n " ${platform_grub_cmds} " ; then
454
+ echo " ${platform_grub_cmds} " > $rootfs /boot/grub2/platform01.cfg
491
455
fi
492
- ;;
493
- aarch64)
494
- # Our aarch64 is UEFI only.
495
- install_uefi
496
- ;;
497
- ppc64le)
498
- # to populate PReP Boot, i.e. support pseries
499
- chroot_run /sbin/grub2-install --target=powerpc-ieee1275 --boot-directory $rootfs /boot --no-nvram " ${disk}${PREPPN} "
500
- install_grub_cfg
501
456
;;
502
457
s390x)
503
458
ostree config --repo $rootfs /ostree/repo set sysroot.bootloader zipl
0 commit comments