Commit 00a1517e authored by Antoine Kaufmann's avatar Antoine Kaufmann
Browse files

experiments: support appending to kcmdline from node config

parent d851fb5f
......@@ -70,6 +70,8 @@ class NodeConfig(object):
"""Do not make checkpoint in Gem5."""
self.app: tp.Optional[AppConfig] = None
"""App to be run on simulated host."""
self.kcmd_append = ''
"""String to be appended to kernel command line."""
def config_str(self):
if self.sim == 'qemu':
......
......@@ -332,6 +332,11 @@ class QemuHost(HostSim):
def run_cmd(self, env):
accel = ',accel=kvm:tcg' if not self.sync else ''
if self.node_config.kcmd_append:
kcmd_append = ' ' + self.node_config.kcmd_append
else:
kcmd_append = ''
cmd = (
f'{env.qemu_path} -machine q35{accel} -serial mon:stdio '
'-cpu Skylake-Server -display none -nic none '
......@@ -340,7 +345,7 @@ class QemuHost(HostSim):
f'-drive file={env.cfgtar_path(self)},if=ide,index=1,media=disk,'
'driver=raw '
'-append "earlyprintk=ttyS0 console=ttyS0 root=/dev/sda1 '
'init=/home/ubuntu/guestinit.sh rw" '
'init=/home/ubuntu/guestinit.sh rw{kcmd_append}" '
f'-m {self.node_config.memory} -smp {self.node_config.cores} '
)
......@@ -418,6 +423,9 @@ class Gem5Host(HostSim):
'--ddio-enabled --ddio-way-part=8 --mem-type=DDR4_2400_16x4 '
)
if self.node_config.kcmd_append:
cmd += f'--command-line-append="{self.node_config.kcmd_append}" '
if env.create_cp:
cmd += '--max-checkpoints=1 '
......
Subproject commit 21d7cb6c58969bf2a0915bac06efa35adfe96a02
Subproject commit 72b0af4256b131e0fc9c66377404b093cf7ef793
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