Skip to content

Commit 2027006

Browse files
committed
ultra: add an ability to specify hyper_config to DiskImage
No reason why we can't offload config file creation to our image utilities. Signed-off-by: Daniil Tatianin <[email protected]>
1 parent 71a0763 commit 2027006

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

ultra.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ class DiskImage:
5858
def __init__(
5959
self, fs_root_dir: str, br_type: str,
6060
fs_type: str, fs_size_mb: Optional[int] = None,
61+
hyper_config: Optional[str] = None,
6162
hyper_uefi_binary_path: Optional[str] = None,
6263
hyper_iso_br_path: Optional[str] = None,
6364
hyper_installer_path: Optional[str] = None,
@@ -68,6 +69,10 @@ def __init__(
6869
self.__fs_type = fs_type.upper()
6970
self.__path = out_path if out_path else tempfile.mkstemp()[1]
7071

72+
if hyper_config is not None:
73+
with open(os.path.join(fs_root_dir, "hyper.cfg"), "w") as f:
74+
f.write(hyper_config)
75+
7176
is_iso = self.fs_type == "ISO9660"
7277

7378
if not is_iso:

0 commit comments

Comments
 (0)