Skip to content

Commit 70c600c

Browse files
committed
Add a GitHub workflow for building images
Signed-off-by: Jens Reidel <[email protected]>
1 parent 07c80e6 commit 70c600c

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

.github/workflows/build-images.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Build images
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
strategy:
8+
fail-fast: false
9+
matrix:
10+
device: [sm7150-google-sunfish, sm7150-xiaomi-davinci, sm7150-xiaomi-surya-huaxing, sm7150-xiaomi-surya-tianma, sm7150-xiaomi-sweet, sm7150-xiaomi-tucana]
11+
usb_mode: [host, peripheral]
12+
13+
name: Build ${{ matrix.device }}
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout sources
18+
uses: actions/checkout@v4
19+
20+
- name: Install dependencies
21+
run: |
22+
sudo apt update
23+
sudo apt install -y --no-install-recommends gcc-aarch64-linux-gnu libgnutls28-dev
24+
25+
# mkbootimg in Ubuntu repos is broken, so use the forked C variant
26+
- name: Build mkbootimg
27+
run: |
28+
git clone https://github.com/osm0sis/mkbootimg
29+
cd mkbootimg
30+
CFLAGS=-Wstringop-overflow=0 make mkbootimg
31+
cd ..
32+
33+
- name: Configure USB as host mode
34+
if: ${{ matrix.usb_mode == 'host' }}
35+
run: |
36+
sed -i 's/dr_mode = "otg"/dr_mode = "host"/g' dts/upstream/src/arm64/qcom/sm7150-xiaomi-common.dtsi
37+
sed -i 's/dr_mode = "otg"/dr_mode = "host"/g' dts/upstream/src/arm64/qcom/sm7150-google-sunfish.dts
38+
39+
- name: Configure U-Boot
40+
run: |
41+
make CROSS_COMPILE=aarch64-linux-gnu- O=.output qcom_defconfig qcom-phone.config
42+
43+
- name: Build U-Boot
44+
run: |
45+
make CROSS_COMPILE=aarch64-linux-gnu- O=.output -j$(nproc) CONFIG_DEFAULT_DEVICE_TREE=qcom/${{ matrix.device }}
46+
47+
- name: Assemble Android boot.img
48+
run: |
49+
gzip .output/u-boot-nodtb.bin -c > .output/u-boot-nodtb.bin.gz
50+
cat .output/u-boot-nodtb.bin.gz .output/dts/upstream/src/arm64/qcom/${{ matrix.device }}.dtb > .output/uboot-dtb
51+
./mkbootimg/mkbootimg --base '0x0' --kernel_offset '0x00008000' --pagesize '4096' --kernel .output/uboot-dtb -o .output/u-boot.img
52+
53+
- name: Upload artifact
54+
uses: actions/upload-artifact@v4
55+
with:
56+
name: u-boot-${{ matrix.device }}-usb-${{ matrix.usb_mode }}.img
57+
path: .output/u-boot.img

0 commit comments

Comments
 (0)