Skip to content

Commit e589fe1

Browse files
committed
cli: add RPM package for system-reinstall-bootc
Modified the bootc.spec file to generate a new subpackage which includes the new system-reinstall-bootc binary. # Try Try out instructions: ```bash # Make srpm cargo xtask package-srpm # Mock group sudo usermod -a -G mock $(whoami) newgrp mock # Build RPM for RHEL mock --rebuild -r rhel+epel-9-x86_64 --rebuild target/bootc-*.src.rpm ``` Then install the RPM (`/var/lib/mock/rhel+epel-9-x86_64/result/bootc-reinstall-2*.el9.x86_64.rpm`) on [a rhel9 gcp vm](https://console.cloud.google.com/compute/instanceTemplates/details/rhel9-dev-1?project=bifrost-devel&authuser=1&inv=1&invt=Abn-jg) instance template Signed-off-by: Omer Tuchfeld <[email protected]>
1 parent 0460c4d commit e589fe1

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

contrib/packaging/bootc.spec

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ Provides: ostree-cli(ostree-container)
6262
%description
6363
%{summary}
6464

65+
%package reinstall
66+
Summary: Utility to reinstall the current system using bootc
67+
Requires: podman
68+
# The reinstall subpackage intentionally does not require bootc, as it pulls in many unnecessary dependencies
69+
70+
%description reinstall
71+
This package provides a utility to simplify reinstalling the current system to a given bootc image.
72+
6573
%prep
6674
%autosetup -p1 -a1
6775
# Default -v vendor config doesn't support non-crates.io deps (i.e. git)
@@ -71,12 +79,17 @@ cat vendor-config.toml >> .cargo/config.toml
7179
rm vendor-config.toml
7280

7381
%build
82+
# Build the main bootc binary
7483
%if 0%{?fedora} || 0%{?rhel} >= 10
7584
%cargo_build %{?with_rhsm:-f rhsm}
7685
%else
7786
%cargo_build %{?with_rhsm:--features rhsm}
7887
%endif
7988

89+
# Build the system reinstallation CLI binary
90+
%global cargo_args -p system-reinstall-bootc
91+
%cargo_build
92+
8093
%cargo_vendor_manifest
8194
# https://pagure.io/fedora-rust/rust-packaging/issue/33
8295
sed -i -e '/https:\/\//d' cargo-vendor.txt
@@ -110,5 +123,8 @@ make install-ostree-hooks DESTDIR=%{?buildroot}
110123
%{_docdir}/bootc/*
111124
%{_mandir}/man*/bootc*
112125

126+
%files reinstall
127+
%{_bindir}/system-reinstall-bootc
128+
113129
%changelog
114130
%autochangelog

0 commit comments

Comments
 (0)