Skip to content

Add Debian package build target to Earthfile#278

Merged
magerstam merged 9 commits intomainfrom
earthfile-deb-package
Nov 3, 2025
Merged

Add Debian package build target to Earthfile#278
magerstam merged 9 commits intomainfrom
earthfile-deb-package

Conversation

@arodage
Copy link
Copy Markdown
Contributor

@arodage arodage commented Oct 28, 2025

Merge Checklist

All boxes should be checked before merging the PR

  • [] The changes in the PR have been built and tested
  • [] Ready to merge

Description

This PR adds a new +deb target to the Earthfile that creates a production-ready Debian package for the OS Image Composer tool. The package follows the Filesystem Hierarchy Standard (FHS) and Debian packaging best practices, making it easy to distribute and install the tool on Ubuntu/Debian systems.

Key Changes:

  • Added parameterized +deb target to Earthfile with configurable VERSION and ARCH arguments
  • Package includes compiled binary, configurations, example templates, and documentation
  • Follows FHS standards with proper directory structure (/etc, /usr/local/bin, /usr/share)
  • Output location changed to dist/ directory for cleaner project organization
  • Added comprehensive installation, verification, and uninstallation instructions to README.md
  • Includes CLI specification document in package documentation

Package Layout:

  • Binary: /usr/local/bin/os-image-composer
  • Configuration: /etc/os-image-composer/ (user-editable)
  • Examples: /usr/share/os-image-composer/examples/ (read-only templates)
  • Documentation: /usr/share/doc/os-image-composer/ (README, LICENSE, CLI spec)

Usage:

# Build package
earthly +deb --VERSION=1.0.0 --ARCH=amd64

# Install package
sudo apt install ./dist/os-image-composer_1.0.0_amd64.deb

Any Newly Introduced Dependencies

How Has This Been Tested?

Build package:
image

Install package on ubuntu machines:
image

Verify installation:
image

Uninstall:
image

Copilot AI review requested due to automatic review settings October 28, 2025 21:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces Debian package support for OS Image Composer, enabling easier distribution and installation on Ubuntu/Debian systems. The implementation follows Filesystem Hierarchy Standard (FHS) and Debian packaging best practices.

Key Changes:

  • Added parameterized +deb target in Earthfile for building production-ready Debian packages
  • Introduced comprehensive installation documentation in README.md covering build, install, verify, and uninstall workflows
  • Added experimental build_oic_deb_package() function in validate.sh (appears to be legacy/test code)

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
Earthfile Implements new +deb target with FHS-compliant directory structure, configurable VERSION/ARCH parameters, and artifact output to dist/ directory
README.md Adds complete Debian package installation section with build instructions, verification steps, package contents overview, and uninstallation commands
validate.sh Adds build_oic_deb_package() function for building basic Debian packages (appears to be experimental/legacy code)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread validate.sh Outdated
Comment thread validate.sh Outdated
Comment thread validate.sh Outdated
Comment thread validate.sh Outdated
Comment thread validate.sh Outdated
@arodage arodage requested review from magerstam and srmungar October 28, 2025 21:58
@arodage arodage changed the title Earthfile deb package Add Debian package build target to Earthfile Oct 28, 2025
Comment thread README.md
Comment thread validate.sh Outdated
Copy link
Copy Markdown
Contributor

@magerstam magerstam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are more dependencies we need to add unify, mmdebbootstrap
License information has to be captured in metadata

Comment thread Earthfile
@arodage
Copy link
Copy Markdown
Contributor Author

arodage commented Oct 30, 2025

I think there are more dependencies we need to add unify, mmdebbootstrap License information has to be captured in metadata

Right, we need to add the dependencies and we are copying the LICENSE file to the doc directory but as per deb package standards, we need the following:
image

@arodage
Copy link
Copy Markdown
Contributor Author

arodage commented Oct 30, 2025

@magerstam @srmungar
We need different defaults in /etc/os-image-composer/os-image-composer.yml
For example, config can not be ./config but /etc/os-image-composer/config/
Not sure what should be defaults for cache_dir work_dir and temp_dir

@arodage arodage changed the title Add Debian package build target to Earthfile Add Debian package build target to Earthfile - DO NO MERGE - WIP Oct 30, 2025
@arodage arodage changed the title Add Debian package build target to Earthfile - DO NO MERGE - WIP Add Debian package build target to Earthfile - DO NOT MERGE - WIP Oct 30, 2025
@arodage arodage changed the title Add Debian package build target to Earthfile - DO NOT MERGE - WIP Add Debian package build target to Earthfile Oct 30, 2025
Comment thread Earthfile
Copy link
Copy Markdown
Contributor

@magerstam magerstam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@magerstam magerstam merged commit 72c7c0b into main Nov 3, 2025
7 checks passed
@yockgen yockgen deleted the earthfile-deb-package branch December 18, 2025 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants