Skip to content

Commit

Permalink
cli: add RPM package for system-reinstall-bootc
Browse files Browse the repository at this point in the history
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
  • Loading branch information
omertuc committed Feb 5, 2025
1 parent 1bbc9dd commit b9743fd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions contrib/packaging/bootc.spec
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ Provides: ostree-cli(ostree-container)
%description
%{summary}

%package reinstall
Summary: Utility to reinstall the current system using bootc
Requires: podman
# The reinstall subpackage intentionally does not require bootc, as it pulls in many unnecessary dependencies

%description reinstall
This package provides a utility to simplify reinstalling the current system to a given bootc image.

%prep
%autosetup -p1 -a1
# Default -v vendor config doesn't support non-crates.io deps (i.e. git)
Expand All @@ -71,12 +79,17 @@ cat vendor-config.toml >> .cargo/config.toml
rm vendor-config.toml

%build
# Build the main bootc binary
%if 0%{?fedora} || 0%{?rhel} >= 10
%cargo_build %{?with_rhsm:-f rhsm}
%else
%cargo_build %{?with_rhsm:--features rhsm}
%endif

# Build the system reinstallation CLI binary
%global cargo_args -p system-reinstall-bootc
%cargo_build

%cargo_vendor_manifest
# https://pagure.io/fedora-rust/rust-packaging/issue/33
sed -i -e '/https:\/\//d' cargo-vendor.txt
Expand Down Expand Up @@ -110,5 +123,8 @@ make install-ostree-hooks DESTDIR=%{?buildroot}
%{_docdir}/bootc/*
%{_mandir}/man*/bootc*

%files reinstall
%{_bindir}/system-reinstall-bootc

%changelog
%autochangelog

0 comments on commit b9743fd

Please sign in to comment.