From 6eb2c6426647fe5f038713c32fba03ef4eb995ab Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Wed, 19 Jul 2023 17:01:09 -0400 Subject: [PATCH] Remove unused kernel build scripts These scripts are superceded by lttng-modules/param-build.sh for lttng-modules and build_kernel_PARAM for system tests. Refs #1499 Change-Id: Ide19802735ff28747ef79124fd5145bc2c86af73 --- scripts/kernel/build.sh | 56 ----------------- scripts/kernel/job-generator-kernel.sh | 77 ------------------------ scripts/kernel/job-trigger-kernel.groovy | 54 ----------------- 3 files changed, 187 deletions(-) delete mode 100755 scripts/kernel/build.sh delete mode 100755 scripts/kernel/job-generator-kernel.sh delete mode 100644 scripts/kernel/job-trigger-kernel.groovy diff --git a/scripts/kernel/build.sh b/scripts/kernel/build.sh deleted file mode 100755 index 0134eda..0000000 --- a/scripts/kernel/build.sh +++ /dev/null @@ -1,56 +0,0 @@ -#!/bin/sh -# -# Copyright (C) 2015 - Jonathan Rajotte-Julien -# Michael Jeanson -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -set -exu - -#Check if ccache is present -#if [ -d /usr/lib/ccache ]; then -# echo "Using CCACHE" -# export PATH="/usr/lib/ccache:$PATH" -# export CC="ccache gcc" -# export CXX="ccache g++" -#fi - -# Use all CPU cores -NPROC=$(nproc) - -SRCDIR="${WORKSPACE}/linux" -BUILDDIR="${WORKSPACE}/build" - -# Create build directory -rm -rf "${BUILDDIR}" -mkdir -p "${BUILDDIR}" - -# Enter source dir -cd "${SRCDIR}" - -# Prepare linux sources for modules OOT build -make O="${BUILDDIR}" defconfig - -# Enable CONFIG_KALLSYMS_ALL -sed -i "s/# CONFIG_KALLSYMS_ALL is not set/CONFIG_KALLSYMS_ALL=y/g" "${BUILDDIR}"/.config - -# Build to out of tree dir -#make -j$nbrProc O="${BUILDDIR}" -make O="${BUILDDIR}" modules_prepare - -# Clean up artifact directory to keep only relevant stuff for lttng-modules -cd "${BUILDDIR}" -find . -maxdepth 1 ! -name "arch" ! -name ".config" ! -name "include" ! -name "Makefile" ! -name "Module.symvers" ! -name "scripts" ! -name "." -exec rm -rf {} \; - -# EOF diff --git a/scripts/kernel/job-generator-kernel.sh b/scripts/kernel/job-generator-kernel.sh deleted file mode 100755 index ec045b5..0000000 --- a/scripts/kernel/job-generator-kernel.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -ex -# -# Copyright (C) 2016 - Jonathan Rajotte-Julien -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -PYTHON_2_ENV=$WORKSPACE"/.python2_venv" -PYTHON_3_ENV=$WORKSPACE"/.python3_venv" - -# Prepare JJB python 2 environment -set -x -if [ ! -d "$PYTHON_2_ENV" ]; then - virtualenv -p python2 $PYTHON_2_ENV -fi -set +x - -. $PYTHON_2_ENV/bin/activate -pip install --force-reinstall git+git://github.com/mjeanson/jenkins-job-builder@ci -deactivate - -# Prepare python 3 env -if [ ! -d "$PYTHON_3_ENV" ]; then - virtualenv -p python3 $PYTHON_3_ENV -fi - -. $PYTHON_3_ENV/bin/activate -pip install --upgrade gitpython pyyaml -deactivate - -# Prepare the configuration file for jjb -cp $WORKSPACE/etc/jenkins_jobs.ini-sample $WORKSPACE/etc/jenkins_jobs.ini - -# Set +x: hide information from the jenkins console log since we use injected -# secrets -set +x -sed -i -e "s/user=jenkins/user=$JJB_JENKINS_USER/g" $WORKSPACE/etc/jenkins_jobs.ini -sed -i -e "s/password=1234567890abcdef1234567890abcdef/password=$JJB_JENKINS_TOKEN/g" $WORKSPACE/etc/jenkins_jobs.ini -set -x - -#Prepare the kernel -if [ ! -d "$WORKSPACE/kernel" ]; then - git clone git://artifacts.internal.efficios.com/git/linux-stable.git $WORKSPACE/kernel -else - pushd $WORKSPACE/kernel - git fetch --tags origin - popd -fi - -# Clean the previous rc -# Note: this step is stateful since it use the last generated version. -. $PYTHON_2_ENV/bin/activate -jenkins-jobs --conf $WORKSPACE/etc/jenkins_jobs.ini delete --path $WORKSPACE/jobs/lttng-modules.yaml:$WORKSPACE/jobs/kernel.yaml \*rc\*_build -deactivate - -# Run the kernel seed generator -. $PYTHON_3_ENV/bin/activate -python $WORKSPACE/automation/kernel-seed.py --kernel-path $WORKSPACE/kernel --kernel-cutoff 2.6.36 > $WORKSPACE/jobs/inc/kernel-versions.yaml.inc -deactivate - -. $PYTHON_2_ENV/bin/activate -jenkins-jobs --conf $WORKSPACE/etc/jenkins_jobs.ini update $WORKSPACE/jobs/lttng-modules.yaml:$WORKSPACE/jobs/kernel.yaml -deactivate - -# Flush the configuration file so no one can access it -rm -f $WORKSPACE/etc/jenkins_jobs.ini -# EOF diff --git a/scripts/kernel/job-trigger-kernel.groovy b/scripts/kernel/job-trigger-kernel.groovy deleted file mode 100644 index 46882f8..0000000 --- a/scripts/kernel/job-trigger-kernel.groovy +++ /dev/null @@ -1,54 +0,0 @@ -/** - * Copyright (C) 2016 - Jonathan Rajotte-Julien - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -import hudson.model.* -import hudson.AbortException -import hudson.console.HyperlinkNote -import java.util.concurrent.CancellationException - - -def jobs = hudson.model.Hudson.instance.items -def jobStartWith = "kernel_" -def toBuild = [] -def counter = 0 - -def anotherBuild -jobs.each { job -> - def jobName = job.getName() - if (jobName.startsWith(jobStartWith)) { - counter = counter + 1 - def lastBuild = job.getLastBuild() - if (lastBuild == null || lastBuild.result != Result.SUCCESS) { - toBuild.push(job) - } else { - println("\t"+ jobName + " Already built") - } - } -} - -def ongoingBuild = [] -def maxConcurrentBuild = 4 - -while (toBuild.size() != 0) { - if(ongoingBuild.size() <= maxConcurrentBuild) { - def job = toBuild.pop() - ongoingBuild.push(job.scheduleBuild2(0)) - println "\t triggering " + HyperlinkNote.encodeTo('/' + job.url, job.fullDisplayName) - } else { - sleep(5000) - ongoingBuild.removeAll{ it.isCancelled() || it.isDone() } - } -} -- 2.34.1