forked from System-Electronics/meta-sysele-nxp-5.15.71
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (79 loc) · 3.44 KB
/
main.yml
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
name: Yocto Build
on:
push:
branches:
- '**' # Matches all branches
jobs:
build:
runs-on: self-hosted
steps:
- name: Install Dependencies
run: |
sudo apt-get update
sudo apt-get upgrade -y
sudo apt-get install -y gawk wget git diffstat unzip texinfo gcc build-essential \
chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils \
iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev \
python3-subunit mesa-common-dev zstd liblz4-tool file locales libacl1 \
curl python-is-python3 bmap-tools qemu-system-arm
sudo locale-gen en_US.UTF-8
- name: Install repo tool
run: |
mkdir -p ~/bin
curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo
chmod a+x ~/bin/repo
echo "${HOME}/bin" >> $GITHUB_PATH
- name: Initialize Yocto Environment
run: |
mkdir -p yocto-astrial
cd yocto-astrial
repo init -u https://github.com/nxp-imx/imx-manifest -b imx-linux-kirkstone -m imx-5.15.71-2.2.0.xml
mkdir -p .repo/local_manifests
wget --directory-prefix .repo/local_manifests https://raw.githubusercontent.com/System-Electronics/meta-sysele-nxp-5.15.71/main/manifest/astrial-5.15.71.xml
repo sync
- name: Generate Build Signature
run: |
if [ "${{ secrets.BUILD_SIGNING_KEY }}" != "" ]; then
SIGNATURE_INPUT="${GITHUB_SHA}|${GITHUB_REPOSITORY}|${GITHUB_RUN_ID}|${{ secrets.BUILD_SIGNING_KEY }}"
BUILD_SIGNATURE=$(echo -n "$SIGNATURE_INPUT" | openssl dgst -sha256 -hmac "${{ secrets.BUILD_SIGNING_KEY }}" -hex | cut -d' ' -f2)
else
BUILD_SIGNATURE="unofficial"
fi
echo "BUILD_SIGNATURE=${BUILD_SIGNATURE}" >> $GITHUB_ENV
- name: Build Image
run: |
cd yocto-astrial
source astrial-setup-env -b build
export BB_ENV_PASSTHROUGH_ADDITIONS="GITHUB_SHA GITHUB_REPOSITORY GITHUB_RUN_ID BUILD_SIGNATURE"
bitbake system-astrial-image
- name: Run QEMU
run: |
cd yocto-astrial/build
# Estraiamo l'immagine wic.zst
zstd -d tmp/deploy/images/astrial-imx8mp/system-astrial-image-astrial-imx8mp-*.rootfs.wic.zst
# Avviamo QEMU con l'immagine
qemu-system-aarch64 \
-machine virt \
-cpu cortex-a53 \
-nographic \
-smp 4 \
-m 2048 \
-kernel tmp/deploy/images/astrial-imx8mp/Image \
-append "root=/dev/vda console=ttyAMA0" \
-drive file=tmp/deploy/images/astrial-imx8mp/system-astrial-image-astrial-imx8mp-*.rootfs.wic,format=raw,if=virtio \
-netdev user,id=eth0 \
-device virtio-net-device,netdev=eth0 \
-no-reboot \
-monitor none \
&
# Aspettiamo che il sistema si avvii e catturiamo l'output
sleep 300
# Terminiamo QEMU
pkill qemu-system-aarch64
- name: Archive Build Artifacts
uses: actions/upload-artifact@v4
with:
name: yocto-build
path: |
yocto-astrial/build/tmp/deploy/images/astrial-imx8mp/imx-boot-astrial-imx8mp-sd.bin-flash_evk
yocto-astrial/build/tmp/deploy/images/astrial-imx8mp/system-astrial-image-astrial-imx8mp-*.rootfs.wic.zst