Add fs type as option

This commit is contained in:
Alexandre CATTEAU 2023-07-27 16:29:06 +02:00
parent 14a205d6a2
commit ee7849be8f
3 changed files with 4 additions and 2 deletions

View File

@ -24,6 +24,7 @@ for f in $run_directory/mounts.conf.d/*.conf; do
$sudo cp $run_directory/template.mount /etc/systemd/system/$mountfile
$sudo sed -i -e "s/PH_MAPPER/${mount[mapper]}/g" /etc/systemd/system/$mountfile
$sudo sed -i -e "s:PH_TARGET:${mount[target]}:g" /etc/systemd/system/$mountfile
$sudo sed -i -e "s:PH_FSTYPE:${mount[type]}:g" /etc/systemd/system/$mountfile
if [ "${mount[friendly]}" != '' ]; then
$sudo sed -i -e "s/PH_FRIENDLY/${mount[friendly]}/g" /etc/systemd/system/$mountfile
else

View File

@ -5,6 +5,7 @@
declare -A mount
mount[mapper]='' # As in /dev/mapper/<?>
mount[target]='' # Mount point (absolute path)
mount[type]='ext4' # Filesystem type
mount[friendly]='' # Optional friendly name for unit file Description
mount[autolock]=0 # Set to 1 to enable autolock
mount[timeout]=0 # Set to 1 to enable mount timeout (30 seconds)

View File

@ -1,10 +1,10 @@
[Unit]
Description=Mount PH_FRIENDLY Volume
# Below Requisite could be a Wants
Requisite=systemd-cryptsetup@PH_MAPPER.service
Wants=systemd-cryptsetup@PH_MAPPER.service
After=systemd-cryptsetup@PH_MAPPER.service
[Mount]
What=/dev/mapper/PH_MAPPER
Where=PH_TARGET
Type=PH_FSTYPE
Options=rw,relatime