Skip to content

Commit

Permalink
git commit -m "fix(build): reference correct path for wlanpi_v8_defco…
Browse files Browse the repository at this point in the history
…nfig and add kmod dependency

- Update build script to use build/wlanpi_v8_defconfig
- Add kmod to package dependencies to ensure depmod is available
- Enhance GitHub Actions workflow to verify file presence and install necessary packages
- Add debugging step to list repository contents during GitHub Actions run"
  • Loading branch information
jolla committed Dec 23, 2024
1 parent 05eb610 commit 8b30a9e
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 17 deletions.
22 changes: 17 additions & 5 deletions .github/workflows/build_kernel_bookworm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,27 @@ jobs:
restore-keys: |
${{ runner.os }}-kernel-
# Step 6: Make the build script executable
# Step 6: Verify Custom Config File Presence
- name: Verify Custom Config File Presence
run: |
echo "Verifying presence of wlanpi_v8_defconfig in build/ directory..."
if [ -f build/wlanpi_v8_defconfig ]; then
echo "wlanpi_v8_defconfig found."
else
echo "ERROR: wlanpi_v8_defconfig not found in build/ directory."
exit 1
fi
# Step 7: Make the build script executable
- name: Make Build Script Executable
run: chmod +x build/build-wlanpi-kernel.sh

# Step 7: Execute the build script
# Step 8: Execute the build script
- name: Execute Build Script
id: build-kernel
run: ./build/build-wlanpi-kernel.sh

# Step 8: Extract Kernel Version and Date
# Step 9: Extract Kernel Version and Date
- name: Extract Kernel Version and Date
id: version-info
run: |
Expand All @@ -86,18 +97,19 @@ jobs:
echo "PACKAGE_NAME=wlanpi-kernel-bookworm" >> $GITHUB_ENV
echo "PACKAGE_VERSION=${VERSION}" >> $GITHUB_ENV
# Step 9: Debug Kernel and Package Versions
# Step 10: Debug Kernel and Package Versions
- name: Debug Kernel and Package Versions
run: |
echo "Kernel Version: ${{ env.KERNEL_VERSION }}"
echo "Build Date: ${{ env.BUILD_DATE }}"
echo "Package Name: ${{ env.PACKAGE_NAME }}"
echo "Package Version: ${{ env.PACKAGE_VERSION }}"
# Step 10: Upload Debian Package as Artifact
# Step 11: Upload Debian Package as Artifact
- name: Upload Debian Package
uses: actions/upload-artifact@v4 # Updated to v4 to avoid deprecation warnings
with:
name: ${{ env.PACKAGE_NAME }}-${{ env.KERNEL_VERSION }}
path: output/*.deb


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ output
*swp
build/build_kernel.log
build/linux/
linux/
28 changes: 16 additions & 12 deletions build/build-wlanpi-kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,21 @@ LOG_FILE="build_kernel.log"
exec > >(tee -i "$LOG_FILE")
exec 2>&1

# Determine the directory where the script resides
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# Set the repository root directory (assuming the script is in 'build/' directory)
REPO_ROOT="$(dirname "$SCRIPT_DIR")"

# Variables
KERNEL_REPO="https://github.com/raspberrypi/linux.git"
KERNEL_BRANCH="rpi-6.12.y"
KERNEL_SRC_DIR="linux"
OUTPUT_PATH="$(pwd)/output" # Output directory
KERNEL_SRC_DIR="$REPO_ROOT/linux"
OUTPUT_PATH="$REPO_ROOT/output" # Output directory
CROSS_COMPILE="aarch64-linux-gnu-"
ARCH="arm64"
BASE_CONFIG="bcm2711_defconfig"
CUSTOM_CONFIG="wlanpi_v8_defconfig" # Corrected path
CUSTOM_CONFIG_FILE="wlanpi_v8_defconfig"
CUSTOM_CONFIG_PATH="$SCRIPT_DIR/$CUSTOM_CONFIG_FILE"
NUM_CORES=$(nproc)

# Define the new kernel image name
Expand All @@ -30,12 +36,9 @@ IMAGE_OUTPUT="${OUTPUT_PATH}/boot/firmware/${KERNEL_IMAGE_NAME}"
DTB_OUTPUT_DIR="${OUTPUT_PATH}/boot/firmware/"
DTBO_OUTPUT_DIR="${OUTPUT_PATH}/boot/firmware/overlays/"
MODULES_OUTPUT_DIR="${OUTPUT_PATH}/lib/modules"
PACKAGE_DIR="$(pwd)/wlanpi-kernel-package"
PACKAGE_DIR="$REPO_ROOT/wlanpi-kernel-package"
# PACKAGE_NAME and PACKAGE_VERSION will be set after retrieving KERNEL_VERSION and BUILD_DATE

# Save the main build directory before changing directories
BUILD_DIR="$(pwd)"

# Functions
error_exit() {
echo "Error on line $1"
Expand Down Expand Up @@ -66,7 +69,7 @@ else
git fetch origin "$KERNEL_BRANCH"
git checkout "$KERNEL_BRANCH"
git reset --hard "origin/$KERNEL_BRANCH"
cd "$BUILD_DIR" # Return to main build directory
cd "$REPO_ROOT" # Return to repository root directory
fi

# Change to kernel source directory
Expand All @@ -90,14 +93,14 @@ echo "Loading base config: $BASE_CONFIG..."
make "$BASE_CONFIG"

# Merge custom config
echo "Merging custom config: $CUSTOM_CONFIG..."
if [ -f "$BUILD_DIR/$CUSTOM_CONFIG" ]; then
echo "Merging custom config: $CUSTOM_CONFIG_PATH..."
if [ -f "$CUSTOM_CONFIG_PATH" ]; then
# Use merge_config.sh to merge the custom config fragment with the base config
./scripts/kconfig/merge_config.sh -m .config "$BUILD_DIR/$CUSTOM_CONFIG" .config
./scripts/kconfig/merge_config.sh -m .config "$CUSTOM_CONFIG_PATH" .config
# Apply the merged configuration
make olddefconfig
else
echo "ERROR: Custom config file $CUSTOM_CONFIG not found in $BUILD_DIR."
echo "ERROR: Custom config file $CUSTOM_CONFIG_PATH not found."
exit 1
fi

Expand Down Expand Up @@ -273,3 +276,4 @@ echo "Cleaning up temporary package directory..."
rm -rf "$PACKAGE_DIR"

echo "Kernel build, module installation, and package creation completed successfully."

0 comments on commit 8b30a9e

Please sign in to comment.