summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2026-02-12 20:34:11 -0600
committerJohn Estabrook <jestabro@vyos.io>2026-02-12 21:36:47 -0600
commitb92471d684f0131fb8885e766cd90ee80dc8ed38 (patch)
tree706f8efacfd7c374961f11d55a627428f9a8314c
parent3b6422f08dff4dc50fe5397c9fede781bd3288c5 (diff)
downloadvyos-build-b92471d684f0131fb8885e766cd90ee80dc8ed38.tar.gz
vyos-build-b92471d684f0131fb8885e766cd90ee80dc8ed38.zip
T8265: leave config path hint in raw image install_image
The raw_image.py script as part of the build-image tools neglects to leave the canonical hint file in the config install path. This is standard in the op mode image_installer.py script and is used to detect previous installations.
-rw-r--r--scripts/image-build/raw_image.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/image-build/raw_image.py b/scripts/image-build/raw_image.py
index a88ed020..a909d1c2 100644
--- a/scripts/image-build/raw_image.py
+++ b/scripts/image-build/raw_image.py
@@ -19,6 +19,8 @@ import os
import sys
import shutil
+from pathlib import Path
+
import vyos.utils.process
import vyos.template
@@ -29,6 +31,7 @@ SQUASHFS_FILE = 'live/filesystem.squashfs'
VERSION_FILE = 'version.json'
from utils import cmd
+from utils import directories as vyos_dirs
def mkdir(path):
os.makedirs(path, exist_ok=True)
@@ -157,6 +160,13 @@ def install_image(con, version):
print(f"I: Copying file {f}")
shutil.copy(f, vyos_dir)
+ # Leave hint in config directory, to be found by subsequent
+ # installations searching for previous config data.
+ # This step is explicitly performed by image_installer.py.
+ config_path = Path(vyos_dir).joinpath(f'rw{vyos_dirs["config"]}')
+ Path(config_path).mkdir(parents=True, exist_ok=True)
+ Path(config_path).joinpath('.vyatta_config').touch()
+
with open(f"{con.raw_dir}/persistence.conf", 'w') as f:
f.write("/ union\n")