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
14 # reasonable start values for bootsplash progress.
20 . /etc/rc.d/init.d/functions
22 # we need /proc mounted before everything
23 mount -n -o gid=17 -t proc /proc /proc
25 # sysfs is also needed before any other things (under kernel > 2.5)
26 if grep -q sysfs /proc/filesystems ; then
27 mount -n -o gid=17 -t sysfs sysfs /sys
31 if grep -q selinuxfs /proc/filesystems && ! grep -q selinuxfs /proc/mounts; then
32 mount -n -o gid=17 -t selinuxfs selinuxfs /selinux
35 # Choose Hardware profile
36 rm -f /var/run/hwprofile 2> /dev/null
37 if [ -f /etc/sysconfig/hwprof ]; then
38 . /etc/sysconfig/hwprof
39 if is_yes "${HWPROFILES}" && [ -x /sbin/hwprofile -a -d /etc/sysconfig/hwprofiles/data ]; then
40 mount -n / -o rw,remount
42 mount -n / -o ro,remount
47 if [ -r /etc/sysconfig/i18n ]; then
49 [ -n "$LANG" ] && export LANG || unset LANG
50 [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE
51 [ -n "$LC_COLLATE" ] && export LC_COLLATE || unset LC_COLLATE
52 [ -n "$LC_MESSAGES" ] && export LC_MESSAGES || unset LC_MESSAGES
53 [ -n "$LC_NUMERIC" ] && export LC_NUMERIC || unset LC_NUMERIC
54 [ -n "$LC_MONETARY" ] && export LC_MONETARY || unset LC_MONETARY
55 [ -n "$LC_TIME" ] && export LC_TIME || unset LC_TIME
56 [ -n "$LC_ALL" ] && export LC_ALL || unset LC_ALL
57 [ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
58 [ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
61 # Read network config data
62 if [ -r /etc/sysconfig/network ]; then
63 . /etc/sysconfig/network
69 # Read system config data
70 if [ -r /etc/sysconfig/system ]; then
71 . /etc/sysconfig/system
73 RUN_SULOGIN_ON_ERR=yes
84 # Disable splash when requested
85 [ -e /proc/splash ] && is_no "$BOOT_SPLASH" && echo "0" > /proc/splash
87 # Print welcome message
88 nls "\t\t\t%sPowered by %sPLD Linux Distribution%s" "$(termput setaf $CPOWEREDBY)" "$(termput setaf $CPLD)" "$(termput op)"
89 if is_yes "$PROMPT"; then
90 nls -n "\t\t Press %sI%s to enter interactive startup" "$(termput setaf $CI)" "$(termput op)"
95 # Set console loglevel
96 if [ -n "$CONSOLE_LOGLEVEL" ]; then
97 /bin/dmesg -n $CONSOLE_LOGLEVEL
100 # /dev must be also mounted before everything but only if we want use them ;-)
101 if is_yes "$MOUNT_DEVFS"; then
102 run_cmd "Mounting Device Filesystem" mount -n -t devfs /dev /dev
106 if [ -e /dev/.devfsd -a -x /sbin/devfsd ]; then
107 run_cmd "Starting Device Filesystem Daemon" /sbin/devfsd /dev
110 # Configure Linux kernel (initial configuration, some required modules still
112 /sbin/sysctl -p /etc/sysctl.conf > /dev/null 2>&1
114 # Set the system clock.
119 if [ -f /etc/sysconfig/clock ]; then
120 . /etc/sysconfig/clock
122 # convert old style clock config to new values
123 if [ "${CLOCKMODE}" = "GMT" ]; then
125 elif [ "${CLOCKMODE}" = "ARC" ]; then
130 if grep "system serial" /proc/cpuinfo | grep -q MILO ; then
135 CLOCKFLAGS="--hctosys"
137 if is_yes "$UTC" ; then
138 CLOCKFLAGS="$CLOCKFLAGS --utc"
139 CLOCKDEF="$CLOCKDEF (utc)"
141 CLOCKFLAGS="$CLOCKFLAGS --localtime"
142 CLOCKDEF="$CLOCKDEF (local)"
145 if is_yes "$ARC" ; then
146 CLOCKFLAGS="$CLOCKFLAGS -A"
147 CLOCKDEF="$CLOCKDEF (arc)"
150 if is_yes "$SRM" ; then
151 CLOCKFLAGS="$CLOCKFLAGS -S"
152 CLOCKDEF="$CLOCKDEF (srm)"
155 # Check if timezone definition is available
156 if [ -e /etc/localtime ] ; then
157 if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
158 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
161 TIME_SETUP_DELAYED=yes
165 run_cmd "Activating swap partitions" swapon -a -e
168 run_cmd "$(nls 'Host:') ${HOSTNAME}" hostname ${HOSTNAME}
170 # Set the NIS domain name
171 if [ -n "$NISDOMAIN" ]; then
172 run_cmd "$(nls 'NIS Domain:') ${NISDOMAIN}" domainname $NISDOMAIN
177 # Initialize USB controllers
179 if ! grep -iq "nousb" /proc/cmdline 2>/dev/null && ! grep -q "usb" /proc/devices 2>/dev/null ; then
180 aliases=$(/sbin/modprobe -c | awk '/^alias usb-controller/ { print $3 }')
181 if [ -n "$aliases" -a "$aliases" != "off" ] ; then
182 /sbin/modprobe -k usbcore
183 for alias in $aliases ; do
184 [ "$alias" = "off" ] && continue
185 run_cmd "$(nls 'Initializing USB controller') ($alias)" /sbin/modprobe $alias
187 [ $? -eq 0 -a -n "$aliases" ] && usb=1
189 if grep -iq "usb" /proc/devices 2>/dev/null ; then
194 if [ "$usb" = "1" -a ! -f /proc/bus/usb/devices ]; then
195 run_cmd "Mounting USB filesystem" mount -t usbdevfs usbdevfs /proc/bus/usb
199 if [ "$usb" = "1" ]; then
200 needusbstorage=$(LC_ALL=C cat /proc/bus/usb/devices 2>/dev/null|grep -e "^I.*Cls=08")
201 LC_ALL=C grep -q 'hid' /proc/bus/usb/drivers 2> /dev/null || run_cmd "Initializing USB HID interface" modprobe hid 2> /dev/null
202 mouseoutput=$(cat /proc/bus/usb/devices 2>/dev/null|grep -E "^I.*Cls=03.*Prot=02")
203 kbdoutput=$(cat /proc/bus/usb/devices 2>/dev/null|grep -E "^I.*Cls=03.*Prot=01")
204 if [ -n "$kbdoutput" ]; then
205 run_cmd "Initializing USB keyboard" modprobe keybdev
207 if [ -n "$mouseoutput" ]; then
208 run_cmd "Initializing USB mouse" modprobe mousedev
212 # Setup hdparm thing (if exists and is needed)
213 if ! grep -iq nohdparm /proc/cmdline; then
214 [ -x /etc/rc.d/rc.hdparm ] && /etc/rc.d/rc.hdparm
217 if [ -f /fastboot ] || grep -iq "fastboot" /proc/cmdline 2> /dev/null ; then
223 if [ -f /fsckoptions ]; then
224 fsckoptions=$(cat /fsckoptions)
229 if [ -f /forcefsck ]; then
230 fsckoptions="-f $fsckoptions"
234 _ROOTFS_TYPE=$(grep " / " /proc/mounts | awk '{ print $3 }')
236 if [ -z "$fastboot" -a "$_ROOTFS_TYPE" != "nfs" -a "$_ROOTFS_TYPE" != "romfs" ]; then
237 show "Checking root filesystem"; started
238 initlog -c "fsck -C -T -a $fsckoptions /"
242 # A return of 4 or higher means there were serious problems.
243 if [ $rc -gt 3 ]; then
244 [ -e /proc/splash ] && echo "verbose" > /proc/splash
245 # don't use '\n' in nls macro !
248 nls "*** An error occurred during the file system check."
249 nls "*** Dropping you to a shell; the system will reboot"
250 nls "*** when you leave the shell."
253 PS1="$(nls '(Repair filesystem)# ')"; export PS1
254 if is_yes "$RUN_SULOGIN_ON_ERR"; then
260 run_cmd "Unmounting file systems" umount -a
261 mount -n -o remount,ro /
262 run_cmd "Automatic reboot in progress" reboot
263 # A return of 2 or 3 means that filesystem was repaired but we need
265 elif [ "$rc" = "2" -o "$rc" = "3" ]; then
266 [ -e /proc/splash ] && echo "verbose" > /proc/splash
268 nls "*** Filesystem was repaired but system needs to be"
269 nls "*** rebooted before mounting it."
270 nls "*** REBOOTING ***"
273 run_cmd "Unmounting file systems" umount -a
274 mount -n -o remount,ro /
275 run_cmd "Automatic reboot in progress" reboot
276 elif [ "$rc" = "1" ]; then
281 # Check for arguments
282 if grep -iq nopnp /proc/cmdline; then
288 # set up pnp and kernel pnp
289 if [ -n "$PNP" ]; then
290 if is_yes "$RUN_USERPNP" && [ -x /sbin/isapnp -a -f /etc/isapnp/isapnp.conf ]; then
291 run_cmd "Setting up ISA PNP devices (userspace pnp)" /sbin/isapnp /etc/isapnp/isapnp.conf
293 if is_yes "$RUN_KERNELPNP"; then
294 /sbin/modprobe -k isa-pnp 2> /dev/null
295 if [ -e /proc/isapnp -a -f /etc/isapnp/isapnp-kernel.conf ]; then
296 show "Setting up ISA PNP devices (kernelspace pnp)"; busy
297 grep -v "^#" /etc/isapnp/isapnp-kernel.conf > /proc/isapnp && (deltext; ok) || (deltext; fail)
302 # Remount the root filesystem read-write
303 run_cmd "Remounting root filesystem in rw mode" mount -n -o remount,rw /
305 # Update quotas if fsck was run on /
306 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
307 run_cmd "Checking root filesystem quotas" /sbin/quotacheck -vnug /
312 [ -f /etc/cryptomtab ] && :>/etc/cryptomtab
314 # Remove stale backups
315 rm -f /etc/mtab~ /etc/mtab~~ /etc/cryptomtab~ /etc/cryptomtab~~
317 # Enter root, /proc, /sys, devfs and other into mtab.
320 [ -f /proc/bus/usb/devices ] && mount -f -t usbdevfs usbdevfs /proc/bus/usb
321 [ -e /dev/.devfsd ] && mount -f -t devfs devfs /dev
323 if grep -q sysfs /proc/filesystems ; then
324 mount -f -t sysfs sysfs /sys
327 if grep -q selinuxfs /proc/filesystems ; then
328 mount -f -t selinuxfs selinuxfs /selinux
331 # Remove /etc/nologin when starting system
332 [ -f /etc/nologin.boot ] && rm -f /etc/nologin /etc/nologin.boot
334 if is_yes "$DELAY_LOGIN" && [ ! -f /etc/nologin ]; then
335 show "Enabling Delay Login"; busy
337 nls "System bootup in progress - please wait" >> /etc/nologin
339 chmod 644 /etc/nologin
340 cp -fp /etc/nologin /etc/nologin.boot
344 # The root filesystem is now read-write, so we can now log via
345 # syslog() directly...
346 if [ -n "$IN_INITLOG" ]; then
350 if [ ! -f /proc/modules ]; then
352 elif ! grep -iq nomodules /proc/cmdline; then
358 # Adjust symlinks as necessary in /boot to keep system services from
359 # spewing messages about mismatched System maps and so on.
360 if is_yes "$SET_SLINKS"; then
361 if [ -L /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
362 ln -s -f System.map-`uname -r` /boot/System.map
364 if [ ! -e /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
365 ln -s -f System.map-`uname -r` /boot/System.map
369 # Run depmod if RUN_DEPMOD != "no" and:
370 # a) user requested or RUN_DEPMOD="";
371 # b) modules.dep is missing
372 # c) modules.dep is older than /etc/modules.conf or /lib/modules/`uname -r`
373 if ! is_no "$RUN_DEPMOD" && [ -n "$USEMODULES" ]; then
374 if is_yes "$RUN_DEPMOD" || [ -z "$RUN_DEPMOD" ]; then
375 run_cmd "Finding module dependencies" depmod -a
376 elif [ "$RUN_DEPMOD" = "ifmissing" ]; then
377 run_cmd "Finding module dependencies" depmod -A
381 if [ -f /proc/sys/kernel/modprobe ]; then
382 if [ -n "$USEMODULES" ]; then
383 sysctl -w kernel.modprobe="/sbin/modprobe" >/dev/null 2>&1
384 sysctl -w kernel.hotplug="/sbin/hotplug" >/dev/null 2>&1
386 # We used to set this to NULL, but that causes
387 # 'failed to exec' messages"
388 sysctl -w kernel.modprobe="/bin/true" >/dev/null 2>&1
389 sysctl -w kernel.hotplug="/bin/true" >/dev/null 2>&1
393 # Load usb storage here, to match most other things
394 if [ -n "$needusbstorage" ]; then
395 modprobe -k usb-storage >/dev/null 2>&1
398 # Load firewire devices
399 if ! grep -iq "nofirewire" /proc/cmdline 2>/dev/null ; then
400 aliases=$(/sbin/modprobe -c | awk '/^alias ieee1394-controller/ { print $3 }')
401 if [ -n "$aliases" -a "$aliases" != "off" ] ; then
402 for alias in $aliases ; do
403 [ "$alias" = "off" ] && continue
404 run_cmd "$(nls 'Initializing firewire controller') ($alias)" /sbin/modprobe $alias
406 LC_ALL=C grep -E "SBP2" /proc/bus/ieee1394/devices 2> /dev/null && /sbin/modprobe -s sbp2 > /dev/null 2>&1
410 # Load sound modules if they need persistent DMA buffers
411 if grep -q "options sound dmabuf=1" /etc/modules.conf 2>/dev/null ; then
413 alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound[[:space:]]+" | awk '{ print $3 }')
414 if [ -n "$alias" -a "$alias" != "off" ] ; then
415 run_cmd "$(nls 'Loading sound module') ($alias)" modprobe -s $alias
418 alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound-slot-0[[:space:]]+" | awk '{ print $3 }')
419 if [ -n "$alias" -a "$alias" != "off" ] ; then
420 run_cmd "$(nls 'Loading sound module') ($alias)" modprobe -s $alias
426 if [ -x /etc/rc.d/rc.modules ]; then
430 # Find and activate volume groups:
432 if [ -x /sbin/evms_activate ]; then
433 # Linux 2.5 core module
434 modprobe -s -k evmscore > /dev/null 2>&1
435 # Linux 2.4 core modules
436 modprobe -s -k evms > /dev/null 2>&1
437 modprobe -s -k evms_passthru > /dev/null 2>&1
438 modprobe -s -k ldev_mgr > /dev/null 2>&1
439 modprobe -s -k dos_part > /dev/null 2>&1
440 is_yes "$EVMS_GUID_PTABLE" && modprobe -s -k gpt_part >/dev/null 2>&1
441 is_yes "$EVMS_LVM" && modprobe -s -k lvm_vge >/dev/null 2>&1
442 is_yes "$EVMS_AIX" && modprobe -s -k AIXlvm_vge >/dev/null 2>&1
443 is_yes "$EVMS_OS2" && modprobe -s -k os2lvm_vge >/dev/null 2>&1
444 run_cmd "Discovering EVMS volumes" /sbin/evms_activate
445 if is_yes "$EVMS_LVM" && is_yes "$EVMS_LVM_COMPAT_NODES" ; then
446 # Link nodes for compatibility with LVM
447 if [ "echo /dev/evms/lvm/*" != '/dev/evms/lvm/*' ] ; then
448 ln -s /dev/evms/lvm/* /dev/
453 if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
454 lvmversion=$(/sbin/vgchange --version 2>/dev/null|head -n 1|awk '{gsub("vgchange: Logical Volume Manager ",""); gsub("LVM version: ",""); gsub(/\..*/,"");print $1}')
455 if [ "$lvmversion" = "1" ] ; then
456 modprobe -s -k lvm-mod >/dev/null 2>&1
458 elif [ "$lvmversion" = "2" ] ; then
459 modprobe -s -k dm-mod >/dev/null 2>&1
460 lvmignorelock="--ignorelockingfailure"
462 modprobe -s -k lvm-mod >/dev/null 2>&1
463 # device mapper (2.5+ and patched 2.4)
464 modprobe -s -k dm-mod >/dev/null 2>&1
469 run_cmd "Scanning for LVM volume groups" /sbin/vgscan $lvmignorelock && \
470 run_cmd "Activating LVM volume groups" /sbin/vgchange -a y $lvmignorelock
474 if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ] || [ -f /etc/raidtab ]; then
476 modprobe -s md >/dev/null 2>&1
477 if [ -f /proc/mdstat ]; then
481 if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ]; then
482 if (grep -qE "^([[:blank:]]|)ARRAY[[:blank:]]" /etc/mdadm.conf); then
483 run_cmd "Starting up RAID devices" /sbin/mdadm --assemble --scan
485 [ "$rc" -eq 0 ] && goraidtab=0
489 if [ -f /etc/raidtab -a "$goraidtab" -eq 1 ]; then
491 for i in $(grep -v "^#" /etc/raidtab | grep "raiddev" | awk '{print $2}') ; do
492 RAIDDEV=$(basename $i)
493 RAIDSTAT=$(grep "^$RAIDDEV : active" /proc/mdstat)
494 show "Starting up RAID device %s" $RAIDDEV
496 if [ -z "$RAIDSTAT" ]; then
497 # Try raidstart first...if that fails then
498 # fall back to raid0run and if that fails too
499 # fall back to raidadd, raidrun.
501 if [ -x /sbin/raidstart ]; then
505 if [ $RESULT -gt 0 -a -x /sbin/raid0run ]; then
509 if [ $RESULT -gt 0 -a -x /sbin/raidadd -a -x /sbin/raidrun ]; then
514 if [ $RESULT -gt 0 ]; then
526 # A non-zero return means there were problems
527 if [ $rc -gt 0 ]; then
528 [ -e /proc/splash ] && echo "verbose" > /proc/splash
529 show "Starting up RAID devices"; fail
532 nls "*** An error occurred during the RAID startup."
533 nls "*** Dropping you to a shell; the system will reboot"
534 nls "*** when you leave the shell."
537 PS1="$(nls '(RAID Repair)# ')"; export PS1
538 if is_yes "$RUN_SULOGIN_ON_ERR"; then
544 run_cmd "Unmounting file systems" umount -a
545 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
546 run_cmd "Automatic reboot in progress" reboot
548 if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
549 run_cmd "Scanning for LVM volume groups" /sbin/vgscan && \
550 run_cmd "Activating LVM volume groups" /sbin/vgchange -a y
552 show "Starting up RAID devices"; ok
558 if [ -z "$fastboot" ] && ! grep -q nofsck /proc/cmdline; then
559 rc_splash "fsck start"
560 show "Checking filesystems"; started
561 initlog -c "fsck -C -T -R -A -a $fsckoptions"
565 # A return of 2 or higher means there were serious problems
566 if [ $rc -gt 1 ]; then
567 [ -e /proc/splash ] && echo "verbose" > /proc/splash
570 nls "*** An error occurred during the file system check."
571 nls "*** Dropping you to a shell; the system will reboot"
572 nls "*** when you leave the shell."
575 PS1="$(nls '(Repair filesystem)# ')"; export PS1
576 if is_yes "$RUN_SULOGIN_ON_ERR"; then
582 run_cmd "Unmounting file systems" umount -a
583 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
584 run_cmd "Automatic reboot in progress" reboot
585 elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
588 rc_splash "fsck stop"
591 # Mount all other filesystems (except for NFS and /proc, which is already
592 # mounted). Contrary to standard usage,
593 # filesystems are NOT unmounted in single user mode.
595 run_cmd "Mounting local filesystems" mount -a -t nonfs,smbfs,ncpfs,proc,cifs -O no_netdev
597 # Now do some workaround - encrypted filesystems couldn't have been fsck-ed
598 # before mount - that's where the password is entered.
599 # mount is buggy - when remounting loopback filesystem, loop=XXX
600 # option is removed from /etc/mtab
601 if grep "^[^#].*encryption=" /etc/fstab | grep -v -q "noauto"; then
602 show "Checking encrypted filesystems"; started
604 FILENAME=="/proc/mounts" {
607 FILENAME=="/etc/fstab" && /encryption=/ && ! /noauto/ && /[^a-zA-Z_]ro[^a-zA-Z_]/ {
608 if ($2 in TAB){print TAB[$2];}
610 FILENAME=="/etc/fstab" && /encryption=/ && ! /noauto/ && ! /[^a-zA-Z_]ro[^a-zA-Z_]/ {
611 if ($2 in TAB){print TAB[$2];}
612 sub("loop(=[^,]*)?","loop=" TAB[$2] ",ro",$4);
613 cmd="mount " $2 " -o remount," $4;
616 ' /proc/mounts /etc/fstab)"
617 initlog -c "fsck -T -C -a $fsckoptions $LOOPLIST"
620 # A return of 2 or higher means there were serious problems.
621 if [ $rc -gt 1 ]; then
622 [ -e /proc/splash ] && echo "verbose" > /proc/splash
625 nls "*** An error occurred during the file system check."
626 nls "*** Dropping you to a shell; the system will reboot"
627 nls "*** when you leave the shell."
630 PS1="`nls '(Repair filesystem)# '`"; export PS1
631 if is_yes "$RUN_SULOGIN_ON_ERR"; then
637 run_cmd "Unmounting file systems" umount -a
638 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
639 run_cmd "Automatic reboot in progress" reboot
640 elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
644 show "Remounting encrypted filesystems back in rw mode"; busy
646 FILENAME=="/proc/mounts" {
649 FILENAME=="/etc/fstab" && /encryption=/ && ! /noauto/ && ! /[^a-zA-Z_]ro[^a-zA-Z_]/ {
650 sub("loop(=[^,]*)?","loop=" TAB[$2] ",rw",$4);
651 cmd="mount " $2 " -o remount," $4;
654 ' /proc/mounts /etc/fstab
658 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
659 run_cmd "Checking filesystem quotas" /sbin/quotacheck -vnugRa
663 if [ -x /sbin/quotaon ]; then
664 run_cmd "Turning on quotas for local filesystems" /sbin/quotaon -aug
667 # Turn on process accounting
668 if [ -x /etc/rc.d/rc.acct ]; then
669 /etc/rc.d/rc.acct start
672 # Set the clock if timezone definition wasn't available (eg. /usr not mounted)
673 if is_yes "$TIME_SETUP_DELAYED"; then
674 if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
675 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
679 # Initialize the serial ports
680 if [ -f /etc/rc.d/rc.serial ]; then
681 . /etc/rc.d/rc.serial
684 if [ -f /proc/sys/kernel/panic -a "$PANIC_REBOOT_TIME" -gt "0" ]; then
685 show 'Setting %s seconds for kernel reboot after panic' "$PANIC_REBOOT_TIME"; busy
686 if (sysctl -w kernel.panic=$PANIC_REBOOT_TIME >/dev/null 2>&1); then ok; else fail; fi
689 # ... and here finish configuring parameters
690 run_cmd "Configuring kernel parameters" /sbin/sysctl -p /etc/sysctl.conf
693 rm -f /fastboot /fsckoptions /forcefsck /halt /poweroff
696 # I'd use find, but /usr may not be mounted.
697 for afile in /var/lock/* /var/run/*; do
698 bafile=$(basename $afile)
699 if [ -d "$afile" ]; then
700 [ "$bafile" != "news" -a "$bafile" != "sudo" -a "$bafile" != "mon" ] && rm -rf $afile/*
702 [ "$bafile" != "hwprofile" ] && rm -f $afile 2> /dev/null
706 rm -f /var/lib/rpm/__db*
707 rm -f /var/spool/postoffice/.pid.*
711 if ! is_no "$NEED_XFILES" ; then
714 chown root.utmp /var/run/utmpx /var/log/wtmpx
715 chmod 0664 /var/run/utmpx /var/log/wtmpx
719 chown root.utmp /var/run/utmp /var/log/wtmp
720 chmod 0664 /var/run/utmp /var/log/wtmp
724 if is_yes "$CLEAN_TMP"; then
725 rm -rf /tmp/* /tmp/.[a-zA-Z0-9]*
728 # Right, now turn on swap in case we swap to files
729 swapon -a >/dev/null 2>&1
730 run_cmd "Enabling swap space" /bin/true
732 # If a SCSI tape has been detected, load the st module unconditionally
733 # since many SCSI tapes don't deal well with st being loaded and unloaded
734 if [ -f /proc/scsi/scsi ] && grep -q 'Type: Sequential-Access' /proc/scsi/scsi 2>/dev/null ; then
735 if grep -qv ' 9 st' /proc/devices; then
736 if [ -n "$USEMODULES" ] ; then
737 # Try to load the module. If it fails, ignore it...
738 insmod -p st >/dev/null 2>&1 && modprobe -s st >/dev/null 2>&1
743 # There could be a new kernel version. Remove old psdevtab database
746 # Now that we have all of our basic modules loaded and the kernel going,
747 # let's dump the syslog ring somewhere so we can find it later
748 dmesg -s 131072 > /var/log/dmesg
750 while [ $i -ge 0 ]; do
751 if [ -f /var/log/dmesg.$i ]; then
752 chmod 0600 /var/log/dmesg.$i
753 mv -f /var/log/dmesg.$i /var/log/dmesg.$(($i+1))
757 cp -f /var/log/dmesg /var/log/dmesg.0
758 chmod 0600 /var/log/dmesg /var/log/dmesg.0
760 kill -TERM $(/sbin/pidof getkey) >/dev/null 2>&1
762 if is_yes "$PROMPT"; then
763 /sbin/getkey i && touch /var/run/confirm
768 # This must be last line !
769 # vi:syntax=sh:tw=78:ts=8:sw=4