diff --git a/kernel-build.yaml b/kernel-build.yaml new file mode 100644 index 0000000..c55015a --- /dev/null +++ b/kernel-build.yaml @@ -0,0 +1,83 @@ +--- +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: cleanup-workspace-pre + image: alpine + command: + - rm + args: + - -rfv + - /workspace/kernel-configs* + - 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)" + ls -la $(resources.inputs.kernel-configs.path) + cp $(resources.inputs.kernel-configs.path)/riotboard-5.7 /usr/src/linux-source-5.10/.config + #cd /usr/src/$(apt-cache search linux-source |awk '{print $1}' |tail -1) + cd /usr/src/linux-source-5.10 + pwd + ls -la + #make oldconfig + 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 \ No newline at end of file