#!/bin/bash #%rlevels: 7:s 0:k 6:k #%start: 40 #%stop: 60 #deps #%needs: #%before: #%after: source /etc/sysconfig/rc source $rc_functions get_mounted(){ local filesys filesys=$1 cat /proc/mounts | grep ${filesys} | cut -d ' ' -f3 } case "$1" in start) echo -e ${COLOREDSTAR}"Recording existing mounts in /etc/mtab ..." > /etc/mtab #fake mount rootfs (taken from /.bootdev) if [ -e /.bootdev ] then source /.bootdev mount -f ${BOOTDEV} /mnt/cdrom -t ${FSTYPE} -o ro #we don't delete this for the alx settings import #wanna check if usbstorage or not #rm /.bootdev fi #fake mount cloop, loop or sqsh if [ -f /mnt/cdrom/livecdrootfs.loop ] then mount -f /mnt/cdrom/livecdrootfs.loop /mnt/cloop -t ext2 -o ro elif [ -f /mnt/cdrom/livecdrootfs.cloop ] then mount -f /mnt/cdrom/livecdrootfs.cloop /mnt/cloop -t ext2 -o ro elif [ -f /mnt/cdrom/livecdrootfs.sqsh ] then mount -f /mnt/cdrom/livecdrootfs.sqsh /mnt/cloop -t ext2 -o ro fi #records devfs if mounted if [ "$(get_mounted devfs)" == devfs ] then mount -f -t devfs none /dev fi #records devpts if mounted if [ "$(get_mounted devpts)" == devpts ] then mount -f -t devpts none /dev/pts fi #records sysfs if mounted if [ "$(get_mounted sysfs)" == sysfs ] then mount -f -t sysfs none /sys fi #records udev's ramfs if mounted if [ "$(get_mounted ramfs)" == ramfs ] then mount -f -t ramfs none /dev fi #fake mount tmpfs mount -f tmpfs / -t tmpfs -o rw #fake mount proc mount -f proc /proc -t proc -o rw evaluate_retval update_svcstatus $1 splash svc_started "$(basename $0)" 0 ;; stop) echo -e ${COLOREDSTAR}"Unmounting all other currently mounted file systems ..." #umount /dev #umount /proc #umount / #umount -a -r evaluate_retval update_svcstatus $1 splash svc_stopped "$(basename $0)" 0 ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac