zfs-mount-generator: Fix escaping for /

The correct name for the mount unit for / is "-.mount", not ".mount".

Reviewed-by: InsanePrawn <insane.prawny@gmail.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Co-authored-by: Antonio Russo <antonio.e.russo@gmail.com>
Signed-off-by: Richard Laager <rlaager@wiktel.com>
Closes #9970
This commit is contained in:
Richard Laager 2020-02-13 13:55:59 -06:00 committed by Tony Hutter
parent d4e04cc145
commit ebc8e360d5

View File

@ -156,7 +156,7 @@ ExecStop=@sbindir@/zfs unload-key '${dataset}'" > "${dest_norm}/${keyloadunit}
fi
# Escape the mountpoint per systemd policy.
mountfile="$(systemd-escape "${p_mountpoint#?}").mount"
mountfile="$(systemd-escape --path --suffix=mount "${p_mountpoint}")"
# Parse options
# see lib/libzfs/libzfs_mount.c:zfs_add_options