forked from qualcomm-linux/qcom-deb-images
-
Notifications
You must be signed in to change notification settings - Fork 0
124 lines (112 loc) · 4.54 KB
/
debos.yml
File metadata and controls
124 lines (112 loc) · 4.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: Build debos recipe
on:
workflow_call:
outputs:
artifacts_url:
description: "URL to retrieve build artifacts"
value: ${{ jobs.build-debos.outputs.url }}
# only need permission to read repository; implicitely set all other
# permissions to none
permissions:
contents: read
security-events: read # This is required to handle authentication to our artifact publishing API
env:
# github runs are only unique per repository and may also be re-run; create a
# build id for the current run
BUILD_ID: ${{ github.repository }}-${{ github.run_id }}-${{ github.run_attempt }}
FILESERVER_URL: https://quic-yocto-fileserver-1029608027416.us-central1.run.app
# cancel in progress builds for this workflow triggered by the same ref
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build-debos:
outputs:
url: ${{ steps.upload_artifacts.outputs.url }}
runs-on: [self-hosted, qcom-u2404, arm64]
container:
image: debian:trixie
volumes:
- /efs/qli/metaqcom/gh-runners/quic-yocto/downloads:/fileserver-downloads
options: --privileged
steps:
# make sure we have latest packages first, to get latest fixes and to
# avoid an automated update while we're building
- name: Update OS packages
run: |
set -ux
apt update
apt -y upgrade
apt -y full-upgrade
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Copy Linux deb and U-Boot for RB1 from fileserver space for downloads
run: |
set -ux
mkdir -v debos-recipes/local-debs
dir="/fileserver-downloads/qcom-deb-images"
# copy linux-image but not the -dbg e.g.
# linux-image-6.15.0-..._6.15.0...-1_arm64.deb but not
# linux-image-6.15.0-...-dbg_6.15.0...-1_arm64.deb
find "${dir}/linux-deb-latest/" \
-name linux-image\*.deb \
-not -name linux-image\*-dbg_\*.deb \
-exec cp -av '{}' debos-recipes/local-debs/ \;
# copy U-Boot RB1 binary
cp -av "${dir}/u-boot-rb1-latest/rb1-boot.img" .
# mtools is needed for the flash recipe
- name: Install debos and dependencies of the recipes
run: apt -y install debos mtools
- name: Build rootfs with debos
run: |
set -ux
debos -t xfcedesktop:true -t localdebs:local-debs/ \
debos-recipes/qualcomm-linux-debian-rootfs.yaml
- name: Build UFS and SD card images with debos
run: |
set -ux
# debos tries KVM and UML as backends, and falls back to
# building directly on the host, but that requires loop
# devices; use qemu backend explicitly even if it's slower;
# qemu backend also requires to set scratchsize, otherwise the
# whole build is done from memory and the out of memory killer
# gets triggered
debos -b qemu --scratchsize 4GiB -t imagetype:ufs \
debos-recipes/qualcomm-linux-debian-image.yaml
debos -b qemu --scratchsize 4GiB -t imagetype:sdcard \
debos-recipes/qualcomm-linux-debian-image.yaml
- name: Build flashable files with debos
run: |
set -ux
debos -t u_boot_rb1:rb1-boot.img \
debos-recipes/qualcomm-linux-debian-flash.yaml
- name: Upload artifacts to fileserver space for builds
id: upload_artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
set -ux
# python3-requests is used by publish_aritfacts.py
apt -y install python3-requests
# create a directory for the current run
export BUILD_DIR="/tmp/${BUILD_ID}"
mkdir -vp "${BUILD_DIR}"
# copy output files
cp -av rootfs.tar.gz "${BUILD_DIR}"
cp -av dtbs.tar.gz "${BUILD_DIR}"
cp -av disk-ufs.img.gz "${BUILD_DIR}"
cp -av disk-sdcard.img.gz "${BUILD_DIR}"
# TODO: separate flash_* directories between UFS and eMMC
tar -cvf "${BUILD_DIR}"/flash-ufs.tar.gz \
disk-ufs.img1 \
disk-ufs.img2 \
flash_rb3*
tar -cvf "${BUILD_DIR}"/flash-emmc.tar.gz \
disk-sdcard.img1 \
disk-sdcard.img2 \
flash_rb1*
# instruct fileserver to publish this directory
export URL="${FILESERVER_URL}/${BUILD_ID}/"
.github/workflows/publish_artifacts.py
echo Image available at: ${URL}