[createiso] Use shell script for runroot

Instead of installing pungi itself in the runroot, we can prepare the
commands to be run on compose box, write the shell script into work/
directory, which is mounted in the chroot, and execute that. This way
there is no business logic in runroot (except for finding lorax
templates).

The main advantage of this approach is that we don't need to pull any
extra dependencies into buildroot.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2016-07-28 13:05:38 +02:00
parent 6a682f64fe
commit f37a14fb60
7 changed files with 276 additions and 327 deletions

View file

@ -1,20 +0,0 @@
#!/usr/bin/env python3
# This needs to work with Python 3 as pylorax only provides the find_templates
# function in recent builds that are not provided for Python 2.7.
#
# This script will print a location of lorax templates. If it fails to import
# pylorax, or the find_templates function does not exist, the first command
# line argument will be printed instead.
import sys
if len(sys.argv) != 2:
print('Usage: {} FALLBACK'.format(sys.argv[0]), file=sys.stderr)
sys.exit(1)
try:
import pylorax
print(pylorax.find_templates())
except (ImportError, AttributeError):
print(sys.argv[1])