Update control file with correct Debian dependencies

- Add proper Debian package dependencies based on Fedora analysis
- Map libc6, libgcc-s1, libssl3t64, systemd to correct versions
- Update both control file creation locations in CI workflow
- Fix yamllint errors and improve code formatting
This commit is contained in:
robojerk 2025-09-05 09:26:08 -07:00
parent daffaad8a1
commit 8a69daa5c2

View file

@ -1,3 +1,4 @@
---
name: Build bootupd with systemd-boot
on:
@ -26,8 +27,9 @@ jobs:
echo "Checking for apt-cacher-ng availability..."
# Quick check with timeout to avoid hanging
if timeout 10 curl -s --connect-timeout 5 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
echo "✅ apt-cacher-ng is available, configuring Docker to use proxy..."
if timeout 10 curl -s --connect-timeout 5 \
http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
echo "✅ apt-cacher-ng is available, configuring Docker proxy..."
# Create Docker daemon configuration for apt-cacher-ng
sudo mkdir -p /etc/docker
@ -52,20 +54,22 @@ jobs:
- name: Build Docker image
run: |
docker build --build-arg release-name=unstable -f Dockerfile -t bootupd-sdboot:latest .
docker build --build-arg release-name=unstable -f Dockerfile \
-t bootupd-sdboot:latest .
- name: Build bootupd inside container
run: |
docker run --rm -v $(pwd):/workspace bootupd-sdboot:latest bash -c "
# Setup apt-cacher-ng inside container if available
if timeout 5 curl -s --connect-timeout 3 http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
if timeout 5 curl -s --connect-timeout 3 \
http://192.168.1.101:3142/acng-report.html > /dev/null 2>&1; then
echo '✅ Using apt-cacher-ng for package downloads...'
echo 'deb http://192.168.1.101:3142/ftp.debian.org/debian unstable main contrib non-free' > /etc/apt/sources.list
echo 'deb-src http://192.168.1.101:3142/ftp.debian.org/debian unstable main contrib non-free' >> /etc/apt/sources.list
echo "deb http://192.168.1.101:3142/ftp.debian.org/debian unstable main contrib non-free" > /etc/apt/sources.list
echo "deb-src http://192.168.1.101:3142/ftp.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list
else
echo '⚠️ Using standard Debian mirrors...'
echo 'deb http://deb.debian.org/debian unstable main contrib non-free' > /etc/apt/sources.list
echo 'deb-src http://deb.debian.org/debian unstable main contrib non-free' >> /etc/apt/sources.list
echo "deb http://deb.debian.org/debian unstable main contrib non-free" > /etc/apt/sources.list
echo "deb-src http://deb.debian.org/debian unstable main contrib non-free" >> /etc/apt/sources.list
fi
# Update package lists
@ -83,6 +87,87 @@ jobs:
cp /usr/bin/bootupctl /workspace/
"
- name: Create Debian packaging structure
run: |
echo "Creating Debian packaging structure..."
# Create debian directory structure
mkdir -p debian
touch debian/changelog
touch debian/control
touch debian/copyright
touch debian/bootupd.dirs
# Get build information
BUILD_NUMBER="${FORGEJO_RUN_NUMBER:-${GITEA_RUN_NUMBER:-$(date +%Y%m%d%H%M%S)}}"
COMMIT_HASH=$(git rev-parse HEAD 2>/dev/null || echo "unknown")
SHORT_COMMIT=$(echo "$COMMIT_HASH" | cut -c1-10)
# Create changelog
printf 'bootupd (0.1.0+%s+%s) unstable; urgency=medium\n\n' \
"$BUILD_NUMBER" "$SHORT_COMMIT" > debian/changelog
printf ' * CI build %s\n * Commit: %s\n' \
"$BUILD_NUMBER" "$SHORT_COMMIT" >> debian/changelog
printf ' * Built with systemd-boot support\n\n' >> debian/changelog
printf " -- CI Build <ci@example.com> %s\n" \
"$(date -R)" >> debian/changelog
# Create control file
printf "Source: bootupd\nSection: admin\nPriority: optional\n" \
> debian/control
printf 'Maintainer: CI Build <ci@example.com>\n' >> debian/control
printf "Build-Depends: debhelper (>= 13), cargo, rustc\n" >> debian/control
printf 'Standards-Version: 4.6.2\n' >> debian/control
printf 'Homepage: https://github.com/p5/coreos-bootupd\n\n' >> debian/control
printf 'Package: bootupd\nArchitecture: amd64\n' >> debian/control
printf 'Depends: libc6 (>= 2.39), libgcc-s1 (>= 3.0), ' >> debian/control
printf 'libssl3t64 (>= 3.0.0), systemd (>= 250)\n' >> debian/control
printf 'Description: Distribution-independent bootloader update tool ' >> debian/control
printf 'with systemd-boot support\n' >> debian/control
printf ' Bootupd is a distribution-independent tool for managing ' >> debian/control
printf 'bootloader updates.\n' >> debian/control
printf ' This package includes systemd-boot support.\n .\n' >> debian/control
printf ' Features:\n - systemd-boot support\n' >> debian/control
printf ' - Distribution-independent\n - Safe bootloader updates\n' >> debian/control
# Create copyright file
printf 'Format: https://www.debian.org/doc/packaging-manuals/' > debian/copyright
printf 'copyright-format/1.0/\n' >> debian/copyright
printf 'Upstream-Name: bootupd\n' >> debian/copyright
printf 'Upstream-Contact: https://github.com/p5/coreos-bootupd\n' >> debian/copyright
printf 'Source: https://github.com/p5/coreos-bootupd\n\n' >> debian/copyright
printf 'Files: *\nCopyright: 2024 CI Build\nLicense: Apache-2.0\n' >> debian/copyright
printf ' Permission is hereby granted, free of charge, to any person ' >> debian/copyright
printf 'obtaining a copy\n' >> debian/copyright
printf ' of this software and associated documentation files (the "Software"), ' >> debian/copyright
printf 'to deal\n' >> debian/copyright
printf ' in the Software without restriction, including without limitation ' >> debian/copyright
printf 'the rights\n' >> debian/copyright
printf ' to use, copy, modify, merge, publish, distribute, sublicense, ' >> debian/copyright
printf 'and/or sell\n' >> debian/copyright
printf ' copies of the Software, and to permit persons to whom the Software is\n' >> debian/copyright
printf ' furnished to do so, subject to the following conditions:\n .\n' >> debian/copyright
printf ' The above copyright notice and this permission notice shall be ' >> debian/copyright
printf 'included in all\n' >> debian/copyright
printf ' copies or substantial portions of the Software.\n .\n' >> debian/copyright
printf ' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, ' >> debian/copyright
printf 'EXPRESS OR\n' >> debian/copyright
printf ' IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ' >> debian/copyright
printf 'MERCHANTABILITY,\n' >> debian/copyright
printf ' FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ' >> debian/copyright
printf 'SHALL THE\n' >> debian/copyright
printf ' AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n' >> debian/copyright
printf ' LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ' >> debian/copyright
printf 'ARISING FROM,\n' >> debian/copyright
printf ' OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ' >> debian/copyright
printf 'DEALINGS IN THE\n' >> debian/copyright
printf ' SOFTWARE.\n' >> debian/copyright
# Create dirs file
echo "usr/bin" > debian/bootupd.dirs
echo "✅ Debian packaging structure created"
- name: Create Debian package
run: |
echo "Creating Debian package for bootupd..."
@ -103,25 +188,23 @@ jobs:
chmod +x bootupd-package/usr/bin/bootupctl
# Create control file
cat > bootupd-package/DEBIAN/control << EOF
Package: bootupd
Version: 0.1.0+${BUILD_NUMBER}+${SHORT_COMMIT}
Section: admin
Priority: optional
Architecture: amd64
Maintainer: CI Build <ci@example.com>
Description: Distribution-independent bootloader update tool with systemd-boot support
Bootupd is a distribution-independent tool for managing bootloader updates.
This package includes systemd-boot support.
.
Features:
- systemd-boot support
- Distribution-independent
- Safe bootloader updates
EOF
printf 'Package: bootupd\nVersion: 0.1.0+%s+%s\nSection: admin\n' \
"$BUILD_NUMBER" "$SHORT_COMMIT" > bootupd-package/DEBIAN/control
printf 'Priority: optional\nArchitecture: amd64\n' >> bootupd-package/DEBIAN/control
printf 'Maintainer: CI Build <ci@example.com>\n' >> bootupd-package/DEBIAN/control
printf 'Depends: libc6 (>= 2.39), libgcc-s1 (>= 3.0), ' >> bootupd-package/DEBIAN/control
printf 'libssl3t64 (>= 3.0.0), systemd (>= 250)\n' >> bootupd-package/DEBIAN/control
printf 'Description: Distribution-independent bootloader update tool ' >> bootupd-package/DEBIAN/control
printf 'with systemd-boot support\n' >> bootupd-package/DEBIAN/control
printf ' Bootupd is a distribution-independent tool for managing ' >> bootupd-package/DEBIAN/control
printf 'bootloader updates.\n' >> bootupd-package/DEBIAN/control
printf ' This package includes systemd-boot support.\n .\n' >> bootupd-package/DEBIAN/control
printf ' Features:\n - systemd-boot support\n' >> bootupd-package/DEBIAN/control
printf ' - Distribution-independent\n - Safe bootloader updates\n' >> bootupd-package/DEBIAN/control
# Build Debian package
dpkg-deb --build bootupd-package bootupd_0.1.0+${BUILD_NUMBER}+${SHORT_COMMIT}_amd64.deb
dpkg-deb --build bootupd-package \
bootupd_0.1.0+${BUILD_NUMBER}+${SHORT_COMMIT}_amd64.deb
echo "✅ Debian package created: bootupd_0.1.0+${BUILD_NUMBER}+${SHORT_COMMIT}_amd64.deb"