Commit df3b8a14 by Oliver Pinter

bootstrap ok, working serial port

parent fef2b186
......@@ -9,11 +9,11 @@ import sys
system = platform.system()
if system == "Linux":
if system == "Linux" or system == "FreeBSD" :
try:
chdir(sys.path[0])
subprocess.call(('pip', 'install', '-r', 'requirements.txt'))
if system == 'Linux':
if system == 'Linux' or system == "FreeBSD":
copy("/root/agent/misc/vm_renewal", "/usr/local/bin/")
except:
pass # hope it works
......
......@@ -27,6 +27,8 @@ def get_context():
from windows._win32context import Context
elif system == "Linux":
from linux._linuxcontext import Context
elif system == "FreeBSD":
from freebsd._freebsdcontext import Context
else:
raise NotImplementedError("Platform %s is not supported.", system)
return Context
......@@ -53,6 +55,15 @@ def get_serial():
port = '/dev/ttyS0'
else:
from linux.posixvirtio import SerialPort
elif system == "FreeBSD":
port = "/dev/ttyV0.1"
try:
open(port, 'rw').close()
except (OSError, IOError):
from twisted.internet.serialport import SerialPort
port = '/dev/ttyu0'
else:
from freebsd.posixvirtio import SerialPort
else:
raise NotImplementedError("Platform %s is not supported.", system)
return (SerialPort, port)
......
......@@ -11,9 +11,11 @@ system = platform.system()
working_directory = sys.path[0]
try:
# load virtio console driver, the device is /dev/ttyV0.1
subprocess.call(('kldload', '-n', 'virtio_console'))
chdir(working_directory)
subprocess.call(('pip', 'install', '-r', 'requirements.txt'))
if system == 'Linux':
if system == 'FreeBSD':
copy("/root/agent/misc/vm_renewal", "/usr/local/bin/")
except:
pass # hope it works
......
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 sign in to comment