Add possibility to set mount options for the ESP

Added new configuration "efiMountOptions" to fstab.conf
When generating the fstab entry for the ESP, take the mount options from
the new configuration or fall back to "mountOptions".
This commit is contained in:
apt-ghetto 2019-07-29 16:06:52 +02:00
parent 8a545941d4
commit 0f5ff9a517
2 changed files with 17 additions and 2 deletions

View File

@ -12,6 +12,11 @@ mountOptions:
default: defaults,noatime default: defaults,noatime
btrfs: defaults,noatime,space_cache,autodefrag btrfs: defaults,noatime,space_cache,autodefrag
# Mount options to use for the EFI System Partition. If not defined, it
# takes either the value of *vfat*, or if also missing, *default* from
# *mountOptions*
efiMountOptions: umask=0077
# If a filesystem is on an SSD, add the following options. If a specific # If a filesystem is on an SSD, add the following options. If a specific
# filesystem is listed here, use those options, otherwise no additional # filesystem is listed here, use those options, otherwise no additional
# options are set (i.e. there is no *default* like in *mountOptions*). # options are set (i.e. there is no *default* like in *mountOptions*).

View File

@ -246,8 +246,8 @@ class FstabGenerator(object):
if not mount_point: if not mount_point:
mount_point = "swap" mount_point = "swap"
options = self.mount_options.get(filesystem, options = self.get_mount_options(filesystem, mount_point)
self.mount_options["default"])
if is_ssd: if is_ssd:
extra = self.ssd_extra_mount_options.get(filesystem) extra = self.ssd_extra_mount_options.get(filesystem)
@ -295,6 +295,16 @@ class FstabGenerator(object):
if partition["mountPoint"]: if partition["mountPoint"]:
mkdir_p(self.root_mount_point + partition["mountPoint"]) mkdir_p(self.root_mount_point + partition["mountPoint"])
def get_mount_options(self, filesystem, mount_point):
efiMountPoint = libcalamares.globalstorage.value("efiSystemPartition")
job_config = libcalamares.job.configuration
if (mount_point == efiMountPoint and "efiMountOptions" in job_config):
return job_config["efiMountOptions"]
return self.mount_options.get(filesystem,
self.mount_options["default"])
def run(): def run():
""" Configures fstab. """ Configures fstab.