mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 01:15:38 -04:00
[mount] Print a warning if mount failure
The return of the call to libcalamares.utils.mount is never tested and it may fail silently; this causes some mounpoints to be missing. This adds a warning if mountpoint cannot be mounted. chcon: failed to get security context of '/tmp/verity': Operation not supported 06:44:23 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds) Running "env" ("mount", "-t", "unformatted", "/dev/sdb2", "/tmp/calamares-root-kv8dqgb5/tmp/verity") .. Finished. Exit code: 32 .. Target cmd: ("mount", "-t", "unformatted", "/dev/sdb7", "/tmp/calamares-root-kv8dqgb5/tmp/verity") output: mount: /tmp/calamares-root-kv8dqgb5/tmp/verity: unknown filesystem type 'unformatted'.
This commit is contained in:
parent
1f9f506a16
commit
54fd1f4b26
1 changed files with 26 additions and 45 deletions
|
@ -7,6 +7,7 @@
|
||||||
# SPDX-FileCopyrightText: 2017 Alf Gaida <agaida@siduction.org>
|
# SPDX-FileCopyrightText: 2017 Alf Gaida <agaida@siduction.org>
|
||||||
# SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
|
# SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
|
||||||
# SPDX-FileCopyrightText: 2019 Kevin Kofler <kevin.kofler@chello.at>
|
# SPDX-FileCopyrightText: 2019 Kevin Kofler <kevin.kofler@chello.at>
|
||||||
|
# SPDX-FileCopyrightText: 2019-2020 Collabora Ltd
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
#
|
#
|
||||||
# Calamares is Free Software: see the License-Identifier above.
|
# Calamares is Free Software: see the License-Identifier above.
|
||||||
|
@ -56,22 +57,16 @@ def mount_partition(root_mount_point, partition, partitions):
|
||||||
if fstype == "fat16" or fstype == "fat32":
|
if fstype == "fat16" or fstype == "fat32":
|
||||||
fstype = "vfat"
|
fstype = "vfat"
|
||||||
|
|
||||||
if "luksMapperName" in partition:
|
device = partition["device"]
|
||||||
libcalamares.utils.debug(
|
|
||||||
"about to mount {!s}".format(partition["luksMapperName"]))
|
|
||||||
libcalamares.utils.mount(
|
|
||||||
"/dev/mapper/{!s}".format(partition["luksMapperName"]),
|
|
||||||
mount_point,
|
|
||||||
fstype,
|
|
||||||
partition.get("options", ""),
|
|
||||||
)
|
|
||||||
|
|
||||||
else:
|
if "luksMapperName" in partition:
|
||||||
libcalamares.utils.mount(partition["device"],
|
device = os.path.join("/dev/mapper", partition["luksMapperName"])
|
||||||
mount_point,
|
|
||||||
fstype,
|
if libcalamares.utils.mount(device,
|
||||||
partition.get("options", ""),
|
mount_point,
|
||||||
)
|
fstype,
|
||||||
|
partition.get("options", "")) != 0:
|
||||||
|
libcalamares.utils.warning("Cannot mount {}".format(device))
|
||||||
|
|
||||||
# If the root partition is btrfs, we create a subvolume "@"
|
# If the root partition is btrfs, we create a subvolume "@"
|
||||||
# for the root mount point.
|
# for the root mount point.
|
||||||
|
@ -96,37 +91,23 @@ def mount_partition(root_mount_point, partition, partitions):
|
||||||
|
|
||||||
subprocess.check_call(["umount", "-v", root_mount_point])
|
subprocess.check_call(["umount", "-v", root_mount_point])
|
||||||
|
|
||||||
|
device = partition["device"]
|
||||||
|
|
||||||
if "luksMapperName" in partition:
|
if "luksMapperName" in partition:
|
||||||
libcalamares.utils.mount(
|
device = os.path.join("/dev/mapper", partition["luksMapperName"])
|
||||||
"/dev/mapper/{!s}".format(partition["luksMapperName"]),
|
|
||||||
mount_point,
|
if libcalamares.utils.mount(device,
|
||||||
fstype,
|
mount_point,
|
||||||
",".join(
|
fstype,
|
||||||
["subvol=@", partition.get("options", "")]),
|
",".join(["subvol=@", partition.get("options", "")])) != 0:
|
||||||
)
|
libcalamares.utils.warning("Cannot mount {}".format(device))
|
||||||
if not has_home_mount_point:
|
|
||||||
libcalamares.utils.mount(
|
if not has_home_mount_point:
|
||||||
"/dev/mapper/{!s}".format(partition["luksMapperName"]),
|
if libcalamares.utils.mount(device,
|
||||||
root_mount_point + "/home",
|
root_mount_point + "/home",
|
||||||
fstype,
|
fstype,
|
||||||
",".join(
|
",".join(["subvol=@home", partition.get("options", "")])) != 0:
|
||||||
["subvol=@home", partition.get("options", "")]),
|
libcalamares.utils.warning("Cannot mount {}".format(device))
|
||||||
)
|
|
||||||
else:
|
|
||||||
libcalamares.utils.mount(
|
|
||||||
partition["device"],
|
|
||||||
mount_point,
|
|
||||||
fstype,
|
|
||||||
",".join(["subvol=@", partition.get("options", "")]),
|
|
||||||
)
|
|
||||||
if not has_home_mount_point:
|
|
||||||
libcalamares.utils.mount(
|
|
||||||
partition["device"],
|
|
||||||
root_mount_point + "/home",
|
|
||||||
fstype,
|
|
||||||
",".join(
|
|
||||||
["subvol=@home", partition.get("options", "")]),
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue