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-debian-task.yaml
2021-04-11 20:45:12 +02:00

64 lines
2.3 KiB
YAML

apiVersion: tekton.dev/v1beta1
kind: Task
metadata:
name: build-kernel-debian
spec:
params:
- name: kernel_version
type: string
- name: make_flags
type: string
default: ""
- name: config
type: string
- name: localversion
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 $PATH
echo "res.input.ke...path: $(resources.inputs.kernel-configs.path)"
echo "K_VERS: $(params.kernel_version)"
ls -altr /usr/src/
cp -v $(resources.inputs.kernel-configs.path)/$(params.config) \
/usr/src/linux-source-$(params.kernel_version)/.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"
ls -latr /usr/lib/distcc-pump/
#distcc-pump make -j20 bindeb-pkg CC=distcc LOCALVERSION=$(params.localversion) $(params.make_flags)
make -j4 bindeb-pkg LOCALVERSION=$(params.localversion) $(params.make_flags)
workspaces:
- name: usr-src
mountPath: /usr/src