Skip to content

Automated upstream sync: Update to kernel 7.0.0-rc1 (a116bac87) #43

Automated upstream sync: Update to kernel 7.0.0-rc1 (a116bac87)

Automated upstream sync: Update to kernel 7.0.0-rc1 (a116bac87) #43

name: Build and Test
on:
push:
branches: [ main ]
tags:
- 'v*'
pull_request:
branches: [ main ]
jobs:
build-deb:
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential debhelper dkms devscripts dh-dkms
- name: Build binary package
run: |
dpkg-buildpackage -us -uc -b
mkdir -p build-output
mv ../*.deb build-output/ || true
mv ../*.buildinfo build-output/ || true
mv ../*.changes build-output/ || true
- name: Build source package
run: |
dpkg-buildpackage -us -uc -S -sa
mkdir -p source-output
mv ../*.dsc source-output/ || true
mv ../*.tar.* source-output/ || true
mv ../*.changes source-output/ || true
- name: List package contents
run: |
echo "=== Built packages ==="
ls -lh build-output/*.deb
echo ""
echo "=== Package contents ==="
dpkg-deb -c build-output/*.deb
- name: Upload Debian package
uses: actions/upload-artifact@v4
with:
name: amdxdna-dkms-deb
path: build-output/*.deb
retention-days: 30
- name: Upload build metadata
if: always()
uses: actions/upload-artifact@v4
with:
name: build-metadata
path: |
build-output/*.buildinfo
build-output/*.changes
retention-days: 7
if-no-files-found: ignore
- name: Upload source package
uses: actions/upload-artifact@v4
with:
name: source-package
path: source-output/*
retention-days: 30
test-kernels:
needs: build-deb
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
kernel:
- name: "OEM 6.17"
package: "linux-headers-oem-24.04d"
- name: "HWE"
package: "linux-headers-generic-hwe-24.04"
name: Test on ${{ matrix.kernel.name }}
steps:
- name: Download package artifact
uses: actions/download-artifact@v4
with:
name: amdxdna-dkms-deb
- name: Install kernel headers and build tools
run: |
sudo apt-get update
sudo apt-get install -y dkms build-essential
# Install headers for the kernel we want to test
sudo apt-get install -y ${{ matrix.kernel.package }}
- name: List installed kernels
run: |
echo "=== Installed kernel headers ==="
ls -la /lib/modules/
- name: Install DKMS package
run: |
sudo dpkg -i *.deb || {
echo "Package installation failed, checking dependencies..."
sudo apt-get install -f -y
sudo dpkg -i *.deb
}
# Extract version and trigger DKMS build for the target kernel
VERSION=$(dpkg -I *.deb | grep '^ Version:' | awk '{print $2}' | sed 's/-[0-9]*$//')
TARGET_KERNEL=$(ls /lib/modules/ | grep -v $(uname -r) | head -1)
echo "Triggering DKMS build for kernel: $TARGET_KERNEL"
sudo dkms build amdxdna/$VERSION -k $TARGET_KERNEL || true
sudo dkms install amdxdna/$VERSION -k $TARGET_KERNEL || true
- name: Verify DKMS build
run: |
echo "=== DKMS Status ==="
dkms status amdxdna || true
dkms status || true
echo ""
echo "=== Checking for built modules ==="
ls -la /lib/modules/*/updates/dkms/ 2>/dev/null || echo "No modules in /lib/modules/*/updates/dkms/"
# Extract version from package filename (remove debian revision suffix)
VERSION=$(dpkg -I *.deb | grep '^ Version:' | awk '{print $2}' | sed 's/-[0-9]*$//')
echo ""
echo "Package version: $VERSION"
# Verify module was built
if dkms status amdxdna/$VERSION 2>/dev/null | grep -q "installed"; then
echo "✓ Module successfully built and installed"
else
echo "✗ Module build may have failed, checking logs..."
echo ""
echo "=== DKMS make.log (if exists) ==="
sudo find /var/lib/dkms/amdxdna -name "make.log" -exec tail -50 {} \; 2>/dev/null || echo "No build logs found"
exit 1
fi
- name: Verify firmware installation
run: |
echo "=== Firmware Files ==="
ls -lR /lib/firmware/updates/amdnpu/
echo ""
echo "=== Verify Symlinks ==="
for device in 1502_00 17f0_10 17f0_11; do
if [ -L "/lib/firmware/updates/amdnpu/$device/npu.sbin" ]; then
echo "✓ $device/npu.sbin symlink exists"
else
echo "✗ $device/npu.sbin symlink missing"
exit 1
fi
if [ -L "/lib/firmware/updates/amdnpu/$device/npu_7.sbin" ]; then
echo "✓ $device/npu_7.sbin symlink exists"
else
echo "✗ $device/npu_7.sbin symlink missing"
exit 1
fi
done
- name: Check module info
run: |
echo "=== Module Information ==="
# Find the built module
VERSION=$(dpkg -I *.deb | grep '^ Version:' | awk '{print $2}' | cut -d- -f1)
KERNEL=$(ls /lib/modules/ | grep ${{ matrix.kernel.version }} | head -1)
if [ -n "$KERNEL" ]; then
MODULE_PATH="/lib/modules/$KERNEL/updates/dkms/amdxdna.ko"
if [ -f "$MODULE_PATH" ]; then
modinfo "$MODULE_PATH" || true
else
echo "Module not found at $MODULE_PATH"
fi
else
echo "No matching kernel found in /lib/modules/"
fi
upload-ppa:
needs: test-kernels
runs-on: ubuntu-24.04
if: startsWith(github.ref, 'refs/tags/v')
strategy:
matrix:
ubuntu_release: [noble, questing, resolute]
build: [3]
name: Upload to PPA for ${{ matrix.ubuntu_release }}
steps:
- name: Download source package
uses: actions/download-artifact@v4
with:
name: source-package
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y devscripts debhelper dh-dkms dkms
- name: Extract source package
run: |
echo "Extracting source package..."
dpkg-source -x amdxdna-dkms_*.dsc extracted-source
- name: Update changelog for Ubuntu release
working-directory: extracted-source
run: |
# Get current version from changelog
CURRENT_VERSION=$(dpkg-parsechangelog -S Version)
# Remove any existing release suffix (e.g., noble1, questing1)
BASE_VERSION=$(echo "$CURRENT_VERSION" | sed 's/[a-z]*[0-9]*$//')
# Append new release suffix
NEW_VERSION="${BASE_VERSION}${{ matrix.ubuntu_release }}${{ matrix.build }}"
echo "Updating version from $CURRENT_VERSION to $NEW_VERSION"
echo "Targeting Ubuntu ${{ matrix.ubuntu_release }}"
# Update changelog with new version and target release
DEBFULLNAME="AMD XDNA Driver Team" \
DEBEMAIL="xdna-driver@amd.com" \
dch --newversion "$NEW_VERSION" \
--distribution "${{ matrix.ubuntu_release }}" \
--force-distribution \
"Rebuild for Ubuntu ${{ matrix.ubuntu_release }}"
# Update PACKAGE_VERSION in dkms.conf to match the new version
# echo "Updating dkms.conf PACKAGE_VERSION to $NEW_VERSION"
# sed -i "s/^PACKAGE_VERSION=.*/PACKAGE_VERSION=\"$NEW_VERSION\"/" dkms.conf
- name: Rebuild source package
working-directory: extracted-source
run: |
echo "Building source package for ${{ matrix.ubuntu_release }}..."
dpkg-buildpackage -S -d -us -uc
- name: Setup GPG key
run: |
echo "Setting up GPG key..."
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --import --batch --yes
# Get the key ID
GPG_KEY_ID=$(gpg --list-secret-keys --keyid-format LONG | grep sec | head -1 | awk '{print $2}' | cut -d'/' -f2)
echo "GPG_KEY_ID=$GPG_KEY_ID" >> $GITHUB_ENV
- name: Sign source package
run: |
echo "Signing package with GPG key $GPG_KEY_ID..."
debsign -k $GPG_KEY_ID amdxdna-dkms_*${{ matrix.ubuntu_release }}${{ matrix.build }}_source.changes
- name: Upload to PPA
run: |
echo "Uploading to ppa:amd-team/xrt for ${{ matrix.ubuntu_release }}..."
dput ppa:amd-team/xrt amdxdna-dkms_*${{ matrix.ubuntu_release }}${{ matrix.build }}_source.changes