commit 721f6d27135bd14a4735c672de7a17521d9fe667
parent 57c7e672b93ff5d66a39dc1250420d3213365293
Author: Jan Pobrislo <ccx@webprojekty.cz>
Date: Thu, 2 Feb 2017 01:49:58 +0100
Derive default LV and label names from mountpoint. Don't check xfs filesystems.
Diffstat:
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/zsh-functions/confz_fs_init b/zsh-functions/confz_fs_init
@@ -482,10 +482,14 @@ confz_filesystem_check() {
# put mountpoint for device into /etc/fstab
confz_fstab_check() {
+ checkvars device mountpoint filesystem
defvar opts noatime
defvar dump 0
- defvar pass 2
- checkvars device mountpoint filesystem opts
+ if [[ $vars[filesystem] == xfs ]]; then
+ defvar pass 0
+ else
+ defvar pass 2
+ fi
local device mountpoint filesystem opts dump pass
sed '/^[ \t]*#/d;s/#.*//;s/[ \t]\+/ /g' /etc/fstab | \
@@ -554,9 +558,10 @@ confz_bind_mounted_do() {
# create LVM2 logical volume, and make sure it's in fstab and mounted
confz_mounted_volume_check() {
- checkvars lv_name
+ checkvars mountpoint
+ defvar lv_name ${${mountpoint//\//_}##_}
defvar filesystem xfs
- defvar label $vars[lv_name]
+ defvar label ${${vars[lv_name]}[1,12]}
require logical_volume %device \?vg_name :size :lv_name
require filesystem :device :label :filesystem \?mkfs_opts