diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-09-02 19:23:57 +0000 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-09-03 17:44:11 +0200 |
| commit | bc0b4178b64a1c8c6961dcd9782678a5bc942163 (patch) | |
| tree | 8c4ca6ebd192b2a9d85248f100d68b12132835b4 /src/migration-scripts | |
| parent | 2c269ef450f88690d03970fcafb1dbaa8b3b7f54 (diff) | |
| download | vyos-1x-bc0b4178b64a1c8c6961dcd9782678a5bc942163.tar.gz vyos-1x-bc0b4178b64a1c8c6961dcd9782678a5bc942163.zip | |
image: T5475: derive the persistence path from the overlay upperdir
The union boot branch matched /proc/mounts against the literal string
upperdir=/live/persistence/, which is the layout produced by the VyOS fork of
live-boot. Debian's live-boot mounts persistence below /run/live/persistence
instead, so on an image built against it the match failed, the script reported
an old style boot, and every caller silently did nothing. In practice that meant
/boot was never bind mounted, so GRUB updates and image management found no
configuration directory, and an encrypted config volume was never unlocked.
The old code also only worked by accident. It rebuilt the path as
/lib/live/mount/persistence/$boot_device, where the device component came from
cutting the fourth slash separated field, and that field was empty solely
because the fork appended a trailing slash and produced a doubled separator.
Rather than match one fixed layout, take the overlay's own upperdir and walk up
three levels to strip the rw, image and boot components, then collapse any
duplicate separators. The result is checked for a boot directory, falling back
to the legacy mount points that live-boot's compatibility bind mount still
provides on bookworm. This handles Debian's path, upstream's optional per
device sub-directory and the fork's original layout alike, so it stays correct
whichever live-boot the image was assembled with.
Diffstat (limited to 'src/migration-scripts')
0 files changed, 0 insertions, 0 deletions
