apt-ostree/CHANGELOG.md
robojerk e24088747b
Some checks failed
Comprehensive CI/CD Pipeline / Build and Test (push) Successful in 16m40s
Comprehensive CI/CD Pipeline / Security Audit (push) Failing after 6s
Comprehensive CI/CD Pipeline / Package Validation (push) Successful in 1m5s
Comprehensive CI/CD Pipeline / Status Report (push) Has been skipped
Add bootc-compatible labels to container-encapsulate
- Implement complete bootc label support for apt-ostree compose container-encapsulate
- Add containers.bootc, ostree.bootable, ostree.commit, ostree.linux, aptostree.inputhash labels
- Add smart kernel version detection from OSTree tree structure
- Fix container-encapsulate command routing and argument parsing
- Update CHANGELOG.md with bootc label documentation

This enables full compatibility with bootc-image-builder and the broader bootc ecosystem.
2025-09-02 11:58:47 -07:00

5.2 KiB

apt-ostree Changelog

Current Session Changes

🐛 Bug Fixes

Fixed OSTree Commit Issues with Device Files

  • Problem: OSTree commits were failing with errors like "Not a regular file or symlink: console" when encountering device files in /dev
  • Solution: Added skip list functionality to exclude problematic directories (/dev, /proc, /sys, /tmp, /var/tmp, /var/cache, /var/log) from OSTree commits
  • Files Modified: src/commands/compose/ostree_integration.rs

Fixed Chroot Environment for Package Installation

  • Problem: Package installation was failing because chroot operations needed access to /dev, /proc, /sys directories that weren't properly set up
  • Solution:
    • Modified package manager to create dummy chroot directories before debootstrap runs
    • Updated install_package and update_cache functions to use proper chroot instead of directory overrides
    • Added ensure_chroot_dirs() helper function to create essential directories
  • Files Modified: src/commands/compose/package_manager.rs

Fixed Disk Space Issues

  • Problem: OSTree commits were failing due to insufficient disk space when using /tmp as work directory
  • Solution: Added support for --workdir option to specify custom working directory with sufficient disk space
  • Files Modified: CLI handling in main.rs (workdir option was already supported)

New Features

Enhanced Package Installation

  • Added: Proper chroot-based package installation using chroot command instead of apt-get with directory overrides
  • Added: Automatic creation of essential chroot directories (/dev, /proc, /sys, /tmp)
  • Added: Creation of minimal device files (/dev/null, /dev/zero) for apt operations

Improved OSTree Integration

  • Added: Skip list functionality to exclude problematic filesystem content from OSTree commits
  • Added: Better error handling and logging for OSTree operations
  • Added: Support for custom working directories to avoid disk space constraints

Bootc-Compatible Container Labels

  • Added: Complete bootc label support for apt-ostree compose container-encapsulate:
    • containers.bootc: "1" - Main identifier for bootc-image-builder compatibility
    • ostree.bootable: "true" - Indicates this is a bootable OSTree container
    • ostree.commit: "<commit-hash>" - The OSTree commit hash from the repository
    • ostree.linux: "<kernel-version>" - The kernel version from the OSTree tree
    • aptostree.inputhash: "<hash>" - Equivalent to rpmostree.inputhash for apt-ostree
  • Added: Automatic kernel version detection from OSTree tree structure
  • Added: Proper argument parsing for container-encapsulate command

🔧 Technical Improvements

Package Manager Architecture

  • Improved: Package installation now uses proper chroot isolation instead of directory overrides
  • Improved: Better separation of concerns between debootstrap initialization and package installation
  • Improved: More robust error handling for chroot operations

OSTree Commit Process

  • Improved: OSTree commits now properly exclude device files and temporary directories
  • Improved: Better integration between package installation and OSTree commit creation
  • Improved: Support for custom working directories to avoid filesystem constraints

📋 Testing Results

Successfully Tested

  • Base system initialization with debootstrap
  • Package cache updates using chroot
  • Installation of 31 packages (11 base + 20 additional) using chroot
  • Post-installation script execution using chroot
  • OSTree commit creation with device file exclusion
  • Bootc-compatible container image generation
  • Export in both Docker and OCI formats

Test Environment

  • OS: Debian Trixie (testing)
  • Architecture: x86_64
  • Work Directory: /home/joe/apt-ostree-build (to avoid /tmp disk space issues)
  • Treefile: debian-minimal-apt-ostree.yaml from debian-atomic-config

🎯 Impact

These fixes resolve the core issues that were preventing apt-ostree from functioning properly:

  1. Device File Handling: OSTree can now successfully commit Debian systems without encountering device file errors
  2. Chroot Operations: Package installation and system configuration now work properly in isolated environments
  3. Disk Space Management: Users can specify custom working directories to avoid filesystem constraints
  4. Production Readiness: The tool can now successfully create bootable Debian atomic systems

🔍 Root Cause Analysis

The original issues were NOT due to apt-ostree being an "RPM tool" (as incorrectly suggested by AI testing). The tool is correctly designed for Debian systems. The real issues were:

  1. Missing chroot environment setup for package operations
  2. OSTree's inability to handle device files in system roots
  3. Default use of /tmp which has limited disk space on many systems

📚 Documentation

  • Verified: apt-ostree is a legitimate Debian tool, not an RPM tool
  • Confirmed: Tool successfully creates Debian atomic systems compatible with deb-bootupd
  • Tested: Full end-to-end workflow from treefile to bootable container image