tests/vm: expose --source-path to scripts to find extra files
Currently the centos8 image expects to run an in-src build to find the kick starter file. Fix this. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20210602103527.32021-1-alex.bennee@linaro.org>
This commit is contained in:
parent
e2d3017809
commit
7bb17a9263
@ -84,6 +84,7 @@ $(IMAGES_DIR)/%.img: $(SRC_PATH)/tests/vm/% \
|
|||||||
$(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \
|
$(if $(QEMU_LOCAL),--build-path $(BUILD_DIR)) \
|
||||||
$(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \
|
$(if $(EFI_AARCH64),--efi-aarch64 $(EFI_AARCH64)) \
|
||||||
$(if $(LOG_CONSOLE),--log-console) \
|
$(if $(LOG_CONSOLE),--log-console) \
|
||||||
|
--source-path $(SRC_PATH) \
|
||||||
--image "$@" \
|
--image "$@" \
|
||||||
--force \
|
--force \
|
||||||
--build-image $@, \
|
--build-image $@, \
|
||||||
|
@ -96,6 +96,7 @@ class BaseVM(object):
|
|||||||
self._genisoimage = args.genisoimage
|
self._genisoimage = args.genisoimage
|
||||||
self._build_path = args.build_path
|
self._build_path = args.build_path
|
||||||
self._efi_aarch64 = args.efi_aarch64
|
self._efi_aarch64 = args.efi_aarch64
|
||||||
|
self._source_path = args.source_path
|
||||||
# Allow input config to override defaults.
|
# Allow input config to override defaults.
|
||||||
self._config = DEFAULT_CONFIG.copy()
|
self._config = DEFAULT_CONFIG.copy()
|
||||||
if config != None:
|
if config != None:
|
||||||
@ -591,6 +592,9 @@ def parse_args(vmcls):
|
|||||||
parser.add_argument("--build-path", default=None,
|
parser.add_argument("--build-path", default=None,
|
||||||
help="Path of build directory, "\
|
help="Path of build directory, "\
|
||||||
"for using build tree QEMU binary. ")
|
"for using build tree QEMU binary. ")
|
||||||
|
parser.add_argument("--source-path", default=None,
|
||||||
|
help="Path of source directory, "\
|
||||||
|
"for finding additional files. ")
|
||||||
parser.add_argument("--interactive", "-I", action="store_true",
|
parser.add_argument("--interactive", "-I", action="store_true",
|
||||||
help="Interactively run command")
|
help="Interactively run command")
|
||||||
parser.add_argument("--snapshot", "-s", action="store_true",
|
parser.add_argument("--snapshot", "-s", action="store_true",
|
||||||
|
@ -64,7 +64,7 @@ class CentosAarch64VM(basevm.BaseVM):
|
|||||||
def create_kickstart(self):
|
def create_kickstart(self):
|
||||||
"""Generate the kickstart file used to generate the centos image."""
|
"""Generate the kickstart file used to generate the centos image."""
|
||||||
# Start with the template for the kickstart.
|
# Start with the template for the kickstart.
|
||||||
ks_file = "../tests/vm/centos-8-aarch64.ks"
|
ks_file = self._source_path + "/tests/vm/centos-8-aarch64.ks"
|
||||||
subprocess.check_call("cp {} ./ks.cfg".format(ks_file), shell=True)
|
subprocess.check_call("cp {} ./ks.cfg".format(ks_file), shell=True)
|
||||||
# Append the ssh keys to the kickstart file
|
# Append the ssh keys to the kickstart file
|
||||||
# as the post processing phase of installation.
|
# as the post processing phase of installation.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user