summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-02-17 16:56:35 +0100
committerGitHub <noreply@github.com>2026-02-17 16:56:35 +0100
commit580728aae855d9d4a871956bcdc00ea208dcee85 (patch)
treed4bc454c8df6d82668ec095ba29ed538b4250375
parent9785f396ba1e82b6b359e42af7da03828b4ff6ed (diff)
parentd9064df5374a80473e0809fe6df2d59f2758bb45 (diff)
downloadvyos-1x-580728aae855d9d4a871956bcdc00ea208dcee85.tar.gz
vyos-1x-580728aae855d9d4a871956bcdc00ea208dcee85.zip
Merge pull request #4984 from jestabro/legacy-bind-mount-config
T8257: image install search previous needs to consider legacy bind mount
-rwxr-xr-xsrc/op_mode/image_installer.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/op_mode/image_installer.py b/src/op_mode/image_installer.py
index 9e2009a0a..a924d188e 100755
--- a/src/op_mode/image_installer.py
+++ b/src/op_mode/image_installer.py
@@ -272,12 +272,18 @@ def search_previous_installation(disks: list[str]) -> None:
print('Searching for data from previous installations')
image_data = []
encrypted_configs = []
+ legacy_bind_mount = False
for disk_name in disks:
for partition in disk.partition_list(disk_name):
if disk.partition_mount(partition, mnt_tmp):
if Path(mnt_tmp + '/boot').exists():
for path in Path(mnt_tmp + '/boot').iterdir():
- if path.joinpath('rw/opt/vyatta/etc/config/.vyatta_config').exists():
+ if path.joinpath('rw/config/.vyatta_config').exists():
+ legacy_bind_mount = True
+ image_data.append((path.name, partition))
+ elif path.joinpath(
+ 'rw/opt/vyatta/etc/config/.vyatta_config'
+ ).exists():
image_data.append((path.name, partition))
if Path(mnt_tmp + '/luks').exists():
for path in Path(mnt_tmp + '/luks').iterdir():
@@ -330,7 +336,12 @@ def search_previous_installation(disks: list[str]) -> None:
disk.partition_mount(image_drive, mnt_tmp)
if not encrypted:
- copytree(f'{mnt_tmp}/boot/{image_name}/rw/opt/vyatta/etc/config', mnt_config)
+ if legacy_bind_mount:
+ copytree(f'{mnt_tmp}/boot/{image_name}/rw/config', mnt_config)
+ else:
+ copytree(
+ f'{mnt_tmp}/boot/{image_name}/rw/opt/vyatta/etc/config', mnt_config
+ )
else:
copy(f'{mnt_tmp}/luks/{image_name}', mnt_encrypted_config)