Repository navigation
feat(packaging): build an .rpm alongside the .deb - #39
Open
gutolatitude wants to merge 2 commits into
Open
gutolatitude wants to merge 2 commits into
gutolatitude wants to merge 2 commits into
Conversation
The RHEL family gets the same package as Debian/Ubuntu: same files, same
lifecycle, amd64 and arm64.
- .goreleaser.yaml: rpm format; dependencies and maintainer scripts per
format (rpm: ufw from EPEL + systemd); file modes set explicitly.
- packaging/scripts/rpm/{post,preun,postun}: the .deb behaviour with RPM's
package counts. Enable on first install, keep the admin's choice on
upgrade, restart an enabled agent onto the new binary, stop and disable on
removal, never touch UFW. The install.sh migration is the postinst function
verbatim (a Bats test keeps them identical). env stays on removal: RPM has
no purge.
- tests/rpm-scripts.bats, scripts/test-rpm-install.sh and a CI job that
installs, reinstalls (config kept) and removes the .rpm on Alma, Rocky and
Oracle 9 and 10, natively on amd64 and arm64.
- The provenance attestation covers the .rpm files.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- uninstall.sh: dnf remove on the RHEL family (keeping ufw), stopping before files or UFW are touched if it fails, as with apt purge. - CI builds the same packages a second time as version 0.0.1, and the install-rpm job installs that first and upgrades to the package under test: new binary in place, migration link kept, and an agent the admin disabled stays disabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@greptileai review |
Contributor
Author
✅ Validated on real bare metalThe whole stack (#39 package, #40 dnf repository, #41 installer) was validated end to end on real Latitude.sh bare metal, provisioned from the production images. It passes on every EL distro we offer:
Each server went through the same 22 checks:
The Oracle Linux 10 image was missing a UEK8 kernel module package that UFW needs. That is fixed on the image side in latitudesh/tinkerbell-packer-images#444, so nothing needs to change here. Full results and notes: #41 (comment) 🤖 Generated with Claude Code |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First of three PRs for RPM support (LSH-3178). Stacked on #38 (same files); retarget to
mainonce #37/#38 merge. Nothing is published to a repository yet: that is the next PR. This one builds the.rpm, attaches it to releases, and tests it.The RPM follows the
.debas-is: same files, same lifecycle, amd64 and arm64.Changes
.goreleaser.yaml:rpmformat next todeb. Dependencies and maintainer scripts move to per-formatoverrides(deb unchanged:ufw,init-system-helpersand the existing scripts; rpm:ufwfrom EPEL andsystemd). File modes are set to 0644 explicitly instead of coming from the checkout's umask.packaging/scripts/rpm/{post,preun,postun}: the.debbehaviour, with RPM's package counts instead of dpkg action names:install.shhost and enable the unit (RHEL presets would leave it disabled);/usr/local/bincompatibility link, never touch UFW;/etc/lsh-agent/envstays on removal (RPM has no purge;uninstall.shremoves it).migrate_from_install_shis the postinst function verbatim; a Bats test fails if they drift.tests/rpm-scripts.bats(12 cases),scripts/test-rpm-install.sh, and aninstall-rpmCI job on Alma, Rocky and Oracle 9 and 10, natively on amd64 and arm64: install over a source-built setup (migration), reinstall with a changedconfig.yaml(kept,%config(noreplace)), remove (ufw and env kept). ShellCheck now lists the package scripts explicitly (thepackaging/scripts/*glob would hit the newrpm/directory)..rpmfiles; release notes mention them.Found while testing
dnf removes packages that came in only as a dependency, so on a host where ufw arrived only with the agent,
dnf remove lsh-agentwould remove ufw too.install.shalready installs ufw on its own first, so hosts set up by it are safe; the test does the same, and the repository docs in the next PR will saydnf install ufw lsh-agent.Checked locally
lsh-agent-<ver>~dev-1.{x86_64,aarch64}.rpmnext to the.debfiles;rpm -qpshows the dependencies, the three scriptlets andconfig.yamlas%config(noreplace).scripts/test-rpm-install.shpasses on all six images (amd64); arm64 runs in CI.goreleaser check.🤖 Generated with Claude Code
Note
Medium Risk
Touches packaging, systemd migration, and uninstall on RHEL-family hosts; wrong scriptlet or dnf flags could break upgrades or leave firewall state inconsistent.
Overview
Adds RPM packages built with GoReleaser next to the existing
.debfiles (same artifacts, amd64/arm64), with per-format overrides: Debian keeps current deps andpostinst/prerm/postrm; RPM uses EPELufwplussystemdand newpackaging/scripts/rpm/{post,preun,postun}scriptlets that mirror the.deblifecycle (migrate frominstall.sh, enable on first install, respect admin enable/disable on upgrade, stop/disable on removal, leave UFW and env file semantics as documented).CI and release upload and attest
.rpmartifacts, generate a second snapshot at0.0.1for upgrade testing, and add aninstall-rpmmatrix (Alma/Rocky/Oracle 9–10 × arch) runningscripts/test-rpm-install.sh. ShellCheck targets the new script paths explicitly.uninstall.shremoveslsh-agentviadnfwhen installed from RPM (clean_requirements_on_remove=False), drops the yum repo file, and Bats assert both apt and dnf failure exits before file cleanup. Docs and release drafter now mention.rpm, SBOM naming, and provenance for RPMs.Reviewed by Cursor Bugbot for commit 5828144. Bugbot is set up for automated code reviews on this repo. Configure here.


Confidence Score: 5/5
The latest changes appear safe to merge, with no new blocking issues found.Summary
Adds RPM packages alongside Debian packages, with package scripts, release attestations, and installation tests.
Reviews (2) · Last reviewed commit: "feat(packaging): uninstall.sh removes th..." · Reviewed by Greptile