[Skiboot] [PATCH] external/mambo: Add support for readline if it exists

Balbir Singh bsingharora at gmail.com
Wed May 2 15:08:02 AEST 2018


Add support for tclreadline package if it is present.
This patch loads the package and uses it when the
simulation stops for any reason.

Signed-off-by: Balbir Singh <bsingharora at gmail.com>
---
 external/mambo/skiboot.tcl | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/external/mambo/skiboot.tcl b/external/mambo/skiboot.tcl
index 38298bff..078f4b65 100644
--- a/external/mambo/skiboot.tcl
+++ b/external/mambo/skiboot.tcl
@@ -1,6 +1,17 @@
 # need to get images path defined early
 source $env(LIB_DIR)/ppc/util.tcl
 
+#
+# Call tclreadline's Loop to move to friendlier
+# commandline if one exists
+#
+proc readline { } {
+    set readline [catch { package require tclreadline }]
+    if { $readline == 0 } {
+        ::tclreadline::Loop
+    }
+}
+
 proc mconfig { name env_name def } {
     global mconf
     global env
@@ -481,5 +492,7 @@ epapr::of2dtb mysim $mconf(epapr_dt_addr)
 mysim mode fastest
 
 if { [info exists env(SKIBOOT_AUTORUN)] } {
-    mysim go
+    if [catch { mysim go }] {
+	readline
+    }
 }
-- 
2.13.6



More information about the Skiboot mailing list