From fcb47ccfc50c1f4da388aed9596c0acaac04a917 Mon Sep 17 00:00:00 2001 From: Fengguang Wu Date: Fri, 10 Nov 2017 20:34:11 +0800 Subject: [PATCH] lkp-bootstrap: run arbitrary job script Signed-off-by: Fengguang Wu --- rootfs/addon/etc/init.d/lkp-bootstrap | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/rootfs/addon/etc/init.d/lkp-bootstrap b/rootfs/addon/etc/init.d/lkp-bootstrap index be314c228..1e2825ed4 100755 --- a/rootfs/addon/etc/init.d/lkp-bootstrap +++ b/rootfs/addon/etc/init.d/lkp-bootstrap @@ -47,16 +47,19 @@ read_kernel_cmdline_vars # The job file is contained in the initrd -- no need to download it here. [ -n "$job" ] || job=$(echo /lkp/scheduled/*/*.yaml) # in case CONFIG_PROC_FS is not set -[ -e "$job" -o -e ${job%.yaml}.sh ] || { - echo $job does not exist, quit from LKP - exit 0 # to work with non-LKP boots -} -if [ "$job" != "${job%.sh}" ]; then - . $job +if [ ${job%.yaml} != $job ]; then + job_script=${job%.yaml}.sh else - . ${job%.yaml}.sh + job_script=$job fi + +[ -e "$job_script" ] || { + echo $job_script does not exist, quit from LKP + exit 0 # to work with non-LKP boots +} + +. $job_script export_top_env : ${user:=lkp}