Add mmdebstrap support. Moved docs into docs
Some checks failed
Generate Treefiles / generate-treefiles (push) Failing after 2s
Some checks failed
Generate Treefiles / generate-treefiles (push) Failing after 2s
This commit is contained in:
parent
47468f0147
commit
6f91ab6ede
11 changed files with 565 additions and 187 deletions
67
.forgejo/workflows/generate-treefiles.yml
Normal file
67
.forgejo/workflows/generate-treefiles.yml
Normal file
|
|
@ -0,0 +1,67 @@
|
||||||
|
name: Generate Treefiles
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, develop ]
|
||||||
|
paths:
|
||||||
|
- 'variants/**'
|
||||||
|
- 'package-groups/**'
|
||||||
|
- 'scripts/**'
|
||||||
|
- 'create-debian-atomic.py'
|
||||||
|
pull_request:
|
||||||
|
branches: [ main, develop ]
|
||||||
|
paths:
|
||||||
|
- 'variants/**'
|
||||||
|
- 'package-groups/**'
|
||||||
|
- 'scripts/**'
|
||||||
|
- 'create-debian-atomic.py'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate-treefiles:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.GITEA_TOKEN }}
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Generate treefiles
|
||||||
|
run: |
|
||||||
|
python create-debian-atomic.py --generate-treefiles
|
||||||
|
|
||||||
|
- name: Check for changes
|
||||||
|
id: check_changes
|
||||||
|
run: |
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
echo "changes=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "changes=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Commit generated treefiles
|
||||||
|
if: steps.check_changes.outputs.changes == 'true'
|
||||||
|
run: |
|
||||||
|
git config --local user.email "forgejo@example.com"
|
||||||
|
git config --local user.name "Forgejo Actions"
|
||||||
|
git add treefiles/
|
||||||
|
git commit -m "Auto-generate treefiles from variant definitions [skip ci]"
|
||||||
|
git push
|
||||||
|
|
||||||
|
- name: Validate treefiles
|
||||||
|
run: |
|
||||||
|
python test-integration.py --validate-treefiles
|
||||||
|
|
||||||
|
- name: Test all variants
|
||||||
|
run: |
|
||||||
|
python test-all-variants.py --quick-test
|
||||||
65
.github/workflows/generate-treefiles.yml
vendored
Normal file
65
.github/workflows/generate-treefiles.yml
vendored
Normal file
|
|
@ -0,0 +1,65 @@
|
||||||
|
name: Generate Treefiles
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main, develop ]
|
||||||
|
paths:
|
||||||
|
- 'variants/**'
|
||||||
|
- 'package-groups/**'
|
||||||
|
- 'scripts/**'
|
||||||
|
- 'create-debian-atomic.py'
|
||||||
|
pull_request:
|
||||||
|
branches: [ main, develop ]
|
||||||
|
paths:
|
||||||
|
- 'variants/**'
|
||||||
|
- 'package-groups/**'
|
||||||
|
- 'scripts/**'
|
||||||
|
- 'create-debian-atomic.py'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
generate-treefiles:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout code
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Set up Python
|
||||||
|
uses: actions/setup-python@v4
|
||||||
|
with:
|
||||||
|
python-version: '3.11'
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
python -m pip install --upgrade pip
|
||||||
|
pip install -r requirements.txt
|
||||||
|
|
||||||
|
- name: Generate treefiles
|
||||||
|
run: |
|
||||||
|
python create-debian-atomic.py --generate-treefiles
|
||||||
|
|
||||||
|
- name: Check for changes
|
||||||
|
id: check_changes
|
||||||
|
run: |
|
||||||
|
if [ -n "$(git status --porcelain)" ]; then
|
||||||
|
echo "changes=true" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "changes=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Commit generated treefiles
|
||||||
|
if: steps.check_changes.outputs.changes == 'true'
|
||||||
|
run: |
|
||||||
|
git config --local user.email "action@github.com"
|
||||||
|
git config --local user.name "GitHub Action"
|
||||||
|
git add treefiles/
|
||||||
|
git commit -m "Auto-generate treefiles from variant definitions [skip ci]"
|
||||||
|
git push
|
||||||
|
|
||||||
|
- name: Validate treefiles
|
||||||
|
run: |
|
||||||
|
python test-integration.py --validate-treefiles
|
||||||
|
|
||||||
|
- name: Test all variants
|
||||||
|
run: |
|
||||||
|
python test-all-variants.py --quick-test
|
||||||
50
.gitignore
vendored
Normal file
50
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,50 @@
|
||||||
|
# Generated treefiles (should be generated by CI)
|
||||||
|
treefiles/*.yaml
|
||||||
|
|
||||||
|
# Python
|
||||||
|
__pycache__/
|
||||||
|
*.py[cod]
|
||||||
|
*$py.class
|
||||||
|
*.so
|
||||||
|
.Python
|
||||||
|
build/
|
||||||
|
develop-eggs/
|
||||||
|
dist/
|
||||||
|
downloads/
|
||||||
|
eggs/
|
||||||
|
.eggs/
|
||||||
|
lib/
|
||||||
|
lib64/
|
||||||
|
parts/
|
||||||
|
sdist/
|
||||||
|
var/
|
||||||
|
wheels/
|
||||||
|
*.egg-info/
|
||||||
|
.installed.cfg
|
||||||
|
*.egg
|
||||||
|
MANIFEST
|
||||||
|
|
||||||
|
# Virtual environments
|
||||||
|
venv/
|
||||||
|
env/
|
||||||
|
ENV/
|
||||||
|
env.bak/
|
||||||
|
venv.bak/
|
||||||
|
|
||||||
|
# IDE
|
||||||
|
.vscode/
|
||||||
|
.idea/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
*~
|
||||||
|
|
||||||
|
# OS
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
|
# Logs
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Temporary files
|
||||||
|
*.tmp
|
||||||
|
*.temp
|
||||||
|
|
@ -1,169 +0,0 @@
|
||||||
# Debian Atomic Alternative Solution - Accomplishments Summary
|
|
||||||
|
|
||||||
## 🎉 **Major Achievement: Complete Alternative Solution Implemented**
|
|
||||||
|
|
||||||
We have successfully implemented a complete alternative Debian Atomic solution that bypasses the limitations of `apt-ostree` and provides a working end-to-end pipeline for generating Debian Atomic systems.
|
|
||||||
|
|
||||||
## ✅ **What We've Accomplished**
|
|
||||||
|
|
||||||
### **1. Core Alternative Solution**
|
|
||||||
- **`create-debian-atomic.py`**: Complete build script using `debootstrap` + `ostree`
|
|
||||||
- **6 Variants Supported**: minimal, GNOME, Plasma, Cosmic, Sway, Budgie
|
|
||||||
- **Real Debian Packages**: Uses actual Debian Trixie repositories (not mock packages)
|
|
||||||
- **OSTree Integration**: Full repository management and commit generation
|
|
||||||
- **Post-Processing**: Systemd services, SSH configuration, essential directories
|
|
||||||
|
|
||||||
### **2. Comprehensive Testing Framework**
|
|
||||||
- **`test-all-variants.py`**: Automated testing of all variants
|
|
||||||
- **OSTree Validation**: Repository inspection, commit verification, reference management
|
|
||||||
- **Detailed Reporting**: Success/failure metrics with comprehensive analysis
|
|
||||||
- **Artifact Management**: Test artifact cleanup and preservation options
|
|
||||||
|
|
||||||
### **3. Complete Documentation**
|
|
||||||
- **`README-alternative-solution.md`**: Overview and explanation of the approach
|
|
||||||
- **`INTEGRATION-GUIDE.md`**: Comprehensive integration and usage guide
|
|
||||||
- **Workflow Examples**: CI/CD pipelines, development workflows, customization
|
|
||||||
- **Troubleshooting**: Common issues and solutions
|
|
||||||
|
|
||||||
### **4. Technical Achievements**
|
|
||||||
- **End-to-End Pipeline**: ✅ WORKING - debian-atomic-configs → debootstrap + ostree → OSTree repository
|
|
||||||
- **Bootable Artifact**: ✅ CAN GENERATE - OSTree commits with real Debian packages
|
|
||||||
- **Variant Support**: ✅ COMPLETE - All 6 variants building successfully
|
|
||||||
- **Integration Ready**: ✅ READY - Can integrate with deb-bootc-image-builder
|
|
||||||
|
|
||||||
## 🔧 **How It Works**
|
|
||||||
|
|
||||||
### **1. Build Process**
|
|
||||||
```bash
|
|
||||||
# 1. Create OSTree repository
|
|
||||||
ostree init --repo=/path/to/repo --mode=bare
|
|
||||||
|
|
||||||
# 2. Generate rootfs with debootstrap
|
|
||||||
debootstrap --variant=minbase --include=packages trixie /path/to/rootfs
|
|
||||||
|
|
||||||
# 3. Post-process rootfs
|
|
||||||
# - Create essential directories
|
|
||||||
# - Configure systemd services
|
|
||||||
# - Set up SSH and networking
|
|
||||||
|
|
||||||
# 4. Create OSTree commit
|
|
||||||
ostree commit --repo=/path/to/repo --branch=debian/14/x86_64/variant --tree=dir=/path/to/rootfs
|
|
||||||
```
|
|
||||||
|
|
||||||
### **2. Variant Support**
|
|
||||||
- **minimal**: Base system equivalent to Fedora CoreOS
|
|
||||||
- **gnome**: GNOME desktop with GDM display manager
|
|
||||||
- **plasma**: KDE Plasma with SDDM display manager
|
|
||||||
- **cosmic**: Pop!_OS desktop environment
|
|
||||||
- **sway**: Sway Wayland compositor
|
|
||||||
- **budgie**: Budgie desktop environment
|
|
||||||
|
|
||||||
### **3. Integration Points**
|
|
||||||
- **deb-bootc-image-builder**: Generate bootable QCOW2/ISO images
|
|
||||||
- **debian-forge**: Use as base images in OSBuild blueprints
|
|
||||||
- **debian-koji**: Package and distribute via build system
|
|
||||||
- **CI/CD**: Automated testing and deployment pipelines
|
|
||||||
|
|
||||||
## 🚀 **Next Steps: Bootable Image Generation**
|
|
||||||
|
|
||||||
### **1. Immediate Priority: deb-bootc-image-builder Integration**
|
|
||||||
```bash
|
|
||||||
# Test integration with our generated OSTree repositories
|
|
||||||
deb-bootc-image-builder \
|
|
||||||
--ostree-repo /path/to/variant/repo \
|
|
||||||
--ostree-ref debian/14/x86_64/variant \
|
|
||||||
--output variant-debian-atomic.qcow2
|
|
||||||
```
|
|
||||||
|
|
||||||
### **2. Image Validation**
|
|
||||||
- **QEMU/KVM Testing**: Boot images in virtual environment
|
|
||||||
- **Performance Benchmarking**: Compare with Fedora Atomic equivalents
|
|
||||||
- **Hardware Compatibility**: Test on real hardware
|
|
||||||
|
|
||||||
### **3. Production Readiness**
|
|
||||||
- **Automated Testing**: CI/CD pipeline for all variants
|
|
||||||
- **Release Management**: Versioned releases with changelogs
|
|
||||||
- **Community Adoption**: Documentation and user guides
|
|
||||||
|
|
||||||
## 📊 **Current Status Metrics**
|
|
||||||
|
|
||||||
### **✅ Completed (100%)**
|
|
||||||
- **Core Components**: 12/12 building/compiling
|
|
||||||
- **Alternative Solution**: 6/6 variants supported
|
|
||||||
- **Testing Framework**: Comprehensive test suite
|
|
||||||
- **Documentation**: Complete integration guide
|
|
||||||
- **End-to-End Pipeline**: Fully functional
|
|
||||||
|
|
||||||
### **🔄 In Progress (0%)**
|
|
||||||
- **Bootable Image Generation**: Ready to start
|
|
||||||
- **Image Validation**: Not yet begun
|
|
||||||
- **Performance Testing**: Not yet begun
|
|
||||||
|
|
||||||
### **📈 Success Rate**
|
|
||||||
- **Variant Builds**: 6/6 (100%) - All variants building successfully
|
|
||||||
- **OSTree Operations**: 100% - Repository management working
|
|
||||||
- **Integration Testing**: 100% - End-to-end pipeline validated
|
|
||||||
|
|
||||||
## 🎯 **Strategic Impact**
|
|
||||||
|
|
||||||
### **1. Problem Solved**
|
|
||||||
- **apt-ostree Limitations**: Bypassed mock package database and incomplete functionality
|
|
||||||
- **Debian Atomic Pipeline**: Now fully functional with real Debian packages
|
|
||||||
- **Bootable Artifacts**: Can generate actual deployable systems
|
|
||||||
|
|
||||||
### **2. Architecture Benefits**
|
|
||||||
- **Direct Control**: Full control over build process without tool limitations
|
|
||||||
- **Real Packages**: Uses actual Debian repositories, not mock data
|
|
||||||
- **Extensible**: Easy to add new variants and customizations
|
|
||||||
- **Reliable**: Bypasses incomplete upstream tooling
|
|
||||||
|
|
||||||
### **3. Community Value**
|
|
||||||
- **Debian Atomic**: First working implementation of Debian Atomic systems
|
|
||||||
- **Fedora Parity**: Achieves feature parity with Fedora Atomic
|
|
||||||
- **Open Source**: Complete solution available for community use
|
|
||||||
- **Documentation**: Comprehensive guides for adoption and contribution
|
|
||||||
|
|
||||||
## 🔮 **Future Development**
|
|
||||||
|
|
||||||
### **1. Short Term (Next 2 Weeks)**
|
|
||||||
- [ ] Integrate with deb-bootc-image-builder
|
|
||||||
- [ ] Generate bootable QCOW2/ISO images
|
|
||||||
- [ ] Test bootable images in QEMU/KVM
|
|
||||||
- [ ] Performance benchmarking
|
|
||||||
|
|
||||||
### **2. Medium Term (Next Month)**
|
|
||||||
- [ ] Automated CI/CD pipeline
|
|
||||||
- [ ] Community testing and feedback
|
|
||||||
- [ ] Performance optimization
|
|
||||||
- [ ] Additional variant support
|
|
||||||
|
|
||||||
### **3. Long Term (Next Quarter)**
|
|
||||||
- [ ] Production deployment
|
|
||||||
- [ ] Community adoption
|
|
||||||
- [ ] Upstream contribution
|
|
||||||
- [ ] Enterprise features
|
|
||||||
|
|
||||||
## 🏆 **Key Achievements**
|
|
||||||
|
|
||||||
1. **✅ Complete Alternative Solution**: Working end-to-end Debian Atomic pipeline
|
|
||||||
2. **✅ All Variants Supported**: 6 desktop environments and minimal system
|
|
||||||
3. **✅ Real Debian Packages**: No more mock package database issues
|
|
||||||
4. **✅ Comprehensive Testing**: Automated testing framework for all variants
|
|
||||||
5. **✅ Production Ready**: Solution ready for bootable image generation
|
|
||||||
6. **✅ Community Ready**: Complete documentation and integration guides
|
|
||||||
|
|
||||||
## 🎊 **Conclusion**
|
|
||||||
|
|
||||||
We have successfully implemented a complete alternative Debian Atomic solution that:
|
|
||||||
|
|
||||||
- **Solves the Core Problem**: Bypasses apt-ostree limitations
|
|
||||||
- **Provides Working Pipeline**: End-to-end Debian Atomic generation
|
|
||||||
- **Supports All Variants**: 6 desktop environments and minimal system
|
|
||||||
- **Enables Bootable Artifacts**: Ready for image generation
|
|
||||||
- **Is Production Ready**: Comprehensive testing and documentation
|
|
||||||
|
|
||||||
**The alternative solution is now the primary path forward for Debian Atomic development.** The next phase focuses on generating bootable images and validating them in real environments.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
*This summary represents a major milestone in the Debian Atomic project. We now have a working, reliable solution that can generate actual Debian Atomic systems with real Debian packages.*
|
|
||||||
|
|
@ -14,14 +14,14 @@ This repository manages:
|
||||||
|
|
||||||
```
|
```
|
||||||
debian-atomic-configs/
|
debian-atomic-configs/
|
||||||
├── variants/ # Debian variant definitions
|
├── variants/ # Debian variant definitions (source of truth)
|
||||||
│ ├── debian-gnome-atomic.yaml # Debian GNOME Atomic equivalent
|
│ ├── debian-gnome-atomic.yaml # Debian GNOME Atomic equivalent
|
||||||
│ ├── debian-plasma-atomic.yaml # Debian KDE Plasma Atomic equivalent
|
│ ├── debian-plasma-atomic.yaml # Debian KDE Plasma Atomic equivalent
|
||||||
│ ├── debian-cosmic-atomic.yaml # Debian Cosmic Atomic equivalent
|
│ ├── debian-cosmic-atomic.yaml # Debian Cosmic Atomic equivalent
|
||||||
│ ├── debian-sway-atomic.yaml # Debian Sway Atomic equivalent
|
│ ├── debian-sway-atomic.yaml # Debian Sway Atomic equivalent
|
||||||
│ ├── debian-budgie-atomic.yaml # Debian Budgie Atomic equivalent
|
│ ├── debian-budgie-atomic.yaml # Debian Budgie Atomic equivalent
|
||||||
│ └── minimal.yaml # Minimal Debian system
|
│ └── minimal.yaml # Minimal Debian system
|
||||||
├── treefiles/ # Generated treefiles for apt-ostree
|
├── treefiles/ # Generated treefiles for apt-ostree (auto-generated)
|
||||||
│ ├── debian-minimal.yaml
|
│ ├── debian-minimal.yaml
|
||||||
│ ├── debian-gnome-atomic.yaml
|
│ ├── debian-gnome-atomic.yaml
|
||||||
│ ├── debian-plasma-atomic.yaml
|
│ ├── debian-plasma-atomic.yaml
|
||||||
|
|
@ -30,6 +30,10 @@ debian-atomic-configs/
|
||||||
│ └── debian-budgie-atomic.yaml
|
│ └── debian-budgie-atomic.yaml
|
||||||
├── scripts/ # Generation and sync scripts
|
├── scripts/ # Generation and sync scripts
|
||||||
│ └── test-integration.py # Integration testing script
|
│ └── test-integration.py # Integration testing script
|
||||||
|
├── .github/workflows/ # GitHub CI/CD automation
|
||||||
|
│ └── generate-treefiles.yml # Auto-generates treefiles on variant changes
|
||||||
|
├── .forgejo/workflows/ # Forgejo CI/CD automation
|
||||||
|
│ └── generate-treefiles.yml # Auto-generates treefiles on variant changes
|
||||||
├── docs/ # Documentation
|
├── docs/ # Documentation
|
||||||
│ └── ATOMIC_DESKTOPS.md # Comprehensive desktop guide
|
│ └── ATOMIC_DESKTOPS.md # Comprehensive desktop guide
|
||||||
└── README.md # This file
|
└── README.md # This file
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,20 @@
|
||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
"""
|
"""
|
||||||
Alternative Debian Atomic Solution
|
Alternative Debian Atomic Solution
|
||||||
Uses debootstrap + ostree instead of apt-ostree to create Debian Atomic systems
|
Uses debootstrap/mmdebstrap + ostree instead of apt-ostree to create Debian Atomic systems
|
||||||
|
|
||||||
|
Features:
|
||||||
|
- Automatic detection of mmdebstrap (preferred) or debootstrap (fallback)
|
||||||
|
- mmdebstrap is faster and more reliable than debootstrap
|
||||||
|
- Automatic installation of mmdebstrap if not available
|
||||||
|
- Support for all major Debian desktop environments
|
||||||
|
- OSTree integration for atomic system management
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
python3 create-debian-atomic.py <variant> [work_dir] [options]
|
||||||
|
|
||||||
|
Variants: minimal, gnome, plasma, cosmic, sway, budgie
|
||||||
|
Options: --use-debootstrap, --help, -h
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
@ -15,12 +28,58 @@ from pathlib import Path
|
||||||
from typing import List, Dict, Any
|
from typing import List, Dict, Any
|
||||||
|
|
||||||
class DebianAtomicBuilder:
|
class DebianAtomicBuilder:
|
||||||
"""Build Debian Atomic systems using debootstrap + ostree"""
|
"""Build Debian Atomic systems using debootstrap/mmdebstrap + ostree"""
|
||||||
|
|
||||||
def __init__(self, work_dir: str = None):
|
def __init__(self, work_dir: str = None, use_mmdebstrap: bool = True):
|
||||||
self.work_dir = Path(work_dir) if work_dir else Path(tempfile.mkdtemp(prefix="debian-atomic-"))
|
self.work_dir = Path(work_dir) if work_dir else Path(tempfile.mkdtemp(prefix="debian-atomic-"))
|
||||||
self.repo_dir = self.work_dir / "repo"
|
self.repo_dir = self.work_dir / "repo"
|
||||||
self.rootfs_dir = self.work_dir / "rootfs"
|
self.rootfs_dir = self.work_dir / "rootfs"
|
||||||
|
self.use_mmdebstrap = use_mmdebstrap
|
||||||
|
|
||||||
|
# Check which bootstrap tool is available
|
||||||
|
self.bootstrap_tool = self._detect_bootstrap_tool()
|
||||||
|
|
||||||
|
def _detect_bootstrap_tool(self) -> str:
|
||||||
|
"""Detect which bootstrap tool is available and preferred"""
|
||||||
|
if self.use_mmdebstrap and self._check_tool_available("mmdebstrap"):
|
||||||
|
print("Using mmdebstrap (faster and more reliable)")
|
||||||
|
return "mmdebstrap"
|
||||||
|
elif self._check_tool_available("debootstrap"):
|
||||||
|
print("Using debootstrap (fallback option)")
|
||||||
|
return "debootstrap"
|
||||||
|
else:
|
||||||
|
print("Warning: No bootstrap tool found, attempting to install mmdebstrap")
|
||||||
|
if self._install_mmdebstrap():
|
||||||
|
return "mmdebstrap"
|
||||||
|
else:
|
||||||
|
raise RuntimeError("No bootstrap tool available and could not install mmdebstrap")
|
||||||
|
|
||||||
|
def _check_tool_available(self, tool: str) -> bool:
|
||||||
|
"""Check if a tool is available in PATH"""
|
||||||
|
try:
|
||||||
|
subprocess.run([tool, "--version"], capture_output=True, check=True)
|
||||||
|
return True
|
||||||
|
except (subprocess.CalledProcessError, FileNotFoundError):
|
||||||
|
return False
|
||||||
|
|
||||||
|
def _install_mmdebstrap(self) -> bool:
|
||||||
|
"""Attempt to install mmdebstrap if not available"""
|
||||||
|
try:
|
||||||
|
print("Attempting to install mmdebstrap...")
|
||||||
|
# Try different package managers
|
||||||
|
install_cmds = [
|
||||||
|
["apt-get", "update", "-y"],
|
||||||
|
["apt-get", "install", "-y", "mmdebstrap"]
|
||||||
|
]
|
||||||
|
|
||||||
|
for cmd in install_cmds:
|
||||||
|
result = subprocess.run(cmd, capture_output=True, text=True, check=True)
|
||||||
|
print(f"Successfully ran: {' '.join(cmd)}")
|
||||||
|
|
||||||
|
return self._check_tool_available("mmdebstrap")
|
||||||
|
except subprocess.CalledProcessError as e:
|
||||||
|
print(f"Failed to install mmdebstrap: {e}")
|
||||||
|
return False
|
||||||
|
|
||||||
def create_ostree_repo(self) -> bool:
|
def create_ostree_repo(self) -> bool:
|
||||||
"""Create and initialize OSTree repository"""
|
"""Create and initialize OSTree repository"""
|
||||||
|
|
@ -46,18 +105,35 @@ class DebianAtomicBuilder:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def create_rootfs(self, variant: str = "minimal") -> bool:
|
def create_rootfs(self, variant: str = "minimal") -> bool:
|
||||||
"""Create rootfs using debootstrap"""
|
"""Create rootfs using detected bootstrap tool"""
|
||||||
try:
|
try:
|
||||||
print(f"Creating rootfs for variant: {variant}")
|
print(f"Creating rootfs for variant: {variant} using {self.bootstrap_tool}")
|
||||||
self.rootfs_dir.mkdir(parents=True, exist_ok=True)
|
self.rootfs_dir.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
# Get package list based on variant
|
# Get package list based on variant
|
||||||
packages = self.get_packages_for_variant(variant)
|
packages = self.get_packages_for_variant(variant)
|
||||||
|
|
||||||
# Create minimal rootfs with debootstrap
|
if self.bootstrap_tool == "mmdebstrap":
|
||||||
|
# Use mmdebstrap (faster and more reliable)
|
||||||
cmd = [
|
cmd = [
|
||||||
"debootstrap", "--variant=minbase", "--include=" + ",".join(packages),
|
"mmdebstrap",
|
||||||
"trixie", str(self.rootfs_dir), "http://deb.debian.org/debian"
|
"--variant=minbase",
|
||||||
|
"--include=" + ",".join(packages),
|
||||||
|
"--aptopt=Acquire::Check-Valid-Until=false", # Handle expired Release files
|
||||||
|
"--aptopt=Acquire::Check-Date=false", # Disable date checking
|
||||||
|
"trixie",
|
||||||
|
str(self.rootfs_dir),
|
||||||
|
"http://deb.debian.org/debian"
|
||||||
|
]
|
||||||
|
else:
|
||||||
|
# Use debootstrap (fallback)
|
||||||
|
cmd = [
|
||||||
|
"debootstrap",
|
||||||
|
"--variant=minbase",
|
||||||
|
"--include=" + ",".join(packages),
|
||||||
|
"trixie",
|
||||||
|
str(self.rootfs_dir),
|
||||||
|
"http://deb.debian.org/debian"
|
||||||
]
|
]
|
||||||
|
|
||||||
print(f"Running: {' '.join(cmd)}")
|
print(f"Running: {' '.join(cmd)}")
|
||||||
|
|
@ -236,6 +312,24 @@ class DebianAtomicBuilder:
|
||||||
"""List all supported variants"""
|
"""List all supported variants"""
|
||||||
return ["minimal", "gnome", "plasma", "cosmic", "sway", "budgie"]
|
return ["minimal", "gnome", "plasma", "cosmic", "sway", "budgie"]
|
||||||
|
|
||||||
|
def get_bootstrap_info(self) -> Dict[str, Any]:
|
||||||
|
"""Get information about the bootstrap tool being used"""
|
||||||
|
return {
|
||||||
|
"tool": self.bootstrap_tool,
|
||||||
|
"preferred": self.use_mmdebstrap,
|
||||||
|
"available": self._check_tool_available(self.bootstrap_tool),
|
||||||
|
"version": self._get_tool_version()
|
||||||
|
}
|
||||||
|
|
||||||
|
def _get_tool_version(self) -> str:
|
||||||
|
"""Get version of the bootstrap tool"""
|
||||||
|
try:
|
||||||
|
result = subprocess.run([self.bootstrap_tool, "--version"],
|
||||||
|
capture_output=True, text=True, check=True)
|
||||||
|
return result.stdout.strip().split('\n')[0]
|
||||||
|
except:
|
||||||
|
return "Unknown"
|
||||||
|
|
||||||
def cleanup(self):
|
def cleanup(self):
|
||||||
"""Clean up temporary files"""
|
"""Clean up temporary files"""
|
||||||
try:
|
try:
|
||||||
|
|
@ -247,15 +341,37 @@ class DebianAtomicBuilder:
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main function"""
|
"""Main function"""
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2 or "--help" in sys.argv or "-h" in sys.argv:
|
||||||
print("Usage: python3 create-debian-atomic.py <variant> [work_dir]")
|
print("Alternative Debian Atomic Builder")
|
||||||
print("Variants:", ", ".join(DebianAtomicBuilder().list_variants()))
|
print("=================================")
|
||||||
sys.exit(1)
|
print("Usage: python3 create-debian-atomic.py <variant> [work_dir] [options]")
|
||||||
|
print("\nVariants:")
|
||||||
|
for variant in DebianAtomicBuilder().list_variants():
|
||||||
|
print(f" {variant}")
|
||||||
|
print("\nOptions:")
|
||||||
|
print(" --use-debootstrap Force use of debootstrap instead of mmdebstrap")
|
||||||
|
print(" --help, -h Show this help message")
|
||||||
|
print("\nExamples:")
|
||||||
|
print(" python3 create-debian-atomic.py minimal")
|
||||||
|
print(" python3 create-debian-atomic.py gnome /tmp/my-work-dir")
|
||||||
|
print(" python3 create-debian-atomic.py plasma --use-debootstrap")
|
||||||
|
sys.exit(0)
|
||||||
|
|
||||||
variant = sys.argv[1]
|
variant = sys.argv[1]
|
||||||
work_dir = sys.argv[2] if len(sys.argv) > 2 else None
|
work_dir = None
|
||||||
|
use_mmdebstrap = True
|
||||||
|
|
||||||
builder = DebianAtomicBuilder()
|
# Parse arguments
|
||||||
|
for i, arg in enumerate(sys.argv[2:], 2):
|
||||||
|
if arg == "--use-debootstrap":
|
||||||
|
use_mmdebstrap = False
|
||||||
|
elif arg in ["--help", "-h"]:
|
||||||
|
continue # Already handled above
|
||||||
|
elif not arg.startswith("--"):
|
||||||
|
work_dir = arg
|
||||||
|
break
|
||||||
|
|
||||||
|
builder = DebianAtomicBuilder(work_dir=work_dir, use_mmdebstrap=use_mmdebstrap)
|
||||||
supported_variants = builder.list_variants()
|
supported_variants = builder.list_variants()
|
||||||
|
|
||||||
if variant not in supported_variants:
|
if variant not in supported_variants:
|
||||||
|
|
@ -264,6 +380,13 @@ def main():
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
# Show bootstrap tool information
|
||||||
|
bootstrap_info = builder.get_bootstrap_info()
|
||||||
|
print(f"\n🔧 Bootstrap Tool Information:")
|
||||||
|
print(f" Tool: {bootstrap_info['tool']}")
|
||||||
|
print(f" Version: {bootstrap_info['version']}")
|
||||||
|
print(f" Preferred: {'mmdebstrap' if bootstrap_info['preferred'] else 'debootstrap'}")
|
||||||
|
|
||||||
success = builder.build_variant(variant)
|
success = builder.build_variant(variant)
|
||||||
if success:
|
if success:
|
||||||
print(f"\n✅ Successfully built Debian Atomic {variant} variant")
|
print(f"\n✅ Successfully built Debian Atomic {variant} variant")
|
||||||
|
|
|
||||||
167
docs/ACCOMPLISHMENTS-SUMMARY.md
Normal file
167
docs/ACCOMPLISHMENTS-SUMMARY.md
Normal file
|
|
@ -0,0 +1,167 @@
|
||||||
|
# Debian Atomic Alternative Solution - Accomplishments Summary
|
||||||
|
|
||||||
|
## 🎯 **Current Status: Working Prototype with Significant Progress**
|
||||||
|
|
||||||
|
We have implemented an alternative approach to Debian Atomic that shows promise but is still in development. This document outlines what we've accomplished and what still needs work.
|
||||||
|
|
||||||
|
## ✅ **What We've Accomplished**
|
||||||
|
|
||||||
|
### **1. Core Alternative Solution**
|
||||||
|
- **`create-debian-atomic.py`**: Working build script using `debootstrap` + `ostree`
|
||||||
|
- **6 Variants Supported**: minimal, GNOME, Plasma, Cosmic, Sway, Budgie (basic structure)
|
||||||
|
- **Real Debian Packages**: Uses actual Debian Trixie repositories (not pretend packages)
|
||||||
|
- **OSTree Integration**: Basic repository management and commit generation
|
||||||
|
- **Post-Processing**: Basic systemd services, SSH configuration, essential directories
|
||||||
|
|
||||||
|
### **2. Testing Framework (In Development)**
|
||||||
|
- **`test-all-variants.py`**: Basic testing script for variants
|
||||||
|
- **OSTree Validation**: Basic repository inspection and commit verification
|
||||||
|
- **Reporting**: Basic success/failure reporting
|
||||||
|
- **Artifact Management**: Basic test artifact handling
|
||||||
|
|
||||||
|
### **3. Documentation (Basic)**
|
||||||
|
- **`README-alternative-solution.md`**: Basic overview of the approach
|
||||||
|
- **`INTEGRATION-GUIDE.md`**: Basic integration guide
|
||||||
|
- **Workflow Examples**: Basic examples and workflows
|
||||||
|
- **Troubleshooting**: Basic issue documentation
|
||||||
|
|
||||||
|
### **4. Technical Achievements**
|
||||||
|
- **End-to-End Pipeline**: 🔄 WORKING (basic) - debian-atomic-configs → debootstrap + ostree → OSTree repository
|
||||||
|
- **Bootable Artifact**: 🔄 PARTIALLY WORKING - Can generate OSTree commits, but not yet bootable images
|
||||||
|
- **Variant Support**: 🔄 BASIC - All 6 variants have basic structure, but need refinement
|
||||||
|
- **Integration Ready**: 🔄 PARTIALLY - Basic integration possible, but needs more work
|
||||||
|
|
||||||
|
## 🔧 **How It Works**
|
||||||
|
|
||||||
|
### **1. Build Process**
|
||||||
|
```bash
|
||||||
|
# 1. Create OSTree repository
|
||||||
|
ostree init --repo=/path/to/repo --mode=bare
|
||||||
|
|
||||||
|
# 2. Generate rootfs with debootstrap
|
||||||
|
debootstrap --variant=minbase --include=packages trixie /path/to/rootfs
|
||||||
|
|
||||||
|
# 3. Post-process rootfs
|
||||||
|
# - Create essential directories
|
||||||
|
# - Configure systemd services
|
||||||
|
# - Set up SSH and networking
|
||||||
|
|
||||||
|
# 4. Create OSTree commit
|
||||||
|
ostree commit --repo=/path/to/repo --branch=debian/14/x86_64/variant --tree=dir=/path/to/rootfs
|
||||||
|
```
|
||||||
|
|
||||||
|
### **2. Variant Support**
|
||||||
|
- **minimal**: Base system equivalent to Fedora CoreOS
|
||||||
|
- **gnome**: GNOME desktop with GDM display manager
|
||||||
|
- **plasma**: KDE Plasma with SDDM display manager
|
||||||
|
- **cosmic**: Cosmic desktop environment
|
||||||
|
- **sway**: Sway Wayland compositor
|
||||||
|
- **budgie**: Budgie desktop environment
|
||||||
|
|
||||||
|
### **3. Integration Points**
|
||||||
|
- **deb-bootc-image-builder**: Generate bootable QCOW2/ISO images
|
||||||
|
- **debian-forge**: Use as base images in OSBuild blueprints
|
||||||
|
- **debian-koji**: Package and distribute via build system
|
||||||
|
- **CI/CD**: Automated testing and deployment pipelines
|
||||||
|
|
||||||
|
## 🚀 **Next Steps: Complete the Basic Pipeline**
|
||||||
|
|
||||||
|
### **1. Immediate Priority: Fix Current Issues**
|
||||||
|
- **Complete OSTree repository generation** - currently basic functionality
|
||||||
|
- **Fix variant package lists** - ensure all variants have proper package sets
|
||||||
|
- **Improve post-processing** - better systemd services and configuration
|
||||||
|
- **Test deb-bootc-image-builder integration** - basic integration testing
|
||||||
|
|
||||||
|
### **2. Basic Validation**
|
||||||
|
- **OSTree repository validation** - ensure repositories are properly structured
|
||||||
|
- **Basic QEMU testing** - test if generated systems can boot at all
|
||||||
|
- **Package verification** - ensure all required packages are included
|
||||||
|
|
||||||
|
### **3. Development Readiness**
|
||||||
|
- **Improve testing framework** - more comprehensive testing
|
||||||
|
- **Better error handling** - handle failures gracefully
|
||||||
|
- **Documentation updates** - reflect actual current state
|
||||||
|
|
||||||
|
## 📊 **Current Status Metrics**
|
||||||
|
|
||||||
|
### **✅ Completed (Basic)**
|
||||||
|
- **Core Components**: 12/12 building/compiling
|
||||||
|
- **Alternative Solution**: 6/6 variants have basic structure
|
||||||
|
- **Testing Framework**: Basic testing scripts working
|
||||||
|
- **Documentation**: Basic documentation available
|
||||||
|
- **End-to-End Pipeline**: Basic functionality working
|
||||||
|
|
||||||
|
### **🔄 In Progress (Significant Work Needed)**
|
||||||
|
- **OSTree Repository Generation**: Basic functionality, needs improvement
|
||||||
|
- **Variant Package Lists**: Basic structure, needs refinement
|
||||||
|
- **Post-Processing**: Basic functionality, needs enhancement
|
||||||
|
- **Integration Testing**: Basic testing, needs comprehensive validation
|
||||||
|
|
||||||
|
### **📈 Current Status**
|
||||||
|
- **Variant Builds**: 6/6 (100%) - All variants have basic structure
|
||||||
|
- **OSTree Operations**: Basic - Repository management working but limited
|
||||||
|
- **Integration Testing**: Basic - End-to-end pipeline functional but needs work
|
||||||
|
|
||||||
|
## 🎯 **Strategic Impact**
|
||||||
|
|
||||||
|
### **1. Problem Addressed**
|
||||||
|
- **apt-ostree Limitations**: Identified and started working around mock package database issues
|
||||||
|
- **Debian Atomic Pipeline**: Basic pipeline working, but needs significant development
|
||||||
|
- **Bootable Artifacts**: Can generate OSTree commits, but not yet bootable images
|
||||||
|
|
||||||
|
### **2. Architecture Benefits**
|
||||||
|
- **Direct Control**: More control over build process than incomplete upstream tools
|
||||||
|
- **Real Packages**: Uses actual Debian repositories, not mock data
|
||||||
|
- **Extensible**: Framework exists for adding variants and customizations
|
||||||
|
- **Learning**: Provides insights into what Debian Atomic needs
|
||||||
|
|
||||||
|
### **3. Community Value**
|
||||||
|
- **Debian Atomic**: Early prototype showing potential approach
|
||||||
|
- **Fedora Parity**: Long way from achieving feature parity with Fedora Atomic
|
||||||
|
- **Open Source**: Basic framework available for community development
|
||||||
|
- **Documentation**: Basic documentation for continued development
|
||||||
|
|
||||||
|
## 🔮 **Future Development**
|
||||||
|
|
||||||
|
### **1. Short Term (Next 2 Weeks)**
|
||||||
|
- [ ] Fix basic OSTree repository generation issues
|
||||||
|
- [ ] Improve variant package lists and dependencies
|
||||||
|
- [ ] Basic deb-bootc-image-builder integration testing
|
||||||
|
- [ ] Improve post-processing and system configuration
|
||||||
|
|
||||||
|
### **2. Medium Term (Next Month)**
|
||||||
|
- [ ] Generate basic bootable images (even if limited functionality)
|
||||||
|
- [ ] Improve testing framework and validation
|
||||||
|
- [ ] Better error handling and debugging
|
||||||
|
- [ ] Refine variant configurations
|
||||||
|
|
||||||
|
### **3. Long Term (Next Quarter)**
|
||||||
|
- [ ] Functional bootable images with basic OS functionality
|
||||||
|
- [ ] Comprehensive testing and validation
|
||||||
|
- [ ] Community feedback and iteration
|
||||||
|
- [ ] Documentation improvements
|
||||||
|
|
||||||
|
## 🏆 **Key Achievements**
|
||||||
|
|
||||||
|
1. **✅ Basic Alternative Solution**: Working prototype of Debian Atomic approach
|
||||||
|
2. **✅ Variant Framework**: 6 desktop environments and minimal system (basic structure)
|
||||||
|
3. **✅ Real Debian Packages**: Uses actual Debian repositories (not mock data)
|
||||||
|
4. **✅ Basic Testing**: Testing framework exists but needs development
|
||||||
|
5. **✅ Development Ready**: Basic framework for continued development
|
||||||
|
6. **✅ Basic Documentation**: Documentation exists but needs improvement
|
||||||
|
|
||||||
|
## 🎊 **Conclusion**
|
||||||
|
|
||||||
|
We have implemented a basic alternative approach to Debian Atomic that shows promise but requires significant development:
|
||||||
|
|
||||||
|
- **Addresses Core Problem**: Started working around apt-ostree limitations
|
||||||
|
- **Provides Basic Pipeline**: Basic end-to-end Debian Atomic generation
|
||||||
|
- **Supports Variant Framework**: 6 desktop environments and minimal system (basic structure)
|
||||||
|
- **Enables Development**: Framework exists for continued development
|
||||||
|
- **Needs Significant Work**: Testing, validation, and refinement required
|
||||||
|
|
||||||
|
**The alternative solution shows potential but is not yet ready for production use.** The next phase focuses on improving the basic functionality and working toward bootable images.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
*This summary represents progress in the Debian Atomic project. We have a working prototype that demonstrates the approach but requires significant development to become a production-ready solution.*
|
||||||
71
test-bootstrap-tools.py
Normal file
71
test-bootstrap-tools.py
Normal file
|
|
@ -0,0 +1,71 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Test script for bootstrap tool detection and functionality
|
||||||
|
"""
|
||||||
|
|
||||||
|
from create_debian_atomic import DebianAtomicBuilder
|
||||||
|
import sys
|
||||||
|
|
||||||
|
def test_bootstrap_detection():
|
||||||
|
"""Test automatic bootstrap tool detection"""
|
||||||
|
print("Testing bootstrap tool detection...")
|
||||||
|
|
||||||
|
# Test with mmdebstrap preference (default)
|
||||||
|
print("\n1. Testing with mmdebstrap preference (default):")
|
||||||
|
try:
|
||||||
|
builder = DebianAtomicBuilder(use_mmdebstrap=True)
|
||||||
|
info = builder.get_bootstrap_info()
|
||||||
|
print(f" Detected tool: {info['tool']}")
|
||||||
|
print(f" Version: {info['version']}")
|
||||||
|
print(f" Available: {info['available']}")
|
||||||
|
print(f" Preferred: {'mmdebstrap' if info['preferred'] else 'debootstrap'}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f" Error: {e}")
|
||||||
|
|
||||||
|
# Test with debootstrap preference
|
||||||
|
print("\n2. Testing with debootstrap preference:")
|
||||||
|
try:
|
||||||
|
builder = DebianAtomicBuilder(use_mmdebstrap=False)
|
||||||
|
info = builder.get_bootstrap_info()
|
||||||
|
print(f" Detected tool: {info['tool']}")
|
||||||
|
print(f" Version: {info['version']}")
|
||||||
|
print(f" Available: {info['available']}")
|
||||||
|
print(f" Preferred: {'mmdebstrap' if info['preferred'] else 'debootstrap'}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f" Error: {e}")
|
||||||
|
|
||||||
|
# Test variant listing
|
||||||
|
print("\n3. Testing variant listing:")
|
||||||
|
try:
|
||||||
|
builder = DebianAtomicBuilder()
|
||||||
|
variants = builder.list_variants()
|
||||||
|
print(f" Available variants: {', '.join(variants)}")
|
||||||
|
except Exception as e:
|
||||||
|
print(f" Error: {e}")
|
||||||
|
|
||||||
|
def test_bootstrap_commands():
|
||||||
|
"""Test bootstrap command generation"""
|
||||||
|
print("\n4. Testing bootstrap command generation:")
|
||||||
|
try:
|
||||||
|
builder = DebianAtomicBuilder()
|
||||||
|
print(f" Using tool: {builder.bootstrap_tool}")
|
||||||
|
|
||||||
|
# Show what command would be run for minimal variant
|
||||||
|
packages = builder.get_packages_for_variant("minimal")
|
||||||
|
print(f" Packages for minimal: {len(packages)} packages")
|
||||||
|
print(f" First 5 packages: {', '.join(packages[:5])}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f" Error: {e}")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
print("🔧 Bootstrap Tool Testing")
|
||||||
|
print("=" * 40)
|
||||||
|
|
||||||
|
test_bootstrap_detection()
|
||||||
|
test_bootstrap_commands()
|
||||||
|
|
||||||
|
print("\n✅ Testing completed!")
|
||||||
|
print("\nTo test actual building, run:")
|
||||||
|
print(" python3 create-debian-atomic.py minimal --help")
|
||||||
|
print(" python3 create-debian-atomic.py minimal")
|
||||||
Loading…
Add table
Add a link
Reference in a new issue