Skip to content

Commit 6734347

Browse files
committed
build-sys: Reinstall fedora-bootc-destructive-cleanup script
When commit cd8fa59 moved unit enablement to a systemd generator, it also removed the installation of the fedora-bootc-destructive-cleanup script from the Makefile. This was unintentional - while the symlink enablement should be handled by the generator, the script itself still needs to be installed. The trap is that because we weren't accurately removing old files from the build, the old version was still there...until the new upstream release. Fix this in two ways: First, continue to install the script on Fedora-like systems as before, but leave unit enablement to the generator as intended. Second, change how we remove prior state to clean out all files from the RPM. (I did look at changing out the build system so we build an RPM in this case which would be cleaner, but it's a large change) Fixes: #1748 Assisted-by: Claude Code (Sonnet 4.5) Signed-off-by: Colin Walters <[email protected]>
1 parent 1f0a312 commit 6734347

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,6 @@ FROM base
7272
ARG variant
7373
RUN <<EORUN
7474
set -xeuo pipefail
75-
# Ensure we've flushed out prior state (i.e. files no longer shipped from the old version);
76-
# and yes, we may need to go to building an RPM in this Dockerfile by default.
77-
rm -vf /usr/lib/systemd/system/multi-user.target.wants/bootc-*
7875
case "${variant}" in
7976
*-sdboot)
8077
dnf -y install systemd-boot-unsigned
@@ -123,6 +120,10 @@ type = "${fs}"
123120
EOF
124121
fi
125122
fi
123+
124+
# Ensure we've flushed out prior state (i.e. files no longer shipped from the old version);
125+
# and yes, we may need to go to building an RPM in this Dockerfile by default.
126+
(set +x; rpm -ql bootc | while read line; do if test -f $line; then rm -v $line; fi; done)
126127
EORUN
127128
# Create a layer that is our new binaries
128129
COPY --from=build /out/ /

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,12 @@ install:
6565
# Copy dracut and systemd config files
6666
cp -Prf baseimage/dracut $(DESTDIR)$(prefix)/share/doc/bootc/baseimage/dracut
6767
cp -Prf baseimage/systemd $(DESTDIR)$(prefix)/share/doc/bootc/baseimage/systemd
68+
# Install fedora-bootc-destructive-cleanup in fedora derivatives
69+
ID=$$(. /usr/lib/os-release && echo $$ID); \
70+
ID_LIKE=$$(. /usr/lib/os-release && echo $$ID_LIKE); \
71+
if [ "$$ID" = "fedora" ] || [[ "$$ID_LIKE" == *"fedora"* ]]; then \
72+
install -D -m 0755 -t $(DESTDIR)/$(prefix)/lib/bootc contrib/scripts/fedora-bootc-destructive-cleanup; \
73+
fi
6874

6975
# Run this to also take over the functionality of `ostree container` for example.
7076
# Only needed for OS/distros that have callers invoking `ostree container` and not bootc.

0 commit comments

Comments
 (0)