From 4719a8664a4567db47f458a0b60d540b0e186e13 Mon Sep 17 00:00:00 2001 From: John Eckersberg Date: Thu, 23 Jan 2025 11:49:03 -0500 Subject: [PATCH] Cherry pick patch for bootc-status-updated-onboot Related: #RHEL-72584 --- ...d-bootc-status-updated-onboot.target.patch | 77 +++++++++++++++++++ bootc.spec | 2 + 2 files changed, 79 insertions(+) create mode 100644 0001-Add-bootc-status-updated-onboot.target.patch diff --git a/0001-Add-bootc-status-updated-onboot.target.patch b/0001-Add-bootc-status-updated-onboot.target.patch new file mode 100644 index 0000000..f1c0843 --- /dev/null +++ b/0001-Add-bootc-status-updated-onboot.target.patch @@ -0,0 +1,77 @@ +From 739904481e5fb33c5ce64597d55ed92346574f0b Mon Sep 17 00:00:00 2001 +From: John Eckersberg +Date: Wed, 22 Jan 2025 14:17:57 -0500 +Subject: [PATCH] Add bootc-status-updated-onboot.target + +The bootc-status-updated.target unit cannot directly be +WantedBy=multi-user.target, because we rely on StopWhenUnneeded=true +so the target will be activated each time bootc-status-updated.path +triggers it. Because multi-user.target remains active, this would +hold bootc-status-updated.target in an active state as well, and the +path unit activating would not have the desired effect of retriggering +the target unit. + +The new bootc-status-updated-onboot.target is intended to serve the +same purpose as bootc-status-updated.target but will activate (and +remain active) on boot. Any interested units should be WantedBy both +targets. This updates bootc-publish-rhsm-facts.service to do just +that. + +Signed-off-by: John Eckersberg +--- + Makefile | 2 +- + systemd/bootc-publish-rhsm-facts.service | 1 + + systemd/bootc-status-updated-onboot.target | 7 +++++++ + systemd/bootc-status-updated.target | 3 --- + 4 files changed, 9 insertions(+), 4 deletions(-) + create mode 100644 systemd/bootc-status-updated-onboot.target + +diff --git a/Makefile b/Makefile +index dbb1d7d7..1957b2cc 100644 +--- a/Makefile ++++ b/Makefile +@@ -27,7 +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 ++ ln -s ../bootc-status-updated-onboot.target $(DESTDIR)/$(prefix)/lib/systemd/system/multi-user.target.wants/bootc-status-updated-onboot.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-publish-rhsm-facts.service b/systemd/bootc-publish-rhsm-facts.service +index 6520ebd1..4dd8550e 100644 +--- a/systemd/bootc-publish-rhsm-facts.service ++++ b/systemd/bootc-publish-rhsm-facts.service +@@ -9,3 +9,4 @@ ExecStart=/usr/bin/bootc internals publish-rhsm-facts + + [Install] + WantedBy=bootc-status-updated.target ++WantedBy=bootc-status-updated-onboot.target +diff --git a/systemd/bootc-status-updated-onboot.target b/systemd/bootc-status-updated-onboot.target +new file mode 100644 +index 00000000..7b898fad +--- /dev/null ++++ b/systemd/bootc-status-updated-onboot.target +@@ -0,0 +1,7 @@ ++[Unit] ++Description=Target for bootc status changes on boot ++Documentation=man:bootc-status-updated.target(8) ++ConditionPathExists=/run/ostree-booted ++ ++[Install] ++WantedBy=multi-user.target +diff --git a/systemd/bootc-status-updated.target b/systemd/bootc-status-updated.target +index 2c159468..afeb5568 100644 +--- a/systemd/bootc-status-updated.target ++++ b/systemd/bootc-status-updated.target +@@ -3,6 +3,3 @@ 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.48.1 + diff --git a/bootc.spec b/bootc.spec index d833c6d..cda5be3 100644 --- a/bootc.spec +++ b/bootc.spec @@ -31,6 +31,8 @@ Source1: %{url}/releases/download/v%{version}/bootc-%{version}-vendor.tar # Cherry pick https://github.com/containers/bootc/pull/1041 Patch0: 0001-systemd-enable-bootc-status-updated.target-on-startu.patch +# Cherry pick https://github.com/containers/bootc/pull/1052 +Patch1: 0001-Add-bootc-status-updated-onboot.target.patch # https://fedoraproject.org/wiki/Changes/EncourageI686LeafRemoval ExcludeArch: %{ix86}