forked from radxa/kernel
-
Notifications
You must be signed in to change notification settings - Fork 0
136 lines (113 loc) · 5 KB
/
BuildRock5ForOpenHD.yaml
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: BuildRock5Kernel
on:
push:
branches:
- "release-rk3588"
- "release-rk3588-41"
permissions:
contents: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: install dependencies
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends -y qemu-user-static coreutils binfmt-support
- name: prepare build
run: |
# Print the current branch name
echo "Branch: ${{ github.ref_name }}"
# Set the BRANCH variable to the current branch name
BRANCH="release-rk3588-41"
# Clone the bsp repository recursively
git clone https://github.com/radxa-repo/bsp --recursive
cd bsp
# Make the bsp script executable
chmod +x bsp
# Insert the current date into lib/linux.sh after a specific line
sed -i '/local kernelversion="\$(bsp_version)"/a \ local DATE=$(date +'%Y-%m-%d-%H-%M')' lib/linux.sh
# Replace kernel version information with a version that includes the current date
sed -i 's/LOCALVERSION=-$PKG_REVISION-$FORK KERNELRELEASE=$kernelversion-$PKG_REVISION-$FORK KDEB_PKGVERSION=$kernelversion-${PKG_REVISION}${SOURCE_GITREV:+-$SOURCE_GITREV}/LOCALVERSION=-$PKG_REVISION-$FORK KERNELRELEASE=$kernelversion-$PKG_REVISION-$FORK KDEB_PKGVERSION=$kernelversion-${PKG_REVISION}-${DATE}-${SOURCE_GITREV:+-$SOURCE_GITREV}/g' lib/linux.sh
# Update the BSP_GIT repository URL in linux/rockchip/fork.conf
sed -i 's/BSP_GIT="https:\/\/github.com\/radxa\/kernel.git"/BSP_GIT="https:\/\/github.com\/openhd\/linux-rock.git"/' linux/.rk3588/fork.conf
# Update the BSP_BRANCH in linux/rockchip/fork.conf to the current branch name
sed -i 's#BSP_BRANCH="[^"]*"#BSP_BRANCH="'"$BRANCH"'"#' linux/.rk3588/fork.conf
# Print fork.conf
echo "___Content of fork.conf___"
cat linux/.rk3588/fork.conf
# Fetch the latest commit hash from the OpenHD overlays repository
COMMITHASH=$(curl -s https://api.github.com/repos/OpenHD/overlays/commits/main | grep '"sha"' | head -n 1 | cut -d '"' -f 4)
# Print commit hash
echo $COMMITHASH
# Create a custom source action script in linux/.common/overlays.sh
echo 'custom_source_action() {
git_source https://github.com/openhd/overlays.git '"$COMMITHASH"'
cp -r $SCRIPT_DIR/.src/overlays/arch $TARGET_DIR
}' > linux/.common/overlays.sh
# Print overlays.sh
echo "___Content of overlays.sh___"
cat linux/.common/overlays.sh
patch -p1 -i ../scripts/patches/openhd_utils.patch
rm linux/.rk3588/0010-backport/0001-scripts-dtc-Update-to-upstream-version-v1.6.0-51-g18.patch
rm linux/.rk3588/0010-backport/0003-mm-page_alloc-fix-building-error-on-Werror-array-com.patch
rm linux/.rk3588/0010-backport/0004-etherdevice-Adjust-ether_addr-prototypes-to-silence-.patch
rm linux/.rk3588/0100-vendor/0004-Include-cma_heap_get_phys-when-needed.patch
rm linux/.rk3588/0100-vendor/0006-Disable-tristate-for-modules-that-uses-unexported-sy.patch
- name: build kernel
run: |
cd bsp
echo "start building"
./bsp --long-version -r radxa linux .rk3588
- name: prepare for Upload
run: |
cp -r /home/runner/work/linux-rock/linux-rock/bsp/*.deb /home/runner/work/linux-rock/linux-rock/
- name: Upload to Github
uses: actions/upload-artifact@v2
with:
name: "rock5-kernel-openhd"
path: |
*.deb
- name: Push
id: push
uses: cloudsmith-io/action@master
with:
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
command: "push"
format: "deb"
owner: "openhd"
repo: "release"
distro: "debian"
release: "bullseye"
republish: "true" # needed ONLY if version is not changing
file: "linux-image-5.10*.deb"
- name: Push header
id: push_headers
uses: cloudsmith-io/action@master
with:
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
command: "push"
format: "deb"
owner: "openhd"
repo: "release"
distro: "debian"
release: "bullseye"
republish: "true" # needed ONLY if version is not changing
file: "linux-headers-5.10*.deb"
- name: Push libc
id: push_libc
uses: cloudsmith-io/action@master
with:
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
command: "push"
format: "deb"
owner: "openhd"
repo: "release"
distro: "debian"
release: "bullseye"
republish: "true" # needed ONLY if version is not changing
file: "linux-libc-dev-5.10*.deb"