refactoring, one task to build them all
This commit is contained in:
59
kernel-build-debian-task.yaml
Normal file
59
kernel-build-debian-task.yaml
Normal file
@@ -0,0 +1,59 @@
|
||||
apiVersion: tekton.dev/v1beta1
|
||||
kind: Task
|
||||
metadata:
|
||||
name: build-kernel-debian
|
||||
spec:
|
||||
params:
|
||||
- name: pathToContext
|
||||
type: string
|
||||
description: |
|
||||
Path to where we build our kernel, usually /usr/src/...
|
||||
default: /usr/src
|
||||
- name: kernel_version
|
||||
type: string
|
||||
- name: make_flags
|
||||
type: array
|
||||
- name: config
|
||||
type: string
|
||||
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-$(params.kernel_version) |awk '{print $1}' |tail -1)
|
||||
- name: unpack-kernel-sources
|
||||
image: cr.lan/debian-kernel-build-stable
|
||||
script: |
|
||||
#!/usr/bin/env bash
|
||||
cd /usr/src
|
||||
for DSRC in $(ls linux-source*xz |tail -1 |awk -F '.tar' '{print $1}'); do
|
||||
D=$(basename ${DSRC})
|
||||
if [[ ! -d ${D} ]]; then
|
||||
tar -xvf ${DSRC}*.xz
|
||||
fi
|
||||
done
|
||||
- name: build-kernel
|
||||
image: cr.lan/debian-kernel-build-stable
|
||||
script: |
|
||||
#!/usr/bin/env bash
|
||||
echo "res.input.ke...path: $(resources.inputs.kernel-configs.path)"
|
||||
echo $PATH
|
||||
cp $(resources.inputs.kernel-configs.path)/$(params.config) \
|
||||
/usr/src/linux-source-${VER}/.config || exit 1
|
||||
cd /usr/src/linux-source-$(params.kernel_version)
|
||||
#distcc config
|
||||
echo "localhost/1,cpp,lzo --randomize distcc-0.distcc,cpp,lzo distcc-1.distcc,cpp,lzo distcc-2.distcc,cpp,lzo distcc-3.distcc,cpp,lzo" >/etc/distcc/hosts
|
||||
echo "ALL DISTCC HOSTS"
|
||||
distcc --show-hosts
|
||||
echo "/ALL DISTCC HOSTS"
|
||||
distcc-pump make -j20 bindeb-pkg CC=distcc $(params.make_flags[*])
|
||||
workspaces:
|
||||
- name: usr-src
|
||||
mountPath: /usr/src
|
||||
Reference in New Issue
Block a user