File tree Expand file tree Collapse file tree 4 files changed +32
-4
lines changed
Expand file tree Collapse file tree 4 files changed +32
-4
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,24 @@ prefix ?= /usr
2929# We may in the future also want to include Fedora+derivatives as
3030# the code is really tiny.
3131# (Note we should also make installation of the units conditional on the rhsm feature)
32- CARGO_FEATURES_DEFAULT ?= $(shell . /usr/lib/os-release; if echo "$$ID_LIKE" |grep -qF rhel; then echo rhsm; fi)
32+ # Enable systemd-supports-mount-extra for RHEL >= 9.6 or non-RHEL systems (Fedora, etc.)
33+ CARGO_FEATURES_DEFAULT ?= $(shell \
34+ . /usr/lib/os-release; \
35+ features=""; \
36+ if echo "$$ID_LIKE" |grep -qF rhel; then \
37+ features="rhsm"; \
38+ fi; \
39+ if [ "$$ID" != "rhel" ] || [ -z "$$VERSION_ID" ]; then \
40+ features="$$features systemd-supports-mount-extra"; \
41+ else \
42+ major=$${VERSION_ID%% .* }; \
43+ minor=$${VERSION_ID#* .}; \
44+ if [ "$$major" -gt 9 ] || ([ "$$major" -eq 9 ] && [ "$$minor" -ge 6 ]) ; then \
45+ features="$$features systemd-supports-mount-extra"; \
46+ fi; \
47+ fi; \
48+ echo "$$features" | sed 's/^ //'; \
49+ )
3350# You can set this to override all cargo features, including the defaults
3451CARGO_FEATURES ?= $(CARGO_FEATURES_DEFAULT )
3552
Original file line number Diff line number Diff line change 1212 %bcond_with rhsm
1313%endif
1414
15+ # systemd.mount-extra support requires RHEL >= 9.6
16+ %if 0%{?rhel } < 9 || (0%{?rhel } == 9 && 0%{?rhel_minor_version } < 6)
17+ %bcond_with systemd_mount_extra
18+ %else
19+ %bcond_without systemd_mount_extra
20+ %endif
21+
1522%global rust_minor %(rustc --version | cut -f2 -d" " | cut -f2 -d".")
1623
1724# https://github.com/bootc-dev/bootc/issues/1640
@@ -127,13 +134,13 @@ make manpages
127134# Build all binaries
128135%if 0%{?container_build }
129136# Container build: use cargo directly with cached dependencies to avoid RPM macro overhead
130- cargo build -j%{_smp_build_ncpus } --release %{?with_rhsm:--features rhsm} --bins
137+ cargo build -j%{_smp_build_ncpus } --release %{?with_rhsm:--features rhsm}%{?with_systemd_mount_extra:,systemd-supports-mount-extra} --bins
131138%else
132139# Non-container build: use RPM macros for proper dependency tracking
133140%if %new_cargo_macros
134- %cargo_build %{?with_rhsm:-f rhsm} -- --bins
141+ %cargo_build %{?with_rhsm:-f rhsm} %{?with_systemd_mount_extra:-f systemd-supports-mount-extra} -- --bins
135142%else
136- %cargo_build %{?with_rhsm:--features rhsm} -- --bins
143+ %cargo_build %{?with_rhsm:--features rhsm}%{?with_systemd_mount_extra:,systemd-supports-mount-extra} -- --bins
137144%endif
138145%endif
139146
Original file line number Diff line number Diff line change @@ -82,6 +82,9 @@ install-to-disk = []
8282# This featuares enables `bootc internals publish-rhsm-facts` to integrate with
8383# Red Hat Subscription Manager
8484rhsm = []
85+ # This feature enables support for systemd.mount-extra kernel argument,
86+ # which requires RHEL >= 9.6
87+ systemd-supports-mount-extra = []
8588# Implementation detail of man page generation.
8689docgen = [" clap_mangen" ]
8790
Original file line number Diff line number Diff line change @@ -983,6 +983,7 @@ async fn install_container(
983983 // For seperate /boot filesystem, the better workaround is
984984 // to inject kernel arguments during installation.
985985 // See discussion in https://github.com/bootc-dev/bootc/issues/1388
986+ #[ cfg( feature = "systemd-supports-mount-extra" ) ]
986987 if let Some ( boot) = root_setup. boot . as_ref ( ) {
987988 if !boot. source . is_empty ( ) {
988989 let mount_extra = format ! (
You can’t perform that action at this time.
0 commit comments