From dcb271a63c49beac90f81ea5bbc19feefc0b6f91 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Tue, 1 Sep 2026 14:45:22 +0000 Subject: 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. --- scripts/iso-to-oci | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3