Skip to content

Commit 523802c

Browse files
authored
Merge pull request #64 from lool/pkg-builds
Initial version of overlay to build Debian packages
2 parents f709354 + 387b499 commit 523802c

File tree

9 files changed

+909
-0
lines changed

9 files changed

+909
-0
lines changed
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: Build a Debian package using an overlay recipe
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
config:
7+
description: 'Path to the YAML configuration file'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
arch: [amd64, arm64]
16+
runs-on: [self-hosted, qcom-u2404, "${{ matrix.arch }}"]
17+
container:
18+
image: debian:trixie
19+
options: --privileged # Required for chroot creation
20+
steps:
21+
- name: Update OS packages
22+
run: |
23+
set -ux
24+
apt update
25+
DEBIAN_FRONTEND=noninteractive apt -y upgrade
26+
DEBIAN_FRONTEND=noninteractive apt -y full-upgrade
27+
28+
- name: Checkout repository
29+
uses: actions/checkout@v4
30+
31+
- name: Install sbuild and dependencies
32+
run: |
33+
set -ux
34+
DEBIAN_FRONTEND=noninteractive \
35+
apt -y install --no-install-recommends \
36+
sudo sbuild gnupg debootstrap debian-archive-keyring schroot
37+
38+
- name: Set up sbuild user
39+
run: |
40+
set -ux
41+
useradd -m builder
42+
echo 'builder ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
43+
mkdir -p /etc/sbuild
44+
echo 'builder' > /etc/sbuild/buildd.conf
45+
sbuild-adduser builder
46+
47+
- name: Create sbuild chroot for target suite
48+
run: |
49+
set -ux
50+
# to read yaml config
51+
DEBIAN_FRONTEND=noninteractive \
52+
apt -y install --no-install-recommends python3 python3-yaml
53+
# read suite from yaml
54+
suite="$(python3 -c "import yaml; print(yaml.safe_load(open('${CONFIG_PATH}'))['suite'])")"
55+
# defaults args
56+
extra_repo=""
57+
debootstrap_suite="${suite}"
58+
chroot_prefix=""
59+
if [ "${suite}" = experimental ]; then
60+
# special extra args for experimental
61+
debootstrap_suite='unstable'
62+
extra_repo='--extra-repository=deb http://deb.debian.org/debian experimental main'
63+
chroot_prefix='--chroot-prefix=experimental'
64+
fi
65+
sudo sbuild-createchroot --include=eatmydata,ccache \
66+
${extra_repo:+"${extra_repo}"} \
67+
${chroot_prefix:+"${chroot_prefix}"} \
68+
"${debootstrap_suite}" \
69+
"/srv/chroot/${suite}-${{ matrix.runs_on }}-sbuild" \
70+
http://deb.debian.org/debian
71+
72+
- name: Download and build deb package
73+
run: |
74+
set -ux
75+
# install dependencies
76+
DEBIAN_FRONTEND=noninteractive \
77+
apt -y install --no-install-recommends \
78+
python3 devscripts patch python3-yaml debian-keyring
79+
# create output dir
80+
mkdir -v upload
81+
chmod a+rw upload
82+
sudo -u builder python3 scripts/build-deb.py \
83+
--config "${CONFIG_PATH}" --output-dir upload
84+
85+
- name: Upload as private artifacts
86+
uses: qualcomm-linux/upload-private-artifact-action@v1
87+
with:
88+
path: upload
89+
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
diff -Nru mesa-25.0.1/debian/changelog mesa-25.0.1/debian/changelog
2+
--- mesa-25.0.1/debian/changelog 2025-03-06 11:07:00.000000000 +0000
3+
+++ mesa-25.0.1/debian/changelog 2025-03-06 18:13:37.000000000 +0000
4+
@@ -1,3 +1,11 @@
5+
+mesa (25.0.1-1qcom1) unstable; urgency=medium
6+
+
7+
+ * patches: add fd_dev_gpu_id-bail-out-on-unsupported-GPU-ids; fixes segfault
8+
+ when trying to use the (currently unsupported GPU) on Qualcomm RB1; from
9+
+ upstream gitlab's MR #33830.
10+
+
11+
+ -- Loïc Minier <[email protected]> Thu, 06 Mar 2025 18:13:37 +0000
12+
+
13+
mesa (25.0.1-1) unstable; urgency=medium
14+
15+
[ Timo Aaltonen ]
16+
diff -Nru mesa-25.0.1/debian/patches/fd_dev_gpu_id-bail-out-on-unsupported-GPU-ids.diff mesa-25.0.1/debian/patches/fd_dev_gpu_id-bail-out-on-unsupported-GPU-ids.diff
17+
--- mesa-25.0.1/debian/patches/fd_dev_gpu_id-bail-out-on-unsupported-GPU-ids.diff 1970-01-01 00:00:00.000000000 +0000
18+
+++ mesa-25.0.1/debian/patches/fd_dev_gpu_id-bail-out-on-unsupported-GPU-ids.diff 2025-03-06 18:12:57.000000000 +0000
19+
@@ -0,0 +1,62 @@
20+
+From a255790e7e62904a5470a1edf6fc8aea5d7cc209 Mon Sep 17 00:00:00 2001
21+
+From: =?UTF-8?q?Lo=C3=AFc=20Minier?= <[email protected]>
22+
+Date: Fri, 28 Feb 2025 20:12:11 +0000
23+
+Subject: [PATCH] fd_dev_gpu_id: bail out on unsupported GPU ids
24+
+MIME-Version: 1.0
25+
+Content-Type: text/plain; charset=UTF-8
26+
+Content-Transfer-Encoding: 8bit
27+
+
28+
+Signed-off-by: Loïc Minier <[email protected]>
29+
+---
30+
+ src/freedreno/common/freedreno_dev_info.h | 9 +++++++++
31+
+ src/freedreno/drm/freedreno_pipe.c | 7 +++++++
32+
+ 2 files changed, 16 insertions(+)
33+
+
34+
+diff --git a/src/freedreno/common/freedreno_dev_info.h b/src/freedreno/common/freedreno_dev_info.h
35+
+index b925d778bb5..a3858bc20c3 100644
36+
+--- a/src/freedreno/common/freedreno_dev_info.h
37+
++++ b/src/freedreno/common/freedreno_dev_info.h
38+
+@@ -9,6 +9,7 @@
39+
+
40+
+ #include <assert.h>
41+
+ #include <stdbool.h>
42+
++#include <stddef.h>
43+
+ #include <stdint.h>
44+
+
45+
+ #ifdef __cplusplus
46+
+@@ -379,6 +380,14 @@ fd_dev_gpu_id(const struct fd_dev_id *id)
47+
+ /* Unmodified dev info as defined in freedreno_devices.py */
48+
+ const struct fd_dev_info *fd_dev_info_raw(const struct fd_dev_id *id);
49+
+
50+
++/* Helper to check if GPU is known before going any further */
51+
++static uint8_t
52+
++fd_dev_is_supported(const struct fd_dev_id *id) {
53+
++ assert(id);
54+
++ assert(id->gpu_id || id->chip_id);
55+
++ return fd_dev_info_raw(id) != NULL;
56+
++}
57+
++
58+
+ /* Final dev info with dbg options and everything else applied. */
59+
+ const struct fd_dev_info fd_dev_info(const struct fd_dev_id *id);
60+
+
61+
+diff --git a/src/freedreno/drm/freedreno_pipe.c b/src/freedreno/drm/freedreno_pipe.c
62+
+index ab53c55152d..8373488368a 100644
63+
+--- a/src/freedreno/drm/freedreno_pipe.c
64+
++++ b/src/freedreno/drm/freedreno_pipe.c
65+
+@@ -45,6 +45,13 @@ fd_pipe_new2(struct fd_device *dev, enum fd_pipe_id id, uint32_t prio)
66+
+ fd_pipe_get_param(pipe, FD_CHIP_ID, &val);
67+
+ pipe->dev_id.chip_id = val;
68+
+
69+
++ if (!fd_dev_is_supported(&pipe->dev_id)) {
70+
++ ERROR_MSG("unsupported GPU id 0x%" PRIx32 " / chip id 0x%" PRIx64,
71+
++ pipe->dev_id.gpu_id,
72+
++ pipe->dev_id.chip_id);
73+
++ return NULL;
74+
++ }
75+
++
76+
+ pipe->is_64bit = fd_dev_64b(&pipe->dev_id);
77+
+
78+
+ /* Use the _NOSYNC flags because we don't want the control_mem bo to hold
79+
+--
80+
+2.47.2
81+
+
82+
diff -Nru mesa-25.0.1/debian/patches/series mesa-25.0.1/debian/patches/series
83+
--- mesa-25.0.1/debian/patches/series 2025-03-06 11:00:09.000000000 +0000
84+
+++ mesa-25.0.1/debian/patches/series 2025-03-06 18:12:57.000000000 +0000
85+
@@ -1,3 +1,4 @@
86+
path_max.diff
87+
src_glx_dri_common.h.diff
88+
disable_ppc64el_assembly.diff
89+
+fd_dev_gpu_id-bail-out-on-unsupported-GPU-ids.diff
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dsc_url: "https://snapshot.debian.org/archive/debian/20250306T150220Z/pool/main/m/mesa/mesa_25.0.1-1.dsc"
2+
dsc_sha256sum: "e17dd4ba98e958dd07c395ee679dac0448d1ec3d97ab6abc71b309eb0480e623"
3+
debdiff_file: "mesa_25.0.1-1qcom1.debdiff"
4+
suite: "trixie"

0 commit comments

Comments
 (0)