[unpackfs] Do not use -o loop on a device

src/modules/unpackfs/main.py (UnpackOperation.mount_image): Check
whether entry.source is a regular file or a device and only use
`-o loop` on regular files, not devices.

At least on Fedora >= 29, `-o loop` fails on the read-only device
`/dev/mapper/live-base` (though `-o loop,ro` would be accepted).
This commit is contained in:
Kevin Kofler 2019-05-06 15:04:58 +02:00
parent 02c7fe8345
commit 71d991e2e4

View File

@ -7,6 +7,7 @@
# Copyright 2014, Daniel Hillenbrand <codeworkx@bbqlinux.org> # Copyright 2014, Daniel Hillenbrand <codeworkx@bbqlinux.org>
# Copyright 2014, Philip Müller <philm@manjaro.org> # Copyright 2014, Philip Müller <philm@manjaro.org>
# Copyright 2017, Alf Gaida <agaida@siduction.org> # Copyright 2017, Alf Gaida <agaida@siduction.org>
# Copyright 2019, Kevin Kofler <kevin.kofler@chello.at>
# #
# Calamares is free software: you can redistribute it and/or modify # Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
@ -252,13 +253,19 @@ class UnpackOperation:
subprocess.check_call(["mount", subprocess.check_call(["mount",
"--bind", entry.source, "--bind", entry.source,
imgmountdir]) imgmountdir])
else: elif os.path.isfile(entry.source):
subprocess.check_call(["mount", subprocess.check_call(["mount",
entry.source, entry.source,
imgmountdir, imgmountdir,
"-t", entry.sourcefs, "-t", entry.sourcefs,
"-o", "loop" "-o", "loop"
]) ])
else: # entry.source is a device
subprocess.check_call(["mount",
entry.source,
imgmountdir,
"-t", entry.sourcefs
])
def unpack_image(self, entry, imgmountdir): def unpack_image(self, entry, imgmountdir):
""" """