diff mbox series

external/mambo: Add an option to exit Mambo when the system is shutdown

Message ID 20190219014551.12700-1-alistair@popple.id.au
State Changes Requested
Headers show
Series external/mambo: Add an option to exit Mambo when the system is shutdown | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master

Commit Message

Alistair Popple Feb. 19, 2019, 1:45 a.m. UTC
Automatically exiting can be convenient for scripting. Will also exit
due to a HW crash (eg. unhandled exception).

Signed-off-by: Alistair Popple <alistair@popple.id.au>
---
 external/mambo/README.md   | 5 +++++
 external/mambo/skiboot.tcl | 4 ++++
 2 files changed, 9 insertions(+)

Comments

Stewart Smith Feb. 19, 2019, 4:12 a.m. UTC | #1
Alistair Popple <alistair@popple.id.au> writes:

> Automatically exiting can be convenient for scripting. Will also exit
> due to a HW crash (eg. unhandled exception).
>
> Signed-off-by: Alistair Popple <alistair@popple.id.au>

travis was pretty unhappy with this, looks to be freaking out at the
variable not existing.

https://travis-ci.org/stewart-ibm/skiboot/jobs/495259083

[ BOOT TEST ]  test/sreset_world/sreset_kernel/sreset_kernel-check-smt-p9-mambo
spawn /opt/ibm/systemsim-p8///run/pegasus/power8 -n -f ../../test/sreset_world/run_sreset_world.tcl
Console XTerms Disabled
Licensed Materials - Property of IBM.
(C) Copyright IBM Corporation 2001, 2014
All Rights Reserved.
Using initial run script ../../test/sreset_world/run_sreset_world.tcl
Starting mambo on *662f5b6cb66d* (pid = 15210) at Tue Feb 19 04:04:21 2019
With command: /opt/ibm/systemsim-p8/bin/systemsim-pegasus -n -f ../../test/sreset_world/run_sreset_world.tcl
No network support selected
INFO: 0: (0): !!!!!! Simulator now in TURBO mode !!!!!!
can't read "env(SKIBOOT_AUTORUN)": no such variable
systemsim % 
Timeout waiting for hello world
/build/test/sreset_world/Makefile.check:23: recipe for target 'test/sreset_world/sreset_kernel/sreset_kernel-check-smt-mambo' failed
make: *** [test/sreset_world/sreset_kernel/sreset_kernel-check-smt-mambo] Error 1
make: *** Waiting for unfinished jobs....
spawn /opt/ibm/systemsim-p9///run/p9/power9 -n -f ../../test/sreset_world/run_sreset_world.tcl
Console XTerms Disabled
Licensed Materials - Property of IBM.
(C) Copyright IBM Corporation 2001, 2017
All Rights Reserved.
Using initial run script ../../test/sreset_world/run_sreset_world.tcl
Starting mambo on *662f5b6cb66d* (pid = 15233) at Tue Feb 19 04:04:31 2019
With command: /opt/ibm/systemsim-p9/bin/systemsim-p9 -n -f ../../test/sreset_world/run_sreset_world.tcl
No network support selected
INFO: 0: (0): !!!!!! Simulator now in TURBO mode !!!!!!
can't read "env(SKIBOOT_AUTORUN)": no such variable
systemsim % 
Timeout waiting for hello world
/build/test/sreset_world/Makefile.check:26: recipe for target 'test/sreset_world/sreset_kernel/sreset_kernel-check-smt-p9-mambo' failed
make: *** [test/sreset_world/sreset_kernel/sreset_kernel-check-smt-p9-mambo] Error 1
The command "if [ ${COVERITY_SCAN_BRANCH} != 1 ]; then docker build --pull -t ${RUN_ON_CONTAINER} -f opal-ci/Dockerfile-${RUN_ON_CONTAINER} . && docker run --volume $HOME/.ccache:/root/.ccache --volume `pwd`:/build --rm -t $RUN_ON_CONTAINER bash -c "./opal-ci/build-${RUN_ON_CONTAINER}.sh"; fi" exited with 2.
Alistair Popple Feb. 19, 2019, 4:40 a.m. UTC | #2
Oh fair enough. I forgot to test without the variable being set at all. Will 
respin.

- Alistair

On Tuesday, 19 February 2019 3:12:08 PM AEDT Stewart Smith wrote:
> Alistair Popple <alistair@popple.id.au> writes:
> > Automatically exiting can be convenient for scripting. Will also exit
> > due to a HW crash (eg. unhandled exception).
> > 
> > Signed-off-by: Alistair Popple <alistair@popple.id.au>
> 
> travis was pretty unhappy with this, looks to be freaking out at the
> variable not existing.
> 
> https://travis-ci.org/stewart-ibm/skiboot/jobs/495259083
> 
> [ BOOT TEST ] 
> test/sreset_world/sreset_kernel/sreset_kernel-check-smt-p9-mambo spawn
> /opt/ibm/systemsim-p8///run/pegasus/power8 -n -f
> ../../test/sreset_world/run_sreset_world.tcl Console XTerms Disabled
> Licensed Materials - Property of IBM.
> (C) Copyright IBM Corporation 2001, 2014
> All Rights Reserved.
> Using initial run script ../../test/sreset_world/run_sreset_world.tcl
> Starting mambo on *662f5b6cb66d* (pid = 15210) at Tue Feb 19 04:04:21 2019
> With command: /opt/ibm/systemsim-p8/bin/systemsim-pegasus -n -f
> ../../test/sreset_world/run_sreset_world.tcl No network support selected
> INFO: 0: (0): !!!!!! Simulator now in TURBO mode !!!!!!
> can't read "env(SKIBOOT_AUTORUN)": no such variable
> systemsim %
> Timeout waiting for hello world
> /build/test/sreset_world/Makefile.check:23: recipe for target
> 'test/sreset_world/sreset_kernel/sreset_kernel-check-smt-mambo' failed
> make: *** [test/sreset_world/sreset_kernel/sreset_kernel-check-smt-mambo]
> Error 1 make: *** Waiting for unfinished jobs....
> spawn /opt/ibm/systemsim-p9///run/p9/power9 -n -f
> ../../test/sreset_world/run_sreset_world.tcl Console XTerms Disabled
> Licensed Materials - Property of IBM.
> (C) Copyright IBM Corporation 2001, 2017
> All Rights Reserved.
> Using initial run script ../../test/sreset_world/run_sreset_world.tcl
> Starting mambo on *662f5b6cb66d* (pid = 15233) at Tue Feb 19 04:04:31 2019
> With command: /opt/ibm/systemsim-p9/bin/systemsim-p9 -n -f
> ../../test/sreset_world/run_sreset_world.tcl No network support selected
> INFO: 0: (0): !!!!!! Simulator now in TURBO mode !!!!!!
> can't read "env(SKIBOOT_AUTORUN)": no such variable
> systemsim %
> Timeout waiting for hello world
> /build/test/sreset_world/Makefile.check:26: recipe for target
> 'test/sreset_world/sreset_kernel/sreset_kernel-check-smt-p9-mambo' failed
> make: ***
> [test/sreset_world/sreset_kernel/sreset_kernel-check-smt-p9-mambo] Error 1
> The command "if [ ${COVERITY_SCAN_BRANCH} != 1 ]; then docker build --pull
> -t ${RUN_ON_CONTAINER} -f opal-ci/Dockerfile-${RUN_ON_CONTAINER} . &&
> docker run --volume $HOME/.ccache:/root/.ccache --volume `pwd`:/build --rm
> -t $RUN_ON_CONTAINER bash -c "./opal-ci/build-${RUN_ON_CONTAINER}.sh"; fi"
> exited with 2.
diff mbox series

Patch

diff --git a/external/mambo/README.md b/external/mambo/README.md
index 750a81e4..a11fe4ae 100644
--- a/external/mambo/README.md
+++ b/external/mambo/README.md
@@ -47,6 +47,11 @@  export SKIBOOT_INITRD=$HOME/src/op-build/output/images/rootfs.cpio.xz
 export SKIBOOT=$HOME/src/skiboot/skiboot.lid
 export SKIBOOT_AUTORUN=1
 ```
+If you want Mambo to autmatically exit when the system is shutdown (or
+has a HW crash) use this:
+```
+export SKIBOOT_AUTORUN=2
+```
 
 ### Run the simulator
 ```
diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 25414450..62c21897 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -568,3 +568,7 @@  if { [info exists env(SKIBOOT_AUTORUN)] } {
 	readline
     }
 }
+
+if { $env(SKIBOOT_AUTORUN) == 2 } {
+    quit
+}