Skip to content

Commit e3961fd

Browse files
committed
bundle kmods
1 parent 9f369c4 commit e3961fd

6 files changed

Lines changed: 82 additions & 101 deletions

File tree

.github/workflows/NanoPi-Build.yml

Lines changed: 24 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ on:
4242
description: 'Build R2C'
4343
type: boolean
4444
default: false
45+
build_mini:
46+
description: 'Build mini seed'
47+
type: boolean
48+
default: false
49+
build_full:
50+
description: 'Build full seed'
51+
type: boolean
52+
default: true
4553
jobs:
4654
init:
4755
runs-on: ubuntu-22.04
@@ -92,6 +100,8 @@ jobs:
92100
echo "RELTAG=${{ needs.init.outputs.release_tag }}" >> $GITHUB_ENV
93101
echo "OPENWRT_BRANCH=${{ github.event.inputs.openwrt_branch }}" >> $GITHUB_ENV
94102
echo "NANOPI_MODEL=${{ matrix.nanopi_model }}" >> $GITHUB_ENV
103+
echo "BUILD_MINI=${{ github.event.inputs.build_mini }}" >> $GITHUB_ENV
104+
echo "BUILD_FULL=${{ github.event.inputs.build_full }}" >> $GITHUB_ENV
95105
96106
- name: Show GITHUB_ENV
97107
run: echo $GITHUB_ENV
@@ -136,137 +146,68 @@ jobs:
136146
echo '================================================================'
137147
cd build/openwrt && make toolchain/install -j1 V=s
138148
139-
# - name: Try cleaning build_dir before packing
140-
# run: |
141-
# cd build/openwrt
142-
# make clean
143-
# #ls -l build_dir/
144-
# #rm -rf build_dir/host build_dir/toolchain*
145-
#
146-
# - name: Pack toolchain
147-
# run: |
148-
# pwd
149-
# cd ~/work/OpenWrt-NanoPi-R2S-R4S-Builds
150-
# pwd
151-
# tar --posix -cf ../toolchain_built.tar OpenWrt-NanoPi-R2S-R4S-Builds
152-
#
153-
# - name: Upload artifact
154-
# uses: actions/upload-artifact@v2
155-
# with:
156-
# name: toolchain_built
157-
# path: ~/work/toolchain_built.tar
158-
#
159-
# build:
160-
# needs: [init, toolchain]
161-
# runs-on: ubuntu-20.04
162-
# steps:
163149
- name: Dump github context
164150
run: echo "$GITHUB_CONTEXT"
165151
shell: bash
166152
env:
167153
GITHUB_CONTEXT: ${{ toJson(github) }}
168-
#
169-
# - name: Retrieve toolchain artifact
170-
# uses: actions/download-artifact@v2
171-
# with:
172-
# name: toolchain_built
173-
# path: ~/work/
174-
#
175-
# - name: Unpack and clean toolchain artifact
176-
# run: |
177-
# cd ~/work/OpenWrt-NanoPi-R2S-R4S-Builds
178-
# tar xf ../toolchain_built.tar
179-
# rm ../toolchain_built.tar
180-
# pwd
181-
# ls -l
182-
#
183-
# - name: list files (debug)
184-
# run: ls -l
185-
#
186-
# - name: fix timestamps
187-
# run: |
188-
# cd build/openwrt
189-
# #find build_dir/{host*,toolchain-*} -name .built\* -exec touch {} \;
190-
# touch staging_dir/{host*,toolchain-*}/stamp/.*
191-
#
192-
# - name: Free space
193-
# run: |
194-
# /bin/bash ./workflow-scripts/free_disk_space.sh
195-
# df -h
196-
#
197-
# - name: Prepare Build deps
198-
# uses: ./.github/actions/setup-devenv
199-
#
200-
# - name: Set env
201-
# run: |
202-
# #echo "SSH_ACTIONS=false" >> $GITHUB_ENV
203-
# #echo "UPLOAD_BIN_DIR=false" >> $GITHUB_ENV
204-
# #echo "UPLOAD_FIRMWARE=true" >> $GITHUB_ENV
205-
# #echo "UPLOAD_RELEASE=true" >> $GITHUB_ENV
206-
# echo "TZ=Europe/Paris" >> $GITHUB_ENV
207-
# echo "BUILD_STRING=${{ needs.init.outputs.build_string }}" >> $GITHUB_ENV
208-
# echo "RELTAG=${{ needs.init.outputs.release_tag }}" >> $GITHUB_ENV
209-
# echo "OPENWRT_BRANCH=${{ github.event.inputs.openwrt_branch }}" >> $GITHUB_ENV
210-
# echo "NANOPI_MODEL=${{ github.event.inputs.nanopi_model }}" >> $GITHUB_ENV
211154

212155
- name: Load AO seed (mini)
156+
if: github.event.inputs.build_mini == 'true'
213157
run: ./openwrt-$OPENWRT_BRANCH/steps/06-create_config_from_seed.sh $NANOPI_MODEL mini
214158

215-
# - name: Download package
216-
# run: |
217-
# cd build/openwrt
218-
# make defconfig
219-
# make download -j10
220-
# find dl -size -1024c -exec ls -l {} \;
221-
# find dl -size -1024c -exec rm -f {} \;
159+
- name: Build kmods (mini)
160+
if: github.event.inputs.build_mini == 'true'
161+
run: ./openwrt-$OPENWRT_BRANCH/steps/07-all_kmods.sh
222162

223163
- name: Compile OpenWRT (mini)
224164
id: compileopenwrtmini
165+
if: github.event.inputs.build_mini == 'true'
225166
continue-on-error: true
226167
run: |
227168
cd build/openwrt
228169
let make_process=$(nproc)+1
229170
make -j${make_process} || make -j${make_process}
230171
231172
- name: If compile openwrt Error
232-
if: steps.compileopenwrtmini.outcome == 'failure'
173+
if: github.event.inputs.build_mini == 'true' && steps.compileopenwrtmini.outcome == 'failure'
233174
run: |
234175
cat build/openwrt/.config
235176
echo '================================================================'
236177
cd build/openwrt && make -j1 V=s
237178
238179
- name: Organize files (mini)
239180
id: organizemini
181+
if: github.event.inputs.build_mini == 'true'
240182
run: ./openwrt-$OPENWRT_BRANCH/steps/organize_files.sh $NANOPI_MODEL mini $OPENWRT_BRANCH $RELTAG
241183

242184
- name: Load AO seed (full)
185+
if: github.event.inputs.build_full == 'true'
243186
run: ./openwrt-$OPENWRT_BRANCH/steps/06-create_config_from_seed.sh $NANOPI_MODEL full
244187

245-
# - name: Download package
246-
# run: |
247-
# cd build/openwrt
248-
# make defconfig
249-
# make download -j10
250-
# find dl -size -1024c -exec ls -l {} \;
251-
# find dl -size -1024c -exec rm -f {} \;
188+
- name: Build kmods (full)
189+
if: github.event.inputs.build_full == 'true'
190+
run: ./openwrt-$OPENWRT_BRANCH/steps/07-all_kmods.sh
252191

253192
- name: Compile OpenWRT (full)
254193
id: compileopenwrtfull
194+
if: github.event.inputs.build_full == 'true'
255195
continue-on-error: true
256196
run: |
257197
cd build/openwrt
258198
let make_process=$(nproc)+1
259199
make -j${make_process} || make -j${make_process}
260200
261201
- name: If compile openwrt Error
262-
if: steps.compileopenwrtfull.outcome == 'failure'
202+
if: github.event.inputs.build_full == 'true' && steps.compileopenwrtfull.outcome == 'failure'
263203
run: |
264204
cat build/openwrt/.config
265205
echo '================================================================'
266206
cd build/openwrt && make -j1 V=s
267207
268208
- name: Organize files (full)
269209
id: organizefull
210+
if: github.event.inputs.build_full == 'true'
270211
run: ./openwrt-$OPENWRT_BRANCH/steps/organize_files.sh $NANOPI_MODEL full $OPENWRT_BRANCH $RELTAG
271212

272213
- name: Create release
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
ROOTDIR=$(pwd)
3+
echo $ROOTDIR
4+
if [ ! -e "$ROOTDIR/build" ]; then
5+
echo "Please run from root / no build dir"
6+
exit 1
7+
fi
8+
9+
cd "$ROOTDIR/build"
10+
11+
cd openwrt
12+
13+
# not implemented in 21.02
14+

openwrt-22.03/release-info.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
- pbr latest version from https://github.com/stangri/source.openwrt.melmac.net
1717

1818
### Changelog
19+
- [2023-01-07] Bundle kmods
1920
- [2023-01-04] Freeze to OpenWrt 22.03.3 release instead of branch
2021
- [2022-10-19] Re-Update U-Boot to 2022.07 and use FriendlyWrt patches
2122
- [2022-09-28] Add kmod-sched

openwrt-22.03/seed/ao-R4S-full.seed

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -205,17 +205,8 @@ CONFIG_PACKAGE_kmod-crypto-user=y
205205
CONFIG_PACKAGE_kmod-cryptodev=y
206206
CONFIG_PACKAGE_kmod-dax=y
207207
CONFIG_PACKAGE_kmod-dm=y
208-
CONFIG_PACKAGE_kmod-dma-buf=y
209-
CONFIG_PACKAGE_kmod-drm=y
210-
CONFIG_PACKAGE_kmod-drm-kms-helper=y
211208
CONFIG_PACKAGE_kmod-dummy=y
212209
CONFIG_PACKAGE_kmod-ebtables=y
213-
CONFIG_PACKAGE_kmod-fb=y
214-
CONFIG_PACKAGE_kmod-fb-cfb-copyarea=y
215-
CONFIG_PACKAGE_kmod-fb-cfb-fillrect=y
216-
CONFIG_PACKAGE_kmod-fb-cfb-imgblt=y
217-
CONFIG_PACKAGE_kmod-fb-sys-fops=y
218-
CONFIG_PACKAGE_kmod-fb-sys-ram=y
219210
CONFIG_PACKAGE_kmod-fs-btrfs=y
220211
CONFIG_PACKAGE_kmod-fs-cifs=y
221212
CONFIG_PACKAGE_kmod-fs-ext4=y
@@ -421,6 +412,7 @@ CONFIG_PACKAGE_luci-i18n-firewall-en=y
421412
CONFIG_PACKAGE_luci-i18n-ntpc-en=y
422413
CONFIG_PACKAGE_luci-i18n-openvpn-en=y
423414
CONFIG_PACKAGE_luci-i18n-opkg-en=y
415+
CONFIG_PACKAGE_luci-i18n-pbr-en=y
424416
CONFIG_PACKAGE_luci-i18n-qos-en=y
425417
CONFIG_PACKAGE_luci-i18n-sqm-en=y
426418
CONFIG_PACKAGE_luci-i18n-statistics-en=y
@@ -495,6 +487,7 @@ CONFIG_PACKAGE_zlib=y
495487
CONFIG_PACKAGE_zoneinfo-core=y
496488
CONFIG_PACKAGE_zoneinfo-europe=y
497489
CONFIG_SOCAT_SSL=y
490+
CONFIG_SQLITE3_COLUMN_METADATA=y
498491
CONFIG_SQLITE3_DYNAMIC_EXTENSIONS=y
499492
CONFIG_SQLITE3_FTS3=y
500493
CONFIG_SQLITE3_FTS4=y

openwrt-22.03/seed/ao-R4S-mini.seed

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,17 +186,8 @@ CONFIG_PACKAGE_kmod-crypto-user=y
186186
CONFIG_PACKAGE_kmod-cryptodev=y
187187
CONFIG_PACKAGE_kmod-dax=y
188188
CONFIG_PACKAGE_kmod-dm=y
189-
CONFIG_PACKAGE_kmod-dma-buf=y
190-
CONFIG_PACKAGE_kmod-drm=y
191-
CONFIG_PACKAGE_kmod-drm-kms-helper=y
192189
CONFIG_PACKAGE_kmod-dummy=y
193190
CONFIG_PACKAGE_kmod-ebtables=y
194-
CONFIG_PACKAGE_kmod-fb=y
195-
CONFIG_PACKAGE_kmod-fb-cfb-copyarea=y
196-
CONFIG_PACKAGE_kmod-fb-cfb-fillrect=y
197-
CONFIG_PACKAGE_kmod-fb-cfb-imgblt=y
198-
CONFIG_PACKAGE_kmod-fb-sys-fops=y
199-
CONFIG_PACKAGE_kmod-fb-sys-ram=y
200191
CONFIG_PACKAGE_kmod-fs-ext4=y
201192
CONFIG_PACKAGE_kmod-fs-f2fs=y
202193
CONFIG_PACKAGE_kmod-fs-squashfs=y
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
#!/bin/bash
2+
ROOTDIR=$(pwd)
3+
echo $ROOTDIR
4+
if [ ! -e "$ROOTDIR/build" ]; then
5+
echo "Please run from root / no build dir"
6+
exit 1
7+
fi
8+
9+
cd "$ROOTDIR/build"
10+
11+
cd openwrt
12+
13+
# patch config to build all kernel modules
14+
sed -i -e '/^# CONFIG_PACKAGE_kmod-/d' .config
15+
echo CONFIG_ALL_KMODS=y >> .config
16+
make defconfig
17+
18+
rm -rf bin/
19+
rm -rf files/ipks/
20+
let make_process=$(nproc)+1
21+
22+
# compile kernel kmods and build packages
23+
make target/compile -j ${make_process} || { make target/compile -j 1 V=s ; exit 1 ; }
24+
make package/linux/compile -j ${make_process} || { make package/linux/compile -j 1 V=s ; exit 1 ; }
25+
26+
# build signing tools and generate key
27+
make package/usign/host/compile V=s || exit 1
28+
make package/ucert/host/compile V=s || exit 1
29+
make package/base-files/configure V=s || exit 1
30+
31+
# sign packages
32+
make package/index V=s || exit 1
33+
mkdir -p files/ipks
34+
cd files/ipks
35+
find ../../bin/targets/rockchip/armv8/packages/ -type f -exec ln {} . \;
36+
cd ..
37+
mkdir -p etc/uci-defaults
38+
cat << "EOF" > etc/uci-defaults/99-local-ipks
39+
echo "src/gz local file:///ipks/" >> /etc/opkg/distfeeds.conf
40+
EOF
41+

0 commit comments

Comments
 (0)