From 64fd48ee1f342f74041c2c21e13ec3eb07a04ae7 Mon Sep 17 00:00:00 2001 From: John Estabrook Date: Wed, 18 Feb 2026 11:15:05 -0600 Subject: 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. --- src/init/vyos-router | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/init') 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 -- cgit v1.2.3