Skip to content

Commit

Permalink
Jenkins: Ensure RISC-V tests the purecap kernel
Browse files Browse the repository at this point in the history
Previously both purecap-kernel and hybrid-kernel jobs were booting the
default kernel (currently hybrid), which is not right for the purecap
jobs. For Morello purecap this did not matter since the kernel is chosen
from the loader prompt, but RISC-V boots the kernel directly.
  • Loading branch information
arichardson committed Jul 31, 2023
1 parent 4c0f637 commit 084aa63
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,13 @@ def addBootJobs(bootJobs, params, String qemuConfig, String architecture, String
if (architecture.endsWith("-purecap")) {
bootJobs["${architecture}-purecap-kernel on ${qemuConfig}"] =
{ -> bootCheriBSD(params, qemuConfig, "${architecture}-purecap-kernel${suffix}", architecture,
["--run-${architecture}/kernel-abi purecap"], cheribsdBranch) }
'purecap', cheribsdBranch) }
bootJobs["${architecture}-hybrid-kernel on ${qemuConfig}"] =
{ -> bootCheriBSD(params, qemuConfig, "${architecture}-hybrid-kernel${suffix}", architecture,
["--run-${architecture}/kernel-abi hybrid"], cheribsdBranch) }
'hybrid', cheribsdBranch) }
} else {
bootJobs["${architecture} on ${qemuConfig}"] =
{ -> bootCheriBSD(params, qemuConfig, "${architecture}${suffix}", architecture, [], cheribsdBranch) }
{ -> bootCheriBSD(params, qemuConfig, "${architecture}${suffix}", architecture, null, cheribsdBranch) }
}
}

Expand All @@ -89,9 +89,16 @@ def bootCheriBSDForAllArchitectures(params, String qemuConfig, boolean isDebug)
}
}

def bootCheriBSD(params, String qemuConfig, String stageSuffix, String archSuffix, extraCheribuildArgs, String cheribsdBranch="main") {
def bootCheriBSD(params, String qemuConfig, String stageSuffix, String archSuffix, String kernelABI, String cheribsdBranch="main") {
try {
def extraCheribuildArgs = []
def compressedKernel = "artifacts-${archSuffix}/kernel.xz"
if (kernelABI != null) {
extraCheribuildArgs += ["--run-${archSuffix}/kernel-abi=${kernelABI}"]
if (archSuffix.startsWith('riscv64') && kernelABI == 'purecap') {
compressedKernel = "artifacts-${archSuffix}/kernel.CHERI-PURECAP-QEMU.xz"
}
}
def compressedDiskImage = "artifacts-${archSuffix}/cheribsd-${archSuffix}.img.xz"
dir (stageSuffix) {
sh "rm -rfv artifacts-${archSuffix}/cheribsd-*.img* artifacts-${archSuffix}/kernel*"
Expand Down

0 comments on commit 084aa63

Please sign in to comment.