]> git.pld-linux.org Git - projects/rc-scripts.git/blame - rc.d/rc.sysinit
Leave default for kernel.
[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
JR
234 # cpuset support (mounted unconditionally, shouldn't be a problem)
235 if grep -q cpuset /proc/filesystems 2>/dev/null ; then
29be11b0
ER
236 # mkdir for udev (FIXME fix the udev instead)
237 mkdir -p /dev/cpuset 2>/dev/null
5e6dfc29 238 mount -n -t cpuset none /dev/cpuset
cc10e704 239 fi
201c98b9 240
cc10e704
JR
241 # Configure Linux kernel (initial configuration, some required modules still
242 # may be missing).
243 /sbin/sysctl -e -p /etc/sysctl.conf > /dev/null 2>&1
201c98b9 244
cc10e704
JR
245 # Set the system clock.
246 ARC=0
247 SRM=0
248 UTC=0
201c98b9 249
cc10e704
JR
250 if [ -f /etc/sysconfig/clock ]; then
251 . /etc/sysconfig/clock
201c98b9 252
cc10e704
JR
253 # convert old style clock config to new values
254 if [ "${CLOCKMODE}" = "GMT" ]; then
255 UTC=true
256 elif [ "${CLOCKMODE}" = "ARC" ]; then
257 ARC=true
258 fi
259 fi
201c98b9 260
cc10e704
JR
261 if grep "system serial" /proc/cpuinfo 2>/dev/null | grep -q MILO 2>/dev/null ; then
262 ARC=true
263 fi
cb4d1aa7 264
cc10e704
JR
265 CLOCKDEF=""
266 CLOCKFLAGS="--hctosys"
cb4d1aa7 267
cc10e704
JR
268 if is_yes "$UTC" ; then
269 CLOCKFLAGS="$CLOCKFLAGS --utc"
270 CLOCKDEF="$CLOCKDEF (utc)"
271 else
272 CLOCKFLAGS="$CLOCKFLAGS --localtime"
273 CLOCKDEF="$CLOCKDEF (local)"
274 fi
201c98b9 275
cc10e704
JR
276 if is_yes "$ARC" ; then
277 CLOCKFLAGS="$CLOCKFLAGS -A"
278 CLOCKDEF="$CLOCKDEF (arc)"
0bbfed6f 279 fi
e4b0481f 280
cc10e704
JR
281 if is_yes "$SRM" ; then
282 CLOCKFLAGS="$CLOCKFLAGS -S"
283 CLOCKDEF="$CLOCKDEF (srm)"
284 fi
7742e157 285
cc10e704 286 # Check if timezone definition is available
bc05b297 287 if [ -e /etc/localtime -a -e /dev/rtc ] ; then
cc10e704
JR
288 if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
289 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
290 fi
291 else
292 TIME_SETUP_DELAYED=yes
293 fi
7742e157 294
6b496866 295 if [ -f /etc/crypttab ] && ! is_empty_file /etc/crypttab; then
dd23d50d
ER
296 # XXX might need modules dep
297 # Device mapper & related initialization
298 if ! fgrep -q device-mapper /proc/devices; then
299 modprobe dm-mod
300 fi
301
302 # but should do this before swapon?
303 . /etc/rc.d/init.d/cryptsetup
8710c4b5 304 show "Starting disk encryption"
dd23d50d
ER
305 init_crypto 0 && ok || fail
306 fi
307
cc10e704
JR
308 # Start up swapping
309 run_cmd "Activating swap partitions" swapon -a -e
310
311 # Initialize USB controllers
312 usb=0
07ea1da7 313 if ! strstr "$cmdline" "nousb" && ! grep -q "/proc/bus/usb" /proc/mounts 2>/dev/null ; then
86711d93 314 aliases=$(/sbin/modprobe -c | awk '/^alias[\t ]+usb-controller/ { print $3 }')
cc10e704 315 if [ -n "$aliases" -a "$aliases" != "off" ] ; then
a6a4a758 316 /sbin/modprobe -s -k usbcore
cc10e704
JR
317 for alias in $aliases ; do
318 [ "$alias" = "off" ] && continue
a6a4a758 319 run_cmd "$(nls 'Initializing USB controller') ($alias)" /sbin/modprobe -s $alias
cc10e704
JR
320 done
321 [ $? -eq 0 -a -n "$aliases" ] && usb=1
322 fi
323 if grep -iq "usb" /proc/devices 2>/dev/null ; then
324 usb=1
325 fi
326 fi
7742e157 327
cc10e704 328 if [ "$usb" = "1" -a ! -f /proc/bus/usb/devices ]; then
7a4f6aef 329 run_cmd "Mounting USB filesystem" mount -n -t usbfs usbfs /proc/bus/usb
b3965b3d 330 fi
b3965b3d 331
cc10e704
JR
332 needusbstorage=
333 if [ "$usb" = "1" ]; then
334 needusbstorage=$(LC_ALL=C cat /proc/bus/usb/devices 2>/dev/null|grep -e "^I.*Cls=08" 2>/dev/null)
335 if [ "$(kernelverser)" -lt "002006" ]; then
5e6dfc29
JR
336 LC_ALL=C grep -q 'hid' /proc/bus/usb/drivers 2>/dev/null || run_cmd "Initializing USB HID interface" modprobe hid 2> /dev/null
337 mouseoutput=$(cat /proc/bus/usb/devices 2>/dev/null|grep -E "^I.*Cls=03.*Prot=02" 2>/dev/null)
338 kbdoutput=$(cat /proc/bus/usb/devices 2>/dev/null|grep -E "^I.*Cls=03.*Prot=01" 2>/dev/null)
339 if [ -n "$kbdoutput" ]; then
340 run_cmd "Initializing USB keyboard" modprobe keybdev
341 fi
342 if [ -n "$mouseoutput" ]; then
343 run_cmd "Initializing USB mouse" modprobe mousedev
344 fi
cc10e704
JR
345 fi
346 fi
b3965b3d 347
cc10e704 348 # Setup hdparm thing (if exists and is needed)
07ea1da7 349 if ! strstr "$cmdline" nohdparm; then
cc10e704 350 [ -x /etc/rc.d/rc.hdparm ] && /etc/rc.d/rc.hdparm
ebd1845b 351 fi
b3965b3d 352
07ea1da7 353 if [ -f /fastboot ] || strstr "$cmdline" "fastboot"; then
cc10e704
JR
354 fastboot=yes
355 else
356 fastboot=
357 fi
03f9cfee 358
cc10e704
JR
359 if [ -f /fsckoptions ]; then
360 fsckoptions=$(cat /fsckoptions)
361 else
362 fsckoptions=''
363 fi
cb4d1aa7 364
cc10e704
JR
365 if [ -f /forcefsck ]; then
366 fsckoptions="-f $fsckoptions"
790968dd
ER
367 else
368 # Obey the fs_passno setting for / (see fstab(5))
369 # - find the / entry
6fe4e4eb
ER
370 # - make sure we have at least 6 fields
371 _ROOTFS_PASSNO=$(awk '($1 !~ /^#/ && $2 == "/" && NF >= 6) { print $6}' /etc/fstab)
cc10e704 372 fi
7742e157 373
cc10e704 374 _RUN_QUOTACHECK=0
dc12b33c 375 _ROOTFS_DEVICE=$(awk '($1 !~ /^#/ && $2 == "/" && NF >= 6) { print $1}' /etc/fstab)
2fce16f9 376 _ROOTFS_TYPE=$(awk '$2 == "/" && $3 != "rootfs" { print $3 }' /proc/mounts 2>/dev/null)
cc10e704 377
dc12b33c 378 if [ -z "$fastboot" -a "$_ROOTFS_TYPE" != "nfs" -a "$_ROOTFS_TYPE" != "romfs" -a "$_ROOTFS_PASSNO" != 0 -a -e $_ROOTFS_DEVICE ]; then
cc10e704
JR
379 show "Checking root filesystem"; started
380 initlog -c "fsck -C -T -a $fsckoptions /"
381
382 rc=$?
383
384 # A return of 4 or higher means there were serious problems.
385 if [ $rc -gt 3 ]; then
386 [ -e /proc/splash ] && echo "verbose" > /proc/splash
387 # don't use '\n' in nls macro !
388 echo
389 echo
390 nls "*** An error occurred during the file system check."
391 nls "*** Dropping you to a shell; the system will reboot"
392 nls "*** when you leave the shell."
393 echo
394
526b7c62 395 PS1="`nls '(Repair filesystem)# '`"; export PS1
cc10e704 396 [ "$SELINUX" = "1" ] && disable_selinux
277e5f53 397 if ! is_no "$RUN_SULOGIN_ON_ERR"; then
cc10e704
JR
398 /sbin/sulogin
399 else
400 /bin/sh
401 fi
cee18a41 402
cc10e704
JR
403 run_cmd "Unmounting file systems" umount -a
404 mount -n -o remount,ro /
405 run_cmd "Automatic reboot in progress" reboot
406 # A return of 2 or 3 means that filesystem was repaired but we need
407 # to reboot.
408 elif [ "$rc" = "2" -o "$rc" = "3" ]; then
409 [ -e /proc/splash ] && echo "verbose" > /proc/splash
410 echo
411 nls "*** Filesystem was repaired but system needs to be"
412 nls "*** rebooted before mounting it."
413 nls "*** REBOOTING ***"
414 echo
415
416 run_cmd "Unmounting file systems" umount -a
417 mount -n -o remount,ro /
418 run_cmd "Automatic reboot in progress" reboot
419 elif [ "$rc" = "1" ]; then
420 _RUN_QUOTACHECK=1
cb4d1aa7 421 fi
cb4d1aa7 422 fi
7742e157 423
5e6dfc29 424 # Check for arguments
07ea1da7 425 if strstr "$cmdline" nopnp; then
cc10e704
JR
426 PNP=
427 else
428 PNP=yes
429 fi
7742e157 430
cc10e704
JR
431 # set up pnp and kernel pnp
432 if [ -n "$PNP" ]; then
277e5f53 433 if ! is_no "$RUN_USERPNP" && [ -x /sbin/isapnp -a -f /etc/isapnp/isapnp.conf ]; then
5e6dfc29
JR
434 run_cmd "Setting up ISA PNP devices (userspace pnp)" /sbin/isapnp /etc/isapnp/isapnp.conf
435 fi
277e5f53 436 if ! is_no "$RUN_KERNELPNP"; then
5e6dfc29
JR
437 /sbin/modprobe -k isa-pnp 2> /dev/null
438 if [ -e /proc/isapnp -a -f /etc/isapnp/isapnp-kernel.conf ]; then
439 show "Setting up ISA PNP devices (kernelspace pnp)"; busy
440 grep -v "^#" /etc/isapnp/isapnp-kernel.conf 2>/dev/null >/proc/isapnp && (deltext; ok) || (deltext; fail)
441 fi
cc10e704 442 fi
b68f99e5 443 fi
7742e157 444
cc10e704 445 # Remount the root filesystem read-write
f1296be4 446 run_cmd "Remounting root filesystem in rw mode" mount -n -o remount,rw /
cee18a41 447
cc10e704
JR
448 # Update quotas if fsck was run on /
449 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
450 run_cmd "Checking root filesystem quotas" /sbin/quotacheck -vnug /
451 fi
aa362992 452
5475bb0f
ER
453 # Clean up SELinux labels
454 if [ -n "$SELINUX" ]; then
455 for file in /etc/mtab /etc/cryptomtab /etc/ld.so.cache ; do
456 [ -r $file ] && restorecon $file >/dev/null 2>&1
457 done
458 fi
652dbae5 459
6b496866 460 if [ -f /etc/crypttab ] && ! is_empty_file /etc/crypttab; then
dd23d50d 461 # XXX, this must be probably done after random is initialized from /var/run/random-seed
1b05bb8a 462 show "Starting disk encryption using the RNG"
dd23d50d
ER
463 init_crypto 1 && ok || fail
464 fi
652dbae5
ER
465else
466 # Start logging console output since we have all /dev stuff setup
467 if [ "$RC_BOOTLOG" ]; then
468 /sbin/blogd -q
469 fi
677fdd75 470fi
5e6dfc29 471
cb4d1aa7 472# Remove stale backups
7158cab8 473rm -f /etc/mtab~ /etc/mtab~~ /etc/cryptomtab~ /etc/cryptomtab~~
cb4d1aa7 474
ef05209d
JR
475# Remove /etc/nologin when starting system
476[ -f /etc/nologin.boot ] && rm -f /etc/nologin /etc/nologin.boot
477
277e5f53 478if ! is_no "$DELAY_LOGIN" && [ ! -f /etc/nologin ]; then
ef05209d
JR
479 show "Enabling Delay Login"; busy
480 echo > /etc/nologin
481 nls "System bootup in progress - please wait" >> /etc/nologin
482 echo >> /etc/nologin
483 chmod 644 /etc/nologin
484 cp -fp /etc/nologin /etc/nologin.boot
485 ok
486fi
487
488# The root filesystem is now read-write, so we can now log via
489# syslog() directly...
490if [ -n "$IN_INITLOG" ]; then
491 IN_INITLOG=""
492fi
493
cc10e704 494if ! is_yes "$VSERVER"; then
220df3e7
JR
495 # Clear mtab
496 :>/etc/mtab
497 [ -f /etc/cryptomtab ] && :>/etc/cryptomtab
498
cc10e704
JR
499 # Enter root, /proc, /sys, devfs and other into mtab.
500 mount -f /
501 mount -f /proc
502 [ -f /proc/bus/usb/devices ] && mount -f -t usbfs usbfs /proc/bus/usb
503 [ -e /dev/.devfsd ] && mount -f -t devfs devfs /dev
7d45bad6 504
29be11b0 505 if grep -q sysfs /proc/mounts 2>/dev/null; then
cc10e704 506 mount -f -t sysfs sysfs /sys
29be11b0 507 if grep -q securityfs /proc/mounts 2>/dev/null ; then
defac991
AM
508 mount -f -t securityfs securityfs /sys/kernel/security
509 fi
cc10e704 510 fi
ad084d91 511
29be11b0 512 if grep -q selinuxfs /proc/mounts 2>/dev/null; then
cc10e704
JR
513 mount -f -t selinuxfs selinuxfs /selinux
514 fi
cb4d1aa7 515
29be11b0 516 if grep -q cpuset /proc/mounts 2>/dev/null; then
2d495b7f 517 mount -f -t cpuset none /dev/cpuset
cc10e704 518 fi
fd6887dc 519
cc10e704
JR
520 if [ ! -f /proc/modules ]; then
521 USEMODULES=
07ea1da7 522 elif ! strstr "$cmdline" nomodules; then
cc10e704
JR
523 USEMODULES=y
524 else
525 USEMODULES=
4cc4301b 526 fi
de1fc6ce 527
0b38e7f1 528 uname_r=$(uname -r)
cc10e704
JR
529 # Adjust symlinks as necessary in /boot to keep system services from
530 # spewing messages about mismatched System maps and so on.
277e5f53 531 if ! is_no "$SET_SLINKS"; then
c14f9857
ER
532 if [ -L /boot/System.map -a -r /boot/System.map-$uname_r ] ; then
533 ln -s -f System.map-$uname_r /boot/System.map
cc10e704 534 fi
c14f9857
ER
535 if [ ! -e /boot/System.map -a -r /boot/System.map-$uname_r ] ; then
536 ln -s -f System.map-$uname_r /boot/System.map
cc10e704 537 fi
418c0cf3 538 fi
7742e157 539
cc10e704
JR
540 # Run depmod if RUN_DEPMOD != "no" and:
541 # a) user requested or RUN_DEPMOD="";
542 # b) modules.dep is missing
cc10e704
JR
543 if ! is_no "$RUN_DEPMOD" && [ -n "$USEMODULES" ]; then
544 if is_yes "$RUN_DEPMOD" || [ -z "$RUN_DEPMOD" ]; then
545 run_cmd "Finding module dependencies" depmod -a
0b38e7f1 546 elif [ "$RUN_DEPMOD" = "ifmissing" ] && [ ! -f /lib/modules/$uname_r/modules.dep ]; then
cc10e704
JR
547 run_cmd "Finding module dependencies" depmod -A
548 fi
aa362992 549 fi
0b38e7f1 550 unset uname_r
5bb58804 551
cc10e704
JR
552 if [ -f /proc/sys/kernel/modprobe ]; then
553 if [ -n "$USEMODULES" ]; then
554 sysctl -w kernel.modprobe="/sbin/modprobe" >/dev/null 2>&1
cc10e704
JR
555 else
556 # We used to set this to NULL, but that causes
557 # 'failed to exec' messages"
558 sysctl -w kernel.modprobe="/bin/true" >/dev/null 2>&1
cc10e704 559 fi
cb4d1aa7 560 fi
cb4d1aa7 561
cc10e704
JR
562 # Load usb storage here, to match most other things
563 if [ -n "$needusbstorage" ]; then
564 modprobe -k usb-storage >/dev/null 2>&1
565 fi
cb4d1aa7 566
cc10e704 567 # Load firewire devices
07ea1da7 568 if ! strstr "$cmdline" nofirewire; then
cc10e704
JR
569 aliases=$(/sbin/modprobe -c | awk '/^alias ieee1394-controller/ { print $3 }')
570 if [ -n "$aliases" -a "$aliases" != "off" ] ; then
5e6dfc29
JR
571 for alias in $aliases ; do
572 [ "$alias" = "off" ] && continue
573 run_cmd "$(nls 'Initializing firewire controller') ($alias)" /sbin/modprobe $alias
574 done
575 LC_ALL=C grep -E "SBP2" /proc/bus/ieee1394/devices 2>/dev/null && /sbin/modprobe -s sbp2 > /dev/null 2>&1
cc10e704 576 fi
5e6dfc29
JR
577 fi
578
cc10e704 579 # Load sound modules if they need persistent DMA buffers
4056c2bf
ER
580 if [ $(kernelverser) = "002006" ]; then
581 MODULES_CONF=/etc/modprobe.conf
582 elif [ -r /etc/modules.conf ]; then
583 MODULES_CONF=/etc/modules.conf
584 else
585 MODULES_CONF=/etc/conf.modules
586 fi
587
cc10e704
JR
588 if grep -q "^options sound dmabuf=1" "$MODULES_CONF" 2>/dev/null ; then
589 RETURN=0
590 alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound[[:space:]]+" 2>/dev/null | awk '{ print $3 }')
591 if [ -n "$alias" -a "$alias" != "off" ] ; then
592 run_cmd "$(nls 'Loading sound module') ($alias)" modprobe -s $alias
593 RETURN=$?
594 fi
595 alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound-slot-0[[:space:]]+" 2>/dev/null | awk '{ print $3 }')
596 if [ -n "$alias" -a "$alias" != "off" ] ; then
597 run_cmd "$(nls 'Loading sound module') ($alias)" modprobe -s $alias
598 RETURN=$?
f47acf6f
JR
599 fi
600 fi
472fa41e 601
cc10e704 602 # Load modules
3aabb390 603 load_kernel_modules
7742e157 604
e62309d9 605 if [ -x /sbin/multipath ]; then
2607b4f4 606 # first make nodes that were discarded due (possible) new /dev mount
6dbec259 607 modprobe -s dm-mod
2607b4f4 608 /sbin/dmsetup mknodes
7da998bd 609 modprobe -s dm-multipath
e62309d9 610 run_cmd "Activating dm-multipath" /sbin/multipath -v 0
094b84e1 611 /sbin/dmsetup ls --target multipath --exec '/sbin/kpartx -a -p p'
e62309d9
ER
612 fi
613
3a4304f3
AM
614 if [ -x /sbin/dmraid ]; then
615 run_cmd "Activating ATARAID devices" /sbin/dmraid -ay
616 fi
617
cc10e704
JR
618 # Find and activate volume groups:
619 # EVMS
620 if [ -x /sbin/evms_activate ]; then
cc10e704 621 if [ "$(kernelverser)" -lt "002006" ]; then
5e6dfc29
JR
622 # Linux 2.4 core modules
623 modprobe -s -k evms > /dev/null 2>&1
624 modprobe -s -k evms_passthru > /dev/null 2>&1
625 modprobe -s -k ldev_mgr > /dev/null 2>&1
626 modprobe -s -k dos_part > /dev/null 2>&1
cc10e704 627 else
5e6dfc29
JR
628 # Linux 2.6 core module
629 modprobe -s -k evmscore > /dev/null 2>&1
d6749722 630 fi
5e6dfc29 631
cc10e704
JR
632 is_yes "$EVMS_GUID_PTABLE" && modprobe -s -k gpt_part >/dev/null 2>&1
633 is_yes "$EVMS_LVM" && modprobe -s -k lvm_vge >/dev/null 2>&1
634 is_yes "$EVMS_AIX" && modprobe -s -k AIXlvm_vge >/dev/null 2>&1
635 is_yes "$EVMS_OS2" && modprobe -s -k os2lvm_vge >/dev/null 2>&1
636 run_cmd "Discovering EVMS volumes" /sbin/evms_activate
637 if is_yes "$EVMS_LVM" && is_yes "$EVMS_LVM_COMPAT_NODES" ; then
638 # Link nodes for compatibility with LVM
24fec6e3
ER
639 if [ "$(echo /dev/evms/lvm/*)" != '/dev/evms/lvm/*' ] ; then
640 ln -s /dev/evms/lvm/* /dev
de1fc6ce 641 fi
cc10e704
JR
642 fi
643 fi
49c61c56 644
cc10e704
JR
645 # LVM (keep in sync with LVM starting after RAID run!)
646 if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
647 lvmversion=$(/sbin/vgchange --version 2>/dev/null | awk '{gsub("vgchange: Logical Volume Manager ",""); gsub("LVM version: ",""); gsub(/\..*/,"");print $1; exit}')
648 if [ "$lvmversion" = "1" ] ; then
649 modprobe -s -k lvm-mod >/dev/null 2>&1
650 lvmignorelock=""
651 elif [ "$lvmversion" = "2" ] ; then
652 modprobe -s -k dm-mod >/dev/null 2>&1
653 lvmignorelock="--ignorelockingfailure"
654 else
5e6dfc29
JR
655 modprobe -s -k lvm-mod >/dev/null 2>&1
656 # device mapper (2.5+ and patched 2.4)
657 modprobe -s -k dm-mod >/dev/null 2>&1
658 lvmignorelock=""
cc10e704 659 fi
5e6dfc29 660
2607b4f4 661 run_cmd "Scanning for LVM volume groups" /sbin/vgscan $lvmignorelock
cc10e704 662 run_cmd "Activating LVM volume groups" /sbin/vgchange -a y $lvmignorelock
2607b4f4 663 [ "$lvmversion" = "2" ] && /sbin/vgmknodes
cc10e704
JR
664 fi
665
666 # Add raid devices
667 if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ] || [ -f /etc/raidtab ]; then
cc10e704
JR
668 modprobe -s md >/dev/null 2>&1
669 if [ -f /proc/mdstat ]; then
5e6dfc29
JR
670 goraidtab=1
671 golvm=0
672 rc=0
673 if [ -x /sbin/mdadm -a -f /etc/mdadm.conf ]; then
674 if (grep -qE "^([[:blank:]]|)ARRAY[[:blank:]]" /etc/mdadm.conf 2>/dev/null); then
0fe527f8 675 run_cmd "Starting up RAID devices" /sbin/mdadm --assemble --scan --auto=yes
5e6dfc29
JR
676 rc=$?
677 [ "$rc" -eq 0 ] && goraidtab=0 && golvm=1
cc10e704 678 fi
5e6dfc29
JR
679 fi
680
681 if [ -f /etc/raidtab -a "$goraidtab" -eq 1 ]; then
49c61c56 682 for i in $(awk '!/^#/ && /raiddev/{print $2}' /etc/raidtab 2>/dev/null); do
5e6dfc29
JR
683 golvm=1
684 RAIDDEV=$(basename $i)
685 RAIDSTAT=$(grep "^$RAIDDEV : active" /proc/mdstat 2>/dev/null)
686 show "Starting up RAID device %s" $RAIDDEV
687 busy
688 if [ -z "$RAIDSTAT" ]; then
689 # Try raidstart first...if that fails then
690 # fall back to raid0run and if that fails too
691 # fall back to raidadd, raidrun.
692 RESULT=1
693 if [ -x /sbin/raidstart ]; then
694 /sbin/raidstart $i
695 RESULT=$?
696 fi
697 if [ $RESULT -gt 0 -a -x /sbin/raid0run ]; then
698 /sbin/raid0run $i
699 RESULT=$?
700 fi
701 if [ $RESULT -gt 0 -a -x /sbin/raidadd -a -x /sbin/raidrun ]; then
702 /sbin/raidadd $i
703 /sbin/raidrun $i
704 RESULT=$?
705 fi
706 if [ $RESULT -gt 0 ]; then
707 rc=1
708 fail
709 else
710 ok
711 fi
712 else
713 ok
714 fi
715 done
716 fi
717
718 # A non-zero return means there were problems
719 if [ $rc -gt 0 ]; then
720 [ -e /proc/splash ] && echo "verbose" > /proc/splash
721 show "Starting up RAID devices"; fail
722 echo
723 echo
724 nls "*** An error occurred during the RAID startup."
725 nls "*** Dropping you to a shell; the system will reboot"
726 nls "*** when you leave the shell."
727 echo
728
729 PS1="$(nls '(RAID Repair)# ')"; export PS1
730 [ "$SELINUX" = "1" ] && disable_selinux
277e5f53 731 if ! is_no "$RUN_SULOGIN_ON_ERR"; then
5e6dfc29 732 /sbin/sulogin
cc10e704 733 else
5e6dfc29 734 /bin/sh
cc10e704 735 fi
12de71be 736
5e6dfc29
JR
737 run_cmd "Unmounting file systems" umount -a
738 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
739 run_cmd "Automatic reboot in progress" reboot
cc10e704 740 fi
5e6dfc29
JR
741 # LVM on RAID (keep in sync with LVM setting few lines above)
742 if [ "$golvm" -eq "1" ]; then
743 if is_yes "$EVMS_LVM" || [ -x /sbin/vgscan -a -x /sbin/vgchange ]; then
2607b4f4 744 run_cmd "Scanning for LVM volume groups (on RAID)" /sbin/vgscan $lvmignorelock
5e6dfc29 745 run_cmd "Activating LVM volume groups (on RAID)" /sbin/vgchange -a y $lvmignorelock
2607b4f4 746 [ "$lvmversion" = "2" ] && /sbin/vgmknodes
5e6dfc29 747 fi
cc10e704 748 fi
5e6dfc29 749 show "Starting up RAID devices"; ok
2619a5cf 750 fi
12de71be 751 fi
7742e157 752
cc10e704
JR
753 _RUN_QUOTACHECK=0
754 # Check filesystems
07ea1da7 755 if [ -z "$fastboot" ] && ! strstr "$cmdline" nofsck; then
cc10e704
JR
756 rc_splash "fsck start"
757 show "Checking filesystems"; started
790968dd 758 initlog -c "fsck -C -T -R -A -a -P $fsckoptions"
cc10e704
JR
759
760 rc=$?
761
762 # A return of 2 or higher means there were serious problems
763 if [ $rc -gt 1 ]; then
764 [ -e /proc/splash ] && echo "verbose" > /proc/splash
765 echo
766 echo
767 nls "*** An error occurred during the file system check."
768 nls "*** Dropping you to a shell; the system will reboot"
769 nls "*** when you leave the shell."
770 echo
771
772 PS1="$(nls '(Repair filesystem)# ')"; export PS1
773 [ "$SELINUX" = "1" ] && disable_selinux
277e5f53 774 if ! is_no "$RUN_SULOGIN_ON_ERR"; then
cc10e704
JR
775 /sbin/sulogin
776 else
777 /bin/sh
778 fi
7742e157 779
cc10e704
JR
780 run_cmd "Unmounting file systems" umount -a
781 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
782 run_cmd "Automatic reboot in progress" reboot
783 elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
784 _RUN_QUOTACHECK=1
785 fi
786 rc_splash "fsck stop"
7742e157 787 fi
7742e157 788
cc10e704
JR
789 # Mount all other filesystems (except for NFS and /proc, which is already
790 # mounted). Contrary to standard usage,
791 # filesystems are NOT unmounted in single user mode.
792
438bf720 793 run_cmd "Mounting local filesystems" mount -a -t nonfs,nfs4,smbfs,ncpfs,proc,cifs -O no_netdev
cc10e704 794
9a0a016d
ER
795 # now we have /usr mounted, recheck if we have gettext and tput available.
796 if is_no "$TPUT"; then
797 GETTEXT=
348aacfc 798 TPUT=
04342743 799 rc_gettext_init
9a0a016d
ER
800 fi
801
cc10e704
JR
802 # Now do some workaround - encrypted filesystems couldn't have been fsck-ed
803 # before mount - that's where the password is entered.
804 # mount is buggy - when remounting loopback filesystem, loop=XXX
805 # option is removed from /etc/mtab
806 if [ -z "$fastboot" ] && grep "^[^#].*encryption=" /etc/fstab 2>/dev/null | grep -v -q "noauto" 2>/dev/null; then
807 show "Checking encrypted filesystems"; started
fea9b6da 808 LOOPLIST="$(LC_ALL=C awk '
cc10e704
JR
809 FILENAME=="/proc/mounts" {
810 TAB[$2]=$1;
811 }
812 FILENAME=="/etc/fstab" && /encryption=/ && ! /noauto/ && /[^a-zA-Z_]ro[^a-zA-Z_]/ {
813 if ($2 in TAB){print TAB[$2];}
814 }
815 FILENAME=="/etc/fstab" && /encryption=/ && ! /noauto/ && ! /[^a-zA-Z_]ro[^a-zA-Z_]/ {
816 if ($2 in TAB){print TAB[$2];}
817 sub("loop(=[^,]*)?","loop=" TAB[$2] ",ro",$4);
818 cmd="mount " $2 " -o remount," $4;
819 system(cmd);
820 }
821 ' /proc/mounts /etc/fstab)"
822 initlog -c "fsck -T -C -a $fsckoptions $LOOPLIST"
823 rc=$?
824
825 # A return of 2 or higher means there were serious problems.
826 if [ $rc -gt 1 ]; then
827 [ -e /proc/splash ] && echo "verbose" > /proc/splash
828 echo
829 echo
830 nls "*** An error occurred during the file system check."
831 nls "*** Dropping you to a shell; the system will reboot"
832 nls "*** when you leave the shell."
833 echo
834
bf14fcab 835 PS1="$(nls '(Repair filesystem)# ')"; export PS1
cc10e704 836 [ "$SELINUX" = "1" ] && disable_selinux
277e5f53 837 if ! is_no "$RUN_SULOGIN_ON_ERR"; then
cc10e704
JR
838 /sbin/sulogin
839 else
840 /bin/sh
841 fi
6fa97a5d 842
cc10e704
JR
843 run_cmd "Unmounting file systems" umount -a
844 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
845 run_cmd "Automatic reboot in progress" reboot
846 elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
847 _RUN_QUOTACHECK=1
848 fi
5e6dfc29 849
cc10e704
JR
850 show "Remounting encrypted filesystems back in rw mode"; busy
851 awk '
852 FILENAME=="/proc/mounts" {
853 TAB[$2]=$1;
854 }
855 FILENAME=="/etc/fstab" && /encryption=/ && ! /noauto/ && ! /[^a-zA-Z_]ro[^a-zA-Z_]/ {
856 sub("loop(=[^,]*)?","loop=" TAB[$2] ",rw",$4);
857 cmd="mount " $2 " -o remount," $4;
858 system(cmd);
859 }
860 ' /proc/mounts /etc/fstab
861 ok
862 fi
6e16ab8f 863
9a0a016d 864 # /var/log should be writable now, so start saving the boot output
652dbae5
ER
865 if [ "$RC_BOOTLOG" ]; then
866 echo > /var/log/boot.msg
867 killall -IO blogd
868 fi
cb4d1aa7 869
1aaf8c92
JR
870 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
871 run_cmd "Checking filesystem quotas" /sbin/quotacheck -vnugRa
872 fi
cb4d1aa7 873
1aaf8c92
JR
874 # Turn on quota
875 if [ -x /sbin/quotaon ]; then
876 run_cmd "Turning on quotas for local filesystems" /sbin/quotaon -aug
877 fi
677fdd75 878
1aaf8c92
JR
879 # Turn on process accounting
880 if [ -x /etc/rc.d/rc.acct ]; then
881 /etc/rc.d/rc.acct start
882 fi
cb4d1aa7 883
cc10e704 884 # Set the clock if timezone definition wasn't available (eg. /usr not mounted)
bc05b297 885 if is_yes "$TIME_SETUP_DELAYED" && [ -e /dev/rtc ]; then
cc10e704
JR
886 if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
887 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
888 fi
0bbfed6f 889 fi
0bbfed6f 890
cc10e704
JR
891 # Initialize the serial ports
892 if [ -f /etc/rc.d/rc.serial ]; then
893 . /etc/rc.d/rc.serial
894 fi
201c98b9 895
277e5f53 896 if [ -f /proc/sys/kernel/panic -a -n "$PANIC_REBOOT_TIME" -a "$PANIC_REBOOT_TIME" -gt "0" ]; then
cc10e704
JR
897 show 'Setting %s seconds for kernel reboot after panic' "$PANIC_REBOOT_TIME"; busy
898 if (sysctl -w kernel.panic=$PANIC_REBOOT_TIME >/dev/null 2>&1); then ok; else fail; fi
899 fi
201c98b9 900
cc10e704
JR
901 # ... and here finish configuring parameters
902 /sbin/sysctl -e -p /etc/sysctl.conf > /dev/null 2>&1
ef05209d 903else
fea9b6da 904 # /var/log should be writable now, so start saving the boot output
652dbae5
ER
905 if [ "$RC_BOOTLOG" ]; then
906 echo > /var/log/boot.msg
907 killall -IO blogd
908 fi
909
ef05209d 910 clean_vserver_mtab
cc10e704 911fi
adec827a 912
652dbae5 913
1aaf8c92
JR
914[ -n "$SELINUX" ] && [ -f /.autorelabel ] && relabel_selinux
915
6239bd5c 916# Clean up /.
cb4d1aa7
JR
917rm -f /fastboot /fsckoptions /forcefsck /halt /poweroff
918
919# Clean up /var
5145ce41 920# /usr could be still not mounted if it is on NFS.
cb4d1aa7 921for afile in /var/lock/* /var/run/*; do
fea9b6da 922 bafile=${afile##*/}
cb4d1aa7 923 if [ -d "$afile" ]; then
38b419e3 924 case $bafile in
fea9b6da
ER
925 news|sudo|mon|cvs)
926 ;;
927 *)
91dc9337 928 echo $afile/* | xargs rm -rf
fea9b6da 929 ;;
38b419e3 930 esac
cb4d1aa7 931 else
5e6dfc29 932 [ "$bafile" != "hwprofile" ] && rm -f $afile 2> /dev/null
cb4d1aa7
JR
933 fi
934done
5145ce41 935
e0cba078 936# Delete stale files
4eb58d70
AM
937rm -f /var/lib/rpm/__db* /var/spool/postoffice/.pid.* /tmp/.X*-lock \
938 /tmp/.lock.* /tmp/.gdm_socket /tmp/.s.PGSQL.*
939rm -rf /tmp/.X*-unix /tmp/.ICE-unix /tmp/.font-unix /tmp/hsperfdata_* \
5e6dfc29
JR
940 /tmp/kde-* /tmp/ksocket-* /tmp/mc-* /tmp/mcop-* /tmp/orbit-* \
941 /tmp/scrollkeeper-* /tmp/ssh-*
45955ed4 942
201c98b9 943{
6b4a354c 944# Clean up utmp/wtmp
fea9b6da 945if ! is_no "$NEED_XFILES"; then
6b4a354c
AM
946 :>/var/run/utmpx
947 touch /var/log/wtmpx
afa9b748 948 chown root:utmp /var/run/utmpx /var/log/wtmpx
19b0557d 949 chmod 0664 /var/run/utmpx /var/log/wtmpx
054a52c9
JR
950else
951 :>/var/run/utmp
952 touch /var/log/wtmp
afa9b748 953 chown root:utmp /var/run/utmp /var/log/wtmp
19b0557d 954 chmod 0664 /var/run/utmp /var/log/wtmp
6b4a354c 955fi
7e04fe0e 956
7e04fe0e 957# Clean /tmp
fcf89189 958if is_yes "$CLEAN_TMP"; then
fea9b6da 959 # XXX LC_ALL needed here
cb4d1aa7 960 rm -rf /tmp/* /tmp/.[a-zA-Z0-9]*
7e04fe0e 961fi
7742e157 962
e6c8dd44
AM
963# System protected dirs
964mkdir -m 1777 -p /tmp/.ICE-unix > /dev/null 2>&1
965chown root:root /tmp/.ICE-unix
677fdd75 966[ -n "$SELINUX" ] && restorecon /tmp/.ICE-unix >/dev/null 2>&1
e6c8dd44 967
1aaf8c92 968if ! is_yes "$VSERVER"; then
fea9b6da 969 run_cmd "Enabling swap space" /bin/true
1aaf8c92
JR
970 # Right, now turn on swap in case we swap to files
971 swapon -a >/dev/null 2>&1
7742e157 972
0d60cc3e
JR
973 # If a SCSI tape has been detected, load the st module unconditionally
974 # since many SCSI tapes don't deal well with st being loaded and unloaded
975 if [ -f /proc/scsi/scsi ] && grep -q 'Type: Sequential-Access' /proc/scsi/scsi 2>/dev/null ; then
976 if grep -qv ' 9 st' /proc/devices 2>/dev/null; then
977 if [ -n "$USEMODULES" ] ; then
978 # Try to load the module. If it fails, ignore it...
979 insmod -p st >/dev/null 2>&1 && modprobe -s st >/dev/null 2>&1
980 fi
7742e157
AF
981 fi
982 fi
7742e157 983
cc10e704
JR
984 # Now that we have all of our basic modules loaded and the kernel going,
985 # let's dump the syslog ring somewhere so we can find it later
c8f4b766 986 dmesg > /var/log/dmesg
cc10e704
JR
987 i=5
988 while [ $i -ge 0 ]; do
989 if [ -f /var/log/dmesg.$i ]; then
5e6dfc29
JR
990 chmod 0600 /var/log/dmesg.$i
991 mv -f /var/log/dmesg.$i /var/log/dmesg.$(($i+1))
cc10e704
JR
992 fi
993 i=$(($i-1))
994 done
995 cp -f /var/log/dmesg /var/log/dmesg.0
996 chmod 0600 /var/log/dmesg /var/log/dmesg.0
997fi
7742e157 998
de1fc6ce 999kill -TERM $(/sbin/pidof getkey) >/dev/null 2>&1
6b4a354c 1000} &
385dc542
ER
1001
1002# extra check if the background process we just spawned is still running,
1003# as in case of vserver bootup it finishes quite instantly.
1004if ! is_no "$RC_PROMPT" && [ -d /proc/$! ]; then
7c341db5 1005 /sbin/getkey -c 5 i && touch /var/run/confirm
6b4a354c
AM
1006fi
1007wait
de1fc6ce 1008echo
This page took 0.286564 seconds and 4 git commands to generate.