This repository has been archived on 2025-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
Files
kernel-configs/kernel-build.yaml
2021-02-19 09:50:16 +01:00

71 lines
2.2 KiB
YAML

---
apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-debian-kernel-from-source
spec:
params:
- name: pathToContext
type: string
description: |
Path to where we build our kernel, usually /usr/src/...
default: /usr/src
resources:
inputs:
- name: kernel-configs
type: git
steps:
- name: install-kernel-source
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
echo 'deb-src http://apt-cache.lan/deb.debian.org/debian testing main' > /etc/apt/sources.list.d/src-testing.list
echo 'deb http://apt-cache.lan/deb.debian.org/debian testing main' > /etc/apt/sources.list.d/testing.list
apt update -y
apt install -y $(apt-cache search linux-source |awk '{print $1}' |tail -1)
- name: unpack-kernel-source
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
[ -d /usr/src/linux-source-5.10 ] && exit 0
echo "Unpacking /usr/src/linux-source*xz ... takes a while."
tar -C /usr/src -xf /usr/src/linux-source*xz
- name: build-kernel-riotboard
image: cr.lan/debian-kernel-build-stable
script: |
#!/usr/bin/env bash
echo "res.input.ke...path: $(resources.inputs.kernel-configs.path)"
cp $(resources.inputs.kernel-configs.path)/riotboard-5.7 /usr/src/linux-source-5.10/.config
cd /usr/src/linux-source-5.10
make ARCH=arm KBUILD_DEBARCH=armhf CROSS_COMPILE=arm-linux-gnueabihf- -j4 deb-pkg LOCALVERSION=-riot2
- name: cleanup-workspace-post
image: alpine
command:
- rm
args:
- -rfv
- /workspace/kernel-configs*
workspaces:
- name: usr-src
mountPath: /usr/src
# - name: workspace
# mountPath: /workspace
---
apiVersion: tekton.dev/v1beta1
kind: TaskRun
metadata:
name: build-debian-kernel-image
spec:
#serviceAccountName: dockerhub-service
taskRef:
name: build-debian-kernel-from-source
resources:
inputs:
- name: kernel-configs
resourceRef:
name: debian-kernel-build-git
workspaces:
- name: usr-src
persistentVolumeClaim:
claimName: tektoncd-workspaces
subPath: usr_src