Skip to content

Commit c66f4e8

Browse files
Add build-mode.sh for kernel static discovery
This script builds the kernel in static discovery mode, including generating HTML documentation, performing a Clang build, running Coccicheck, and building kselftest.
1 parent 7a1d111 commit c66f4e8

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

‎.github/ci/build-mode.sh‎

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Inputs (from CI)
5+
: "${ARCH:?}"
6+
: "${CONFIG:?}"
7+
8+
source .github/ci/common.sh
9+
10+
echo "==> Building kernel"
11+
echo "ARCH=$ARCH"
12+
echo "CONFIG=$CONFIG"
13+
echo "CROSS_COMPILE=$CROSS_COMPILE"
14+
echo "OUT=$KERNEL_OUT"
15+
16+
case "${MODE}" in
17+
static)
18+
echo "Running Static Discovery Mode"
19+
20+
# -------------------------------------------------
21+
# 1. HTML Documentation
22+
# -------------------------------------------------
23+
echo "===== htmldocs =====" | tee -a "$LOG_FILE"
24+
make O="$KERNEL_OUT/htmldocs" htmldocs -j$(nproc) >> "$LOG_FILE"
25+
26+
# -------------------------------------------------
27+
# 2. Clang Build (defconfig)
28+
# -------------------------------------------------
29+
echo "===== clang defconfig =====" | tee -a "$LOG_FILE"
30+
make O="$KERNEL_OUT/$CONFIG" "$CONFIG"
31+
make O="$KERNEL_OUT/$CONFIG" CC=clang -j$(nproc) >> "$LOG_FILE"
32+
33+
# -------------------------------------------------
34+
# 3. Coccicheck (Report Mode Only)
35+
# -------------------------------------------------
36+
echo "===== coccicheck report =====" | tee -a "$LOG_FILE"
37+
make O="$KERNEL_OUT/coccicheck" coccicheck MODE=report >> "$LOG_FILE"
38+
39+
# -------------------------------------------------
40+
# 4. kselftest Build Only
41+
# -------------------------------------------------
42+
echo "===== kselftest build =====" | tee -a "$LOG_FILE"
43+
make O="$KERNEL_OUT/kselftest" kselftest >> "$LOG_FILE"
44+
45+
echo "Static discovery completed"
46+
;;
47+
esac

0 commit comments

Comments
 (0)