Skip to content

Commit

Permalink
PACKAGE_NAME: Set to wlanpi-kernel-bookworm consistently across both …
Browse files Browse the repository at this point in the history
…the build script and the workflow
  • Loading branch information
jolla committed Dec 5, 2024
1 parent f45fdc7 commit f0b130d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/build_kernel_bookworm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,29 @@ jobs:
id: version-info
run: |
DEB_FILE=$(ls output/*.deb | head -n 1)
DEB_COUNT=$(ls output/*.deb | wc -l)
if [ "$DEB_COUNT" -ne 1 ]; then
echo "ERROR: Expected exactly one .deb file, found $DEB_COUNT."
exit 1
fi
echo "Extracting kernel version from $DEB_FILE..."
KERNEL_VERSION=$(basename "$DEB_FILE" | grep -Po 'wlanpi-kernel-\K[^-]+')
BUILD_DATE=$(date +%Y%m%d)
PACKAGE_NAME="wlanpi-kernel-${KERNEL_VERSION}-${BUILD_DATE}"
# Extract the version from the .deb filename
KERNEL_VERSION=$(echo "$(basename "$DEB_FILE")" | grep -Po 'wlanpi-kernel-bookworm_\K[^_]+')
BUILD_DATE=$(echo "$(basename "$DEB_FILE")" | grep -Po 'wlanpi-kernel-bookworm_[^_]+_\K[^_]+')
PACKAGE_NAME="wlanpi-kernel-bookworm"
PACKAGE_VERSION=$(echo "$(basename "$DEB_FILE")" | grep -Po 'wlanpi-kernel-bookworm_\K[^_]+')
echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV
echo "BUILD_DATE=$BUILD_DATE" >> $GITHUB_ENV
echo "PACKAGE_NAME=$PACKAGE_NAME" >> $GITHUB_ENV
echo "PACKAGE_VERSION=$PACKAGE_VERSION" >> $GITHUB_ENV
# Step 9: 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
- name: Upload Debian Package
Expand Down
10 changes: 6 additions & 4 deletions build/build-wlanpi-kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ echo "Building Device Tree Blobs (DTBs)..."
make -j"$NUM_CORES" dtbs

# Retrieve the kernel version and set the package version
KERNEL_VERSION=$(make kernelrelease) # Do NOT strip '+' to match modules_install directory
KERNEL_VERSION=$(make kernelrelease) # Preserve '+' to match modules_install directory
BUILD_DATE=$(date +%Y%m%d)
PACKAGE_NAME="wlanpi-kernel-${KERNEL_VERSION}-${BUILD_DATE}"
PACKAGE_NAME="wlanpi-kernel-bookworm" # Consistent package name
PACKAGE_VERSION="${KERNEL_VERSION}-${BUILD_DATE}"

# Debugging
Expand Down Expand Up @@ -185,6 +185,8 @@ Priority: optional
Architecture: arm64
Maintainer: Jerry Olla <jerryolla@gmail.com>
Depends: libc6 (>= 2.29)
Conflicts: wlanpi-kernel
Replaces: wlanpi-kernel
Description: Custom Linux kernel for Raspberry Pi CM4/RPI4 with WLAN Pi v8 configuration for Debian Bookworm
This package contains a custom-built Linux kernel image, Device Tree Blobs (DTBs),
and kernel modules tailored for the WLAN Pi v8 configuration on Raspberry Pi CM4/RPI4 running Debian Bookworm.
Expand Down Expand Up @@ -245,9 +247,9 @@ chmod 755 "$PACKAGE_DIR/DEBIAN/postinst"

# Create the Debian package inside the output directory with the kernel version and date
echo "Building Debian package..."
dpkg-deb --build "$PACKAGE_DIR" "$OUTPUT_PATH/${PACKAGE_NAME}_arm64.deb"
dpkg-deb --build "$PACKAGE_DIR" "$OUTPUT_PATH/${PACKAGE_NAME}_${PACKAGE_VERSION}_arm64.deb"

echo "Debian package ${PACKAGE_NAME}_arm64.deb created successfully in $OUTPUT_PATH."
echo "Debian package ${PACKAGE_NAME}_${PACKAGE_VERSION}_arm64.deb created successfully in $OUTPUT_PATH."

# Clean up temporary package directory
echo "Cleaning up temporary package directory..."
Expand Down

0 comments on commit f0b130d

Please sign in to comment.