Commit c8613dd8 authored by Guillaume Tucker's avatar Guillaume Tucker

run-servod: update for hdctools stabilize-11839.B

Update run-servod to use with hdctools from version stabilize-11839.B.
Some modules have been consolidated and renames, and the main function
can now accept arbitrary arguments rather than sys.argv (yay!).
Signed-off-by: Guillaume Tucker's avatarGuillaume Tucker <guillaume.tucker@collabora.com>
parent 7f994bb7
......@@ -36,7 +36,7 @@ import shutil
import signal
import sys
from servo import client, multiservo, servod
from servo import client, servo_parsing, servod
# Icky global variables. But then, icky signal handling.
DEV_DIR = None
......@@ -114,7 +114,7 @@ def run_servod():
print("Board serial: {}".format(target_serial))
board_name = None
all_boards = multiservo.parse_rc(logger, "/etc/google-servo.conf")
all_boards = servo_parsing.parse_rc(logger, "/etc/google-servo.conf")
for board in all_boards:
if not all_boards[board]["sn"] == target_serial:
continue
......@@ -133,12 +133,8 @@ def run_servod():
os.dup2(servod_output[1], 2)
os.close(servod_output[0])
os.close(servod_output[1])
# A comment in servod says they should fix it to not parse
# sys.argv directly. Quite.
sys.argv = ['servod', '--rcfile', '/etc/google-servo.conf',
'--serialname', ud_dev.attributes.get("serial")]
servod.main_function()
servod.main(cmdline=['--rcfile', '/etc/google-servo.conf',
'--serialname', ud_dev.attributes.get("serial")])
else: # parent
# Run servod and pull its stdout/stderr.
# FIXME: Smarter mainloop:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment