diff --git a/bkr-runtest/gen_job_xml b/bkr-runtest/gen_job_xml index 27928b6b..5fb494c8 100755 --- a/bkr-runtest/gen_job_xml +++ b/bkr-runtest/gen_job_xml @@ -379,6 +379,23 @@ if {$harness in {r re res rest restr restra restrai restrain restraint rst}} { } if [info exist Opt(ks-meta)] { append recipe_ks_meta " " {*}$Opt(ks-meta) } +set ksAppend {} +if [info exist Opt(ks-pkgs)] { + append ksAppend "\n%packages --ignoremissing" + foreach ks $Opt(ks-pkgs) { append ksAppend "\n[string map {" " "\n"} $ks]" } + append ksAppend "\n%end" +} +if [info exist Opt(ks-append)] { foreach ks $Opt(ks-append) { append ksAppend "\n$ks" } } +if [info exist Opt(ks-post)] { + append ksAppend "\n%post" + foreach ks $Opt(ks-post) { append ksAppend "\n$ks" } + append ksAppend "\n%end" +} +if [info exist Opt(ks-pre)] { + append ksAppend "\n%pre" + foreach ks $Opt(ks-pre) { append ksAppend "\n$ks" } + append ksAppend "\n%end" +} #https://projects.engineering.redhat.com/browse/BKR-4998 append recipe_ks_meta " disabled_root_access" @@ -774,11 +791,9 @@ job retention_tag=$retentionTag $productkv user=$jobOwner $jobCtl { } } - if [info exist Opt(ks-append)] { - foreach ks $Opt(ks-append) { - ks_append ! { - puts "" - } + if {$ksAppend != ""} { + ks_append ! { + puts "" } } diff --git a/share/common-options.tcl b/share/common-options.tcl index 72fd9d18..63320b16 100644 --- a/share/common-options.tcl +++ b/share/common-options.tcl @@ -167,8 +167,11 @@ set CommonOptionList { {part partition} {arg m help {Additional for job, example: --part='fs=xfs name=/mnt/xfs size=10 type=part'}} method {arg y help {Installation source method (nfs, http, ftp)}} ks-meta {arg m help {Pass kickstart metadata OPTIONS when generating kickstart}} - ks-append {arg m help {Specify additional kickstart commands to add to the base kickstart file}} + ks-append {arg m help {append additional fragment to the base kickstart file}} ks {link ks-append hide y} + ks-pkgs {arg m help {append additional packages to %packages section in base kickstart file}} + ks-post {arg m help {append additional commands to %post section in the base kickstart file}} + ks-pre {arg m help {append additional commands to %pre section in the base kickstart file}} ksf {arg y help {Similar to --ks-append, but pass the content of a specified file}} {k-opts kernel-options} {arg m help {Pass OPTIONS to kernel during installation}} {k-opts-post kernel-options-post} {arg m help {Pass OPTIONS to kernel after installation}}