Commit graph

9 commits

Author SHA1 Message Date
Ondřej Budai
86baf4879a tools/deploy-qemu: use sys.exit instead of exit
exit is just a helper for the interactive shell, see:

https://stackoverflow.com/questions/6501121/difference-between-exit-and-sys-exit-in-python
Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-22 14:45:54 +02:00
Ondřej Budai
99d1d4e5d0 tools/deploy-qemu: use default temp dir location
Previously, the temporary directory was created in the script dir. It just
imo created unnecessary and confusing files in my git checkout. Let's just
use the default temporary directory because we don't really have special
needs for it.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-06-22 14:45:54 +02:00
Martin Sehnoutka
1fffb57a4c deploy-qemu: rewrite in python
The discussion about Bash syntax have reached the threshold where it is
necessary to rewrite the script in Python to make everyone's life
easier.
2021-06-15 09:53:53 +02:00
Ondřej Budai
54a458af5c test: replace genisoimage with mkisofs
genisoimage might be removed from RHEL 9. The users are advised to switch
to mkisofs tools from the xorriso package. It should be a drop-in replacement.

The same change was recently done by libguestfs:

efb8a766ca
2216ab2e32

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-04-02 14:21:29 +02:00
Tomas Hozza
d9f09c66f2 tools: Fix checking of args number in deploy-qemu
When the deploy-qemu script is run with less than 2 arguments, it ended
with error, instead of printing usage. This was due to using 'set -u' and
trying to expand unset variables "$1" and "$2" as part of checking if
they were provided. The issue has been fixed by checking number of
provided arguments, instead of their content. The same approach is used
in 'deploy-openstack' script.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-01-11 10:33:51 +01:00
Lars Karlitski
8e86d9dcae tools/deploy-qemu: allow passing extra args to qemu
This is a developer tool. Allowing setting QEMU_EXTRA_ARGS so that
developers can add arguments that make sense on their machines and for
their workflows.
2020-11-24 13:08:44 +01:00
Lars Karlitski
07b2486dcb tools/deploy-qemu: add macOS support
Just a few tweaks were necessary to add support for macOS:

1. /usr/bin/bash → /bin/bash, which is a link on Linux as well.

2. Use hdiutil instead of genisoimage to make the cloud-init iso.

3. Ask qemu to fall back to macOS' hypervisor hvf.
2020-11-24 13:08:44 +01:00
Lars Karlitski
4c9eea130d tools/deploy-qemu: put cidata into own directory
Put all files (user-data and meta-data) into its own directory under
`$workdir` while assembling it, to keep it separate from the .iso file.
2020-11-24 13:08:44 +01:00
Lars Karlitski
857570980d tools: add deploy-qemu and gen-user-data
tools/gen-user-data generates a cloud-init user-data file from a
configuration directory. It is mostly useful to embed files in the
user-data.

tools/deploy-qemu uses above tool to make a user-data file and spins up
a virtual machine with it. This is useful to locally run, test, and
debug osbuild-composer.

A simple user-data directory for running tests locally is included in
tests/deploy-user-data. It expects a repository with osbuild-composer
rpms to be served on the host's port 8000.
2020-10-07 11:51:33 +02:00