From 0ca60ad5c233a335536bd823a81155523aa6bbec Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Wed, 2 Sep 2020 14:17:26 +0000 Subject: [PATCH] WIP: Use bootupd to install uefi See https://github.com/coreos/bootupd and https://github.com/coreos/fedora-coreos-tracker/issues/510 Basically in order to handle *updates*, bootupd should also take care of installation. For example this also generates a JSON file with the versions. --- src/create_disk.sh | 27 +++++---------------------- src/vmdeps.txt | 2 ++ 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/src/create_disk.sh b/src/create_disk.sh index 2823c24d5f..3c2c1cefbb 100755 --- a/src/create_disk.sh +++ b/src/create_disk.sh @@ -328,30 +328,13 @@ bootloader_backend=none # Helper to install UEFI on supported architectures install_uefi() { + # https://github.com/coreos/fedora-coreos-tracker/issues/510 # 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. - local source_efidir="${deploy_root}/usr/lib/ostree-boot/efi" + /usr/libexec/bootupd install --src-root=${deploy_root} ${rootfs} + # However, we currently install the config file separately. local target_efi="$rootfs/boot/efi" - local src_grubefi=$(find "${source_efidir}"/EFI/ -maxdepth 1 -type d | grep -v BOOT) - local vendor_id="${src_grubefi##*/}" - local vendordir="${target_efi}/EFI/${vendor_id}" - - # Some of the files in EFI/BOOT are _symlinks_ to EFI/$VENDOR - # in the OS tree. We need to make copies here. - mkdir -p "${target_efi}"/EFI/BOOT "${vendordir}" - for t in BOOT "${vendor_id}"; - do - ( - cd "${source_efidir}"/EFI/${t} - for i in *; do - /usr/lib/coreos-assembler/cp-reflink -vRL \ - $(readlink -f $i) \ - "${target_efi}"/EFI/"${t}"/ - done - ) - done - + 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' diff --git a/src/vmdeps.txt b/src/vmdeps.txt index 60a4fe8e01..b94f777060 100644 --- a/src/vmdeps.txt +++ b/src/vmdeps.txt @@ -24,6 +24,8 @@ python3 python3-gobject-base buildah podman skopeo iptables iptables-libs # luks cryptsetup +# How we install/update bootloaders +bootupd # filesystems/storage gdisk xfsprogs e2fsprogs dosfstools btrfs-progs