mirror of
https://github.com/ublue-os/akmods.git
synced 2026-11-03 23:09:54 -09:00
- New akmods build infra
- Builds ublue-os/ublue-akmods-others (just a cache) and ublue-os/{silverblue,...}-extended
- build-others.{sh,Containerfile} work similiar to ublue-os/nvidia
- The akmods signing key is installed with ublue-os-akmods-key.spec, which was previously installed in ublue-os-nvidia-addons.spec
- Just is now installed in -main and wont be build/installed here or in -nvidia, instead the default justfile is extended with justfile-akmods
This commit is contained in:
parent
42a863b2bb
commit
4e1267c261
18 changed files with 582 additions and 0 deletions
1
.github/CODEOWNERS
vendored
Normal file
1
.github/CODEOWNERS
vendored
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
* @castrojo
|
||||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
5
.github/ISSUE_TEMPLATE/config.yml
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
blank_issues_enabled: true
|
||||||
|
contact_links:
|
||||||
|
- name: Questions
|
||||||
|
url: https://github.com/orgs/ublue-os/discussions/
|
||||||
|
about: Ask a question, share tips, and help others
|
||||||
35
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
35
.github/ISSUE_TEMPLATE/feature_request.yml
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
||||||
|
name: Request a Package
|
||||||
|
description: Request an RPM package to be included in an image
|
||||||
|
labels: [package-request]
|
||||||
|
|
||||||
|
body:
|
||||||
|
- type: markdown
|
||||||
|
attributes:
|
||||||
|
value: |
|
||||||
|
Thank you for taking the time to fill out this request!
|
||||||
|
- type: textarea
|
||||||
|
id: describe-bug
|
||||||
|
attributes:
|
||||||
|
label: Describe the package
|
||||||
|
description: Include why you feel this should be on the image
|
||||||
|
placeholder: Tell us what you need
|
||||||
|
value: "I'd like to request the package `vim` because ..."
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
- type: dropdown
|
||||||
|
id: image
|
||||||
|
attributes:
|
||||||
|
label: Image
|
||||||
|
description: Which specific image do you want?
|
||||||
|
options:
|
||||||
|
- All Images
|
||||||
|
- Bazzite
|
||||||
|
- Kinoite
|
||||||
|
- LXQt
|
||||||
|
- Mate
|
||||||
|
- Silverblue
|
||||||
|
- Ubuntu
|
||||||
|
- Vauxite
|
||||||
|
validations:
|
||||||
|
required: true
|
||||||
|
|
||||||
11
.github/dependabot.yml
vendored
Normal file
11
.github/dependabot.yml
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
# To get started with Dependabot version updates, you'll need to specify which
|
||||||
|
# package ecosystems to update and where the package manifests are located.
|
||||||
|
# Please see the documentation for all configuration options:
|
||||||
|
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||||
|
|
||||||
|
version: 2
|
||||||
|
updates:
|
||||||
|
- package-ecosystem: "github-actions"
|
||||||
|
directory: "/"
|
||||||
|
schedule:
|
||||||
|
interval: "weekly"
|
||||||
335
.github/workflows/build.yml
vendored
Normal file
335
.github/workflows/build.yml
vendored
Normal file
|
|
@ -0,0 +1,335 @@
|
||||||
|
name: build-ublue
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- '**.txt'
|
||||||
|
schedule:
|
||||||
|
- cron: '20 20 * * *' # 8:20pm everyday
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
paths-ignore:
|
||||||
|
- '**.md'
|
||||||
|
- '**.txt'
|
||||||
|
env:
|
||||||
|
IMAGE_BASE_NAME: main
|
||||||
|
IMAGE_AKMODS_NAME: extended
|
||||||
|
IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }}
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-others-akmod:
|
||||||
|
name: Build others
|
||||||
|
needs: build-main
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
id-token: write
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
major_version: [37, 38]
|
||||||
|
steps:
|
||||||
|
# Checkout push-to-registry action GitHub repository
|
||||||
|
- name: Checkout Push to Registry action
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Matrix Variables
|
||||||
|
run: |
|
||||||
|
REPO=${{ github.repository }}
|
||||||
|
echo "IMAGE_NAME=ublue-akmod-others" >> $GITHUB_ENV
|
||||||
|
- name: Generate tags
|
||||||
|
id: generate-tags
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Generate a timestamp for creating an image version history
|
||||||
|
TIMESTAMP="$(date +%Y%m%d)"
|
||||||
|
VARIANT="${{ matrix.major_version }}"
|
||||||
|
|
||||||
|
COMMIT_TAGS=()
|
||||||
|
BUILD_TAGS=()
|
||||||
|
|
||||||
|
# Have tags for tracking builds during pull request
|
||||||
|
SHA_SHORT="$(git rev-parse --short HEAD)"
|
||||||
|
COMMIT_TAGS+=("pr-${{ github.event.number }}-${VARIANT}")
|
||||||
|
COMMIT_TAGS+=("${SHA_SHORT}-${VARIANT}")
|
||||||
|
|
||||||
|
BUILD_TAGS=("${VARIANT}" "${VARIANT}-${TIMESTAMP}")
|
||||||
|
|
||||||
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
|
echo "Generated the following commit tags: "
|
||||||
|
for TAG in "${COMMIT_TAGS[@]}"; do
|
||||||
|
echo "${TAG}"
|
||||||
|
done
|
||||||
|
|
||||||
|
alias_tags=("${COMMIT_TAGS[@]}")
|
||||||
|
else
|
||||||
|
alias_tags=("${BUILD_TAGS[@]}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Generated the following build tags: "
|
||||||
|
for TAG in "${BUILD_TAGS[@]}"; do
|
||||||
|
echo "${TAG}"
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "alias_tags=${alias_tags[*]}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
- name: Retrieve akmods signing key
|
||||||
|
run: |
|
||||||
|
mkdir -p certs
|
||||||
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
|
echo "Using test signing key"
|
||||||
|
else
|
||||||
|
echo "${{ secrets.AKMOD_PRIVKEY }}" > certs/private_key.priv
|
||||||
|
fi
|
||||||
|
# DEBUG: get character count of key
|
||||||
|
wc -c certs/private_key.priv
|
||||||
|
|
||||||
|
# Build metadata
|
||||||
|
- name: Image Metadata
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
id: meta
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.IMAGE_NAME }}
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
|
||||||
|
org.opencontainers.image.description=ublue-os ${{ env.IMAGE_NAME }} with akmods-nvidia packages pre-built
|
||||||
|
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/${{ github.repository }}/main/README.md
|
||||||
|
io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/1728152?s=200&v=4
|
||||||
|
# Build image using Buildah action
|
||||||
|
- name: Build Image
|
||||||
|
id: build_image
|
||||||
|
uses: redhat-actions/buildah-build@v2
|
||||||
|
with:
|
||||||
|
containerfiles: |
|
||||||
|
./build-others.Containerfile
|
||||||
|
image: ${{ env.IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
${{ steps.generate-tags.outputs.alias_tags }}
|
||||||
|
build-args: |
|
||||||
|
IMAGE_NAME=base-main
|
||||||
|
FEDORA_MAJOR_VERSION=${{ matrix.major_version }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
oci: false
|
||||||
|
|
||||||
|
# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
|
||||||
|
# https://github.com/macbre/push-to-ghcr/issues/12
|
||||||
|
- name: Lowercase Registry
|
||||||
|
id: registry_case
|
||||||
|
uses: ASzc/change-string-case-action@v5
|
||||||
|
with:
|
||||||
|
string: ${{ env.IMAGE_REGISTRY }}
|
||||||
|
|
||||||
|
# Push the image to GHCR (Image Registry)
|
||||||
|
- name: Push To GHCR
|
||||||
|
uses: redhat-actions/push-to-registry@v2
|
||||||
|
id: push
|
||||||
|
env:
|
||||||
|
REGISTRY_USER: ${{ github.actor }}
|
||||||
|
REGISTRY_PASSWORD: ${{ github.token }}
|
||||||
|
with:
|
||||||
|
image: ${{ steps.build_image.outputs.image }}
|
||||||
|
tags: ${{ steps.build_image.outputs.tags }}
|
||||||
|
registry: ${{ steps.registry_case.outputs.lowercase }}
|
||||||
|
username: ${{ env.REGISTRY_USER }}
|
||||||
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
|
extra-args: |
|
||||||
|
--disable-content-trust
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Sign container
|
||||||
|
- uses: sigstore/cosign-installer@v3.0.1
|
||||||
|
|
||||||
|
# Only needed when running `cosign sign` using a key
|
||||||
|
- name: Write signing key to disk
|
||||||
|
run: |
|
||||||
|
echo "${{ env.COSIGN_PRIVATE_KEY }}" > cosign.key
|
||||||
|
# DEBUG: get character count of key
|
||||||
|
wc -c cosign.key
|
||||||
|
env:
|
||||||
|
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
|
||||||
|
|
||||||
|
- name: Sign container image
|
||||||
|
run: |
|
||||||
|
cosign sign -y --key cosign.key ${{ steps.registry_case.outputs.lowercase }}/${{ steps.build_image.outputs.image }}@${TAGS}
|
||||||
|
env:
|
||||||
|
TAGS: ${{ steps.push.outputs.digest }}
|
||||||
|
COSIGN_EXPERIMENTAL: false
|
||||||
|
|
||||||
|
- name: Echo outputs
|
||||||
|
run: |
|
||||||
|
echo "${{ toJSON(steps.push.outputs) }}"
|
||||||
|
|
||||||
|
build-extended:
|
||||||
|
name: main with akmods
|
||||||
|
needs: build-others-akmod
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
contents: read
|
||||||
|
packages: write
|
||||||
|
id-token: write
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
image_name: [silverblue, kinoite, vauxite, sericea, base, lxqt, mate]
|
||||||
|
major_version: [37, 38]
|
||||||
|
include:
|
||||||
|
- major_version: 37
|
||||||
|
is_latest_version: true
|
||||||
|
is_stable_version: true
|
||||||
|
- major_version: 38
|
||||||
|
is_latest_version: true
|
||||||
|
is_stable_version: false
|
||||||
|
exclude:
|
||||||
|
# There is no Fedora 37 version of sericea
|
||||||
|
# When F38 is added, sericea will automatically be built too
|
||||||
|
- image_name: sericea
|
||||||
|
major_version: 37
|
||||||
|
steps:
|
||||||
|
# Checkout push-to-registry action GitHub repository
|
||||||
|
- name: Checkout Push to Registry action
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: Matrix Variables
|
||||||
|
run: |
|
||||||
|
if [[ "${{ matrix.image_name }}" == "lxqt" || "${{ matrix.image_name }}" == "mate" ]]; then
|
||||||
|
echo "SOURCE_IMAGE=base-main" >> $GITHUB_ENV
|
||||||
|
else
|
||||||
|
echo "SOURCE_IMAGE=${{ format('{0}-{1}', matrix.image_name, env.IMAGE_BASE_NAME) }}" >> $GITHUB_ENV
|
||||||
|
fi
|
||||||
|
echo "IMAGE_NAME=${{ format('{0}-{1}', matrix.image_name, env.IMAGE_AKMODS_NAME) }}" >> $GITHUB_ENV
|
||||||
|
|
||||||
|
- name: Generate tags
|
||||||
|
id: generate-tags
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
# Generate a timestamp for creating an image version history
|
||||||
|
TIMESTAMP="$(date +%Y%m%d)"
|
||||||
|
MAJOR_VERSION="${{ matrix.major_version }}"
|
||||||
|
COMMIT_TAGS=()
|
||||||
|
BUILD_TAGS=()
|
||||||
|
# Have tags for tracking builds during pull request
|
||||||
|
SHA_SHORT="$(git rev-parse --short HEAD)"
|
||||||
|
COMMIT_TAGS+=("pr-${{ github.event.number }}-${MAJOR_VERSION}")
|
||||||
|
COMMIT_TAGS+=("${SHA_SHORT}-${MAJOR_VERSION}")
|
||||||
|
if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
|
||||||
|
[[ "${{ matrix.is_stable_version }}" == "true" ]]; then
|
||||||
|
COMMIT_TAGS+=("pr-${{ github.event.number }}")
|
||||||
|
COMMIT_TAGS+=("${SHA_SHORT}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
BUILD_TAGS=("${MAJOR_VERSION}" "${MAJOR_VERSION}-${TIMESTAMP}")
|
||||||
|
|
||||||
|
if [[ "${{ matrix.is_latest_version }}" == "true" ]] && \
|
||||||
|
[[ "${{ matrix.is_stable_version }}" == "true" ]]; then
|
||||||
|
BUILD_TAGS+=("${TIMESTAMP}")
|
||||||
|
BUILD_TAGS+=("latest")
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
|
||||||
|
echo "Generated the following commit tags: "
|
||||||
|
for TAG in "${COMMIT_TAGS[@]}"; do
|
||||||
|
echo "${TAG}"
|
||||||
|
done
|
||||||
|
alias_tags=("${COMMIT_TAGS[@]}")
|
||||||
|
else
|
||||||
|
alias_tags=("${BUILD_TAGS[@]}")
|
||||||
|
fi
|
||||||
|
echo "Generated the following build tags: "
|
||||||
|
for TAG in "${BUILD_TAGS[@]}"; do
|
||||||
|
echo "${TAG}"
|
||||||
|
done
|
||||||
|
echo "alias_tags=${alias_tags[*]}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# Build metadata
|
||||||
|
- name: Image Metadata
|
||||||
|
uses: docker/metadata-action@v4
|
||||||
|
id: meta
|
||||||
|
with:
|
||||||
|
images: |
|
||||||
|
${{ env.IMAGE_NAME }}
|
||||||
|
labels: |
|
||||||
|
org.opencontainers.image.title=${{ env.IMAGE_NAME }}
|
||||||
|
org.opencontainers.image.description=A base ${{ env.IMAGE_NAME }} image with batteries included
|
||||||
|
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/ublue-os/main/main/README.md
|
||||||
|
io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/120078124?s=200&v=4
|
||||||
|
|
||||||
|
# Build image using Buildah action
|
||||||
|
- name: Build Image
|
||||||
|
id: build_image
|
||||||
|
uses: redhat-actions/buildah-build@v2
|
||||||
|
with:
|
||||||
|
containerfiles: |
|
||||||
|
./extended.Containerfile
|
||||||
|
image: ${{ env.IMAGE_NAME }}
|
||||||
|
tags: |
|
||||||
|
${{ steps.generate-tags.outputs.alias_tags }}
|
||||||
|
build-args: |
|
||||||
|
IMAGE_NAME=${{ matrix.image_name }}
|
||||||
|
SOURCE_IMAGE=${{ env.SOURCE_IMAGE }}
|
||||||
|
FEDORA_MAJOR_VERSION=${{ matrix.major_version }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
oci: false
|
||||||
|
|
||||||
|
# Workaround bug where capital letters in your GitHub username make it impossible to push to GHCR.
|
||||||
|
# https://github.com/macbre/push-to-ghcr/issues/12
|
||||||
|
- name: Lowercase Registry
|
||||||
|
id: registry_case
|
||||||
|
uses: ASzc/change-string-case-action@v5
|
||||||
|
with:
|
||||||
|
string: ${{ env.IMAGE_REGISTRY }}
|
||||||
|
|
||||||
|
# Push the image to GHCR (Image Registry)
|
||||||
|
- name: Push To GHCR
|
||||||
|
uses: redhat-actions/push-to-registry@v2
|
||||||
|
id: push
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
env:
|
||||||
|
REGISTRY_USER: ${{ github.actor }}
|
||||||
|
REGISTRY_PASSWORD: ${{ github.token }}
|
||||||
|
with:
|
||||||
|
image: ${{ steps.build_image.outputs.image }}
|
||||||
|
tags: ${{ steps.build_image.outputs.tags }}
|
||||||
|
registry: ${{ steps.registry_case.outputs.lowercase }}
|
||||||
|
username: ${{ env.REGISTRY_USER }}
|
||||||
|
password: ${{ env.REGISTRY_PASSWORD }}
|
||||||
|
extra-args: |
|
||||||
|
--disable-content-trust
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v2
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
# Sign container
|
||||||
|
- uses: sigstore/cosign-installer@v3.0.1
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
|
||||||
|
- name: Sign container image
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
run: |
|
||||||
|
echo "${{ env.COSIGN_PRIVATE_KEY }}" > cosign.key
|
||||||
|
wc -c cosign.key
|
||||||
|
cosign sign -y --key cosign.key ${{ steps.registry_case.outputs.lowercase }}/${{ env.IMAGE_NAME }}@${TAGS}
|
||||||
|
env:
|
||||||
|
TAGS: ${{ steps.push.outputs.digest }}
|
||||||
|
COSIGN_EXPERIMENTAL: false
|
||||||
|
COSIGN_PRIVATE_KEY: ${{ secrets.SIGNING_SECRET }}
|
||||||
|
|
||||||
|
- name: Echo outputs
|
||||||
|
if: github.event_name != 'pull_request'
|
||||||
|
run: |
|
||||||
|
echo "${{ toJSON(steps.push.outputs) }}"
|
||||||
14
.github/workflows/conventional-commits.yml
vendored
Normal file
14
.github/workflows/conventional-commits.yml
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
name: Conventional Commits
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
branches: main
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
name: Conventional Commits
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: webiny/action-conventional-commits@v1.1.0
|
||||||
13
.github/workflows/release-please.yml
vendored
Normal file
13
.github/workflows/release-please.yml
vendored
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- main
|
||||||
|
name: release-please
|
||||||
|
jobs:
|
||||||
|
release-please:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: google-github-actions/release-please-action@v3
|
||||||
|
with:
|
||||||
|
release-type: node
|
||||||
|
package-name: release-please-action
|
||||||
19
build-others.Containerfile
Normal file
19
build-others.Containerfile
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
#Build from ublue/base, simpley because it's the smallest image
|
||||||
|
ARG IMAGE_NAME="${IMAGE_NAME:-base-main}"
|
||||||
|
ARG BASE_IMAGE="ghcr.io/dhoell/${IMAGE_NAME}"
|
||||||
|
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}"
|
||||||
|
|
||||||
|
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder
|
||||||
|
|
||||||
|
COPY build-others.sh /tmp/build-others.sh
|
||||||
|
|
||||||
|
ADD certs /tmp/certs
|
||||||
|
|
||||||
|
ADD ublue-os-akmods-key.spec /tmp/ublue-os-akmods-key/ublue-os-akmods-key.spec
|
||||||
|
|
||||||
|
RUN /tmp/build-others.sh
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
|
||||||
|
COPY --from=builder /var/cache /var/cache
|
||||||
|
COPY --from=builder /tmp/ublue-os-akmods-key /tmp/ublue-os-akmods-key
|
||||||
46
build-others.sh
Executable file
46
build-others.sh
Executable file
|
|
@ -0,0 +1,46 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -oeux pipefail
|
||||||
|
|
||||||
|
RELEASE="$(rpm -E '%fedora.%_arch')"
|
||||||
|
|
||||||
|
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-{cisco-openh264,modular,updates-modular}.repo
|
||||||
|
|
||||||
|
rpm-ostree install \
|
||||||
|
akmod-v4l2loopback-*.fc${RELEASE} \
|
||||||
|
mock
|
||||||
|
|
||||||
|
# alternatives cannot create symlinks on its own during a container build
|
||||||
|
ln -s /usr/bin/ld.bfd /etc/alternatives/ld && ln -s /etc/alternatives/ld /usr/bin/ld
|
||||||
|
|
||||||
|
if [[ ! -s "/tmp/certs/private_key.priv" ]]; then
|
||||||
|
echo "WARNING: Using test signing key. Run './generate-akmods-key' for production builds."
|
||||||
|
cp /tmp/certs/private_key.priv{.test,}
|
||||||
|
cp /tmp/certs/public_key.der{.test,}
|
||||||
|
fi
|
||||||
|
|
||||||
|
install -Dm644 /tmp/certs/public_key.der /etc/pki/akmods/certs/public_key.der
|
||||||
|
install -Dm644 /tmp/certs/private_key.priv /etc/pki/akmods/private/private_key.priv
|
||||||
|
|
||||||
|
# Either successfully build and install the kernel modules, or fail early with debug output
|
||||||
|
KERNEL_VERSION="$(rpm -q kernel --queryformat '%{VERSION}-%{RELEASE}.%{ARCH}')"
|
||||||
|
LOOPBACK_AKMOD_VERSION="$(basename "$(rpm -q "akmod-v4l2loopback" --queryformat '%{VERSION}-%{RELEASE}')" ".fc${RELEASE%%.*}")"
|
||||||
|
|
||||||
|
akmods --force --kernels "${KERNEL_VERSION}" --kmod "v4l2loopback"
|
||||||
|
|
||||||
|
modinfo /usr/lib/modules/${KERNEL_VERSION}/extra/v4l2loopback/v4l2loopback.ko.xz > /dev/null || \
|
||||||
|
(cat /var/cache/akmods/v4l2loopback/${LOOPBACK_AKMOD_VERSION}-for-${KERNEL_VERSION}.failed.log && exit 1)
|
||||||
|
|
||||||
|
install -D /etc/pki/akmods/certs/public_key.der /tmp/ublue-os-akmods-key/rpmbuild/SOURCES/public_key.der
|
||||||
|
|
||||||
|
rpmbuild -ba \
|
||||||
|
--define '_topdir /tmp/ublue-os-akmods-key/rpmbuild' \
|
||||||
|
--define '%_tmppath %{_topdir}/tmp' \
|
||||||
|
/tmp/ublue-os-akmods-key/ublue-os-akmods-key.spec
|
||||||
|
|
||||||
|
|
||||||
|
cat <<EOF > /var/cache/akmods/akmod-vars
|
||||||
|
KERNEL_VERSION=${KERNEL_VERSION}
|
||||||
|
RELEASE=${RELEASE}
|
||||||
|
LOOPBACK_AKMOD_VERSION=${LOOPBACK_AKMOD_VERSION}
|
||||||
|
EOF
|
||||||
0
certs/private_key.priv
Normal file
0
certs/private_key.priv
Normal file
28
certs/private_key.priv.test
Normal file
28
certs/private_key.priv.test
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
-----BEGIN PRIVATE KEY-----
|
||||||
|
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDMaUcd1e4fYogO
|
||||||
|
N/cYZc22xmzsAetfhgVLvHNkKb/mNHywkGK4T7vPwvpQCxFGUufmRxYlGJra/QCn
|
||||||
|
WjYd4/thBWoU/K7RBcLJJpuHFBODls5eBdXGXXpeTYmRKqcT6qBEJf4p21N2BqMz
|
||||||
|
Mmh242TUKFOJ3rWWKXxWb8peNC+aMfIMKICLYSQvoonjHQm1ShMjkgTiOZQIaVLB
|
||||||
|
zjfNewdaNCHOMh49xQrQxquTXJuNU6Y7LvPGSIdxShwotGi/E+Z3Y4kvUCapo0os
|
||||||
|
wjhXXbhuj/XTH7gF+15mvHD9k1RPyVACLgmLyzM9LSOr80/rslj0nQf1KF8jW+bq
|
||||||
|
tze3bZ17AgMBAAECggEABG8GJV4GB7U96T0KhYNzxlKgezABeHVyOPXR9Oq46Ffc
|
||||||
|
GoJPOds04ilC/6h1y/YxZHvHPa++cCCLupWI1fYjdjPFXMYsTolW88D8H55uW+zR
|
||||||
|
9hUfUWmmpVP+N2Fa9WIh7sh6LlM9CLLVKF+gB3AgOD/VrAhiHOsycLeFBq0QGUKR
|
||||||
|
IkG7pKrF7CX1oal9WOnPo0r2oNUdP4yYCyEa7e7APTUwGbuihtixdnrYyiwEmpp0
|
||||||
|
rfZPfBgh+3ACqeUO12gIdtjd85/3UsQ2kLt9/9m2q7Fa6aEcYQVz6nznLKuY4EVm
|
||||||
|
zoYzAXfC2KsGol2V6eNY4MNBuvzY4DDJnpyjzicOEQKBgQDX4vd+t7ygUyZmGu6V
|
||||||
|
CsF6uDSRHvHYJvJp2fR5spz6eRj7WXMkCTnyjzpDkMvbxtvjlEBntixlQicXsytW
|
||||||
|
u2oayYPHl7ppGIEddcKlHsWUFqsAOATkQy3Bs5DCfzliELApGv5zoXJJC/A/iaiD
|
||||||
|
GXVDJ0+FdSldetpMGw//rItoqwKBgQDyZHcrt0sVY6oxW2JpEVZXNSOoNMjBQQgL
|
||||||
|
+7lQyFpfXl9wfOXUkcqFc0m5UWPbTrI9OBZbXYcvI1eV/Xbtu3gdGiOv2sYauO1Z
|
||||||
|
HgAS2B3yNGllzj8dNucELFCSNLwthTGhYO03bWflV7XbsG9O8SrZF2LaEglL2V8m
|
||||||
|
wqPP5aE+cQKBgQCu7kp9c4R0pOvIcKpCOqTsO7bcoKZ275geDW377q8khlunz6Ns
|
||||||
|
380EruoXNYz6WPh0P/ywDP2MTz4+BgBoFxSy//a4FEoIPsLgjDtccMLIbFXDp6DP
|
||||||
|
FWBORKJX958Xx033ANiN+ZQRfIr/8RuKn2ZVM9VL3tPV22ZnpMYh9j5AYQKBgF36
|
||||||
|
+gGnJaN7aweMCRH3uORDJDoZjSTw0+/hf66EoBWN/68bnfjXNhCb7J+/oNntH0qB
|
||||||
|
LpnqH3n1WAY9qhjusNmHwwJx7pF51fzRlvG3fZTlIWBpoSrwmI2TqQGnFLcJh36s
|
||||||
|
mAz/jGLtqQMu21leRGC7ooYurBAOjcf3e5Al1mjhAoGAT0L02oGzce1vbwfqHCRK
|
||||||
|
PexrY8GvNU6/Bml70P9n6FX3jQwt6Dhh1JkZZofv+wJWjOj4zV/Z0tj1uB1Ax9nR
|
||||||
|
Z+87Pu7iYuNaYFGT9s76q+sbQtiUu5Gwlg6CyRSwbKdL15UBWf+Bt22Tp3NfbEoh
|
||||||
|
OevJKeniH2GYy+ME5XxXb14=
|
||||||
|
-----END PRIVATE KEY-----
|
||||||
BIN
certs/public_key.der
Normal file
BIN
certs/public_key.der
Normal file
Binary file not shown.
BIN
certs/public_key.der.test
Normal file
BIN
certs/public_key.der.test
Normal file
Binary file not shown.
4
cosign.pub
Normal file
4
cosign.pub
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
-----BEGIN PUBLIC KEY-----
|
||||||
|
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEWs65+GCxjOBnyDxvYnVZYVbGBirj
|
||||||
|
BtB6InSCp/c8FRNy0g4nEQWzPIpPznX6TzUNqe6ha11rfaqACjoZOb2NlQ==
|
||||||
|
-----END PUBLIC KEY-----
|
||||||
12
extended-install.sh
Executable file
12
extended-install.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -ouex pipefail
|
||||||
|
|
||||||
|
#source akmod variables
|
||||||
|
source /var/cache/akmods/akmod-vars
|
||||||
|
|
||||||
|
#install local kmod RPMs and possible necessary remote packages
|
||||||
|
rpm-ostree install \
|
||||||
|
v4l2loopback \
|
||||||
|
/var/cache/akmods/v4l2loopback/kmod-v4l2loopback-${KERNEL_VERSION}-${LOOPBACK_AKMOD_VERSION}.fc${RELEASE}.rpm \
|
||||||
|
/tmp/ublue-os-akmods-key/rpmbuild/RPMS/noarch/ublue-os-akmods-key-*.rpm
|
||||||
23
extended.Containerfile
Normal file
23
extended.Containerfile
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
ARG IMAGE_NAME="${IMAGE_NAME:-silverblue}"
|
||||||
|
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-silverblue}"
|
||||||
|
ARG BASE_IMAGE="ghcr.io/dhoell/${SOURCE_IMAGE}"
|
||||||
|
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-37}"
|
||||||
|
|
||||||
|
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS builder
|
||||||
|
|
||||||
|
ARG IMAGE_NAME="${IMAGE_NAME}"
|
||||||
|
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
|
||||||
|
ARG AKMOD_OTHERS="ghcr.io/dhoell/ublue-akmod-others"
|
||||||
|
ARG AKMODS_VERSION="${FEDORA_MAJOR_VERSION}"
|
||||||
|
|
||||||
|
COPY --from=${AKMOD_OTHERS}:${AKMODS_VERSION} / .
|
||||||
|
|
||||||
|
ADD justfile-akmods /tmp/justfile-akmods
|
||||||
|
RUN cat /tmp/justfile-akmods >> /usr/share/ublue-os/ublue-os-just/justfile
|
||||||
|
|
||||||
|
ADD extended-install.sh /tmp/extended-install.sh
|
||||||
|
|
||||||
|
RUN /tmp/extended-install.sh
|
||||||
|
RUN rm -rf /tmp/* /var/*
|
||||||
|
RUN ostree container commit
|
||||||
|
RUN mkdir -p /var/tmp && chmod -R 1777 /var/tmp
|
||||||
3
justfile-akmods
Normal file
3
justfile-akmods
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
enroll-secure-boot-key:
|
||||||
|
sudo mokutil --import /etc/pki/akmods/certs/akmods-ublue.der
|
||||||
|
|
||||||
33
ublue-os-akmods-key.spec
Normal file
33
ublue-os-akmods-key.spec
Normal file
|
|
@ -0,0 +1,33 @@
|
||||||
|
Name: ublue-os-akmods-key
|
||||||
|
Version: 0.1
|
||||||
|
Release: 1%{?dist}
|
||||||
|
Summary: Signing key for ublue os akmods
|
||||||
|
|
||||||
|
License: MIT
|
||||||
|
URL: https://github.com/ublue-os/akmods
|
||||||
|
|
||||||
|
BuildArch: noarch
|
||||||
|
Supplements: mokutil policycoreutils
|
||||||
|
|
||||||
|
Source0: public_key.der
|
||||||
|
|
||||||
|
%description
|
||||||
|
Add the signing key for importing with mokutil to enable secure boot for kernel modules
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -c -T
|
||||||
|
|
||||||
|
|
||||||
|
%build
|
||||||
|
# Have different name for *.der in case kmodgenca is needed for creating more keys
|
||||||
|
install -Dm0644 %{SOURCE0} %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/pki/akmods/certs/akmods-ublue.der
|
||||||
|
|
||||||
|
install -Dm0644 %{buildroot}%{_datadir}/ublue-os/%{_sysconfdir}/pki/akmods/certs/akmods-ublue.der %{buildroot}%{_sysconfdir}/pki/akmods/certs/akmods-ublue.der
|
||||||
|
|
||||||
|
%files
|
||||||
|
%attr(0644,root,root) %{_datadir}/ublue-os/%{_sysconfdir}/pki/akmods/certs/akmods-ublue.der
|
||||||
|
%attr(0644,root,root) %{_sysconfdir}/pki/akmods/certs/akmods-ublue.der
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Fri Mar 17 2034 David Hoell - 0.1
|
||||||
|
- Add key for inrolling ublue kernel modules with new build infrastucture
|
||||||
Loading…
Reference in a new issue