From 60ce3f12a13c70c414cc8b517fc43d46e97d112a Mon Sep 17 00:00:00 2001 From: Dirk von Suchodoletz Date: Tue, 31 Jul 2007 15:48:01 +0000 Subject: Allow user provided automounter configuration (same as for passwd/shadow in ~/rootfs/etc ...) git-svn-id: http://svn.openslx.org/svn/openslx/trunk@1285 95ad53e4-c205-0410-b2fa-d234c58c8868 --- initramfs/initrd-stuff/bin/servconfig | 64 +++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 30 deletions(-) (limited to 'initramfs') diff --git a/initramfs/initrd-stuff/bin/servconfig b/initramfs/initrd-stuff/bin/servconfig index bd123a3e..c854ac4f 100755 --- a/initramfs/initrd-stuff/bin/servconfig +++ b/initramfs/initrd-stuff/bin/servconfig @@ -231,41 +231,45 @@ config_acpi config_dreshal # configure automounter -# if automounter=yes -if [ -d /mnt/misc ] ; then - echo -e "# /etc/auto.master - file generated by $0:\n\ +if [ "x$automnt" != "xno" ] ; then + # check if there is some user provided configuration (only auto.master is + # important) and skip automatic setup + if [ ! -f /rootfs/etc/auto.master ] ; then + if [ -d /mnt/misc ] ; then + echo -e "# /etc/auto.master - file generated by $0:\n\ /misc\t/etc/auto.misc" >/mnt/etc/auto.master - echo -e "# /etc/auto.misc - file generated by $0:" >/mnt/etc/auto.misc -else - echo -e "# /etc/auto.master - file generated by $0:\n\ + echo -e "# /etc/auto.misc - file generated by $0:" >/mnt/etc/auto.misc + else + echo -e "# /etc/auto.master - file generated by $0:\n\ /misc\t#/etc/auto.misc" >/mnt/etc/auto.master - echo -e "# /etc/auto.misc - file generated by $0:\nautomount for \ + echo -e "# /etc/auto.misc - file generated by $0:\nautomount for \ removable devices is mostly deprecated, so /misc is not\nactivated in \ auto.master." > /mnt/etc/auto.misc + fi + if [ -n "${automnt_src}" ] ; then + # local directory and home directory server from machine-setup + [ -z "${automnt_dir}" ] && automnt_dir="/home" + # remove leading and trailing slash + automnt_dir=${automnt_dir#/} + automnt_dir=${automnt_dir%/} + test -d /${automnt_dir} || error "$scfg_erradir" nonfatal + strinstr "/" ${automnt_dir} && error "$scfg_erratpld" nonfatal + amserv=$(uri_token $automnt_src server) + ampath=$(uri_token $automnt_src path) + echo -e "/${automnt_dir}\t/etc/auto.${automnt_dir}\n" \ + >> /mnt/etc/auto.master + echo -e "# /etc/auto.${automnt_dir} created by $0:\n" \ + > /mnt/etc/auto.${automnt_dir} + echo -e "*\t-rsize=32768,wsize=32768,rw\t${amserv}:${ampath}/&" \ + >> /mnt/etc/auto.${automnt_dir} + # no tempfs needed if automounter operates on /home + [ "${automnt_dir}" = "home" ] && umount -t tmpfs /mnt/home 2>/dev/null + # portmapper is needed for remote NFS sources + config_portmap + fi + fi + config_automount fi -if [ -n "${automnt_src}" ] ; then - # local directory and home directory server from machine-setup - [ -z "${automnt_dir}" ] && automnt_dir="/home" - # remove leading and trailing slash - automnt_dir=${automnt_dir#/} - automnt_dir=${automnt_dir%/} - test -d /${automnt_dir} || error "$scfg_erradir" nonfatal - strinstr "/" ${automnt_dir} && error "$scfg_erratpld" nonfatal - amserv=$(uri_token $automnt_src server) - ampath=$(uri_token $automnt_src path) - echo -e "/${automnt_dir}\t/etc/auto.${automnt_dir}\n" \ - >> /mnt/etc/auto.master - echo -e "# /etc/auto.${automnt_dir} created by $0:\n" \ - > /mnt/etc/auto.${automnt_dir} - echo -e "*\t-rsize=32768,wsize=32768,rw\t${amserv}:${ampath}/&" \ - >> /mnt/etc/auto.${automnt_dir} - # no tempfs needed if automounter operates on /home - [ "${automnt_dir}" = "home" ] && umount -t tmpfs /mnt/home 2>/dev/null - # portmapper is needed for remote NFS sources - config_portmap -fi -config_automount -# fi # configure print services / start requested printer daemon config_printer -- cgit v1.2.3-55-g7522