3 # /etc/rc.d/rc.sysinit - run once at boot time
6 # Taken in part from Miquel van Smoorenburg's bcheckrc.
7 # Changes: Arkadiusz Mi¶kiewicz <misiek@pld-linux.org>
11 PATH=/bin:/sbin:/usr/bin:/usr/sbin
15 . /etc/rc.d/init.d/functions
17 # we need /proc mounted before everything
18 mount -n -o gid=17 -t proc /proc /proc
20 # sysfs is also needed before any other things (under kernel > 2.5)
21 if grep -q sysfs /proc/filesystems ; then
22 run_cmd "Mounting sysfs filesystem" mount -n -o gid=17 -t sysfs sysfs /sys
25 # Choose Hardware profile
26 rm -f /var/run/hwprofile 2> /dev/null
27 if [ -f /etc/sysconfig/hwprof ]; then
28 . /etc/sysconfig/hwprof
29 if is_yes "${HWPROFILES}" && [ -x /sbin/hwprofile -a -d /etc/sysconfig/hwprofiles/data ]; then
30 mount -n / -o rw,remount
32 mount -n / -o ro,remount
37 if [ -r /etc/sysconfig/i18n ]; then
39 [ -n "$LANG" ] && export LANG || unset LANG
40 [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE
41 [ -n "$LC_COLLATE" ] && export LC_COLLATE || unset LC_COLLATE
42 [ -n "$LC_MESSAGES" ] && export LC_MESSAGES || unset LC_MESSAGES
43 [ -n "$LC_NUMERIC" ] && export LC_NUMERIC || unset LC_NUMERIC
44 [ -n "$LC_MONETARY" ] && export LC_MONETARY || unset LC_MONETARY
45 [ -n "$LC_TIME" ] && export LC_TIME || unset LC_TIME
46 [ -n "$LC_ALL" ] && export LC_ALL || unset LC_ALL
47 [ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
48 [ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
51 # Read network config data
52 if [ -r /etc/sysconfig/network ]; then
53 . /etc/sysconfig/network
59 # Read system config data
60 if [ -r /etc/sysconfig/system ]; then
61 . /etc/sysconfig/system
63 RUN_SULOGIN_ON_ERR=yes
74 # Print welcome message
75 nls "\t\t\t%sPowered by %sPLD Linux Distribution%s" "$(termput setaf 6)" "$(termput setaf 2)" "$(termput setaf 7)"
76 if is_yes "$PROMPT"; then
77 nls -n "\t\t Press %sI%s to enter interactive startup" "$(termput setaf 1)" "$(termput setaf 7)"
82 # Set console loglevel
83 if [ -n "$CONSOLE_LOGLEVEL" ]; then
84 /bin/dmesg -n $CONSOLE_LOGLEVEL
87 # /dev must be also mounted before everything but only if we want use them ;-)
88 if is_yes "$MOUNT_DEVFS"; then
89 run_cmd "Mounting Device Filesystem" mount -n -t devfs /dev /dev
93 if [ -e /dev/.devfsd -a -x /sbin/devfsd ]; then
94 run_cmd "Starting Device Filesystem Daemon" /sbin/devfsd /dev
97 # Configure Linux kernel (initial configuration, some required modules still
99 /sbin/sysctl -p /etc/sysctl.conf > /dev/null 2>&1
101 # Set the system clock.
106 if [ -f /etc/sysconfig/clock ]; then
107 . /etc/sysconfig/clock
109 # convert old style clock config to new values
110 if [ "${CLOCKMODE}" = "GMT" ]; then
112 elif [ "${CLOCKMODE}" = "ARC" ]; then
117 if grep "system serial" /proc/cpuinfo | grep -q MILO ; then
122 CLOCKFLAGS="--hctosys"
124 if is_yes "$UTC" ; then
125 CLOCKFLAGS="$CLOCKFLAGS --utc"
126 CLOCKDEF="$CLOCKDEF (utc)"
128 CLOCKFLAGS="$CLOCKFLAGS --localtime"
129 CLOCKDEF="$CLOCKDEF (local)"
132 if is_yes "$ARC" ; then
133 CLOCKFLAGS="$CLOCKFLAGS -A"
134 CLOCKDEF="$CLOCKDEF (arc)"
137 if is_yes "$SRM" ; then
138 CLOCKFLAGS="$CLOCKFLAGS -S"
139 CLOCKDEF="$CLOCKDEF (srm)"
142 # Check if timezone definition is available
143 if [ -e /etc/localtime ] ; then
144 if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
145 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
148 TIME_SETUP_DELAYED=yes
152 run_cmd "Activating swap partitions" swapon -a -e
155 run_cmd "$(nls 'Host:') ${HOSTNAME}" hostname ${HOSTNAME}
157 # Set the NIS domain name
158 if [ -n "$NISDOMAIN" ]; then
159 run_cmd "$(nls 'NIS Domain:') ${NISDOMAIN}" domainname $NISDOMAIN
164 # Initialize USB controllers
166 if ! grep -iq "nousb" /proc/cmdline 2>/dev/null && ! grep -q "usb" /proc/devices 2>/dev/null ; then
167 aliases=$(/sbin/modprobe -c | awk '/^alias usb-controller/ { print $3 }')
168 if [ -n "$aliases" -a "$aliases" != "off" ] ; then
169 /sbin/modprobe -k usbcore
170 for alias in $aliases ; do
171 [ "$alias" = "off" ] && continue
172 run_cmd "$(nls 'Initializing USB controller') ($alias)" /sbin/modprobe $alias
174 [ $? -eq 0 -a -n "$aliases" ] && usb=1
176 if grep -iq "usb" /proc/devices 2>/dev/null ; then
181 if [ "$usb" = "1" -a ! -f /proc/bus/usb/devices ]; then
182 run_cmd "Mounting USB filesystem" mount -t usbdevfs usbdevfs /proc/bus/usb
186 if [ "$usb" = "1" ]; then
187 needusbstorage=$(LC_ALL=C cat /proc/bus/usb/devices 2>/dev/null|grep -e "^I.*Cls=08")
188 LC_ALL=C grep -q 'hid' /proc/bus/usb/drivers || run_cmd "Initializing USB HID interface" modprobe hid 2> /dev/null
189 mouseoutput=$(cat /proc/bus/usb/devices 2>/dev/null|grep -E "^I.*Cls=03.*Prot=02")
190 kbdoutput=$(cat /proc/bus/usb/devices 2>/dev/null|grep -E "^I.*Cls=03.*Prot=01")
191 if [ -n "$kbdoutput" ]; then
192 run_cmd "Initializing USB keyboard" modprobe keybdev
194 if [ -n "$mouseoutput" ]; then
195 run_cmd "Initializing USB mouse" modprobe mousedev
199 # Setup hdparm thing (if exists and is needed)
200 if ! grep -iq nohdparm /proc/cmdline; then
201 [ -x /etc/rc.d/rc.hdparm ] && /etc/rc.d/rc.hdparm
204 if [ -f /fastboot ] || grep -iq "fastboot" /proc/cmdline 2> /dev/null ; then
210 if [ -f /fsckoptions ]; then
211 fsckoptions=$(cat /fsckoptions)
216 if [ -f /forcefsck ]; then
217 fsckoptions="-f $fsckoptions"
221 _ROOTFS_TYPE=$(grep " / " /proc/mounts | awk '{ print $3 }')
223 if [ -z "$fastboot" -a "$_ROOTFS_TYPE" != "nfs" -a "$_ROOTFS_TYPE" != "romfs" ]; then
224 show "Checking root filesystem"; started
225 initlog -c "fsck -C -T -a $fsckoptions /"
229 # A return of 4 or higher means there were serious problems.
230 if [ $rc -gt 3 ]; then
231 # don't use '\n' in nls macro !
234 nls "*** An error occurred during the file system check."
235 nls "*** Dropping you to a shell; the system will reboot"
236 nls "*** when you leave the shell."
239 PS1="$(nls '(Repair filesystem)# ')"; export PS1
240 if is_yes "$RUN_SULOGIN_ON_ERR"; then
246 run_cmd "Unmounting file systems" umount -a
247 mount -n -o remount,ro /
248 run_cmd "Automatic reboot in progress" reboot
249 # A return of 2 or 3 means that filesystem was repaired but we need
251 elif [ "$rc" = "2" -o "$rc" = "3" ]; then
253 nls "*** Filesystem was repaired but system needs to be"
254 nls "*** rebooted before mounting it."
255 nls "*** REBOOTING ***"
258 run_cmd "Unmounting file systems" umount -a
259 mount -n -o remount,ro /
260 run_cmd "Automatic reboot in progress" reboot
261 elif [ "$rc" = "1" ]; then
266 # Check for arguments
267 if grep -iq nopnp /proc/cmdline; then
273 # set up pnp and kernel pnp
274 if [ -n "$PNP" ]; then
275 if is_yes "$RUN_USERPNP" && [ -x /sbin/isapnp -a -f /etc/isapnp/isapnp.conf ]; then
276 run_cmd "Setting up ISA PNP devices (userspace pnp)" /sbin/isapnp /etc/isapnp/isapnp.conf
278 if is_yes "$RUN_KERNELPNP"; then
279 /sbin/modprobe -k isa-pnp 2> /dev/null
280 if [ -e /proc/isapnp -a -f /etc/isapnp/isapnp-kernel.conf ]; then
281 show "Setting up ISA PNP devices (kernelspace pnp)"; busy
282 grep -v "^#" /etc/isapnp/isapnp-kernel.conf > /proc/isapnp && (deltext; ok) || (deltext; fail)
287 # Remount the root filesystem read-write
288 run_cmd "Remounting root filesystem in rw mode" mount -n -o remount,rw /
290 # Update quotas if fsck was run on /
291 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
292 run_cmd "Checking root filesystem quotas" /sbin/quotacheck -vnug /
298 # Remove stale backups
299 rm -f /etc/mtab~ /etc/mtab~~
301 # Enter root, /proc, /sys, devfs and other into mtab.
304 [ -f /proc/bus/usb/devices ] && mount -f -t usbdevfs usbdevfs /proc/bus/usb
305 [ -e /dev/.devfsd ] && mount -f -t devfs devfs /dev
307 if grep -q sysfs /proc/filesystems ; then
311 # Remove /etc/nologin when starting system
312 [ -f /etc/nologin.boot ] && rm -f /etc/nologin /etc/nologin.boot
314 if is_yes "$DELAY_LOGIN" && [ ! -f /etc/nologin ]; then
315 show "Enabling Delay Login"; busy
317 nls "System bootup in progress - please wait" >> /etc/nologin
319 chmod 644 /etc/nologin
320 cp -fp /etc/nologin /etc/nologin.boot
324 # The root filesystem is now read-write, so we can now log via
325 # syslog() directly...
326 if [ -n "$IN_INITLOG" ]; then
330 if [ ! -f /proc/modules ]; then
332 elif ! grep -iq nomodules /proc/cmdline; then
338 # Adjust symlinks as necessary in /boot to keep system services from
339 # spewing messages about mismatched System maps and so on.
340 if is_yes "$SET_SLINKS"; then
341 if [ -L /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
342 ln -s -f System.map-`uname -r` /boot/System.map
344 if [ ! -e /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
345 ln -s -f System.map-`uname -r` /boot/System.map
349 # Run depmod if RUN_DEPMOD != "no" and:
350 # a) user requested or RUN_DEPMOD="";
351 # b) modules.dep is missing
352 # c) modules.dep is older than /etc/modules.conf or /lib/modules/`uname -r`
353 if ! is_no "$RUN_DEPMOD" && [ -n "$USEMODULES" ]; then
354 if is_yes "$RUN_DEPMOD" || [ -z "$RUN_DEPMOD" ]; then
355 run_cmd "Finding module dependencies" depmod -a
356 elif [ "$RUN_DEPMOD" = "ifmissing" ]; then
357 run_cmd "Finding module dependencies" depmod -A
361 if [ -f /proc/sys/kernel/modprobe ]; then
362 if [ -n "$USEMODULES" ]; then
363 sysctl -w kernel.modprobe="/sbin/modprobe" >/dev/null 2>&1
364 sysctl -w kernel.hotplug="/sbin/hotplug" >/dev/null 2>&1
366 # We used to set this to NULL, but that causes
367 # 'failed to exec' messages"
368 sysctl -w kernel.modprobe="/bin/true" >/dev/null 2>&1
369 sysctl -w kernel.hotplug="/bin/true" >/dev/null 2>&1
373 # Load usb storage here, to match most other things
374 if [ -n "$needusbstorage" ]; then
375 modprobe -k usb-storage >/dev/null 2>&1
378 # Load firewire devices
379 if ! grep -iq "nofirewire" /proc/cmdline 2>/dev/null ; then
380 aliases=$(/sbin/modprobe -c | awk '/^alias ieee1394-controller/ { print $3 }')
381 if [ -n "$aliases" -a "$aliases" != "off" ] ; then
382 for alias in $aliases ; do
383 [ "$alias" = "off" ] && continue
384 run_cmd "$(nls 'Initializing firewire controller') ($alias)" /sbin/modprobe $alias
386 LC_ALL=C grep -E "SBP2" /proc/bus/ieee1394/devices 2> /dev/null && /sbin/modprobe -s sbp2 > /dev/null 2>&1
390 # Load sound modules if they need persistent DMA buffers
391 if grep -q "options sound dmabuf=1" /etc/modules.conf 2>/dev/null ; then
393 alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound[[:space:]]+" | awk '{ print $3 }')
394 if [ -n "$alias" -a "$alias" != "off" ] ; then
395 run_cmd "$(nls 'Loading sound module') ($alias)" modprobe -s $alias
398 alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound-slot-0[[:space:]]+" | awk '{ print $3 }')
399 if [ -n "$alias" -a "$alias" != "off" ] ; then
400 run_cmd "$(nls 'Loading sound module') ($alias)" modprobe -s $alias
406 if [ -x /etc/rc.d/rc.modules ]; then
410 # Find and activate volume groups:
412 if [ -x /sbin/evms_activate ]; then
413 # Linux 2.5 core module
414 modprobe -s -k evmscore > /dev/null 2>&1
415 # Linux 2.4 core modules
416 modprobe -s -k evms > /dev/null 2>&1
417 modprobe -s -k evms_passthru > /dev/null 2>&1
418 modprobe -s -k ldev_mgr > /dev/null 2>&1
419 modprobe -s -k dos_part > /dev/null 2>&1
420 is_yes "$EVMS_GUID_PTABLE" && modprobe -s -k gpt_part >/dev/null 2>&1
421 is_yes "$EVMS_LVM" && modprobe -s -k lvm_vge >/dev/null 2>&1
422 is_yes "$EVMS_AIX" && modprobe -s -k AIXlvm_vge >/dev/null 2>&1
423 is_yes "$EVMS_OS2" && modprobe -s -k os2lvm_vge >/dev/null 2>&1
424 run_cmd "Discovering EVMS volumes" /sbin/evms_activate
425 if is_yes "$EVMS_LVM" && is_yes "$EVMS_LVM_COMPAT_NODES" ; then
426 # Link nodes for compatibility with LVM
427 if [ "echo /dev/evms/lvm/*" != '/dev/evms/lvm/*' ] ; then
428 ln -s /dev/evms/lvm/* /dev/
433 if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
434 modprobe -s -k lvm-mod >/dev/null 2>&1
435 # device mapper (2.5+ and patched 2.4)
436 modprobe -s -k dm-mod >/dev/null 2>&1
437 run_cmd "Scanning for LVM volume groups" /sbin/vgscan && \
438 run_cmd "Activating LVM volume groups" /sbin/vgchange -a y
442 if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ] || [ -f /etc/raidtab ]; then
444 modprobe -s md >/dev/null 2>&1
445 if [ -f /proc/mdstat ]; then
449 if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ]; then
450 if (grep -qE "^([[:blank:]]|)ARRAY[[:blank:]]" /etc/mdadm.conf); then
451 run_cmd "Starting up RAID devices" /sbin/mdadm --assemble --scan
453 [ "$rc" -eq 0 ] && goraidtab=0
457 if [ -f /etc/raidtab -a "$goraidtab" -eq 1 ]; then
459 for i in $(grep -v "^#" /etc/raidtab | grep "raiddev" | awk '{print $2}') ; do
460 RAIDDEV=$(basename $i)
461 RAIDSTAT=$(grep "^$RAIDDEV : active" /proc/mdstat)
462 show "Starting up RAID device %s" $RAIDDEV
464 if [ -z "$RAIDSTAT" ]; then
465 # Try raidstart first...if that fails then
466 # fall back to raid0run and if that fails too
467 # fall back to raidadd, raidrun.
469 if [ -x /sbin/raidstart ]; then
473 if [ $RESULT -gt 0 -a -x /sbin/raid0run ]; then
477 if [ $RESULT -gt 0 -a -x /sbin/raidadd -a -x /sbin/raidrun ]; then
482 if [ $RESULT -gt 0 ]; then
494 # A non-zero return means there were problems
495 if [ $rc -gt 0 ]; then
496 show "Starting up RAID devices"; fail
499 nls "*** An error occurred during the RAID startup."
500 nls "*** Dropping you to a shell; the system will reboot"
501 nls "*** when you leave the shell."
504 PS1="$(nls '(RAID Repair)# ')"; export PS1
505 if is_yes "$RUN_SULOGIN_ON_ERR"; then
511 run_cmd "Unmounting file systems" umount -a
512 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
513 run_cmd "Automatic reboot in progress" reboot
515 if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
516 run_cmd "Scanning for LVM volume groups" /sbin/vgscan && \
517 run_cmd "Activating LVM volume groups" /sbin/vgchange -a y
519 show "Starting up RAID devices"; ok
525 if [ -z "$fastboot" ] && ! grep -q nofsck /proc/cmdline; then
526 show "Checking filesystems"; started
527 initlog -c "fsck -C -T -R -A -a $fsckoptions"
531 # A return of 2 or higher means there were serious problems
532 if [ $rc -gt 1 ]; then
535 nls "*** An error occurred during the file system check."
536 nls "*** Dropping you to a shell; the system will reboot"
537 nls "*** when you leave the shell."
540 PS1="$(nls '(Repair filesystem)# ')"; export PS1
541 if is_yes "$RUN_SULOGIN_ON_ERR"; then
547 run_cmd "Unmounting file systems" umount -a
548 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
549 run_cmd "Automatic reboot in progress" reboot
550 elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
555 # Mount all other filesystems (except for NFS and /proc, which is already
556 # mounted). Contrary to standard usage,
557 # filesystems are NOT unmounted in single user mode.
559 run_cmd "Mounting local filesystems" mount -a -t nonfs,smbfs,ncpfs,proc -O no_netdev
561 # Now do some workaround - encrypted filesystems couldn't have been fsck-ed
562 # before mount - that's where the password is entered.
563 # mount is buggy - when remounting loopback filesystem, loop=XXX
564 # option is removed from /etc/mtab
565 if grep "^[^#].*encryption=" /etc/fstab | grep -v -q "noauto"; then
566 show "Checking encrypted filesystems"; started
568 grep "encryption=" /etc/fstab | grep -v 'noauto' | grep -w 'ro' |\
569 while read FILE DIR TYPE OPTS TMP1; do
570 LOOP="`cat /proc/mounts | awk '$2 == "'"$DIR"'" { print $1 }'`"
573 grep "encryption=" /etc/fstab | grep -vw 'ro\|noauto' |\
574 while read FILE DIR TYPE OPTS TMP1; do
575 LOOP="`cat /proc/mounts | awk '$2 == "'"$DIR"'" { print $1 }'`"
576 LOOPLIST="$LOOPLIST $LOOP"
577 NEWOPTS="remount,`echo "$OPTS" | sed 's#loop\(=[^,]*\)\?#loop='"$LOOP"'#'`,ro"
579 mount "$DIR" -o "$NEWOPTS"
583 initlog -c "fsck -T -C -a $fsckoptions $LOOPLIST"
586 # A return of 2 or higher means there were serious problems.
587 if [ $rc -gt 1 ]; then
589 nls "*** An error occurred during the file system check."
590 nls "*** Dropping you to a shell; the system will reboot"
591 nls "*** when you leave the shell."
594 PS1="`nls '(Repair filesystem)# '`"; export PS1
595 if is_yes "$RUN_SULOGIN_ON_ERR"; then
601 run_cmd "Unmounting file systems" umount -a
602 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
603 run_cmd "Automatic reboot in progress" reboot
604 elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
608 show "Remounting encrypted filesystems back in rw mode"; busy
609 grep "encryption=" /etc/fstab | grep -vw 'ro\|noauto' |\
610 while read FILE DIR TYPE OPTS TMP1; do
611 LOOP="`cat /proc/mounts | awk '$2 == "'"$DIR"'" { print $1 }'`"
612 NEWOPTS="remount,`echo "$OPTS" | sed 's#loop\(=[^,]*\)\?#loop='"$LOOP"'#'`,rw"
613 mount "$DIR" -o "$NEWOPTS"
618 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
619 run_cmd "Checking filesystem quotas" /sbin/quotacheck -vnugRa
623 if [ -x /sbin/quotaon ]; then
624 run_cmd "Turning on quotas for local filesystems" /sbin/quotaon -aug
627 # Turn on process accounting
628 if [ -x /etc/rc.d/rc.acct ]; then
629 /etc/rc.d/rc.acct start
632 # Set the clock if timezone definition wasn't available (eg. /usr not mounted)
633 if is_yes "$TIME_SETUP_DELAYED"; then
634 if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
635 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
639 # Initialize the serial ports
640 if [ -f /etc/rc.d/rc.serial ]; then
641 . /etc/rc.d/rc.serial
644 if [ -f /proc/sys/kernel/panic -a "$PANIC_REBOOT_TIME" -gt "0" ]; then
645 show 'Setting %s seconds for kernel reboot after panic' "$PANIC_REBOOT_TIME"; busy
646 if (sysctl -w kernel.panic=$PANIC_REBOOT_TIME >/dev/null 2>&1); then ok; else fail; fi
649 # ... and here finish configuring parameters
650 run_cmd "Configuring kernel parameters" /sbin/sysctl -p /etc/sysctl.conf
653 rm -f /fastboot /fsckoptions /forcefsck /halt /poweroff
656 # I'd use find, but /usr may not be mounted.
657 for afile in /var/lock/* /var/run/*; do
658 if [ -d "$afile" ]; then
659 bafile=$(basename $afile)
660 [ "$bafile" != "news" -a "$bafile" != "sudo" -a "$bafile" != "mon" ] && rm -rf $afile/*
662 rm -f $afile 2> /dev/null
666 rm -f /var/lib/rpm/__db*
667 rm -f /var/spool/postoffice/.pid.*
671 if ! is_no "$NEED_XFILES" ; then
674 chown root.utmp /var/run/utmpx /var/log/wtmpx
675 chmod 0664 /var/run/utmpx /var/log/wtmpx
679 chown root.utmp /var/run/utmp /var/log/wtmp
680 chmod 0664 /var/run/utmp /var/log/wtmp
684 if is_yes "$CLEAN_TMP"; then
685 rm -rf /tmp/* /tmp/.[a-zA-Z0-9]*
688 # Right, now turn on swap in case we swap to files
689 swapon -a >/dev/null 2>&1
690 run_cmd "Enabling swap space" /bin/true
692 # If a SCSI tape has been detected, load the st module unconditionally
693 # since many SCSI tapes don't deal well with st being loaded and unloaded
694 if [ -f /proc/scsi/scsi ] && grep -q 'Type: Sequential-Access' /proc/scsi/scsi 2>/dev/null ; then
695 if cat /proc/devices | grep -qv ' 9 st' ; then
696 if [ -n "$USEMODULES" ] ; then
697 # Try to load the module. If it fails, ignore it...
698 insmod -p st >/dev/null 2>&1 && modprobe -s st >/dev/null 2>&1
703 # There could be a new kernel version. Remove old psdevtab database
706 # Now that we have all of our basic modules loaded and the kernel going,
707 # let's dump the syslog ring somewhere so we can find it later
708 dmesg -s 131072 > /var/log/dmesg
710 while [ $i -ge 0 ]; do
711 if [ -f /var/log/dmesg.$i ]; then
712 chmod 0600 /var/log/dmesg.$i
713 mv -f /var/log/dmesg.$i /var/log/dmesg.$(($i+1))
717 cp -f /var/log/dmesg /var/log/dmesg.0
718 chmod 0600 /var/log/dmesg /var/log/dmesg.0
720 kill -TERM $(/sbin/pidof getkey) >/dev/null 2>&1
722 if is_yes "$PROMPT"; then
723 /sbin/getkey i && touch /var/run/confirm
728 # This must be last line !
729 # vi:syntax=sh:tw=78:ts=8:sw=4