calamares/src/modules/umount
Gaël PORTAY e9e4be1c60 [umount] Fix list of mount-points to unmount
The root mount-point can end with a / while the mount-point read from
the file /etc/mtab does not end with a /.

This leads to skip the unmounting of the root mount-point and causes the
removal of the root mountpoint directory to fail with EBUSY because it
is still mounted.

This uses the python functions os.path.normpath() to normalize the root
mount-point (i.e. to drop the trailing /) and os.path.commonprefix() to
determine the longest common prefix between the two mount-points. If the
returned prefix is identical to the normalized root mount-point then the
mount-point must be added to the list of the mount-points to unmount.

More generally, the python modules should rely on the os.path functions
to compare for paths instead of using strings. It covers this way lots
of corner cases (path with "//", "/../", "/./", ...).
2020-11-04 08:37:22 -05:00
..
main.py [umount] Fix list of mount-points to unmount 2020-11-04 08:37:22 -05:00
module.desc REUSE: (CC0-1.0) module descriptors and configuration files 2020-08-26 02:22:49 +02:00
umount.conf REUSE: (CC0-1.0) module descriptors and configuration files 2020-08-26 02:22:49 +02:00
umount.schema.yaml REUSE: (GPL-3.0-or-later) all the schema files 2020-08-26 02:01:58 +02:00