Skip to content

Commit a88ad9a

Browse files
Add support for debian sid
Signed-off-by: Simon Beaudoin <sbeaudoi@qti.qualcomm.com>
1 parent d5f0ff5 commit a88ad9a

File tree

4 files changed

+141
-1
lines changed

4 files changed

+141
-1
lines changed

.github/actions/build_container/action.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,6 @@ runs:
3737
echo ${{inputs.token}} | docker login ghcr.io -u ${{inputs.username}} --password-stdin
3838
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:${{inputs.arch}}-noble
3939
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:${{inputs.arch}}-questing
40+
docker push ghcr.io/${{env.QCOM_ORG_NAME}}/${{env.IMAGE_NAME}}:${{inputs.arch}}-sid
4041
4142

docker/Dockerfile.amd64.sid

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
2+
# syntax=docker/dockerfile:1.6
3+
4+
# Debian sid (unstable) base image
5+
FROM debian:sid
6+
7+
# Avoid interactive prompts during apt operations
8+
ENV DEBIAN_FRONTEND=noninteractive
9+
10+
# Base tooling for Debian packaging + chroot creation
11+
# (eatmydata/ccache are nice QoL additions; remove if you prefer)
12+
RUN apt-get update && apt-get install -y \
13+
ca-certificates gnupg \
14+
curl git jq tree gh \
15+
sbuild schroot debootstrap \
16+
git-buildpackage devscripts \
17+
build-essential debhelper \
18+
abigail-tools \
19+
eatmydata ccache \
20+
&& rm -rf /var/lib/apt/lists/*
21+
22+
# Force sbuild to use the schroot backend.
23+
# sbuild-createchroot is for schroot-managed chroots; this avoids the "unshare" warning.
24+
RUN mkdir -p /root/.config/sbuild && \
25+
printf '%s\n' \
26+
'$chroot_mode = "schroot";' \
27+
'$schroot = "schroot";' \
28+
> /root/.config/sbuild/config.pl
29+
30+
# Optional list of extra packages to seed into the chroot during creation.
31+
COPY extra-packages.txt /tmp/extra-packages.txt
32+
33+
# Create a Debian sid sbuild chroot and prepare it for cross-building to arm64.
34+
RUN set -eux; \
35+
EXTRA_PACKAGES="$(tr -s '[:space:]' ',' < /tmp/extra-packages.txt || true)"; \
36+
\
37+
# Create the chroot from Debian mirrors (NOT Ubuntu) with Debian components.
38+
sbuild-createchroot \
39+
--arch=amd64 \
40+
--components=main,contrib,non-free,non-free-firmware \
41+
${EXTRA_PACKAGES:+--include="$EXTRA_PACKAGES"} \
42+
sid /srv/chroot/sid http://deb.debian.org/debian; \
43+
\
44+
# Configure the chroot's apt sources + enable multi-arch + install cross toolchain.
45+
chroot /srv/chroot/sid /bin/bash -lc '\
46+
set -eux; \
47+
# Minimal, correct sources for Debian sid. Add contrib/non-free only if needed.
48+
printf "%s\n" \
49+
"deb http://deb.debian.org/debian sid main" \
50+
"# deb http://deb.debian.org/debian sid contrib non-free non-free-firmware" \
51+
> /etc/apt/sources.list; \
52+
\
53+
# Enable arm64 multi-arch so sbuild can satisfy Build-Depends for the host arch.
54+
dpkg --add-architecture arm64; \
55+
apt-get update; \
56+
apt-get -y upgrade; \
57+
\
58+
# Cross toolchain for arm64 + a small baseline of arm64 libs.
59+
# sbuild will install package-specific B-Ds later (often :arm64 automatically).
60+
apt-get install -y --no-install-recommends \
61+
crossbuild-essential-arm64 \
62+
pkg-config \
63+
libc6:arm64 libc6-dev:arm64 linux-libc-dev:arm64 \
64+
libstdc++6:arm64 \
65+
lintian:amd64; \
66+
\
67+
# Keep the chroot lean
68+
apt-get clean; rm -rf /var/lib/apt/lists/* \
69+
'
70+
71+
# Workspace for mounting sources/outputs (your script already bind-mounts /workspace)
72+
WORKDIR /workspace
73+
74+
# Default shell
75+
CMD ["bash"]

docker/Dockerfile.arm64.sid

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
2+
# syntax=docker/dockerfile:1.6
3+
4+
FROM debian:sid
5+
6+
# Avoid interactive prompts during apt operations
7+
ENV DEBIAN_FRONTEND=noninteractive
8+
9+
# Base tooling for Debian packaging + chroot creation
10+
# (eatmydata/ccache are nice QoL additions; remove if you prefer)
11+
RUN apt-get update && apt-get install -y \
12+
ca-certificates gnupg \
13+
curl git jq tree gh \
14+
sbuild schroot debootstrap \
15+
git-buildpackage devscripts \
16+
build-essential debhelper \
17+
abigail-tools \
18+
eatmydata ccache \
19+
&& rm -rf /var/lib/apt/lists/*
20+
21+
# Force sbuild to use the schroot backend.
22+
# sbuild-createchroot is for schroot-managed chroots; this avoids the "unshare" warning.
23+
RUN mkdir -p /root/.config/sbuild && \
24+
printf '%s\n' \
25+
'$chroot_mode = "schroot";' \
26+
'$schroot = "schroot";' \
27+
> /root/.config/sbuild/config.pl
28+
29+
# Optional list of extra packages to seed into the chroot during creation.
30+
COPY extra-packages.txt /tmp/extra-packages.txt
31+
32+
RUN set -eux; \
33+
EXTRA_PACKAGES="$(tr -s '[:space:]' ',' < /tmp/extra-packages.txt || true)"; \
34+
\
35+
# Create the chroot for arm64 builder/host (native build)
36+
sbuild-createchroot \
37+
--arch=arm64 \
38+
--components=main,contrib,non-free,non-free-firmware \
39+
${EXTRA_PACKAGES:+--include="$EXTRA_PACKAGES"} \
40+
sid /srv/chroot/sid http://deb.debian.org/debian; \
41+
\
42+
# Configure the chroot's apt sources and install baseline build tools.
43+
chroot /srv/chroot/sid /bin/bash -lc '\
44+
set -eux; \
45+
printf "%s\n" \
46+
"deb http://deb.debian.org/debian sid main" \
47+
"# deb http://deb.debian.org/debian sid contrib non-free non-free-firmware" \
48+
> /etc/apt/sources.list; \
49+
apt-get update; \
50+
apt-get -y upgrade; \
51+
apt-get install -y --no-install-recommends \
52+
pkg-config \
53+
libc6 libc6-dev linux-libc-dev \
54+
libstdc++6 \
55+
lintian; \
56+
apt-get clean; rm -rf /var/lib/apt/lists/* \
57+
'
58+
59+
# Workspace for mounting sources/outputs (your script already bind-mounts /workspace)
60+
WORKDIR /workspace
61+
62+
# Default shell
63+
CMD ["bash"]

docker_deb_build.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def parse_arguments() -> argparse.Namespace:
4646

4747
parser.add_argument("--distro",
4848
type=str,
49-
choices=['noble', 'questing'],
49+
choices=['noble', 'questing', 'sid'],
5050
default='noble',
5151
help="The target distribution for the package build.")
5252

@@ -358,6 +358,7 @@ def main() -> None:
358358
if args.rebuild:
359359
rebuild_docker_image(image_base, build_arch, 'noble')
360360
rebuild_docker_image(image_base, build_arch, 'questing')
361+
rebuild_docker_image(image_base, build_arch, 'sid')
361362
sys.exit(0)
362363

363364
# Make sure source and output dirs are absolute paths

0 commit comments

Comments
 (0)