-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature: replace Fedora with CoreOS kernel for stable releases (#116)
- Loading branch information
Showing
12 changed files
with
146 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Get CoreOS Kernel | ||
|
||
inputs: | ||
coreos-stream: | ||
description: 'The CoreOS stream to pull the image from' | ||
required: true | ||
default: 'stable' | ||
|
||
outputs: | ||
coreos-repo-version: | ||
description: 'The Fedora repository version CoreOS sources their kernel from' | ||
value: ${{ steps.extract-fedora-version.outputs.fedora-version }} | ||
coreos-kernel-release: | ||
description: 'The full CoreOS kernel version string' | ||
value: ${{ steps.extract-kernel-release.outputs.kernel-release }} | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Pull CoreOS Image | ||
shell: bash | ||
env: | ||
COREOS_STREAM: ${{ inputs.coreos-stream }} | ||
run: | | ||
docker pull quay.io/fedora/fedora-coreos:$COREOS_STREAM | ||
- name: Extract Kernel Release | ||
id: extract-kernel-release | ||
shell: bash | ||
env: | ||
COREOS_STREAM: ${{ inputs.coreos-stream }} | ||
run: | | ||
KERNEL_RELEASE=$(docker run --rm --privileged quay.io/fedora/fedora-coreos:$COREOS_STREAM sh -c \ | ||
"rpm -qa | grep -oP 'kernel-core-\K[0-9]+\.[0-9]+\.[0-9]+-[0-9]+\.fc[0-9]+' | head -n 1") | ||
echo "kernel-release=$KERNEL_RELEASE" >> $GITHUB_OUTPUT | ||
- name: Extract Fedora Repository Version | ||
shell: bash | ||
id: extract-fedora-version | ||
env: | ||
KERNEL_RELEASE: ${{ steps.extract-kernel-release.outputs.kernel-release }} | ||
run: | | ||
FEDORA_VERSION=$(echo $KERNEL_RELEASE | grep -oP 'fc\K[0-9]+') | ||
echo "fedora-version=$FEDORA_VERSION" >> $GITHUB_OUTPUT | ||
- name: Cleanup | ||
shell: bash | ||
env: | ||
COREOS_STREAM: ${{ inputs.coreos-stream }} | ||
run: | | ||
docker image rm quay.io/fedora/fedora-coreos:$COREOS_STREAM |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -euox pipefail | ||
|
||
COREOS_KERNEL="" | ||
FEDORA_VERSION="" | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case "$1" in | ||
--version) | ||
FEDORA_VERSION="$2" | ||
shift 2 | ||
;; | ||
--coreos-kernel) | ||
COREOS_KERNEL="$2" | ||
shift 2 | ||
;; | ||
*) | ||
echo "Unknown argument: $1" | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
if [[ "$COREOS_KERNEL" == "N/A" ]]; then | ||
exit 0 | ||
fi | ||
|
||
KERNEL_VERSION=$COREOS_KERNEL | ||
KERNEL_MAJOR_MINOR_PATCH=$(echo $KERNEL_VERSION | cut -d '-' -f 1) | ||
KERNEL_RELEASE=$(echo $KERNEL_VERSION | cut -d '-' -f 2) | ||
rpm-ostree override replace --experimental \ | ||
https://kojipkgs.fedoraproject.org//packages/kernel/$KERNEL_MAJOR_MINOR_PATCH/$KERNEL_RELEASE/x86_64/kernel-$KERNEL_MAJOR_MINOR_PATCH-$KERNEL_RELEASE.x86_64.rpm \ | ||
https://kojipkgs.fedoraproject.org//packages/kernel/$KERNEL_MAJOR_MINOR_PATCH/$KERNEL_RELEASE/x86_64/kernel-core-$KERNEL_MAJOR_MINOR_PATCH-$KERNEL_RELEASE.x86_64.rpm \ | ||
https://kojipkgs.fedoraproject.org//packages/kernel/$KERNEL_MAJOR_MINOR_PATCH/$KERNEL_RELEASE/x86_64/kernel-modules-$KERNEL_MAJOR_MINOR_PATCH-$KERNEL_RELEASE.x86_64.rpm \ | ||
https://kojipkgs.fedoraproject.org//packages/kernel/$KERNEL_MAJOR_MINOR_PATCH/$KERNEL_RELEASE/x86_64/kernel-modules-core-$KERNEL_MAJOR_MINOR_PATCH-$KERNEL_RELEASE.x86_64.rpm \ | ||
https://kojipkgs.fedoraproject.org//packages/kernel/$KERNEL_MAJOR_MINOR_PATCH/$KERNEL_RELEASE/x86_64/kernel-modules-extra-$KERNEL_MAJOR_MINOR_PATCH-$KERNEL_RELEASE.x86_64.rpm |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters