From 2df5b7942e313c2b7c75ac55d27d69af65393c89 Mon Sep 17 00:00:00 2001
From: Timothée Ravier <tim@siosm.fr>
Date: Feb 09 2025 20:51:51 +0000
Subject: [PATCH 1/4] bootupd: Remove bootloader-update.service (now part of bootupd)


See: https://github.com/coreos/bootupd/pull/803

---

diff --git a/bootupd.yaml b/bootupd.yaml
index 5fbb0fc..d6599f3 100644
--- a/bootupd.yaml
+++ b/bootupd.yaml
@@ -12,22 +12,6 @@ postprocess:
     # Transforms /usr/lib/ostree-boot into a bootupd-compatible update payload
     /usr/bin/bootupctl backend generate-update-metadata
 
-    # Trigger a bootloader update on boot
-    cat > /usr/lib/systemd/system/bootloader-update.service << 'EOF'
-    [Unit]
-    Description=Update bootloader on boot
-    Documentation=https://github.com/coreos/bootupd
-
-    [Service]
-    Type=oneshot
-    ExecStart=/usr/bin/bootupctl update
-    RemainAfterExit=yes
-    MountFlags=slave
-
-    [Install]
-    WantedBy=multi-user.target
-    EOF
-    chmod 644 /usr/lib/systemd/system/bootloader-update.service
     echo "enable bootloader-update.service" > /usr/lib/systemd/system-preset/81-atomic-desktop.preset
 
     # Turn permissive mode on for bootupd until all SELinux issues are fixed

From b49a69558f32b15dd85cca6b8a5f45aae205cebf Mon Sep 17 00:00:00 2001
From: Timothée Ravier <tim@siosm.fr>
Date: Feb 09 2025 20:51:51 +0000
Subject: [PATCH 2/4] bootupd: Enable static GRUB config migration


See: https://github.com/coreos/bootupd/pull/790
See: https://github.com/coreos/bootupd/issues/789
See: https://gitlab.com/fedora/ostree/sig/-/issues/35

---

diff --git a/bootupd.yaml b/bootupd.yaml
index d6599f3..4f49b5e 100644
--- a/bootupd.yaml
+++ b/bootupd.yaml
@@ -12,6 +12,13 @@ postprocess:
     # Transforms /usr/lib/ostree-boot into a bootupd-compatible update payload
     /usr/bin/bootupctl backend generate-update-metadata
 
+    # 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'
+    [Service]
+    ExecStart=/usr/bin/bootupctl migrate-static-grub-config
+    EOF
+
     echo "enable bootloader-update.service" > /usr/lib/systemd/system-preset/81-atomic-desktop.preset
 
     # Turn permissive mode on for bootupd until all SELinux issues are fixed

From 82b01d561aa63a90461ee11065c8cd255d85d840 Mon Sep 17 00:00:00 2001
From: Timothée Ravier <tim@siosm.fr>
Date: Feb 09 2025 20:51:51 +0000
Subject: [PATCH 3/4] common: Remove ostree-grub2


New systems are setup with a static GRUB config and thus don't need
support to generate the GRUB config dynamically.

Older systems will be migrated to a static GRUB config during their
first boot on Fedora 42.

See: https://gitlab.com/fedora/ostree/sig/-/issues/35
Fixes: https://github.com/fedora-silverblue/issue-tracker/issues/120

---

diff --git a/common.yaml b/common.yaml
index e8da269..86d68ed 100644
--- a/common.yaml
+++ b/common.yaml
@@ -45,9 +45,6 @@ packages:
   - git-core
   # Explicitely add Git docs
   - git-core-doc
-  # Required for compatibility with old bootloaders until we have bootupd
-  # See https://github.com/fedora-silverblue/issue-tracker/issues/120
-  - ostree-grub2
   # Required until we've completed the move to systemd-sysusers
   # See: https://github.com/fedora-silverblue/issue-tracker/issues/362
   - nss-altfiles
diff --git a/ostree-classic.yaml b/ostree-classic.yaml
index a331b17..b0de205 100644
--- a/ostree-classic.yaml
+++ b/ostree-classic.yaml
@@ -1,10 +1,5 @@
 # Manifest for classic ostree varaints only and not Bootable Containers
 
-# Packages only included in the legacy ostree variants and not in Bootable
-# Containers
-packages:
-  - ostree-grub2
-
 # We do not include any version of DNF in the classic ostree Atomic Desktops
 # See: https://fedoraproject.org/wiki/Changes/DNFAndBootcInImageModeFedora
 exclude-packages:

From c124e79447f51acf3eff29a36c78ee8812506d36 Mon Sep 17 00:00:00 2001
From: Timothée Ravier <tim@siosm.fr>
Date: Feb 09 2025 20:51:51 +0000
Subject: [PATCH 4/4] common: Enable composefs for classic ostree images


In Fedora 41, we enabled bootupd by default. In Fedora 42, we are
migrating older installations to a static GRUB config by default.

We can thus enable composefs by default for all our variants, wether
theyr are Bootable Containers or classic ostree ones.

See: https://gitlab.com/fedora/ostree/sig/-/issues/35

---

diff --git a/common.yaml b/common.yaml
index 86d68ed..9e9d860 100644
--- a/common.yaml
+++ b/common.yaml
@@ -17,6 +17,8 @@ include:
   - sysroot-ro.yaml
   # Enable kernel-install support
   - kernel-install.yaml
+  # Enable composefs
+  - composefs.yaml
 
 arch-include:
   x86_64:
@@ -32,7 +34,6 @@ conditional-include:
   # Manifests included only for the Bootable Container variants
   - if: bootable_container == true
     include:
-      - composefs.yaml
       - bootc.yaml
       - dnf5.yaml
 

