Skip to content

Commit 459b84b

Browse files
authored
Rework mount point argument (archlinux#3041)
1 parent d5c5b60 commit 459b84b

File tree

12 files changed

+12
-18
lines changed

12 files changed

+12
-18
lines changed

archinstall/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def define_arguments() -> None:
7777
parser.add_argument("--dry-run", "--dry_run", action="store_true",
7878
help="Generates a configuration file and then exits instead of performing an installation")
7979
parser.add_argument("--script", default="guided", nargs="?", help="Script to run for installation", type=str)
80-
parser.add_argument("--mount-point", "--mount_point", nargs="?", type=str,
80+
parser.add_argument("--mount-point", "--mount_point", default=Path("/mnt/archinstall"), nargs="?", type=Path,
8181
help="Define an alternate mount point for installation")
8282
parser.add_argument("--skip-ntp", action="store_true", help="Disables NTP checks during installation", default=False)
8383
parser.add_argument("--debug", action="store_true", default=False, help="Adds debug info into the log")
@@ -266,8 +266,6 @@ def load_config() -> None:
266266

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

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

archinstall/lib/args.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,9 +272,6 @@ def _parse_args(self) -> Arguments:
272272
if args.config is None:
273273
args.silent = False
274274

275-
if args.mount_point is not None:
276-
storage['MOUNT_POINT'] = Path(args.mount_point)
277-
278275
if args.debug:
279276
warn(f"Warning: --debug mode will write certain credentials to {storage['LOG_PATH']}/{storage['LOG_FILE']}!")
280277

archinstall/lib/disk/device_model.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def parse_arg(cls, disk_config: _DiskLayoutConfigurationSerialization) -> DiskLa
9999
mods = device_handler.detect_pre_mounted_mods(path)
100100
device_modifications.extend(mods)
101101

102-
storage['MOUNT_POINT'] = path
102+
storage['arguments']['mount_point'] = path
103103

104104
config.mountpoint = path
105105

archinstall/lib/interactions/disk_conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def select_disk_config(
148148

149149
mods = disk.device_handler.detect_pre_mounted_mods(path)
150150

151-
storage['MOUNT_POINT'] = path
151+
storage['arguments']['mount_point'] = path
152152

153153
return disk.DiskLayoutConfiguration(
154154
config_type=disk.DiskLayoutType.Pre_mount,

archinstall/lib/storage.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,4 @@
1111
storage: dict[str, Any] = {
1212
'LOG_PATH': Path('/var/log/archinstall'),
1313
'LOG_FILE': Path('install.log'),
14-
'MOUNT_POINT': Path('/mnt/archinstall'),
1514
}

archinstall/scripts/guided.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def guided() -> None:
180180
)
181181

182182
fs_handler.perform_filesystem_operations()
183-
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
183+
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')))
184184

185185

186186
guided()

archinstall/scripts/minimal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def minimal() -> None:
107107
)
108108

109109
fs_handler.perform_filesystem_operations()
110-
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
110+
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')))
111111

112112

113113
minimal()

archinstall/scripts/only_hd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def only_hd() -> None:
7676
)
7777

7878
fs_handler.perform_filesystem_operations()
79-
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
79+
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')))
8080

8181

8282
only_hd()

archinstall/scripts/swiss.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def execute(self) -> None:
6161
archinstall.arguments[item.key] = item.action(item.value)
6262

6363
perform_installation(
64-
archinstall.storage.get('MOUNT_POINT', Path('/mnt')),
64+
archinstall.arguments.get('mount_point', Path('/mnt')),
6565
self._execution_mode
6666
)
6767
case ExecutionMode.Only_OS:
@@ -87,7 +87,7 @@ def execute(self) -> None:
8787
break
8888

8989
perform_installation(
90-
archinstall.storage.get('MOUNT_POINT', Path('/mnt')),
90+
archinstall.arguments.get('mount_point', Path('/mnt')),
9191
self._execution_mode
9292
)
9393
case _:
@@ -266,7 +266,7 @@ def swiss() -> None:
266266
)
267267

268268
fs_handler.perform_filesystem_operations()
269-
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')), mode)
269+
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')), mode)
270270

271271

272272
swiss()

examples/interactive_installation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ def _guided() -> None:
180180
)
181181

182182
fs_handler.perform_filesystem_operations()
183-
perform_installation(archinstall.storage.get('MOUNT_POINT', Path('/mnt')))
183+
perform_installation(archinstall.arguments.get('mount_point', Path('/mnt')))
184184

185185

186186
_guided()

0 commit comments

Comments
 (0)