-
Notifications
You must be signed in to change notification settings - Fork 2
136 lines (102 loc) · 4.5 KB
/
firmware-compile.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
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
125
126
127
128
129
130
131
132
133
134
135
136
name: Firmwire-CI
on:
schedule:
- cron: 00 22 * * *
workflow_dispatch:
release:
types: [published]
jobs:
build_firmware:
name: Build Firmware
runs-on: ubuntu-latest
if: github.event.repository.owner.id == github.event.sender.id
steps:
- name: Fix up git URLs
run: |
git config --global --add url."https://${{ secrets.GITHUB_SECRET }}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
git config --global --add url."https://${{ secrets.GITHUB_SECRET }}:x-oauth-basic@github.com/".insteadOf "git@github.com:"
- name: Install Dependencies
run: |
sudo -E apt-get update
sudo -E apt-get -fy install bison flex swig lzop lzma libmpc-dev u-boot-tools libncurses5-dev build-essential asciidoc binutils bzip2 gawk gettext git libz-dev patch python3 unzip zlib1g-dev libc6-dev-i386 subversion uglifyjs p7zip p7zip-full msmtp libssl-dev texinfo lib32gcc-s1 libglib2.0-dev xmlto qemu-utils upx libelf-dev autoconf automake libtool autopoint device-tree-compiler antlr3 gperf
- name: Generate artifact Path
run: |
mkdir ./artifact
sudo chmod 777 ./artifact
cd ./artifact
echo ${PWD}
- name: Path Init
run: |
cd ./artifact
if [ ! -d "bootloader" ];then
mkdir bootloader
fi
if [ ! -d "kernelfile" ];then
mkdir kernelfile
fi
if [ ! -d "rootfs" ];then
mkdir rootfs
fi
ls -l
- name: U-Boot Compile
run: |
wget -c https://releases.linaro.org/components/toolchain/binaries/6.5-2018.12/arm-linux-gnueabihf/gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf.tar.xz
tar -xf gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf.tar.xz
export CC=`pwd`/gcc-linaro-6.5.0-2018.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-
${CC}gcc --version
export ARCH=arm CROSS_COMPILE=${CC}
git clone -b v2022.04-rc1 https://github.com/u-boot/u-boot/ --depth=1
cd u-boot
make distclean
make stm32mp15_basic_defconfig
make DEVICE_TREE=stm32mp157a-dk1 all -j $(nproc)
- name: Copy U-Boot files
run: |
cp ./u-boot/u-boot-spl.stm32 ./artifact/bootloader/u-boot-spl.stm32
cp ./u-boot/u-boot.img ./artifact/bootloader/u-boot.img
cd ..
rm -rf ./u-boot
ls -l
- name: Kernel Compile
run: |
export TERM=xterm
git clone https://github.com/RobertCNelson/armv7-lpae-multiplatform
cd armv7-lpae-multiplatform/
git checkout origin/v6.0.x -b tmp
sed -i '200,229s/make_menuconfig/echo \"CONFIGURE DONE!\"\n/' ./build_kernel.sh
./build_kernel.sh
- name: Copy Kernel Files
run: |
kernel_version=$(cat "./armv7-lpae-multiplatform/KERNEL/include/generated/utsrelease.h" | awk '{print $3}' | sed 's/\"//g' )
sudo cp ./armv7-lpae-multiplatform/deploy/${kernel_version}.zImage ./artifact/kernelfile/${kernel_version}.zImage
sudo cp ./armv7-lpae-multiplatform/deploy/${kernel_version}-dtbs.tar.gz ./artifact/kernelfile/${kernel_version}-dtbs.tar.gz
sudo cp ./armv7-lpae-multiplatform/deploy/${kernel_version}-modules.tar.gz ./artifact/kernelfile/${kernel_version}-modules.tar.gz
cd ..
rm -rf ./armv7-lpae-multiplatform
- name: rootfs(Ubuntu-minimal) Preparation
run: |
wget -c https://rcn-ee.com/rootfs/eewiki/minfs/ubuntu-20.04.3-minimal-armhf-2021-12-20.tar.xz
tar -xvf ./ubuntu-20.04.3-minimal-armhf-2021-12-20.tar.xz -C ./artifact/rootfs
- name: Deliver U-Boot
uses: actions/upload-artifact@v3
with:
name: STM32MP157_bootloader
path: ./artifact/bootloader/
- name: Deliver Kernel
uses: actions/upload-artifact@v3
with:
name: STM32MP157_kernel
path: ./artifact/kernelfile/
- name: Deliver rootfs
uses: actions/upload-artifact@v3
with:
name: STM32MP157_rootfs
path: ./artifact/rootfs/
- name: Upload release asset
if: github.event == 'release'
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.YOURTOKEN }}
file: ./artifact/*
tag: ${{ github.ref }}
file_glob: true