changeset 392:134c047c1269

loadtools: Iota poweroff on Compal targets
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Wed, 11 Jun 2014 16:38:28 +0000
parents 8bbdf5221b24
children d7591faa1258
files loadtools/ltexit.c loadtools/scripts/compal.config
diffstat 2 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/loadtools/ltexit.c	Wed Jun 11 08:32:22 2014 +0000
+++ b/loadtools/ltexit.c	Wed Jun 11 16:38:28 2014 +0000
@@ -1,6 +1,6 @@
 /*
  * This module implements the loadtool exit command, along with its
- * options for jump-reboot or eventual Iota power-off.
+ * options for jump-reboot and Iota power-off.
  */
 
 #include <stdio.h>
@@ -24,6 +24,16 @@
 }
 
 static void
+exit_iotaoff()
+{
+	static char *poweroff_argv[2] = {"poweroff", 0};
+
+	tpinterf_make_cmd(poweroff_argv);
+	tpinterf_send_cmd();
+	exit(0);
+}
+
+static void
 exit_jump0()
 {
 	static char *jump0_argv[3] = {"jump", "0", 0};
@@ -41,6 +51,7 @@
 } exit_modes[] = {
 	{"bare", exit_bare},
 	{"gta02-cutpwr", exit_gta02_cutpwr},
+	{"iota-off", exit_iotaoff},
 	{"jump0", exit_jump0},
 	{0, 0}
 };
--- a/loadtools/scripts/compal.config	Wed Jun 11 08:32:22 2014 +0000
+++ b/loadtools/scripts/compal.config	Wed Jun 11 16:38:28 2014 +0000
@@ -25,3 +25,6 @@
 
 # The remaining settings are carried out via loadagent commands
 init-script compal.init
+
+# Perform a Iota poweroff when we are done
+exit-mode iota-off