Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions .github/workflows/arch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,31 @@ jobs:
- name: Setup ORAS
uses: oras-project/setup-oras@22ce207df3b08e061f537244349aac6ae1d214f6 # v1

- name: Fetch Arch kernel config
shell: bash
run: |
set -euo pipefail
CACHE="${GITHUB_WORKSPACE}/pkgcache"
PKGVER=$(pacman -Si linux-headers | awk -F': ' '/^Version/ {print $2; exit}')
mkdir -p "$CACHE"
pacman -Sw --noconfirm --cachedir "$CACHE" linux-headers
PKG=$(find "$CACHE" -maxdepth 1 -name 'linux-headers-*.pkg.tar.zst' -type f)
if [ "$(printf '%s\n' "$PKG" | wc -l)" -ne 1 ] || [ -z "$PKG" ]; then
echo "::error::Expected exactly one linux-headers package, found: ${PKG:-none}"
exit 1
fi
CFG=$(tar --zstd -tf "$PKG" | grep -E '^usr/lib/modules/[^/]+/build/\.config$' || true)
if [ "$(printf '%s\n' "$CFG" | wc -l)" -ne 1 ] || [ -z "$CFG" ]; then
echo "::error::Expected exactly one kernel config in $PKG, found: ${CFG:-none}"
exit 1
fi
tar --zstd -xOf "$PKG" "$CFG" > distro-base.config
if [ ! -s distro-base.config ]; then
echo "::error::Extracted Arch kernel config is empty"
exit 1
fi
rm -rf "$CACHE"

- name: Compute content hash
id: content-hash
shell: bash
Expand All @@ -113,7 +138,7 @@ jobs:
echo "distro=arch"
sha256sum \
arch/PKGBUILD \
arch/config \
distro-base.config \
config/arch.config.set \
config/ogc.config.set \
config/arch.config.unset \
Expand Down Expand Up @@ -202,7 +227,7 @@ jobs:
if: steps.check-existing.outputs.exists != 'true'
uses: OpenGamingCollective/kernel-configurator@5b4abc58a2edf89941180dbbe33b26415db23b0b # v1.0.1
with:
config: arch/config
config: distro-base.config
set: |
config/arch.config.set
config/ogc.config.set
Expand Down
30 changes: 28 additions & 2 deletions .github/workflows/fedora.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,32 @@ jobs:
- name: Setup ORAS
uses: oras-project/setup-oras@22ce207df3b08e061f537244349aac6ae1d214f6 # v1

- name: Fetch Fedora kernel config
shell: bash
run: |
set -euo pipefail
CACHE="${GITHUB_WORKSPACE}/pkgcache"
dnf -y install dnf5-plugins cpio
mkdir -p "$CACHE"
dnf download --destdir "$CACHE" kernel-core
RPM=$(find "$CACHE" -maxdepth 1 -name 'kernel-core-*.rpm' -type f)
if [ "$(printf '%s\n' "$RPM" | wc -l)" -ne 1 ] || [ -z "$RPM" ]; then
echo "::error::Expected exactly one kernel-core package, found: ${RPM:-none}"
exit 1
fi
echo "::notice::Base config from Fedora $(basename "$RPM")"
CFG=$(rpm -qlp "$RPM" | grep -E '^/lib/modules/[^/]+/config$' || true)
if [ "$(printf '%s\n' "$CFG" | wc -l)" -ne 1 ] || [ -z "$CFG" ]; then
echo "::error::Expected exactly one kernel config in $RPM, found: ${CFG:-none}"
exit 1
fi
rpm2cpio "$RPM" | cpio -i --to-stdout ".${CFG}" > distro-base.config
if [ ! -s distro-base.config ]; then
echo "::error::Extracted Fedora kernel config is empty"
exit 1
fi
rm -rf "$CACHE"

- name: Compute content hash
id: content-hash
shell: bash
Expand All @@ -107,7 +133,7 @@ jobs:
echo "fedora_version=${{ matrix.fedora_version }}"
sha256sum \
fedora/kernel.spec \
fedora/config \
distro-base.config \
fedora/kvm_stat.logrotate \
config/fedora.config.set \
config/ogc.config.set \
Expand Down Expand Up @@ -210,7 +236,7 @@ jobs:
if: steps.check-existing.outputs.exists != 'true'
uses: OpenGamingCollective/kernel-configurator@5b4abc58a2edf89941180dbbe33b26415db23b0b # v1.0.1
with:
config: fedora/config
config: distro-base.config
set: |
config/fedora.config.set
config/ogc.config.set
Expand Down
33 changes: 31 additions & 2 deletions .github/workflows/ubuntu.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,35 @@ jobs:
- name: Setup ORAS
uses: oras-project/setup-oras@22ce207df3b08e061f537244349aac6ae1d214f6 # v1

- name: Fetch Ubuntu kernel config
shell: bash
run: |
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
CACHE="${GITHUB_WORKSPACE}/pkgcache"
ABI=$(apt-cache depends linux-image-generic \
| awk -F'linux-image-' '/Depends: linux-image-[0-9]/ {print $2}' \
| sed 's/-generic$//')
if [ "$(printf '%s\n' "$ABI" | wc -l)" -ne 1 ] || [ -z "$ABI" ]; then
echo "::error::Could not resolve a single kernel ABI from linux-image-generic, got: ${ABI:-none}"
exit 1
fi
echo "::notice::Base config from Ubuntu linux-buildinfo-${ABI}-generic"
mkdir -p "$CACHE"
( cd "$CACHE" && apt-get download -o APT::Sandbox::User=root "linux-buildinfo-${ABI}-generic" )
DEB=$(find "$CACHE" -maxdepth 1 -name 'linux-buildinfo-*.deb' -type f)
if [ "$(printf '%s\n' "$DEB" | wc -l)" -ne 1 ] || [ -z "$DEB" ]; then
echo "::error::Expected exactly one linux-buildinfo package, found: ${DEB:-none}"
exit 1
fi
dpkg-deb --fsys-tarfile "$DEB" \
| tar -xOf - "./usr/lib/linux/${ABI}-generic/config" > distro-base.config
if [ ! -s distro-base.config ]; then
echo "::error::Extracted Ubuntu kernel config is empty"
exit 1
fi
rm -rf "$CACHE"

- name: Compute content hash
id: content-hash
shell: bash
Expand All @@ -109,7 +138,7 @@ jobs:
echo "ogc_version=${{ steps.version.outputs.ogc_version }}"
echo "distro=ubuntu"
sha256sum \
ubuntu/config \
distro-base.config \
config/ubuntu.config.set \
config/ogc.config.set \
config/ubuntu.config.unset \
Expand Down Expand Up @@ -175,7 +204,7 @@ jobs:
if: steps.check-existing.outputs.exists != 'true'
uses: OpenGamingCollective/kernel-configurator@5b4abc58a2edf89941180dbbe33b26415db23b0b # v1.0.1
with:
config: ubuntu/config
config: distro-base.config
set: |
config/ubuntu.config.set
config/ogc.config.set
Expand Down
Loading