Skip to content

Commit

Permalink
Rework mount point argument (#3041)
Browse files Browse the repository at this point in the history
  • Loading branch information
codefiles authored Dec 23, 2024
1 parent d5c5b60 commit 459b84b
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 18 deletions.
4 changes: 1 addition & 3 deletions archinstall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def define_arguments() -> None:
parser.add_argument("--dry-run", "--dry_run", action="store_true",
help="Generates a configuration file and then exits instead of performing an installation")
parser.add_argument("--script", default="guided", nargs="?", help="Script to run for installation", type=str)
parser.add_argument("--mount-point", "--mount_point", nargs="?", type=str,
parser.add_argument("--mount-point", "--mount_point", default=Path("/mnt/archinstall"), nargs="?", type=Path,
help="Define an alternate mount point for installation")
parser.add_argument("--skip-ntp", action="store_true", help="Disables NTP checks during installation", default=False)
parser.add_argument("--debug", action="store_true", default=False, help="Adds debug info into the log")
Expand Down Expand Up @@ -266,8 +266,6 @@ def load_config() -> None:

def post_process_arguments(args: dict[str, Any]) -> None:
storage['arguments'] = args
if mountpoint := args.get('mount_point', None):
storage['MOUNT_POINT'] = Path(mountpoint)

if args.get('debug', False):
warn(f"Warning: --debug mode will write certain credentials to {storage['LOG_PATH']}/{storage['LOG_FILE']}!")
Expand Down
3 changes: 0 additions & 3 deletions archinstall/lib/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,6 @@ def _parse_args(self) -> Arguments:
if args.config is None:
args.silent = False

if args.mount_point is not None:
storage['MOUNT_POINT'] = Path(args.mount_point)

if args.debug:
warn(f"Warning: --debug mode will write certain credentials to {storage['LOG_PATH']}/{storage['LOG_FILE']}!")

Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/disk/device_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def parse_arg(cls, disk_config: _DiskLayoutConfigurationSerialization) -> DiskLa
mods = device_handler.detect_pre_mounted_mods(path)
device_modifications.extend(mods)

storage['MOUNT_POINT'] = path
storage['arguments']['mount_point'] = path

config.mountpoint = path

Expand Down
2 changes: 1 addition & 1 deletion archinstall/lib/interactions/disk_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def select_disk_config(

mods = disk.device_handler.detect_pre_mounted_mods(path)

storage['MOUNT_POINT'] = path
storage['arguments']['mount_point'] = path

return disk.DiskLayoutConfiguration(
config_type=disk.DiskLayoutType.Pre_mount,
Expand Down
1 change: 0 additions & 1 deletion archinstall/lib/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,4 @@
storage: dict[str, Any] = {
'LOG_PATH': Path('/var/log/archinstall'),
'LOG_FILE': Path('install.log'),
'MOUNT_POINT': Path('/mnt/archinstall'),
}
2 changes: 1 addition & 1 deletion archinstall/scripts/guided.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def guided() -> None:
)

fs_handler.perform_filesystem_operations()
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')))


guided()
2 changes: 1 addition & 1 deletion archinstall/scripts/minimal.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def minimal() -> None:
)

fs_handler.perform_filesystem_operations()
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')))


minimal()
2 changes: 1 addition & 1 deletion archinstall/scripts/only_hd.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def only_hd() -> None:
)

fs_handler.perform_filesystem_operations()
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')))


only_hd()
6 changes: 3 additions & 3 deletions archinstall/scripts/swiss.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def execute(self) -> None:
archinstall.arguments[item.key] = item.action(item.value)

perform_installation(
archinstall.storage.get('MOUNT_POINT', Path('/mnt')),
archinstall.arguments.get('mount_point', Path('/mnt')),
self._execution_mode
)
case ExecutionMode.Only_OS:
Expand All @@ -87,7 +87,7 @@ def execute(self) -> None:
break

perform_installation(
archinstall.storage.get('MOUNT_POINT', Path('/mnt')),
archinstall.arguments.get('mount_point', Path('/mnt')),
self._execution_mode
)
case _:
Expand Down Expand Up @@ -266,7 +266,7 @@ def swiss() -> None:
)

fs_handler.perform_filesystem_operations()
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')), mode)
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')), mode)


swiss()
2 changes: 1 addition & 1 deletion examples/interactive_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def _guided() -> None:
)

fs_handler.perform_filesystem_operations()
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')))


_guided()
2 changes: 1 addition & 1 deletion examples/minimal_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def _minimal() -> None:
)

fs_handler.perform_filesystem_operations()
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')))


_minimal()
2 changes: 1 addition & 1 deletion examples/only_hd_installation.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ def _only_hd() -> None:
)

fs_handler.perform_filesystem_operations()
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')))


_only_hd()

0 comments on commit 459b84b

Please sign in to comment.