Set kernel arguments from host in qemu #2
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "dbautist/nixos-riscv:pl-enhancement"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This merge request introduces the next features to the system:
Thanks, this is more or less what I had in mind. I left some comments so we can keep it more flexible. I would need to enable a pipeline for Gitea to check it can detect a successful execution and a wrong one.
@ -1,6 +1,40 @@
#!/usr/bin/env bash
set -ex
set -e
Let's leave -x for now, so we see what is happening.
The -x option is set on line 37 to avoid showing the trace of the option parsing commands. Do you want these commands to be also traced?
For now yes
@ -4,0 +32,4 @@
break
;;
esac
done
Use just
QEMU_KERNEL_PARAMS="$@"
, there is no need to add all this complexity.The reason why I did it this way is to enable the possibility of adding new options to boot.sh in the future. Furthermore, the option of passing additional arguments to the qemu command is not erased.
If you still want it the simple way, I'll change it :-)
Let's keep it simple until we need more complexity.
@ -76,0 +105,4 @@
-serial mon:stdio \
-append "$(cat $system/kernel-params) init=$system/init console=ttyS0 loglevel=7 $QEMU_KERNEL_PARAMS" \
$QEMU_OPTS
"$@" 2>&1
Why do we need to send stderr to the awk output?, this will hide errors.
Sorry that was an experiment I performed, there's no reason for that to be there... erasing it.
@ -76,0 +108,4 @@
"$@" 2>&1
}
if [ $QEMU_KERNEL_PARAMS == "bench2" ]; then
Use a regex match and quote
$QEMU_KERNEL_PARAMS
:if [[ "$QEMU_KERNEL_PARAMS" =~ bench2 ]]; then
@ -76,0 +109,4 @@
}
if [ $QEMU_KERNEL_PARAMS == "bench2" ]; then
run_qemu | awk -f $CDIR/verify_rvb.awk
As this would be used to test the bench2 outcome including other benchmarks I recommend you it rename to
verify-bench2.awk
.@ -0,0 +3,4 @@
}
/^BENCHMARK-SUCESS-STATE/ { bench_success_flag = 1; system("pkill -f -SIGTERM qemu-system-riscv64")}
/^BENCHMARK-ERROR-STATE/ { bench_success_flag = 0; system("pkill -f -SIGTERM qemu-system-riscv64")}
This will kill any qemu running in parallel by the CI, could this be done by just breaking the pipe? Just exit 0 or 1 instead of the system command.
I've previously tried to do it this way. However, breaking the pipe is not sufficient for stopping the qemu process (or at least, not by exiting). I am reseraching why this happens.
I suspect SIGPIPE is ignored by qemu process and continues executing.
Okay, then let's leave it as-is for now, but we will have to add a different logic to handle the FPGA case in the future.
I've updated the script and the awk program to only kill the desired qemu process. For this, I save the qemu process PID in a file named qemu.pid which is read by awk when a pattern matches.
Not sure if this is FPGA friendly.
pl-enhancementto Set kernel arguments from host in qemuCould you make this run in the Gitea CI? Here is an example:
5da53c69b8
I think we only need to run the same command we are doing in the GitLab CI (https://jungle.bsc.es/git/rarias/nixos-riscv/src/branch/master/.gitlab-ci.yml#L31) but in Gitea.
Otherwise I can take a look later.
4ca9182c75
to492c540bf5
Checkout
From your project repository, check out a new branch and test the changes.