summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-09-01 14:45:22 +0000
committerChristian Breunig <christian@breunig.cc>2026-09-01 14:45:22 +0000
commitdcb271a63c49beac90f81ea5bbc19feefc0b6f91 (patch)
treea95bdfd8c863c436c543ebcdc95dc92d2699c0f5
parentd2d7c27cb0c71945fc9dc1a4f299fa88a45cb42e (diff)
downloadvyos-build-dcb271a63c49beac90f81ea5bbc19feefc0b6f91.tar.gz
vyos-build-dcb271a63c49beac90f81ea5bbc19feefc0b6f91.zip
oci: T9269: fix /config symlink creation
/config already exists as an empty directory in the squashfs, so "ln -s /opt/vyatta/etc/config /config" did not create the intended symlink - it placed one at /config/config and left /config a dead directory. Verified in a running container built from the previous OCI image: readlink /config -> (empty) ls -ld /config -> drwxr-xr-x 2 root root 4096 /config readlink /config/config-> /opt/vyatta/etc/config Remove the directory first, refusing to continue if it ever carries content, so the breakage cannot silently reappear.
-rwxr-xr-xscripts/iso-to-oci5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/iso-to-oci b/scripts/iso-to-oci
index bc132681..86dd8687 100755
--- a/scripts/iso-to-oci
+++ b/scripts/iso-to-oci
@@ -86,7 +86,10 @@ rm -rf "${UNSQUASHFS}/opt/vyatta/share/vyatta-cfg/templates/system/option/root-p
rm -rf "${UNSQUASHFS}/opt/vyatta/share/vyatta-cfg/templates/system/option/reboot-on-panic"
rm -rf "${UNSQUASHFS}/opt/vyatta/share/vyatta-cfg/templates/system/option/performance"
-# create a symbolic link to the configuration
+# create a symbolic link to the configuration - /config already exists as an
+# empty directory in the squashfs, so it must go first. A plain "ln -s" would
+# happily create /config/config instead and leave /config a dead directory.
+rmdir "${UNSQUASHFS}/config" || { echo "E: /config is not an empty directory"; exit 1; }
ln -s /opt/vyatta/etc/config "${UNSQUASHFS}/config"
# create docker image