Skip to content

Commit

Permalink
WIP: Use bootupd to install uefi
Browse files Browse the repository at this point in the history
See https://github.com/coreos/bootupd
and coreos/fedora-coreos-tracker#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.
  • Loading branch information
cgwalters committed Sep 2, 2020
1 parent 1adb9f1 commit 0ca60ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 22 deletions.
27 changes: 5 additions & 22 deletions src/create_disk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 2 additions & 0 deletions src/vmdeps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 0ca60ad

Please sign in to comment.