--- ./rc.sysinit.orig 2006-03-21 09:41:51 +0300 +++ ./rc.sysinit 2006-03-21 11:12:27 +0300 @@ -86,6 +86,70 @@ # Set the system clock (when /etc/adjtime is missing) [ -s /etc/adjtime ] || /etc/init.d/clock start +action "Temorary remounting root filesystem in read/write mode:" mount -n -o remount,rw / + +# Load device-mapper, create its device file +if [ ! -e /dev/.devfsd -a -e /proc/devices -a -e /proc/misc ]; then + rm -f /dev/mapper/control + modprobe dm-mod >/dev/null 2>&1 + MAJOR="$(sed -ne 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices)" + MINOR="$(sed -ne 's/^ *\([0-9]\+\) \+device-mapper$/\1/p' /proc/misc)" + if [ -n "$MAJOR" -a -n "$MINOR" ]; then + mkdir -p -m755 /dev/mapper + action "Creating device-mapper character device ($MAJOR, $MINOR):" \ + mknod --mode=600 /dev/mapper/control c "$MAJOR" "$MINOR" + fi + unset MAJOR MINOR +fi + +# Activate EVMS +EVMS_ACTIVE= +STARTEVMS=/sbin/startevms +if [ -x "$STARTEVMS" ] && ! grep -iwqs noevms /proc/cmdline; then + action "Starting up EVMS:" "$STARTEVMS" init + EVMS_ACTIVE=1 +fi + +# Add raid devices +if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat ]; then + # A non-zero return means there were problems. + if ! /etc/rc.d/scripts/raidstart; then + echo + echo + echo "*** An error occurred during the RAID startup" + echo "*** Dropping you to a shell; the system will reboot" + echo "*** when you leave the shell." + + PS1="(RAID Repair) \# # "; export PS1 + sulogin + + echo "Unmounting file systems" + umount -arnf + mount -n -o remount,ro / + echo "Automatic reboot in progress." + reboot -f + fi +fi + +# Activate LVM +VGMKNODES=/sbin/vgmknodes +VGCHANGE=/sbin/vgchange +if [ -e "$VGCHANGE" -a -e "$VGMKNODES" ]; then + modprobe lvm-mod >/dev/null 2>&1 + # for 2.4.x kernel and LVM1 binaris + if [ -d /proc/lvm -a ! -c /dev/mapper/control -a ! -x /sbin/lvm ]; then + "$VGMKNODES" >/dev/null 2>&1 + action "Setting up LVM:" "$VGCHANGE" -a y + fi + # for 2.6.x kernel and LVM2 binaris + if [ ! -d /proc/lvm -a -c /dev/mapper/control -a -x /sbin/lvm ]; then + "$VGMKNODES" >/dev/null 2>&1 + action "Setting up LVM2:" "$VGCHANGE" -a y + fi +fi + +action "Temorary remounting root filesystem in read-only mode:" mount -n -o remount,ro / + # Activate swap action "Activating swap partitions:" swapon -a -e @@ -258,66 +322,6 @@ ExecIfExecutable /sbin/setsysfont >/dev/null 2>&1 && SETSYSFONT_DONE=1 || SETSYSFONT_DONE= fi -# Load device-mapper, create its device file -if [ ! -e /dev/.devfsd -a -e /proc/devices -a -e /proc/misc ]; then - rm -f /dev/mapper/control - modprobe dm-mod >/dev/null 2>&1 - MAJOR="$(sed -ne 's/^ *\([0-9]\+\) \+misc$/\1/p' /proc/devices)" - MINOR="$(sed -ne 's/^ *\([0-9]\+\) \+device-mapper$/\1/p' /proc/misc)" - if [ -n "$MAJOR" -a -n "$MINOR" ]; then - mkdir -p -m755 /dev/mapper - action "Creating device-mapper character device ($MAJOR, $MINOR):" \ - mknod --mode=600 /dev/mapper/control c "$MAJOR" "$MINOR" - fi - unset MAJOR MINOR -fi - -# Activate EVMS -EVMS_ACTIVE= -STARTEVMS=/sbin/startevms -if [ -x "$STARTEVMS" ] && ! grep -iwqs noevms /proc/cmdline; then - action "Starting up EVMS:" "$STARTEVMS" init - EVMS_ACTIVE=1 -fi - -# Add raid devices -if [ -z "$EVMS_ACTIVE" ] && [ -f /proc/mdstat ]; then - # A non-zero return means there were problems. - if ! /etc/rc.d/scripts/raidstart; then - echo - echo - echo "*** An error occurred during the RAID startup" - echo "*** Dropping you to a shell; the system will reboot" - echo "*** when you leave the shell." - - PS1="(RAID Repair) \# # "; export PS1 - sulogin - - echo "Unmounting file systems" - umount -arnf - mount -n -o remount,ro / - echo "Automatic reboot in progress." - reboot -f - fi -fi - -# Activate LVM -VGSCAN=/sbin/vgscan -VGCHANGE=/sbin/vgchange -if [ -e "$VGCHANGE" -a -e "$VGSCAN" -a -s /etc/lvmtab ]; then - modprobe lvm-mod >/dev/null 2>&1 - # for 2.4.x kernel and LVM1 binaris - if [ -d /proc/lvm -a ! -c /dev/mapper/control -a ! -x /sbin/lvm ]; then - "$VGSCAN" >/dev/null 2>&1 - action "Setting up LVM:" "$VGCHANGE" -a y - fi - # for 2.6.x kernel and LVM2 binaris - if [ ! -d /proc/lvm -a -c /dev/mapper/control -a -x /sbin/lvm ]; then - "$VGSCAN" >/dev/null 2>&1 - action "Setting up LVM2:" "$VGCHANGE" -a y - fi -fi - # Check filesystems splash_update localfs 5 _RUN_QUOTACHECK=0