diff --git a/0001-systemd-enable-bootc-status-updated.target-on-startu.patch b/0001-systemd-enable-bootc-status-updated.target-on-startu.patch new file mode 100644 index 0000000..077f684 --- /dev/null +++ b/0001-systemd-enable-bootc-status-updated.target-on-startu.patch @@ -0,0 +1,46 @@ +From edcdf9c8308653b865a9ebe276cd758da4a62f49 Mon Sep 17 00:00:00 2001 +From: John Eckersberg +Date: Fri, 17 Jan 2025 11:32:11 -0500 +Subject: [PATCH] systemd: enable bootc-status-updated.target on startup + +Any services that react to status changes should be idempotent, and +should run on boot. It is likely (but not guaranteed) that during +boot we are in the process of switching from a previous deployment to +a new one, and thus what was previously "staged" is now "booted" and +what was previously "booted" is now "rollback", so anything that cares +about status is going to want to handle that. + +Signed-off-by: John Eckersberg +Signed-off-by: Colin Walters +--- + Makefile | 1 + + systemd/bootc-status-updated.target | 4 ++++ + 2 files changed, 5 insertions(+) + +diff --git a/Makefile b/Makefile +index 3809c4b9..dbb1d7d7 100644 +--- a/Makefile ++++ b/Makefile +@@ -27,6 +27,7 @@ install: + install -D -m 0644 -t $(DESTDIR)/$(prefix)/lib/systemd/system systemd/*.service systemd/*.timer systemd/*.path systemd/*.target + install -d -m 0755 $(DESTDIR)/$(prefix)/lib/systemd/system/multi-user.target.wants + ln -s ../bootc-status-updated.path $(DESTDIR)/$(prefix)/lib/systemd/system/multi-user.target.wants/bootc-status-updated.path ++ ln -s ../bootc-status-updated.target $(DESTDIR)/$(prefix)/lib/systemd/system/multi-user.target.wants/bootc-status-updated.target + install -D -m 0644 -t $(DESTDIR)/$(prefix)/share/doc/bootc/baseimage/base/usr/lib/ostree/ baseimage/base/usr/lib/ostree/prepare-root.conf + install -d -m 755 $(DESTDIR)/$(prefix)/share/doc/bootc/baseimage/base/sysroot + cp -PfT baseimage/base/ostree $(DESTDIR)/$(prefix)/share/doc/bootc/baseimage/base/ostree +diff --git a/systemd/bootc-status-updated.target b/systemd/bootc-status-updated.target +index a0c13417..2c159468 100644 +--- a/systemd/bootc-status-updated.target ++++ b/systemd/bootc-status-updated.target +@@ -2,3 +2,7 @@ + Description=Target for bootc status changes + Documentation=man:bootc-status-updated.target(8) + StopWhenUnneeded=true ++ConditionPathExists=/run/ostree-booted ++ ++[Install] ++WantedBy=multi-user.target +-- +2.47.0 + diff --git a/bootc.spec b/bootc.spec index 430c3dd..51eac5d 100644 --- a/bootc.spec +++ b/bootc.spec @@ -29,6 +29,9 @@ URL: https://github.com/containers/bootc Source0: %{url}/releases/download/v%{version}/bootc-%{version}.tar.zstd Source1: %{url}/releases/download/v%{version}/bootc-%{version}-vendor.tar.zstd +# Cherry pick https://github.com/containers/bootc/pull/1041 +Patch0: 0001-systemd-enable-bootc-status-updated.target-on-startu.patch + # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86}