Hello,
I'm trying to generalize the power_off_cmd support so in addition to running an arbitrary command, it can send a command over the serial console. This is useful where conmux is abstracting not only the serial console, but also the power control.
The patch below implements what I *think* is needed, and using that, here's the tail end of the LAVA logs showing that it's at least trying to send my commands:
84.3 2014-08-21 04:08:20 PM INFO: [ACTION-E] boot_linaro_image is finished successfully. 84.4 2014-08-21 04:08:20 PM DEBUG: KJH: power_off_cmd: console: ~$off, 84.5 2014-08-21 04:08:20 PM DEBUG: send (delay_ms=0): ~$ 84.6 2014-08-21 04:08:20 PM DEBUG: send (delay_ms=0): off 84.7 2014-08-21 04:08:20 PM DEBUG: send (delay_ms=0):
But the commands don't get to the console, so the board never powers down.
Any ideas what's going on here? Is the console being disconnected before a power_off_cmd?
Kevin
From 1a748eff537d47107b23bc0dd1e8d2871bde5550 Mon Sep 17 00:00:00 2001
From: Kevin Hilman khilman@linaro.org Date: Thu, 21 Aug 2014 09:15:53 -0700 Subject: [PATCH] WIP: power_off_cmd: use conmux
--- lava_dispatcher/device/master.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/lava_dispatcher/device/master.py b/lava_dispatcher/device/master.py index 2036776b6d56..6bf20661bcd0 100644 --- a/lava_dispatcher/device/master.py +++ b/lava_dispatcher/device/master.py @@ -105,7 +105,14 @@ class MasterImageTarget(Target):
def power_off(self, proc): if self.config.power_off_cmd: - self.context.run_command(self.config.power_off_cmd) + logging.debug("KJH: power_off_cmd: %s, %s" %(self.config.power_off_cmd, type(self.config.power_off_cmd))) + if self.config.power_off_cmd.startswith("console:"): +# console_cmd = self.config.power_off_cmd.split(':', 1)[1].strip() +# self.proc.sendline(console_cmd) + self.proc.send("~$") + self.proc.sendline("off") + else: + self.context.run_command(self.config.power_off_cmd) finalize_process(self.proc)
def deploy_linaro(self, hwpack, rfs, dtb, rootfstype, bootloadertype):
linaro-validation@lists.linaro.org