summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2026-02-18 11:15:05 -0600
committerJohn Estabrook <jestabro@vyos.io>2026-02-25 14:50:04 -0600
commit64fd48ee1f342f74041c2c21e13ec3eb07a04ae7 (patch)
tree8567094ee291da200ec2104cb333de0b9b4a35c9 /src
parentc386550aa8dd07026eba25bf40323c8d2439b6e2 (diff)
downloadvyos-1x-64fd48ee1f342f74041c2c21e13ec3eb07a04ae7.tar.gz
vyos-1x-64fd48ee1f342f74041c2c21e13ec3eb07a04ae7.zip
T8279: recover config data provided by legacy image upgrade tools
When upgrading from systems using the legacy image upgrade tools (1.3.x), config data is copied to a now non-standard path. Add check on first boot into target image to recover source image config data.
Diffstat (limited to 'src')
-rwxr-xr-xsrc/init/vyos-router19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/init/vyos-router b/src/init/vyos-router
index 794715368..550c916a1 100755
--- a/src/init/vyos-router
+++ b/src/init/vyos-router
@@ -312,6 +312,23 @@ bind_mount_boot ()
fi
}
+# this is called before migration and bind_mount_slash_config to check for
+# upgrade data installed by legacy image update tools
+copy_legacy_config_path ()
+{
+ if [ -d /config ] ; then
+ if [ -f /config/.upgraded ] ; then
+ rm -f /config/.upgraded
+ cp -a /config /opt/vyatta/etc
+ chgrp -R vyattacfg /opt/vyatta/etc/config
+ chmod -R 775 /opt/vyatta/etc/config
+ chmod 660 /opt/vyatta/etc/config/config.boot
+ touch /opt/vyatta/etc/config/.vyatta_config
+ rm -rf /config
+ fi
+ fi
+}
+
bind_mount_slash_config ()
{
if [ -d /opt/vyatta/etc/config ]
@@ -578,6 +595,8 @@ start ()
# This is a safety net!
systemctl start frr.service
+ disabled copy_legacy_config_path || copy_legacy_config_path
+
disabled bootfile || init_bootfile
cleanup_post_commit_hooks