Skip to content

Run CMD on ttyS0 after login and exit the VM after CMD is finished#5

Open
rmohr wants to merge 2 commits intofabiand:masterfrom
rmohr:network
Open

Run CMD on ttyS0 after login and exit the VM after CMD is finished#5
rmohr wants to merge 2 commits intofabiand:masterfrom
rmohr:network

Conversation

@rmohr
Copy link
Contributor

@rmohr rmohr commented Jun 2, 2016

We somehow have to make sure that SPICE always uses ttyS0

vocker Outdated

with tempfile.NamedTemporaryFile("wb") as spec:
spec.write(xml)
spec.write(xml.encode())
Copy link
Owner

@fabiand fabiand Jun 2, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need it earlier:

@@ -305,7 +309,7 @@ if __name__ == "__main__":
                      "--rng", "/dev/random",
                      "--noautoconsole",
                      "--print-xml")
-        xml = str(xml)
+        xml = str(xml).encode("UTF-8")

Copy link
Contributor Author

@rmohr rmohr Jun 3, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so.

domroot = ET.fromstring(xml)

at line 322 would not work then

@rmohr rmohr changed the title Encode xml before writing Run CMD on ttyS0 after login and exit the VM after CMD is finished Jun 3, 2016
A very simple way to have automatic login with everything set up and
making sure that we run CMD only once by checking in .bashrc if tty
confirms that we run on ttyS0.

After CMD is done, 'shutdown -h now' is invoked.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants