Tails Installer crashes on upgrade if cruft files with same name are present on both sides
Originally created by @sajolida on #7678 (Redmine)
On upgrade, if both the source and destination USB sticks contain files with the same name, that are not part of what’s normally on a Tails USB stick, then Tails Installer crashes with:
ERROR:liveusb.creator:[Errno 17] File exists: '/media/Tails/$filename Information'
This is because on upgrade, Tails Installer first removes all expected
files (liveos_toplevel_files
) from the destination, and then extract
(when upgrading from ISO) or copies (when “clone and upgrade”) all
files from the source device to the destination one.
We could workaround this by deleting all files on the destination, when a file called the same name is on the source too. But this might lead to the personal data of the user, which our Installer has always been very careful about: it may not be that clear to users that they should not store any personal files on the system partition.
But, some filenames might clearly not be personal data and could then be treated as a special case, if they were created automatically by some operating system for example, then we could:
* either by unconditionally removing it from the destination before
copying files;
* or by skipping it when copying files.
A better approach, that would avoid the need to list all these special
cases, could be to copy only liveos_toplevel_files
from the source
on “clone and upgrade”. Given the files with these names were removed
already from the destination device, no conflict should arise :)
(Long term, this calls for a MANIFEST
file in the ISO filesystem, that
would avoid having to encode this information in the Tails Installer
source code, but oh well, this can wait.)
Feature Branch: liveusb-creator:bugfix/7678-Tails-Installer-crashes-on-upgrade
Related issues
- Related to #6783 (closed)