From ba3c9a1ad387aaf6487852acf8cbcb7def630e26 Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Sun, 28 Oct 2012 12:03:59 +0100 Subject: [PATCH] grml-udev-rebuildfstab: support diabling labels via /etc/grml/rebuildfstab.conf It's inconveniant to be able to configure the behaviour only during boot up, so support customization through configuration file /etc/grml/rebuildfstab.conf. As the file might disable labels but the user might want to enable them during boot up, add support for boot option 'label' to force usage of LABEL=... in /etc/fstab, actually overriding the configuration file settings. --- scripts/grml-udev-rebuildfstab | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/scripts/grml-udev-rebuildfstab b/scripts/grml-udev-rebuildfstab index 07c3436..c0371cf 100755 --- a/scripts/grml-udev-rebuildfstab +++ b/scripts/grml-udev-rebuildfstab @@ -53,10 +53,6 @@ if grep -q " nofstab" /proc/cmdline ; then bailout 0 fi -grep -q 'nolabel' /proc/cmdline && NOLABEL='TRUE' || LABEL='TRUE' - - - if [ "$CONFIG_FSTAB" = "no" ] ; then bailout 0 fi @@ -67,6 +63,26 @@ if grep -q ' $MOUNTPOINT_PREFIX ' /proc/mounts ; then bailout 1 fi +LABEL=true # by default use labels + +if [ -r /etc/grml/rebuildfstab.conf ] ; then + logit 'Reading /etc/grml/rebuildfstab.conf' + . /etc/grml/rebuildfstab.conf + + if [ "$LABEL" = "false" ] ; then + logit 'Disabling LABEL=... in /etc/fstab as requested via LABEL=false' + fi +fi + +# support overriding via boot option +if grep -q ' nolabel' /proc/cmdline ; then + LABEL=false +fi + +if grep -q ' label' /proc/cmdline ; then + LABEL=true +fi + # default directories {{{ if [ -d "$MOUNTPOINT_PREFIX" ] ; then [ -d "$MOUNTPOINT_PREFIX/floppy" ] || mkdir "$MOUNTPOINT_PREFIX/floppy" @@ -145,7 +161,7 @@ iso9660) break; ;; *) -if [ -n "$LABEL" ] && [ -n "$ID_FS_LABEL_ENC" ] ; then +if "$LABEL" && [ -n "$ID_FS_LABEL_ENC" ] ; then # see check_for_label() in scanpartitions for details case $ID_FS_LABEL_ENC in *\x*) -- 2.1.4