]> git.pld-linux.org Git - projects/rc-scripts.git/blame - rc.d/rc.sysinit
- udev-135-2 finally creates /dev/cpuset directory
[projects/rc-scripts.git] / rc.d / rc.sysinit
CommitLineData
12de71be 1#!/bin/sh
7742e157
AF
2#
3# /etc/rc.d/rc.sysinit - run once at boot time
ec8b15cb 4# $Id$
7742e157
AF
5#
6# Taken in part from Miquel van Smoorenburg's bcheckrc.
7#
8
b6509675
AM
9# reasonable start values for bootsplash progress.
10export progress=0
11export sscripts=45
12export kscripts=45
13
38198f50 14# NLS
de1fc6ce 15if [ -r /etc/sysconfig/i18n ]; then
38198f50
AM
16 . /etc/sysconfig/i18n
17 [ -n "$LANG" ] && export LANG || unset LANG
18 [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE
19 [ -n "$LC_COLLATE" ] && export LC_COLLATE || unset LC_COLLATE
20 [ -n "$LC_MESSAGES" ] && export LC_MESSAGES || unset LC_MESSAGES
21 [ -n "$LC_NUMERIC" ] && export LC_NUMERIC || unset LC_NUMERIC
22 [ -n "$LC_MONETARY" ] && export LC_MONETARY || unset LC_MONETARY
23 [ -n "$LC_TIME" ] && export LC_TIME || unset LC_TIME
24 [ -n "$LC_ALL" ] && export LC_ALL || unset LC_ALL
25 [ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
26 [ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
27fi
28
418c0cf3 29# Read network config data
de1fc6ce 30if [ -r /etc/sysconfig/network ]; then
1b228409 31 . /etc/sysconfig/network
7742e157 32else
1b228409 33 NETWORKING=no
34 HOSTNAME=localhost
7742e157
AF
35fi
36
277e5f53 37CONSOLE_LOGLEVEL=1
45e88cd0 38
e298d489
JR
39# Read functions
40. /etc/rc.d/init.d/functions
41
483f1dda
ER
42disable_selinux() {
43 typeset _d selinuxfs _t _r
44
45 while read _d selinuxfs _t _r; do
46 [ "$_t" = "selinuxfs" ] && break
47 done </proc/mounts
48 echo "*** Warning -- SELinux is active"
49 echo "*** Disabling security enforcement for system recovery."
50 echo "*** Run 'setenforce 1' to reenable."
51 echo "0" > $selinuxfs/enforce
52}
53
54relabel_selinux() {
55 typeset _d selinuxfs _t _r
56
57 while read _d selinuxfs _t _r; do
58 [ "$_t" = "selinuxfs" ] && break
59 done </proc/mounts
60 echo "
61 *** Warning -- SELinux relabel is required. ***
62 *** Disabling security enforcement. ***
63 *** Relabeling could take a very long time, ***
64 *** depending on file system size. ***
65 "
66 echo "0" > $selinuxfs/enforce
67 /sbin/fixfiles -F relabel > /dev/null 2>&1
68 rm -f /.autorelabel
69 echo "*** Enabling security enforcement. ***"
70 echo $SELINUX > $selinuxfs/enforce
71}
72
73# Remove duplicate entries from mtab (for vserver guest use only)
74clean_vserver_mtab() {
75 :>/etc/mtab.clean
76 while read device mountpoint line; do
77 grep -qs "$mountpoint" /etc/mtab.clean || \
78 echo "$device $mountpoint $line" >> /etc/mtab.clean
79 done < /etc/mtab
80 cat /etc/mtab.clean > /etc/mtab
81 rm -f /etc/mtab.clean
82}
83
3aabb390
ER
84# Loads modules from /etc/modules, /etc/modules.X.Y and /etc/modules.X.Y.Z
85load_kernel_modules() {
86 {
87 local _x _y v _z
88 read _x _y v _z
89 old_IFS=$IFS
90 IFS='.'
91 set -- $v
92 IFS=$old_IFS
93 kernel="$1.$2"
94 kerneleq="$1.$2.$3"
95 } < /proc/version
96
97 local module
98 # Loop over every line in modules file
99 ( \
100 egrep -hv '^(#|[[:blank:]]*$)' /etc/modules /etc/modules.$kernel /etc/modules.$kerneleq 2>/dev/null
101 echo '' # make sure there is a LF at the end
102 ) | while read module args; do
103 [ -z "$module" ] && continue
104 modprobe -s $module -- $args
105 done
106}
483f1dda 107
48e500cd
ER
108# boot logging to /var/log/boot.msg. install showconsole package to get it.
109if [ -x /sbin/blogd ] && ! is_no "$RC_BOOTLOG"; then
110 RC_BOOTLOG=1
111else
112 RC_BOOTLOG=
113fi
114
5163449d 115if ! is_yes "$VSERVER" ; then
a1ad6ea5
ER
116 # we need /proc mounted before everything
117 mount -n -o gid=17 -t proc /proc /proc
118
b0290bbb
ER
119 # Only read this once.
120 cmdline=$(cat /proc/cmdline)
121
5163449d
JR
122 # sysfs is also needed before any other things (under kernel > 2.5)
123 if grep -q sysfs /proc/filesystems 2>/dev/null ; then
124 mount -n -o gid=17 -t sysfs sysfs /sys
125 if [ "$(kernelver)" -ge "002006014" ] && \
126 grep -q securityfs /proc/filesystems 2>/dev/null ; then
127 mount -n -o gid=17 -t securityfs securityfs /sys/kernel/security
128 fi
defac991 129 fi
e298d489 130
5163449d
JR
131 # selinux
132 if grep -q selinuxfs /proc/filesystems 2>/dev/null && ! grep -q selinuxfs /proc/mounts 2>/dev/null; then
133 mount -n -o gid=17 -t selinuxfs selinuxfs /selinux
134 fi
e298d489 135
ffe19b59 136 # PLD Linux LiveCD support
01b60fd3
JR
137 if [ -x /etc/rc.d/rc.live ]; then
138 /etc/rc.d/rc.live
139 fi
e298d489 140
01b60fd3
JR
141 # Choose Hardware profile
142 if [ -f /etc/sysconfig/hwprof ]; then
143 . /etc/sysconfig/hwprof
144 if is_yes "${HWPROFILES}" && [ -x /sbin/hwprofile -a -d /etc/sysconfig/hwprofiles/data ]; then
145 mount -n / -o rw,remount
146 /sbin/hwprofile -qf
147 mount -n / -o ro,remount
148 fi
5e6dfc29 149 fi
e298d489 150
01b60fd3
JR
151 # Disable splash when requested
152 [ -e /proc/splash ] && is_no "$BOOT_SPLASH" && echo "0" > /proc/splash
5b0f5a94 153
c5e74817
ER
154 # Check SELinux status
155 selinuxfs=$(awk '/ selinuxfs / { print $2 }' /proc/mounts 2> /dev/null)
156 SELINUX=
157 if [ -n "$selinuxfs" ] && [ "$(cat /proc/self/attr/current)" != "kernel" ]; then
158 if [ -r $selinuxfs/enforce ] ; then
159 SELINUX=$(cat $selinuxfs/enforce)
160 else
161 # assume enforcing if you can't read it
162 SELINUX=1
163 fi
5e6dfc29 164 fi
677fdd75 165
c5e74817
ER
166 if [ -x /sbin/restorecon ] && LC_ALL=C fgrep -q " /dev " /proc/mounts 2>/dev/null ; then
167 /sbin/restorecon -R /dev 2>/dev/null
168 fi
677fdd75
AM
169
170
7e16b45e
ER
171 [ -z "${CONSOLETYPE}" ] && CONSOLETYPE="$(/sbin/consoletype)"
172
c5e74817
ER
173 if [ "$CONSOLETYPE" = "vt" -a -x /sbin/setsysfont ]; then
174 /sbin/setsysfont
175 fi
12c4fb70 176fi
5b0f5a94 177
652dbae5 178
458f14b7 179# Print welcome message
503bfc80 180nls "\t\t\t%sPowered by %sPLD Linux Distribution%s" "$(termput setaf $CPOWEREDBY)" "$(termput setaf $CPLD)" "$(termput op)"
8a917f32 181if ! is_no "$RC_PROMPT"; then
503bfc80 182 nls -n "\t\t Press %sI%s to enter interactive startup" "$(termput setaf $CI)" "$(termput op)"
6b4a354c 183 echo
6b4a354c 184fi
201c98b9 185
cc10e704 186# Set the hostname
499b251c
JR
187if [ -z "${HOSTNAME}" ]; then
188 show "$(nls 'Host:') $(hostname)" ; ok
189else
190 run_cmd "$(nls 'Host:') ${HOSTNAME}" hostname ${HOSTNAME}
191fi
6956336c 192
cc10e704
JR
193# Set the NIS domain name
194if [ -n "$NISDOMAIN" ]; then
195 run_cmd "$(nls 'NIS Domain:') ${NISDOMAIN}" domainname $NISDOMAIN
196else
197 domainname ""
4289a4ff
AM
198fi
199
cc10e704
JR
200if ! is_yes "$VSERVER"; then
201 # Set console loglevel
202 if [ -n "$CONSOLE_LOGLEVEL" ]; then
203 /bin/dmesg -n $CONSOLE_LOGLEVEL
204 fi
6bf50269 205
348aacfc
TP
206 if ! is_no "$START_UDEV"; then
207 [ -x /sbin/start_udev ] && /sbin/start_udev
208 fi
5e6dfc29 209
6a8f0f05 210 # Unmount the initrd, if necessary
426e1497 211 if grep -q /initrd /proc/mounts 2>/dev/null && ! grep -q /initrd/loopfs /proc/mounts 2>/dev/null; then
6a8f0f05
ER
212 if [ -e /initrd/dev/.devfsd ]; then
213 umount /initrd/dev
214 fi
426e1497 215 umount /initrd/dev 2>/dev/null
6a8f0f05
ER
216 umount /initrd
217 /sbin/blockdev --flushbufs /dev/ram0 >/dev/null 2>&1
218 fi
219
cc10e704
JR
220 # /dev must be also mounted before everything but only if we want use them ;-)
221 if is_yes "$MOUNT_DEVFS"; then
222 run_cmd "Mounting Device Filesystem" mount -n -t devfs /dev /dev
60c42ce9
ER
223 fi
224 # set up devfsd
225 if [ -e /dev/.devfsd -a -x /sbin/devfsd ]; then
226 run_cmd "Starting Device Filesystem Daemon" /sbin/devfsd /dev
cc10e704 227 fi
201c98b9 228
33c6207a
ER
229 # Start logging console output since we have all /dev stuff setup
230 if [ "$RC_BOOTLOG" ]; then
0868c9a6 231 /sbin/blogd
33c6207a
ER
232 fi
233
cc10e704 234 # cpuset support (mounted unconditionally, shouldn't be a problem)
5bae5434
JR
235 if grep -q cgroup /proc/filesystems 2>/dev/null ; then
236 mount -n -t cgroup none /dev/cpuset -ocpuset
237 [ $? -eq 0 ] && echo "/sbin/cpuset_release_agent" > /dev/cpuset/release_agent
238 elif grep -q cpuset /proc/filesystems 2>/dev/null ; then
5e6dfc29 239 mount -n -t cpuset none /dev/cpuset
cc10e704 240 fi
201c98b9 241
cc10e704
JR
242 # Configure Linux kernel (initial configuration, some required modules still
243 # may be missing).
244 /sbin/sysctl -e -p /etc/sysctl.conf > /dev/null 2>&1
201c98b9 245
cc10e704
JR
246 # Set the system clock.
247 ARC=0
248 SRM=0
249 UTC=0
201c98b9 250
cc10e704
JR
251 if [ -f /etc/sysconfig/clock ]; then
252 . /etc/sysconfig/clock
201c98b9 253
cc10e704
JR
254 # convert old style clock config to new values
255 if [ "${CLOCKMODE}" = "GMT" ]; then
256 UTC=true
257 elif [ "${CLOCKMODE}" = "ARC" ]; then
258 ARC=true
259 fi
260 fi
201c98b9 261
cc10e704
JR
262 if grep "system serial" /proc/cpuinfo 2>/dev/null | grep -q MILO 2>/dev/null ; then
263 ARC=true
264 fi
cb4d1aa7 265
cc10e704
JR
266 CLOCKDEF=""
267 CLOCKFLAGS="--hctosys"
cb4d1aa7 268
cc10e704
JR
269 if is_yes "$UTC" ; then
270 CLOCKFLAGS="$CLOCKFLAGS --utc"
271 CLOCKDEF="$CLOCKDEF (utc)"
272 else
273 CLOCKFLAGS="$CLOCKFLAGS --localtime"
274 CLOCKDEF="$CLOCKDEF (local)"
275 fi
201c98b9 276
cc10e704
JR
277 if is_yes "$ARC" ; then
278 CLOCKFLAGS="$CLOCKFLAGS -A"
279 CLOCKDEF="$CLOCKDEF (arc)"
0bbfed6f 280 fi
e4b0481f 281
cc10e704
JR
282 if is_yes "$SRM" ; then
283 CLOCKFLAGS="$CLOCKFLAGS -S"
284 CLOCKDEF="$CLOCKDEF (srm)"
285 fi
7742e157 286
cc10e704 287 # Check if timezone definition is available
bc05b297 288 if [ -e /etc/localtime -a -e /dev/rtc ] ; then
cc10e704
JR
289 if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
290 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
291 fi
292 else
293 TIME_SETUP_DELAYED=yes
294 fi
7742e157 295
6b496866 296 if [ -f /etc/crypttab ] && ! is_empty_file /etc/crypttab; then
dd23d50d
ER
297 # XXX might need modules dep
298 # Device mapper & related initialization
299 if ! fgrep -q device-mapper /proc/devices; then
300 modprobe dm-mod
301 fi
302
303 # but should do this before swapon?
304 . /etc/rc.d/init.d/cryptsetup
8710c4b5 305 show "Starting disk encryption"
dd23d50d
ER
306 init_crypto 0 && ok || fail
307 fi
308
cc10e704
JR
309 # Start up swapping
310 run_cmd "Activating swap partitions" swapon -a -e
311
312 # Initialize USB controllers
313 usb=0
07ea1da7 314 if ! strstr "$cmdline" "nousb" && ! grep -q "/proc/bus/usb" /proc/mounts 2>/dev/null ; then
86711d93 315 aliases=$(/sbin/modprobe -c | awk '/^alias[\t ]+usb-controller/ { print $3 }')
cc10e704 316 if [ -n "$aliases" -a "$aliases" != "off" ] ; then
a6a4a758 317 /sbin/modprobe -s -k usbcore
cc10e704
JR
318 for alias in $aliases ; do
319 [ "$alias" = "off" ] && continue
a6a4a758 320 run_cmd "$(nls 'Initializing USB controller') ($alias)" /sbin/modprobe -s $alias
cc10e704
JR
321 done
322 [ $? -eq 0 -a -n "$aliases" ] && usb=1
323 fi
324 if grep -iq "usb" /proc/devices 2>/dev/null ; then
325 usb=1
326 fi
327 fi
7742e157 328
cc10e704 329 if [ "$usb" = "1" -a ! -f /proc/bus/usb/devices ]; then
a40bbbec 330 run_cmd "Mounting USB filesystem" mount -n -t usbfs -o devgid=78,devmode=664 usbfs /proc/bus/usb
b3965b3d 331 fi
b3965b3d 332
cc10e704
JR
333 needusbstorage=
334 if [ "$usb" = "1" ]; then
335 needusbstorage=$(LC_ALL=C cat /proc/bus/usb/devices 2>/dev/null|grep -e "^I.*Cls=08" 2>/dev/null)
336 if [ "$(kernelverser)" -lt "002006" ]; then
5e6dfc29
JR
337 LC_ALL=C grep -q 'hid' /proc/bus/usb/drivers 2>/dev/null || run_cmd "Initializing USB HID interface" modprobe hid 2> /dev/null
338 mouseoutput=$(cat /proc/bus/usb/devices 2>/dev/null|grep -E "^I.*Cls=03.*Prot=02" 2>/dev/null)
339 kbdoutput=$(cat /proc/bus/usb/devices 2>/dev/null|grep -E "^I.*Cls=03.*Prot=01" 2>/dev/null)
340 if [ -n "$kbdoutput" ]; then
341 run_cmd "Initializing USB keyboard" modprobe keybdev
342 fi
343 if [ -n "$mouseoutput" ]; then
344 run_cmd "Initializing USB mouse" modprobe mousedev
345 fi
cc10e704
JR
346 fi
347 fi
b3965b3d 348
cc10e704 349 # Setup hdparm thing (if exists and is needed)
07ea1da7 350 if ! strstr "$cmdline" nohdparm; then
cc10e704 351 [ -x /etc/rc.d/rc.hdparm ] && /etc/rc.d/rc.hdparm
ebd1845b 352 fi
b3965b3d 353
07ea1da7 354 if [ -f /fastboot ] || strstr "$cmdline" "fastboot"; then
cc10e704
JR
355 fastboot=yes
356 else
357 fastboot=
358 fi
03f9cfee 359
cc10e704
JR
360 if [ -f /fsckoptions ]; then
361 fsckoptions=$(cat /fsckoptions)
362 else
363 fsckoptions=''
364 fi
cb4d1aa7 365
cc10e704
JR
366 if [ -f /forcefsck ]; then
367 fsckoptions="-f $fsckoptions"
790968dd
ER
368 else
369 # Obey the fs_passno setting for / (see fstab(5))
370 # - find the / entry
6fe4e4eb
ER
371 # - make sure we have at least 6 fields
372 _ROOTFS_PASSNO=$(awk '($1 !~ /^#/ && $2 == "/" && NF >= 6) { print $6}' /etc/fstab)
cc10e704 373 fi
7742e157 374
cc10e704 375 _RUN_QUOTACHECK=0
dc12b33c 376 _ROOTFS_DEVICE=$(awk '($1 !~ /^#/ && $2 == "/" && NF >= 6) { print $1}' /etc/fstab)
2fce16f9 377 _ROOTFS_TYPE=$(awk '$2 == "/" && $3 != "rootfs" { print $3 }' /proc/mounts 2>/dev/null)
cc10e704 378
dc12b33c 379 if [ -z "$fastboot" -a "$_ROOTFS_TYPE" != "nfs" -a "$_ROOTFS_TYPE" != "romfs" -a "$_ROOTFS_PASSNO" != 0 -a -e $_ROOTFS_DEVICE ]; then
cc10e704
JR
380 show "Checking root filesystem"; started
381 initlog -c "fsck -C -T -a $fsckoptions /"
382
383 rc=$?
384
385 # A return of 4 or higher means there were serious problems.
386 if [ $rc -gt 3 ]; then
387 [ -e /proc/splash ] && echo "verbose" > /proc/splash
388 # don't use '\n' in nls macro !
389 echo
390 echo
391 nls "*** An error occurred during the file system check."
392 nls "*** Dropping you to a shell; the system will reboot"
393 nls "*** when you leave the shell."
394 echo
395
526b7c62 396 PS1="`nls '(Repair filesystem)# '`"; export PS1
cc10e704 397 [ "$SELINUX" = "1" ] && disable_selinux
277e5f53 398 if ! is_no "$RUN_SULOGIN_ON_ERR"; then
cc10e704
JR
399 /sbin/sulogin
400 else
401 /bin/sh
402 fi
cee18a41 403
cc10e704
JR
404 run_cmd "Unmounting file systems" umount -a
405 mount -n -o remount,ro /
406 run_cmd "Automatic reboot in progress" reboot
407 # A return of 2 or 3 means that filesystem was repaired but we need
408 # to reboot.
409 elif [ "$rc" = "2" -o "$rc" = "3" ]; then
410 [ -e /proc/splash ] && echo "verbose" > /proc/splash
411 echo
412 nls "*** Filesystem was repaired but system needs to be"
413 nls "*** rebooted before mounting it."
414 nls "*** REBOOTING ***"
415 echo
416
417 run_cmd "Unmounting file systems" umount -a
418 mount -n -o remount,ro /
419 run_cmd "Automatic reboot in progress" reboot
420 elif [ "$rc" = "1" ]; then
421 _RUN_QUOTACHECK=1
cb4d1aa7 422 fi
cb4d1aa7 423 fi
7742e157 424
5e6dfc29 425 # Check for arguments
07ea1da7 426 if strstr "$cmdline" nopnp; then
cc10e704
JR
427 PNP=
428 else
429 PNP=yes
430 fi
7742e157 431
cc10e704
JR
432 # set up pnp and kernel pnp
433 if [ -n "$PNP" ]; then
277e5f53 434 if ! is_no "$RUN_USERPNP" && [ -x /sbin/isapnp -a -f /etc/isapnp/isapnp.conf ]; then
5e6dfc29
JR
435 run_cmd "Setting up ISA PNP devices (userspace pnp)" /sbin/isapnp /etc/isapnp/isapnp.conf
436 fi
277e5f53 437 if ! is_no "$RUN_KERNELPNP"; then
5e6dfc29
JR
438 /sbin/modprobe -k isa-pnp 2> /dev/null
439 if [ -e /proc/isapnp -a -f /etc/isapnp/isapnp-kernel.conf ]; then
440 show "Setting up ISA PNP devices (kernelspace pnp)"; busy
441 grep -v "^#" /etc/isapnp/isapnp-kernel.conf 2>/dev/null >/proc/isapnp && (deltext; ok) || (deltext; fail)
442 fi
cc10e704 443 fi
b68f99e5 444 fi
7742e157 445
cc10e704 446 # Remount the root filesystem read-write
f1296be4 447 run_cmd "Remounting root filesystem in rw mode" mount -n -o remount,rw /
cee18a41 448
cc10e704
JR
449 # Update quotas if fsck was run on /
450 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
451 run_cmd "Checking root filesystem quotas" /sbin/quotacheck -vnug /
452 fi
aa362992 453
5475bb0f
ER
454 # Clean up SELinux labels
455 if [ -n "$SELINUX" ]; then
456 for file in /etc/mtab /etc/cryptomtab /etc/ld.so.cache ; do
457 [ -r $file ] && restorecon $file >/dev/null 2>&1
458 done
459 fi
652dbae5 460
6b496866 461 if [ -f /etc/crypttab ] && ! is_empty_file /etc/crypttab; then
dd23d50d 462 # XXX, this must be probably done after random is initialized from /var/run/random-seed
1b05bb8a 463 show "Starting disk encryption using the RNG"
dd23d50d
ER
464 init_crypto 1 && ok || fail
465 fi
652dbae5
ER
466else
467 # Start logging console output since we have all /dev stuff setup
468 if [ "$RC_BOOTLOG" ]; then
469 /sbin/blogd -q
470 fi
677fdd75 471fi
5e6dfc29 472
cb4d1aa7 473# Remove stale backups
7158cab8 474rm -f /etc/mtab~ /etc/mtab~~ /etc/cryptomtab~ /etc/cryptomtab~~
cb4d1aa7 475
ef05209d
JR
476# Remove /etc/nologin when starting system
477[ -f /etc/nologin.boot ] && rm -f /etc/nologin /etc/nologin.boot
478
277e5f53 479if ! is_no "$DELAY_LOGIN" && [ ! -f /etc/nologin ]; then
ef05209d
JR
480 show "Enabling Delay Login"; busy
481 echo > /etc/nologin
482 nls "System bootup in progress - please wait" >> /etc/nologin
483 echo >> /etc/nologin
484 chmod 644 /etc/nologin
485 cp -fp /etc/nologin /etc/nologin.boot
486 ok
487fi
488
489# The root filesystem is now read-write, so we can now log via
490# syslog() directly...
491if [ -n "$IN_INITLOG" ]; then
492 IN_INITLOG=""
493fi
494
cc10e704 495if ! is_yes "$VSERVER"; then
220df3e7
JR
496 # Clear mtab
497 :>/etc/mtab
498 [ -f /etc/cryptomtab ] && :>/etc/cryptomtab
499
cc10e704
JR
500 # Enter root, /proc, /sys, devfs and other into mtab.
501 mount -f /
502 mount -f /proc
a40bbbec 503 [ -f /proc/bus/usb/devices ] && mount -f -t usbfs -o devgid=78,devmode=664 usbfs /proc/bus/usb
cc10e704 504 [ -e /dev/.devfsd ] && mount -f -t devfs devfs /dev
7d45bad6 505
29be11b0 506 if grep -q sysfs /proc/mounts 2>/dev/null; then
cc10e704 507 mount -f -t sysfs sysfs /sys
29be11b0 508 if grep -q securityfs /proc/mounts 2>/dev/null ; then
defac991
AM
509 mount -f -t securityfs securityfs /sys/kernel/security
510 fi
cc10e704 511 fi
ad084d91 512
29be11b0 513 if grep -q selinuxfs /proc/mounts 2>/dev/null; then
cc10e704
JR
514 mount -f -t selinuxfs selinuxfs /selinux
515 fi
cb4d1aa7 516
29be11b0 517 if grep -q cpuset /proc/mounts 2>/dev/null; then
2d495b7f 518 mount -f -t cpuset none /dev/cpuset
cc10e704 519 fi
fd6887dc 520
cc10e704
JR
521 if [ ! -f /proc/modules ]; then
522 USEMODULES=
07ea1da7 523 elif ! strstr "$cmdline" nomodules; then
cc10e704
JR
524 USEMODULES=y
525 else
526 USEMODULES=
4cc4301b 527 fi
de1fc6ce 528
0b38e7f1 529 uname_r=$(uname -r)
cc10e704
JR
530 # Adjust symlinks as necessary in /boot to keep system services from
531 # spewing messages about mismatched System maps and so on.
277e5f53 532 if ! is_no "$SET_SLINKS"; then
c14f9857
ER
533 if [ -L /boot/System.map -a -r /boot/System.map-$uname_r ] ; then
534 ln -s -f System.map-$uname_r /boot/System.map
cc10e704 535 fi
c14f9857
ER
536 if [ ! -e /boot/System.map -a -r /boot/System.map-$uname_r ] ; then
537 ln -s -f System.map-$uname_r /boot/System.map
cc10e704 538 fi
418c0cf3 539 fi
7742e157 540
cc10e704
JR
541 # Run depmod if RUN_DEPMOD != "no" and:
542 # a) user requested or RUN_DEPMOD="";
543 # b) modules.dep is missing
cc10e704
JR
544 if ! is_no "$RUN_DEPMOD" && [ -n "$USEMODULES" ]; then
545 if is_yes "$RUN_DEPMOD" || [ -z "$RUN_DEPMOD" ]; then
546 run_cmd "Finding module dependencies" depmod -a
0b38e7f1 547 elif [ "$RUN_DEPMOD" = "ifmissing" ] && [ ! -f /lib/modules/$uname_r/modules.dep ]; then
cc10e704
JR
548 run_cmd "Finding module dependencies" depmod -A
549 fi
aa362992 550 fi
0b38e7f1 551 unset uname_r
5bb58804 552
cc10e704
JR
553 if [ -f /proc/sys/kernel/modprobe ]; then
554 if [ -n "$USEMODULES" ]; then
555 sysctl -w kernel.modprobe="/sbin/modprobe" >/dev/null 2>&1
cc10e704
JR
556 else
557 # We used to set this to NULL, but that causes
558 # 'failed to exec' messages"
559 sysctl -w kernel.modprobe="/bin/true" >/dev/null 2>&1
cc10e704 560 fi
cb4d1aa7 561 fi
cb4d1aa7 562
cc10e704
JR
563 # Load usb storage here, to match most other things
564 if [ -n "$needusbstorage" ]; then
565 modprobe -k usb-storage >/dev/null 2>&1
566 fi
cb4d1aa7 567
cc10e704 568 # Load firewire devices
07ea1da7 569 if ! strstr "$cmdline" nofirewire; then
cc10e704
JR
570 aliases=$(/sbin/modprobe -c | awk '/^alias ieee1394-controller/ { print $3 }')
571 if [ -n "$aliases" -a "$aliases" != "off" ] ; then
5e6dfc29
JR
572 for alias in $aliases ; do
573 [ "$alias" = "off" ] && continue
574 run_cmd "$(nls 'Initializing firewire controller') ($alias)" /sbin/modprobe $alias
575 done
576 LC_ALL=C grep -E "SBP2" /proc/bus/ieee1394/devices 2>/dev/null && /sbin/modprobe -s sbp2 > /dev/null 2>&1
cc10e704 577 fi
5e6dfc29
JR
578 fi
579
cc10e704 580 # Load sound modules if they need persistent DMA buffers
4056c2bf
ER
581 if [ $(kernelverser) = "002006" ]; then
582 MODULES_CONF=/etc/modprobe.conf
583 elif [ -r /etc/modules.conf ]; then
584 MODULES_CONF=/etc/modules.conf
585 else
586 MODULES_CONF=/etc/conf.modules
587 fi
588
cc10e704
JR
589 if grep -q "^options sound dmabuf=1" "$MODULES_CONF" 2>/dev/null ; then
590 RETURN=0
591 alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound[[:space:]]+" 2>/dev/null | awk '{ print $3 }')
592 if [ -n "$alias" -a "$alias" != "off" ] ; then
593 run_cmd "$(nls 'Loading sound module') ($alias)" modprobe -s $alias
594 RETURN=$?
595 fi
596 alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound-slot-0[[:space:]]+" 2>/dev/null | awk '{ print $3 }')
597 if [ -n "$alias" -a "$alias" != "off" ] ; then
598 run_cmd "$(nls 'Loading sound module') ($alias)" modprobe -s $alias
599 RETURN=$?
f47acf6f
JR
600 fi
601 fi
472fa41e 602
cc10e704 603 # Load modules
3aabb390 604 load_kernel_modules
7742e157 605
e62309d9 606 if [ -x /sbin/multipath ]; then
2607b4f4 607 # first make nodes that were discarded due (possible) new /dev mount
6dbec259 608 modprobe -s dm-mod
2607b4f4 609 /sbin/dmsetup mknodes
7da998bd 610 modprobe -s dm-multipath
e62309d9 611 run_cmd "Activating dm-multipath" /sbin/multipath -v 0
094b84e1 612 /sbin/dmsetup ls --target multipath --exec '/sbin/kpartx -a -p p'
e62309d9
ER
613 fi
614
3a4304f3
AM
615 if [ -x /sbin/dmraid ]; then
616 run_cmd "Activating ATARAID devices" /sbin/dmraid -ay
617 fi
618
cc10e704
JR
619 # Find and activate volume groups:
620 # EVMS
621 if [ -x /sbin/evms_activate ]; then
cc10e704 622 if [ "$(kernelverser)" -lt "002006" ]; then
5e6dfc29
JR
623 # Linux 2.4 core modules
624 modprobe -s -k evms > /dev/null 2>&1
625 modprobe -s -k evms_passthru > /dev/null 2>&1
626 modprobe -s -k ldev_mgr > /dev/null 2>&1
627 modprobe -s -k dos_part > /dev/null 2>&1
cc10e704 628 else
5e6dfc29
JR
629 # Linux 2.6 core module
630 modprobe -s -k evmscore > /dev/null 2>&1
d6749722 631 fi
5e6dfc29 632
cc10e704
JR
633 is_yes "$EVMS_GUID_PTABLE" && modprobe -s -k gpt_part >/dev/null 2>&1
634 is_yes "$EVMS_LVM" && modprobe -s -k lvm_vge >/dev/null 2>&1
635 is_yes "$EVMS_AIX" && modprobe -s -k AIXlvm_vge >/dev/null 2>&1
636 is_yes "$EVMS_OS2" && modprobe -s -k os2lvm_vge >/dev/null 2>&1
637 run_cmd "Discovering EVMS volumes" /sbin/evms_activate
638 if is_yes "$EVMS_LVM" && is_yes "$EVMS_LVM_COMPAT_NODES" ; then
639 # Link nodes for compatibility with LVM
24fec6e3
ER
640 if [ "$(echo /dev/evms/lvm/*)" != '/dev/evms/lvm/*' ] ; then
641 ln -s /dev/evms/lvm/* /dev
de1fc6ce 642 fi
cc10e704
JR
643 fi
644 fi
49c61c56 645
cc10e704
JR
646 # LVM (keep in sync with LVM starting after RAID run!)
647 if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
648 lvmversion=$(/sbin/vgchange --version 2>/dev/null | awk '{gsub("vgchange: Logical Volume Manager ",""); gsub("LVM version: ",""); gsub(/\..*/,"");print $1; exit}')
649 if [ "$lvmversion" = "1" ] ; then
650 modprobe -s -k lvm-mod >/dev/null 2>&1
651 lvmignorelock=""
652 elif [ "$lvmversion" = "2" ] ; then
653 modprobe -s -k dm-mod >/dev/null 2>&1
654 lvmignorelock="--ignorelockingfailure"
655 else
5e6dfc29
JR
656 modprobe -s -k lvm-mod >/dev/null 2>&1
657 # device mapper (2.5+ and patched 2.4)
658 modprobe -s -k dm-mod >/dev/null 2>&1
659 lvmignorelock=""
cc10e704 660 fi
5e6dfc29 661
2607b4f4 662 run_cmd "Scanning for LVM volume groups" /sbin/vgscan $lvmignorelock
cc10e704 663 run_cmd "Activating LVM volume groups" /sbin/vgchange -a y $lvmignorelock
2607b4f4 664 [ "$lvmversion" = "2" ] && /sbin/vgmknodes
cc10e704
JR
665 fi
666
667 # Add raid devices
668 if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ] || [ -f /etc/raidtab ]; then
cc10e704
JR
669 modprobe -s md >/dev/null 2>&1
670 if [ -f /proc/mdstat ]; then
5e6dfc29
JR
671 goraidtab=1
672 golvm=0
673 rc=0
674 if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ]; then
675 if (grep -qE "^([[:blank:]]|)ARRAY[[:blank:]]" /etc/mdadm.conf 2>/dev/null); then
0fe527f8 676 run_cmd "Starting up RAID devices" /sbin/mdadm --assemble --scan --auto=yes
5e6dfc29
JR
677 rc=$?
678 [ "$rc" -eq 0 ] && goraidtab=0 && golvm=1
cc10e704 679 fi
5e6dfc29
JR
680 fi
681
682 if [ -f /etc/raidtab -a "$goraidtab" -eq 1 ]; then
49c61c56 683 for i in $(awk '!/^#/ && /raiddev/{print $2}' /etc/raidtab 2>/dev/null); do
5e6dfc29
JR
684 golvm=1
685 RAIDDEV=$(basename $i)
686 RAIDSTAT=$(grep "^$RAIDDEV : active" /proc/mdstat 2>/dev/null)
687 show "Starting up RAID device %s" $RAIDDEV
688 busy
689 if [ -z "$RAIDSTAT" ]; then
690 # Try raidstart first...if that fails then
691 # fall back to raid0run and if that fails too
692 # fall back to raidadd, raidrun.
693 RESULT=1
694 if [ -x /sbin/raidstart ]; then
695 /sbin/raidstart $i
696 RESULT=$?
697 fi
698 if [ $RESULT -gt 0 -a -x /sbin/raid0run ]; then
699 /sbin/raid0run $i
700 RESULT=$?
701 fi
702 if [ $RESULT -gt 0 -a -x /sbin/raidadd -a -x /sbin/raidrun ]; then
703 /sbin/raidadd $i
704 /sbin/raidrun $i
705 RESULT=$?
706 fi
707 if [ $RESULT -gt 0 ]; then
708 rc=1
709 fail
710 else
711 ok
712 fi
713 else
714 ok
715 fi
716 done
717 fi
718
719 # A non-zero return means there were problems
720 if [ $rc -gt 0 ]; then
721 [ -e /proc/splash ] && echo "verbose" > /proc/splash
722 show "Starting up RAID devices"; fail
723 echo
724 echo
725 nls "*** An error occurred during the RAID startup."
726 nls "*** Dropping you to a shell; the system will reboot"
727 nls "*** when you leave the shell."
728 echo
729
730 PS1="$(nls '(RAID Repair)# ')"; export PS1
731 [ "$SELINUX" = "1" ] && disable_selinux
277e5f53 732 if ! is_no "$RUN_SULOGIN_ON_ERR"; then
5e6dfc29 733 /sbin/sulogin
cc10e704 734 else
5e6dfc29 735 /bin/sh
cc10e704 736 fi
12de71be 737
5e6dfc29
JR
738 run_cmd "Unmounting file systems" umount -a
739 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
740 run_cmd "Automatic reboot in progress" reboot
cc10e704 741 fi
5e6dfc29
JR
742 # LVM on RAID (keep in sync with LVM setting few lines above)
743 if [ "$golvm" -eq "1" ]; then
744 if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
2607b4f4 745 run_cmd "Scanning for LVM volume groups (on RAID)" /sbin/vgscan $lvmignorelock
5e6dfc29 746 run_cmd "Activating LVM volume groups (on RAID)" /sbin/vgchange -a y $lvmignorelock
2607b4f4 747 [ "$lvmversion" = "2" ] && /sbin/vgmknodes
5e6dfc29 748 fi
cc10e704 749 fi
5e6dfc29 750 show "Starting up RAID devices"; ok
2619a5cf 751 fi
12de71be 752 fi
7742e157 753
cc10e704
JR
754 _RUN_QUOTACHECK=0
755 # Check filesystems
07ea1da7 756 if [ -z "$fastboot" ] && ! strstr "$cmdline" nofsck; then
cc10e704
JR
757 rc_splash "fsck start"
758 show "Checking filesystems"; started
790968dd 759 initlog -c "fsck -C -T -R -A -a -P $fsckoptions"
cc10e704
JR
760
761 rc=$?
762
763 # A return of 2 or higher means there were serious problems
764 if [ $rc -gt 1 ]; then
765 [ -e /proc/splash ] && echo "verbose" > /proc/splash
766 echo
767 echo
768 nls "*** An error occurred during the file system check."
769 nls "*** Dropping you to a shell; the system will reboot"
770 nls "*** when you leave the shell."
771 echo
772
773 PS1="$(nls '(Repair filesystem)# ')"; export PS1
774 [ "$SELINUX" = "1" ] && disable_selinux
277e5f53 775 if ! is_no "$RUN_SULOGIN_ON_ERR"; then
cc10e704
JR
776 /sbin/sulogin
777 else
778 /bin/sh
779 fi
7742e157 780
cc10e704
JR
781 run_cmd "Unmounting file systems" umount -a
782 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
783 run_cmd "Automatic reboot in progress" reboot
784 elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
785 _RUN_QUOTACHECK=1
786 fi
787 rc_splash "fsck stop"
7742e157 788 fi
7742e157 789
cc10e704
JR
790 # Mount all other filesystems (except for NFS and /proc, which is already
791 # mounted). Contrary to standard usage,
792 # filesystems are NOT unmounted in single user mode.
793
438bf720 794 run_cmd "Mounting local filesystems" mount -a -t nonfs,nfs4,smbfs,ncpfs,proc,cifs -O no_netdev
cc10e704 795
9a0a016d
ER
796 # now we have /usr mounted, recheck if we have gettext and tput available.
797 if is_no "$TPUT"; then
798 GETTEXT=
348aacfc 799 TPUT=
04342743 800 rc_gettext_init
9a0a016d
ER
801 fi
802
cc10e704
JR
803 # Now do some workaround - encrypted filesystems couldn't have been fsck-ed
804 # before mount - that's where the password is entered.
805 # mount is buggy - when remounting loopback filesystem, loop=XXX
806 # option is removed from /etc/mtab
807 if [ -z "$fastboot" ] && grep "^[^#].*encryption=" /etc/fstab 2>/dev/null | grep -v -q "noauto" 2>/dev/null; then
808 show "Checking encrypted filesystems"; started
fea9b6da 809 LOOPLIST="$(LC_ALL=C awk '
cc10e704
JR
810 FILENAME=="/proc/mounts" {
811 TAB[$2]=$1;
812 }
813 FILENAME=="/etc/fstab" && /encryption=/ && ! /noauto/ && /[^a-zA-Z_]ro[^a-zA-Z_]/ {
814 if ($2 in TAB){print TAB[$2];}
815 }
816 FILENAME=="/etc/fstab" && /encryption=/ && ! /noauto/ && ! /[^a-zA-Z_]ro[^a-zA-Z_]/ {
817 if ($2 in TAB){print TAB[$2];}
818 sub("loop(=[^,]*)?","loop=" TAB[$2] ",ro",$4);
819 cmd="mount " $2 " -o remount," $4;
820 system(cmd);
821 }
822 ' /proc/mounts /etc/fstab)"
823 initlog -c "fsck -T -C -a $fsckoptions $LOOPLIST"
824 rc=$?
825
826 # A return of 2 or higher means there were serious problems.
827 if [ $rc -gt 1 ]; then
828 [ -e /proc/splash ] && echo "verbose" > /proc/splash
829 echo
830 echo
831 nls "*** An error occurred during the file system check."
832 nls "*** Dropping you to a shell; the system will reboot"
833 nls "*** when you leave the shell."
834 echo
835
bf14fcab 836 PS1="$(nls '(Repair filesystem)# ')"; export PS1
cc10e704 837 [ "$SELINUX" = "1" ] && disable_selinux
277e5f53 838 if ! is_no "$RUN_SULOGIN_ON_ERR"; then
cc10e704
JR
839 /sbin/sulogin
840 else
841 /bin/sh
842 fi
6fa97a5d 843
cc10e704
JR
844 run_cmd "Unmounting file systems" umount -a
845 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
846 run_cmd "Automatic reboot in progress" reboot
847 elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
848 _RUN_QUOTACHECK=1
849 fi
5e6dfc29 850
cc10e704
JR
851 show "Remounting encrypted filesystems back in rw mode"; busy
852 awk '
853 FILENAME=="/proc/mounts" {
854 TAB[$2]=$1;
855 }
856 FILENAME=="/etc/fstab" && /encryption=/ && ! /noauto/ && ! /[^a-zA-Z_]ro[^a-zA-Z_]/ {
857 sub("loop(=[^,]*)?","loop=" TAB[$2] ",rw",$4);
858 cmd="mount " $2 " -o remount," $4;
859 system(cmd);
860 }
861 ' /proc/mounts /etc/fstab
862 ok
863 fi
6e16ab8f 864
9a0a016d 865 # /var/log should be writable now, so start saving the boot output
652dbae5
ER
866 if [ "$RC_BOOTLOG" ]; then
867 echo > /var/log/boot.msg
868 killall -IO blogd
869 fi
cb4d1aa7 870
1aaf8c92
JR
871 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
872 run_cmd "Checking filesystem quotas" /sbin/quotacheck -vnugRa
873 fi
cb4d1aa7 874
1aaf8c92
JR
875 # Turn on quota
876 if [ -x /sbin/quotaon ]; then
877 run_cmd "Turning on quotas for local filesystems" /sbin/quotaon -aug
878 fi
677fdd75 879
1aaf8c92
JR
880 # Turn on process accounting
881 if [ -x /etc/rc.d/rc.acct ]; then
882 /etc/rc.d/rc.acct start
883 fi
cb4d1aa7 884
cc10e704 885 # Set the clock if timezone definition wasn't available (eg. /usr not mounted)
bc05b297 886 if is_yes "$TIME_SETUP_DELAYED" && [ -e /dev/rtc ]; then
cc10e704
JR
887 if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
888 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
889 fi
0bbfed6f 890 fi
0bbfed6f 891
cc10e704
JR
892 # Initialize the serial ports
893 if [ -f /etc/rc.d/rc.serial ]; then
894 . /etc/rc.d/rc.serial
895 fi
201c98b9 896
277e5f53 897 if [ -f /proc/sys/kernel/panic -a -n "$PANIC_REBOOT_TIME" -a "$PANIC_REBOOT_TIME" -gt "0" ]; then
cc10e704
JR
898 show 'Setting %s seconds for kernel reboot after panic' "$PANIC_REBOOT_TIME"; busy
899 if (sysctl -w kernel.panic=$PANIC_REBOOT_TIME >/dev/null 2>&1); then ok; else fail; fi
900 fi
201c98b9 901
cc10e704
JR
902 # ... and here finish configuring parameters
903 /sbin/sysctl -e -p /etc/sysctl.conf > /dev/null 2>&1
ef05209d 904else
fea9b6da 905 # /var/log should be writable now, so start saving the boot output
652dbae5
ER
906 if [ "$RC_BOOTLOG" ]; then
907 echo > /var/log/boot.msg
908 killall -IO blogd
909 fi
910
ef05209d 911 clean_vserver_mtab
cc10e704 912fi
adec827a 913
652dbae5 914
1aaf8c92
JR
915[ -n "$SELINUX" ] && [ -f /.autorelabel ] && relabel_selinux
916
6239bd5c 917# Clean up /.
cb4d1aa7
JR
918rm -f /fastboot /fsckoptions /forcefsck /halt /poweroff
919
920# Clean up /var
5145ce41 921# /usr could be still not mounted if it is on NFS.
cb4d1aa7 922for afile in /var/lock/* /var/run/*; do
fea9b6da 923 bafile=${afile##*/}
cb4d1aa7 924 if [ -d "$afile" ]; then
38b419e3 925 case $bafile in
fea9b6da
ER
926 news|sudo|mon|cvs)
927 ;;
928 *)
91dc9337 929 echo $afile/* | xargs rm -rf
fea9b6da 930 ;;
38b419e3 931 esac
cb4d1aa7 932 else
5e6dfc29 933 [ "$bafile" != "hwprofile" ] && rm -f $afile 2> /dev/null
cb4d1aa7
JR
934 fi
935done
5145ce41 936
e0cba078 937# Delete stale files
4eb58d70
AM
938rm -f /var/lib/rpm/__db* /var/spool/postoffice/.pid.* /tmp/.X*-lock \
939 /tmp/.lock.* /tmp/.gdm_socket /tmp/.s.PGSQL.*
940rm -rf /tmp/.X*-unix /tmp/.ICE-unix /tmp/.font-unix /tmp/hsperfdata_* \
5e6dfc29
JR
941 /tmp/kde-* /tmp/ksocket-* /tmp/mc-* /tmp/mcop-* /tmp/orbit-* \
942 /tmp/scrollkeeper-* /tmp/ssh-*
45955ed4 943
201c98b9 944{
6b4a354c 945# Clean up utmp/wtmp
fea9b6da 946if ! is_no "$NEED_XFILES"; then
6b4a354c
AM
947 :>/var/run/utmpx
948 touch /var/log/wtmpx
afa9b748 949 chown root:utmp /var/run/utmpx /var/log/wtmpx
19b0557d 950 chmod 0664 /var/run/utmpx /var/log/wtmpx
054a52c9
JR
951else
952 :>/var/run/utmp
953 touch /var/log/wtmp
afa9b748 954 chown root:utmp /var/run/utmp /var/log/wtmp
19b0557d 955 chmod 0664 /var/run/utmp /var/log/wtmp
6b4a354c 956fi
7e04fe0e 957
7e04fe0e 958# Clean /tmp
fcf89189 959if is_yes "$CLEAN_TMP"; then
fea9b6da 960 # XXX LC_ALL needed here
cb4d1aa7 961 rm -rf /tmp/* /tmp/.[a-zA-Z0-9]*
7e04fe0e 962fi
7742e157 963
e6c8dd44
AM
964# System protected dirs
965mkdir -m 1777 -p /tmp/.ICE-unix > /dev/null 2>&1
966chown root:root /tmp/.ICE-unix
677fdd75 967[ -n "$SELINUX" ] && restorecon /tmp/.ICE-unix >/dev/null 2>&1
e6c8dd44 968
1aaf8c92 969if ! is_yes "$VSERVER"; then
fea9b6da 970 run_cmd "Enabling swap space" /bin/true
1aaf8c92
JR
971 # Right, now turn on swap in case we swap to files
972 swapon -a >/dev/null 2>&1
7742e157 973
0d60cc3e
JR
974 # If a SCSI tape has been detected, load the st module unconditionally
975 # since many SCSI tapes don't deal well with st being loaded and unloaded
976 if [ -f /proc/scsi/scsi ] && grep -q 'Type: Sequential-Access' /proc/scsi/scsi 2>/dev/null ; then
977 if grep -qv ' 9 st' /proc/devices 2>/dev/null; then
978 if [ -n "$USEMODULES" ] ; then
979 # Try to load the module. If it fails, ignore it...
980 insmod -p st >/dev/null 2>&1 && modprobe -s st >/dev/null 2>&1
981 fi
7742e157
AF
982 fi
983 fi
7742e157 984
cc10e704
JR
985 # Now that we have all of our basic modules loaded and the kernel going,
986 # let's dump the syslog ring somewhere so we can find it later
c8f4b766 987 dmesg > /var/log/dmesg
cc10e704
JR
988 i=5
989 while [ $i -ge 0 ]; do
990 if [ -f /var/log/dmesg.$i ]; then
5e6dfc29
JR
991 chmod 0600 /var/log/dmesg.$i
992 mv -f /var/log/dmesg.$i /var/log/dmesg.$(($i+1))
cc10e704
JR
993 fi
994 i=$(($i-1))
995 done
996 cp -f /var/log/dmesg /var/log/dmesg.0
997 chmod 0600 /var/log/dmesg /var/log/dmesg.0
998fi
7742e157 999
de1fc6ce 1000kill -TERM $(/sbin/pidof getkey) >/dev/null 2>&1
6b4a354c 1001} &
385dc542
ER
1002
1003# extra check if the background process we just spawned is still running,
1004# as in case of vserver bootup it finishes quite instantly.
1005if ! is_no "$RC_PROMPT" && [ -d /proc/$! ]; then
7c341db5 1006 /sbin/getkey -c 5 i && touch /var/run/confirm
6b4a354c
AM
1007fi
1008wait
de1fc6ce 1009echo
This page took 1.562223 seconds and 4 git commands to generate.