-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathTaskfile.yaml
More file actions
52 lines (47 loc) · 1.74 KB
/
Copy pathTaskfile.yaml
File metadata and controls
52 lines (47 loc) · 1.74 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
version: "3"
vars:
HELLO_DIR: payloads/aarch64-hello
HELLO_ELF: payloads/aarch64-hello/hello.elf
CBFSTOOL: '{{.CBFSTOOL | default "cbfstool"}}'
tasks:
build-images:
desc: Build the QEMU disk images
dir: images
cmds:
- make all
build-hello-payload:
desc: Build the aarch64 hello-world coreboot payload (uses a debian:bookworm container so no cross-gcc is required on the host)
dir: "{{.HELLO_DIR}}"
sources:
- hello.S
- hello.ld
generates:
- hello.elf
cmds:
- |
docker run --rm -v "$PWD":/work -w /work debian:bookworm bash -c '
set -e
export DEBIAN_FRONTEND=noninteractive
apt-get update -qq
apt-get install -y -qq gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
aarch64-linux-gnu-gcc -nostdlib -ffreestanding -c hello.S -o hello.o
aarch64-linux-gnu-ld -T hello.ld -nostdlib --no-warn-rwx-segments -o hello.elf hello.o
chown {{.USER_ID | default "1000"}}:{{.GROUP_ID | default "1000"}} hello.o hello.elf
'
- file hello.elf
inject-hello-payload:
desc: Bake the hello payload into an existing aarch64 coreboot.rom. Pass ROM=/path/to/coreboot.rom; the rom is patched in place.
deps: [build-hello-payload]
requires:
vars: [ROM]
cmds:
- "{{.CBFSTOOL}} {{.ROM}} remove -n fallback/payload 2>/dev/null || true"
- "{{.CBFSTOOL}} {{.ROM}} add-payload -f {{.HELLO_ELF}} -n fallback/payload -c lzma"
- "{{.CBFSTOOL}} {{.ROM}} print | grep fallback/payload"
build-aarch64-rom:
desc: End-to-end — build the payload, inject it into ROM. Pass ROM=/path/to/coreboot.rom.
requires:
vars: [ROM]
cmds:
- task: inject-hello-payload
vars: { ROM: '{{.ROM}}' }