summaryrefslogtreecommitdiffstats
path: root/initramfs
diff options
context:
space:
mode:
authorDirk von Suchodoletz2007-07-31 17:48:01 +0200
committerDirk von Suchodoletz2007-07-31 17:48:01 +0200
commit60ce3f12a13c70c414cc8b517fc43d46e97d112a (patch)
tree4f71cbbaa4dd7c546b76ff0ac422a2866112acd5 /initramfs
parentActualized LDAP SiteManagement Code - Web Interface, DHCP Generationscript (diff)
downloadcore-60ce3f12a13c70c414cc8b517fc43d46e97d112a.tar.gz
core-60ce3f12a13c70c414cc8b517fc43d46e97d112a.tar.xz
core-60ce3f12a13c70c414cc8b517fc43d46e97d112a.zip
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
Diffstat (limited to 'initramfs')
-rwxr-xr-xinitramfs/initrd-stuff/bin/servconfig64
1 files changed, 34 insertions, 30 deletions
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