The change to the definition of the environment variable in https://vyos.dev/T5461 is incorrect in the case that an image is added with a custom name. More generally, for future uses of this env var, one will want to distinguish between vyos_rootfs_dir before and after bind_mount_boot, with appropriate names --- here we only address its current (and only) use in the context of https://vyos.dev/T5440 by reverting the commit revising the definition (6b03f686406); the original definition suffices for its use.
Symptom when updating 1.3.4 to Sagitta:
vyos@vyos:~$ show system image The system currently has the following image(s) installed: 1: 1.3.4 (default boot) vyos@vyos:~$ add system image vyos-1.4-rolling-202310261853-amd64.iso Checking SHA256 checksums of files on the ISO image... OK. Done! What would you like to name this image? [1.4-rolling-202310261853]: some-other-name-vyos-1.4 OK. This image will be named: some-other-name-vyos-1.4 Installing "some-other-name-vyos-1.4" image. ...
Oct 26 19:33:41 vyos vyos-router[1089]: Starting VyOS router: migrate Oct 26 19:33:41 vyos vyos-router[1688]: cp: cannot stat '/usr/lib/live/mount/rootfs/some-other-name-vyos-1.4.squashfs/opt/vyatta/etc/config/scripts/vyos-preconfig-bootup.script': No such file or directory Oct 26 19:33:41 vyos vyos-router[1689]: chgrp: cannot access '/opt/vyatta/etc/config/scripts/vyos-preconfig-bootup.script': No such file or directory Oct 26 19:33:41 vyos vyos-router[1690]: chmod: cannot access '/opt/vyatta/etc/config/scripts/vyos-preconfig-bootup.script': No such file or directory
Since this is called before bind_mount, one wants the original definition:
root@vyos:/home/vyos# mount -t squashfs | cut -d' ' -f3 /usr/lib/live/mount/rootfs/1.4-rolling-202310261853.squashfs
not the revised definition using:
root@vyos:/home/vyos# cat /proc/cmdline | sed -e s+^.*vyos-union=/boot/++ | sed -e 's/ .*$//' some-other-name-vyos-1.4
Again, for any future uses the env var should be split into cases for searching
/usr/lib/live/mount/rootfs/
respectively
/usr/lib/live/mount/persistence/boot
for version before bind_mount respectively image-name after.