1 diff --git a/src/libcalamares/utils/Runner.cpp b/src/libcalamares/utils/Runner.cpp
2 index c7146c2d7..e165d9a8f 100644
3 --- a/src/libcalamares/utils/Runner.cpp
4 +++ b/src/libcalamares/utils/Runner.cpp
5 @@ -140,13 +140,13 @@ Calamares::Utils::Runner::run()
7 if ( m_location == RunLocation::RunInTarget )
9 - process.setProgram( "chroot" );
10 - process.setArguments( QStringList { workingDirectory.absolutePath() } << m_command );
11 + process.setProgram( "pkexec" );
12 + process.setArguments( QStringList { "chroot" } + QStringList { workingDirectory.absolutePath() } << m_command );
16 - process.setProgram( "env" );
17 - process.setArguments( m_command );
18 + process.setProgram( "pkexec" );
19 + process.setArguments( QStringList { "env" } + m_command );
23 diff --git a/src/modules/mount/main.py b/src/modules/mount/main.py
24 index a3318d1a0..5fbe202fd 100644
25 --- a/src/modules/mount/main.py
26 +++ b/src/modules/mount/main.py
27 @@ -152,7 +152,8 @@ def mount_partition(root_mount_point, partition, partitions):
29 # Ensure that the created directory has the correct SELinux context on
30 # SELinux-enabled systems.
31 - os.makedirs(mount_point, exist_ok=True)
32 + subprocess.check_call(["pkexec", "mkdir", "-p", mount_point])
35 subprocess.call(['chcon', '--reference=' + raw_mount_point, mount_point])
36 except FileNotFoundError as e:
37 @@ -193,13 +194,13 @@ def mount_partition(root_mount_point, partition, partitions):
38 for s in btrfs_subvolumes:
39 if not s["subvolume"]:
41 - os.makedirs(root_mount_point + os.path.dirname(s["subvolume"]), exist_ok=True)
42 - subprocess.check_call(["btrfs", "subvolume", "create",
43 + subprocess.check_call(["pkexec", "mkdir", "-p", root_mount_point + os.path.dirname(s["subvolume"])])
44 + subprocess.check_call(["pkexec", "btrfs", "subvolume", "create",
45 root_mount_point + s["subvolume"]])
46 if s["mountPoint"] == "/":
47 # insert the root subvolume into global storage
48 libcalamares.globalstorage.insert("btrfsRootSubvolume", s["subvolume"])
49 - subprocess.check_call(["umount", "-v", root_mount_point])
50 + subprocess.check_call(["pkexec", "umount", "-v", root_mount_point])
52 device = partition["device"]
54 diff --git a/src/modules/welcome/checker/GeneralRequirements.cpp b/src/modules/welcome/checker/GeneralRequirements.cpp
55 index ca7219ca4..6ac682ba4 100644
56 --- a/src/modules/welcome/checker/GeneralRequirements.cpp
57 +++ b/src/modules/welcome/checker/GeneralRequirements.cpp
58 @@ -371,10 +371,34 @@ GeneralRequirements::checkEnoughStorage( qint64 requiredSpace )
59 cWarning() << "GeneralRequirements is configured without libparted.";
62 - return check_big_enough( requiredSpace );
63 + return big_enough( requiredSpace );
68 +GeneralRequirements::big_enough( qint64 requiredSpace )
72 + snprintf(command, sizeof(command), "lsblk --bytes -no SIZE,TYPE | grep disk | awk '$1 > %llu {print $1}'", requiredSpace);
75 + if (0 == (fpipe = (FILE*)popen(command, "r")))
77 + cWarning() << "Failed to check storage size.";
81 + while (fread(&c, sizeof c, 1, fpipe))
93 GeneralRequirements::checkEnoughRam( qint64 requiredRam )
94 diff --git a/src/modules/welcome/checker/GeneralRequirements.h b/src/modules/welcome/checker/GeneralRequirements.h
95 index b6646da11..ea27324fa 100644
96 --- a/src/modules/welcome/checker/GeneralRequirements.h
97 +++ b/src/modules/welcome/checker/GeneralRequirements.h
98 @@ -36,6 +36,7 @@ private:
100 bool checkHasInternet();
102 + bool big_enough( qint64 requiredSpace );
104 qreal m_requiredStorageGiB;
105 qreal m_requiredRamGiB;