#!/bin/sh # if [ "$1" = "prereqs" ]; then exit 0 fi quiet=n . /scripts/functions . /conf/tcos.conf . /conf/tcos-run-functions # if break=autofs STOP here maybe_break autofs # DOCUMENTME noautofs | disable autofs (automount daemon) noautofs=$(read_cmdline_var "noautofs" "0") if [ ${noautofs} = 1 ]; then _log "AUTOFS autofs disabled from cmdline" exit 0 fi if [ -z "$TCOS_AUTOFS" ]; then _log "AUTOFS autofs disabled in tcos.conf" exit 0 fi if [ ! -x $(which automount) ]; then _log "AUTOFS automount not found" # exit if automount not found exit 0 fi # load kernel module modprobe autofs4 >/dev/null 2>&1 & #modprobe autofs >/dev/null 2>&1 & echo "/media/autofs/ /etc/auto.removable --timeout=10" >> /etc/auto.master cdroms=$(grep iso9660 /etc/fstab| awk '{print $1":"$2}') for cdrom in $cdroms; do device=$(echo $cdrom| awk -F ":" '{print $1}') mountpoint=$(echo $cdrom| awk -F ":" '{print $2}'| awk -F "/" '{print $3}') echo "$mountpoint -fstype=iso9660,ro :$device" >> /etc/auto.removable done echo "floppy -fstype=vfat :/dev/fd0" >> /etc/auto.removable echo "flash1 -fstype=vfat :/dev/sda1" >> /etc/auto.removable echo "flash2 -fstype=vfat :/dev/sda" >> /etc/auto.removable log_begin_msg "Loading autofs daemon" # create daemon to start automount cat < /sbin/autofs #!/bin/sh automount --timeout=0 --ghost /media/autofs file /etc/auto.removable exit 0 EOF chmod +x /sbin/autofs #start daemon _log "AUTOFS Starting autofs daemon" autofs >> /tmp/initramfs.debug 2>&1 & log_end_msg $? # manually make mountpoints #mkdir /media/autofs >> /tmp/initramfs.debug 2>&1 #devices=$(cat /etc/auto.removable | awk '{print $1}') #for dev in $devices; do # _log "AUTOFS Linking dir /media/autofs/$dev into /media/.autofs/" # ln -s /media/.autofs/$dev /media/autofs/$dev>> /tmp/initramfs.debug 2>&1 #done echo 90 > /tmp/progress update_progress exit 0