Skip to content

Commit

Permalink
ultra: add an ability to specify hyper_config to DiskImage
Browse files Browse the repository at this point in the history
No reason why we can't offload config file creation to our image
utilities.

Signed-off-by: Daniil Tatianin <[email protected]>
  • Loading branch information
d-tatianin committed Oct 12, 2023
1 parent 71a0763 commit 2027006
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ultra.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class DiskImage:
def __init__(
self, fs_root_dir: str, br_type: str,
fs_type: str, fs_size_mb: Optional[int] = None,
hyper_config: Optional[str] = None,
hyper_uefi_binary_path: Optional[str] = None,
hyper_iso_br_path: Optional[str] = None,
hyper_installer_path: Optional[str] = None,
Expand All @@ -68,6 +69,10 @@ def __init__(
self.__fs_type = fs_type.upper()
self.__path = out_path if out_path else tempfile.mkstemp()[1]

if hyper_config is not None:
with open(os.path.join(fs_root_dir, "hyper.cfg"), "w") as f:
f.write(hyper_config)

is_iso = self.fs_type == "ISO9660"

if not is_iso:
Expand Down

0 comments on commit 2027006

Please sign in to comment.