[rawfs] Allow use of symlinks in configuration
In its current state, the 'rawfs' module requires the source partition to be identified either by its mount point or device name, but using a symlink to either one (e.g '/dev/disk/by-uuid/...') would fail. This patch fetches the real path of source partition, allowing the use of symlinks. Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
This commit is contained in:
parent
a31cbefab6
commit
32a5a796f7
@ -131,7 +131,7 @@ class RawFSItem:
|
|||||||
def __init__(self, config, device, fs):
|
def __init__(self, config, device, fs):
|
||||||
libcalamares.utils.debug("Adding an entry for raw copy of {} to {}".format(
|
libcalamares.utils.debug("Adding an entry for raw copy of {} to {}".format(
|
||||||
config["source"], device))
|
config["source"], device))
|
||||||
self.source = config["source"]
|
self.source = os.path.realpath(config["source"])
|
||||||
# If source is a mount point, look for the actual device mounted on it
|
# If source is a mount point, look for the actual device mounted on it
|
||||||
if os.path.ismount(self.source):
|
if os.path.ismount(self.source):
|
||||||
procmounts = open("/proc/mounts", "r")
|
procmounts = open("/proc/mounts", "r")
|
||||||
|
Loading…
Reference in New Issue
Block a user