From b685cce7b30b26ef1b08484733a8276ae0f0bb68 Mon Sep 17 00:00:00 2001 From: Timothée Ravier Date: Dec 17 2025 18:04:44 +0000 Subject: bootupd: Check for shim & grub2 in metadata --- diff --git a/bootupd.yaml b/bootupd.yaml index fb03fb9..99b3bfd 100644 --- a/bootupd.yaml +++ b/bootupd.yaml @@ -12,6 +12,21 @@ postprocess: # Transforms /usr/lib/ostree-boot into a bootupd-compatible update payload /usr/bin/bootupctl backend generate-update-metadata + if [[ "$(uname -m)" == "x86_64" ]]; then + if [[ "$(cat "/usr/lib/bootupd/updates/EFI.json" | jq '[.versions[] | select(.name == "shim")] | length')" -lt 1 ]]; then + echo "Missing bootupd metadata for shim. Something is wrong. Is shim included?" + exit 1 + else + echo "Found shim in bootupd metadata" + fi + if [[ "$(cat "/usr/lib/bootupd/updates/EFI.json" | jq '[.versions[] | select(.name == "grub2")] | length')" -lt 1 ]]; then + echo "Missing bootupd metadata for GRUB2. Something is wrong. Is GRUB2 included?" + exit 1 + else + echo "Found GRUB2 in bootupd metadata" + fi + fi + # Enable migration to a static GRUB config install -dm0755 /usr/lib/systemd/system/bootloader-update.service.d cat > /usr/lib/systemd/system/bootloader-update.service.d/migrate-static-grub-config.conf << 'EOF'