A major change in coreutils between versions < 9.0 (buster, bullseye) and >= 9.0 (bookworm) opens legacy image tools to a corrupted config.boot on system update:
(1) As of coreutils 9.0 'cp' is default --reflink=auto instead of previous --reflink=never; this can lead to truncation when copying files from the bind mount /config, but not from /opt/vyatta/etc/config.
https://lists.gnu.org/archive/html/info-gnu/2021-09/msg00010.html
https://github.com/coreutils/coreutils/commit/25725f9d41
(2) Legacy image-tools do a cp -a from /config instead of /opt/vyatta/etc/config, inviting this error during a system image update.
https://github.com/vyos/vyatta-cfg-system/blob/current/scripts/install/install-image-existing#L194-L195
The full root cause regarding bind mount, cp --reflink=auto, is not yet analyzed, nor do I have a reliable reproducer across recent images --- the periodic recurrence of the problem (e.g. T5267) indicates that several factors may incite it, or a yet unknown common factor.
However, the urgency of the bug suggest opening a high priority task and an immediate one line fix to legacy image tools; note that the new image tools (T4516) avoid copying from the bind mount, as do most if not all VyOS scripts, as a common practice.
Symptoms of the problem in current, below, show comparisons in copying config.boot from /opt/vyatta/etc/config; /config with --reflink=never (both okay); /config (not okay).
vyos@vyos# ls -l /config/config.boot -rwxrwxr-x 1 root vyattacfg 1870 Aug 28 01:21 /config/config.boot [edit] vyos@vyos# cp /opt/vyatta/etc/config/config.boot . [edit] vyos@vyos# ls -l config.boot -rwxr-xr-x 1 vyos users 1870 Aug 28 01:53 config.boot [edit] vyos@vyos# cp --reflink=never /config/config.boot . [edit] vyos@vyos# ls -l config.boot -rwxr-xr-x 1 vyos users 1870 Aug 28 01:53 config.boot [edit] vyos@vyos# cp /config/config.boot . [edit] vyos@vyos# ls -l config.boot -rwxr-xr-x 1 vyos users 1838 Aug 28 01:54 config.boot vyos@vyos# diff /config/config.boot config.boot | tail -n 5 72c72 < // Release version: 1.4-rolling-202308262315 --- > // Release ve \ No newline at end of file