From 35fb8dcc27bc9ed823808cea0191c19f2aca8333 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 9 Jun 2020 13:24:12 +0200 Subject: [PATCH] [mount] Warn if chcon is missing, rather than fail FIXES #1429 --- src/modules/mount/main.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py index b10c5c0bf..4e16b43c3 100644 --- a/src/modules/mount/main.py +++ b/src/modules/mount/main.py @@ -52,8 +52,13 @@ def mount_partition(root_mount_point, partition, partitions): # Ensure that the created directory has the correct SELinux context on # SELinux-enabled systems. os.makedirs(mount_point, exist_ok=True) - subprocess.call(['chcon', '--reference=' + raw_mount_point, - mount_point]) + try: + subprocess.call(['chcon', '--reference=' + raw_mount_point, mount_point]) + except FileNotFoundError as e: + libcalamares.utils.warning(str(e)) + except OSError: + libcalamares.utils.error("Cannot run 'chcon' normally.") + raise fstype = partition.get("fs", "").lower()