Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rmohr
Copy link
Contributor

@rmohr rmohr commented Jun 2, 2016

We somehow have to make sure that SPICE always uses ttyS0

@@ -345,7 +345,7 @@ if __name__ == "__main__":


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