#!/bin/sh # if [ "$1" = "prereqs" ]; then exit 0 fi quiet=n . /scripts/functions # if break=fstab STOP here maybe_break fstab . /conf/tcos.conf . /conf/tcos-run-functions cat < /etc/fstab # /etc/fstab: static file system information. # # proc /proc proc defaults 0 0 sys /sys sysfs defaults 0 0 none /dev/pts devpts gid=5,mode=620 0 0 EOF if [ ! -d /dev/pts ]; then _log "FSTAB Mount /dev/pts" mkdir -p /dev/pts mount /dev/pts >> /tmp/initramfs.debug 2>&1 fi # mount usbfs if [ "$(grep -c usbfs /proc/filesystems)" != "0" ] && [ ! -e /proc/bus/usb/devices ]; then log_begin_msg "Mounting /proc/bus/usb" mount -t usbfs procbususb /proc/bus/usb/ 2>/dev/null log_end_msg $? fi # DOCUMENTME uselocal | enable use of local disks uselocal=$(read_cmdline_var "uselocal" "1") if [ ${uselocal} = 0 ]; then _log "FSTAB uselocal disabled from cmdline" exit 0 fi if [ "$NO_UDEV" = "" ]; then # don't call udev again with NFS # wait for devices [ -x /sbin/udevtrigger ] && /sbin/udevtrigger --subsystem-match=ide --subsystem-match=block [ -x /sbin/udevsettle ] && /sbin/udevadm settle fi # To avoid fsck #touch ${rootmnt}/fastboot # # Search local disks partitions # get_partitions () { echo $(ls /dev/[sh]d[a-z]?* 2>/dev/null) } # # Search for CD/DVDs # get_cdroms () { echo $(head -3 /proc/sys/dev/cdrom/info 2>/dev/null | tail -1 | cut -f 3-) } # # Create fstab # create_fstab () { defaults=" defaults,noauto 0 2" partitions=$(get_partitions) for part in $partitions; do # get_filesystem is a script in /bin entry=$(get_filesystem $part) dev=$(echo $entry | awk '{print $1}' ) fs=$(echo $entry | awk '{print $2}' ) if [ "$fs" = "swap" ] ; then entry="${dev} none swap sw 0 0" elif [ "$fs" = "extended" ] ; then # extended partition continue else mntpoint="/mnt/${dev#/dev/}" mkdir -p $mntpoint if [ "$fs" = "ntfs" ]; then defaults=" defaults,ro,noauto 0 2" fi entry="${dev} ${mntpoint} ${fs} ${defaults}" fi echo $entry >> /etc/fstab done num=0 cdroms=$(get_cdroms) for cd in $cdroms; do entry="/dev/${cd} /mnt/cdrom${num} udf,iso9660 ro,noauto 0 0" mkdir -p /mnt/cdrom${num} >> /var/log/initramfs.debug 2>&1 let num=num+1 echo $entry >> /etc/fstab done } [ "$NO_MSG" = "" ] && log_begin_msg "Searching local disks (fstab)" create_fstab rm -f /etc/mtab cat /proc/mounts > /etc/mtab # force boot without swap if [ "$(read_cmdline_var 'noswap' '0')" = 0 ]; then swapon -a >> /tmp/initramfs.debug 2>&1 fi _log "FSTAB done" [ "$NO_MSG" = "" ] && log_end_msg 0 echo 25 > /tmp/progress update_progress exit 0