Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install --yes \
build-essential \
debhelper \
git \
meson \
libglib2.0-dev \
Expand Down
49 changes: 48 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,56 @@ jobs:
path: partup-${{ github.ref_name }}-${{ env.ARCH }}
if-no-files-found: error

debian-package:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform:
- 'linux/amd64'
- 'linux/arm64/v8'
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install qemu-user-static
- name: Get architecture
run: |
ARCH=$(echo "${{ matrix.platform }}" | cut -d / -f 2- | tr -d /)
echo "ARCH=$ARCH" >> $GITHUB_ENV
- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
username: ${{ github.actor }}
password: ${{ github.token }}
registry: ghcr.io
- name: Prepare container for ${{ matrix.platform }}
run: |
podman run --name partupci -di --platform ${{ matrix.platform }} -v "$PWD":/partup -w /partup ghcr.io/phytec/partup/partup-ci:latest bash
podman logs partupci
podman exec -i partupci uname -a
- name: Build
run: |
podman exec -i partupci sh -c 'tar -czf ../partup_$(git describe --tags --abbrev=0 | cut -c 2-).orig.tar.gz .'
podman exec -i partupci dpkg-buildpackage -us -uc
DEB_FILE=$(podman exec partupci sh -c "ls /*.deb" | head -n 1)
podman cp partupci:$DEB_FILE .
echo "DEB_FILE=$(basename $DEB_FILE)" >> $GITHUB_ENV
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: partup-debian-package-${{ github.ref_name }}-${{ env.ARCH }}
path: ${{ env.DEB_FILE }}
if-no-files-found: error

create-release:
runs-on: ubuntu-latest
needs:
- sources
- static-build
- debian-package
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -94,7 +139,8 @@ jobs:
run: |
mv partup-sources-${{ github.ref_name }}/* .
mv partup-static-build-${{ github.ref_name }}-*/* .
sha256sum partup-${{ env.VERSION_NUMBER }}.tar.gz partup-${{ github.ref_name }}-* > sha256sum.txt
mv partup-debian-package-${{ github.ref_name }}-*/* .
sha256sum partup-${{ env.VERSION_NUMBER }}.tar.gz partup-${{ github.ref_name }}-* partup_*.deb > sha256sum.txt
cat sha256sum.txt
- name: Construct changelog for this release
run: |
Expand All @@ -114,4 +160,5 @@ jobs:
files: |
partup-${{ env.VERSION_NUMBER }}.tar.gz
partup-${{ github.ref_name }}-*
partup_*.deb
sha256sum.txt
5 changes: 5 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
partup (3.0.0-1) unstable; urgency=medium

* Initial packaging

-- Martin Schwan <m.schwan@phytec.de> Wed, 29 Oct 2025 14:07:15 +0100
31 changes: 31 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Source: partup
Section: utils
Priority: optional
Maintainer: Martin Schwan <m.schwan@phytec.de>
Build-Depends:
debhelper-compat (=13),
libglib2.0-dev,
libyaml-dev,
libparted-dev,
util-linux,
meson
Standards-Version: 4.7.2
Homepage: https://github.com/phytec/partup
Vcs-Git: https://github.com/phytec/partup.git
Vcs-Browser: https://github.com/phytec/partup

Package: partup
Architecture: any
Depends:
libglib2.0-0t64,
libyaml-0-2,
libparted,
util-linux,
udev,
squashfs-tools,
dosfstools,
e2fsprogs,
mtd-utils
Description: partup -- System initialization program
partup is a program used for initializing flash memory on a target device
using a predefined layout.
8 changes: 8 additions & 0 deletions debian/copyright
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0
Upstream-Name: partup
Upstream-Contact: https://github.com/phytec/partup
Source: https://github.com/phytec/partup

Files: *
Copyright: Copyright 2025 PHYTEC Messtechnik GmbH
License: GPL-3+
1 change: 1 addition & 0 deletions debian/dirs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
usr/bin
Empty file added debian/install
Empty file.
19 changes: 19 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/make -f

export DH_VERBOSE=1

%:
dh $@

override_dh_auto_configure:
rm -rf build
meson setup build --prefix=/usr --buildtype=release

override_dh_auto_build:
meson compile -C build

override_dh_auto_install:
meson install -C build --destdir=$(shell pwd)/debian/partup

override_dh_strip:
dh_strip
1 change: 1 addition & 0 deletions debian/source/format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.0 (quilt)
1 change: 1 addition & 0 deletions tools/debian-package/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
partup_*.deb
17 changes: 17 additions & 0 deletions tools/debian-package/Containerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM ubuntu:24.04

ENV DEBIAN_FRONTEND=noninteractive
RUN apt-get update && \
apt-get install --yes \
debhelper \
git \
meson \
libglib2.0-dev \
libyaml-dev \
libparted-dev && \
rm -rf /var/lib/apt/lists/*

RUN git clone --branch $PARTUP_BRANCH $PARTUP_REPO && \
cd partup && \
tar -czf ../partup_$(git describe --tags --abbrev=0 | cut -c 2-).orig.tar.gz . && \
dpkg-buildpackage -us -uc
68 changes: 68 additions & 0 deletions tools/debian-package/build-debian-package
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-3.0-or-later
# Copyright (c) 2025 PHYTEC Messtechnik GmbH
# Author: Martin Schwan <m.schwan@phytec.de>

BRANCH=main
PLATFORM=linux/amd64,linux/arm64
REPO=https://github.com/phytec/partup

usage() {
printf "\
Usage:
$(basename $0) [OPTION…]

Build partup Debian package for multiple Ubuntu platforms using podman
containers.

Options:
-b, --branch An optional tag or branch name to use from partup's remote
repository (default \"$BRANCH\")
-p, --platform A comma separated list of platforms to build for
(default \"$PLATFORM\")
-r, --repo The remote URL to clone partup from
(default \"$REPO\")
-h, --help Show help options
"
}

ARGS=$(getopt -n $(basename $0) -o b:p:r:h -l branch:,platform:,repo:,help -- "$@")
VALID_ARGS=$?
if [ "$VALID_ARGS" != "0" ]; then
usage
exit 2
fi

eval set -- "$ARGS"
while :
do
case "$1" in
-b | --branch) BRANCH="$2"; shift 2;;
-p | --platform) PLATFORM="$2"; shift 2;;
-r | --repo) REPO="$2"; shift 2;;
-h | --help) usage; exit 0;;
--) shift; break;;
*) printf "ERROR: Invalid option \"$1\"\n"; usage; exit 2;;
esac
done

podman build \
--env PARTUP_BRANCH=$BRANCH \
--env PARTUP_REPO=$REPO \
--jobs $(nproc) \
--manifest partup-deb \
-t partup-deb:$BRANCH \
--platform $PLATFORM \
.

for P in $(printf "$PLATFORM" | tr ',' ' '); do
ARCH=$(printf "$P" | cut -f2 -d '/')
LATEST_TAG=$(git describe --tags --abbrev=0 | cut -c 2-)
podman run -td --rm --name partup-deb-$ARCH --arch $ARCH partup-deb /bin/sh
DEB_FILE=$(podman exec partup-deb-$ARCH bash -c "ls /*.deb" | head -n 1)
podman cp partup-deb-$ARCH:$DEB_FILE .
podman stop --time 0 partup-deb-$ARCH
done

podman image rm -f partup-deb
podman manifest rm partup-deb