]> git.pld-linux.org Git - projects/rc-scripts.git/blob - rc.d/rc.sysinit
- merge my private tree
[projects/rc-scripts.git] / rc.d / rc.sysinit
1 #!/bin/sh
2 #
3 # /etc/rc.d/rc.sysinit - run once at boot time
4 # $Id: rc.sysinit,v 1.69.2.11 2001/09/30 10:19:36 misiek Exp $
5 #
6 # Taken in part from Miquel van Smoorenburg's bcheckrc.
7 # Changes:      Arkadiusz Mi¶kiewicz <misiek@pld.org.pl>
8 #
9
10 # Rerun ourselves through initlog
11 if [ -z "$IN_INITLOG" ]; then
12         [ -f /sbin/initlog ] && exec /sbin/initlog -r /etc/rc.d/rc.sysinit
13 fi
14  
15 # Set the path
16 PATH=/bin:/sbin:/usr/bin:/usr/sbin
17 export PATH
18
19 # we need /proc mounted before everything
20 mount -n -o gid=17 -t proc /proc /proc
21
22 # Choose Hardware profile
23 rm -f /var/run/hwprofile 2> /dev/null
24 if [ -f /etc/sysconfig/hwprof ]; then
25     . /etc/sysconfig/hwprof
26     if is_yes "${HWPROFILES}" && [ -x /sbin/hwprofile -a -d /etc/sysconfig/hwprofiles/data ]; then
27         mount -n / -o rw,remount
28         /sbin/hwprofile -qf
29         mount -n / -o ro,remount
30     fi
31 fi
32
33 # NLS
34 if [ -r /etc/sysconfig/i18n ]; then
35         . /etc/sysconfig/i18n
36         [ -n "$LANG" ] && export LANG || unset LANG
37         [ -n "$LC_CTYPE" ] && export LC_CTYPE || unset LC_CTYPE
38         [ -n "$LC_COLLATE" ] && export LC_COLLATE || unset LC_COLLATE
39         [ -n "$LC_MESSAGES" ] && export LC_MESSAGES || unset LC_MESSAGES
40         [ -n "$LC_NUMERIC" ] && export LC_NUMERIC || unset LC_NUMERIC
41         [ -n "$LC_MONETARY" ] && export LC_MONETARY || unset LC_MONETARY
42         [ -n "$LC_TIME" ] && export LC_TIME || unset LC_TIME
43         [ -n "$LC_ALL" ] && export LC_ALL || unset LC_ALL
44         [ -n "$LANGUAGE" ] && export LANGUAGE || unset LANGUAGE
45         [ -n "$LINGUAS" ] && export LINGUAS || unset LINGUAS
46 fi
47
48 # Read functions
49 . /etc/rc.d/init.d/functions
50
51 # Read network config data.
52 if [ -r /etc/sysconfig/network ]; then
53         . /etc/sysconfig/network
54 else
55         NETWORKING=no
56         HOSTNAME=localhost
57 fi
58
59 # Read system config data.
60 if [ -r /etc/sysconfig/system ]; then
61         . /etc/sysconfig/system
62 else
63         RUN_SULOGIN_ON_ERR=yes
64         RUN_USERPNP=yes
65         RUN_KERNELPNP=yes
66         PANIC_REBOOT_TIME=0
67         DELAY_LOGIN=yes
68         CLEAN_TMP=no
69         CONSOLE_LOGLEVEL=1
70         LOAD_SOUND=yes
71         SET_SLINKS=yes
72         RUN_LDCONFIG=yes
73 fi
74
75 # Print welcome message
76 nls "\t\t\t%sPowered by %sPLD GNU/Linux%s" "$(termput setaf 6)" "$(termput setaf 2)" "$(termput setaf 7)"
77 if is_yes "$PROMPT"; then
78         nls -n "\t\t     Press %sI%s to enter interactive startup." "$(termput setaf 1)" "$(termput setaf 7)"
79         echo
80         sleep 1
81 fi
82
83 # /dev must be also mounted before everything but only if we want use them ;-)
84 if is_yes "$MOUNT_DEVFS"; then
85     run_cmd "Mounting Device Filesystem" mount -n -t devfs /dev /dev
86 fi
87
88 # set up devfsd
89 if [ -c /dev/.devfsd -a -x /sbin/devfsd ]; then
90         run_cmd "Starting Device Filesystem Daemon" /sbin/devfsd /dev
91 fi
92
93 # Set console loglevel
94 /bin/dmesg -n $CONSOLE_LOGLEVEL
95
96 # Configure Linux kernel
97 run_cmd "Configuring kernel parameters" /sbin/sysctl -p /etc/sysctl.conf
98
99 # Set the system clock.
100 ARC=0
101 SRM=0
102 UTC=0
103
104 if [ -f /etc/sysconfig/clock ]; then
105    . /etc/sysconfig/clock
106
107    # convert old style clock config to new values
108    if [ "${CLOCKMODE}" = "GMT" ]; then
109       UTC=true
110    elif [ "${CLOCKMODE}" = "ARC" ]; then
111       ARC=true
112    fi
113 fi
114
115 if grep "system serial" /proc/cpuinfo | grep -q MILO ; then
116    ARC=true
117 fi
118
119 CLOCKDEF=""
120 CLOCKFLAGS="--hctosys"
121
122 if is_yes "${UTC}"; then
123     CLOCKFLAGS="${CLOCKFLAGS} --utc";
124     CLOCKDEF="${CLOCKDEF} (utc)";
125 else
126     CLOCKFLAGS="${CLOCKFLAGS} --localtime";
127     CLOCKDEF="${CLOCKDEF} (local)";
128 fi
129
130 if is_yes "${ARC}"; then
131         CLOCKFLAGS="${CLOCKFLAGS} -A";
132         CLOCKDEF="${CLOCKDEF} (arc)";
133 fi
134
135 if is_yes "${SRM}"; then
136         CLOCKFLAGS="${CLOCKFLAGS} -S";
137         CLOCKDEF="${CLOCKDEF} (srm)";
138 fi
139
140 # Check if timezone definition is available
141 if [ -e /etc/localtime ] ; then
142         if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
143                 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
144         fi
145 else
146         TIME_SETUP_DELAYED=yes
147 fi
148
149 # Start up swapping.
150 run_cmd "Activating swap partitions" swapon -a
151
152 # Set the hostname.
153 run_cmd "$(nls 'Host:') ${HOSTNAME}" hostname ${HOSTNAME}
154
155 # Set the NIS domain name
156 if [ -n "$NISDOMAIN" ]; then
157         run_cmd "$(nls 'NIS Domain:') ${NISDOMAIN}" domainname $NISDOMAIN
158 else
159         domainname ""
160 fi
161
162 # Initialize USB controller and HID devices
163 usb=0
164 if ! grep -iq "nousb" /proc/cmdline 2>/dev/null && ! grep -q "usb" /proc/devices 2>/dev/null ; then
165     aliases=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+usb-controller" | awk '{ print $3 }')
166     if [ -n "$aliases" -a "$aliases" != "off" ] ; then
167       /sbin/modprobe -k usbcore
168       run_cmd "Mounting USB filesystem" mount -t usbdevfs usbdevfs /proc/bus/usb
169       for alias in $aliases ; do 
170         run_cmd "$(nls 'Initializing USB controller') ($alias)" /sbin/modprobe $alias
171       done
172       [ $? -eq 0 -a -n "$aliases" ] && usb=1
173     fi
174 fi
175
176 if ! grep -iq "nousb" /proc/cmdline 2>/dev/null && grep -q "usb" /proc/devices 2>/dev/null ; then
177   usb=1
178 fi
179
180 needusbstorage=
181 if [ $usb = "1" ]; then
182     sleep 5
183     mouseoutput=$(cat /proc/bus/usb/devices 2>/dev/null|grep -E "^I.*Cls=03.*Prot=02")
184     kbdoutput=$(cat /proc/bus/usb/devices 2>/dev/null|grep -E "^I.*Cls=03.*Prot=01")
185     needusbstorage=$(cat /proc/bus/usb/devices 2>/dev/null|grep -e "^I.*Cls=08")
186     if [ -n "$kbdoutput" ] || [ -n "$mouseoutput" ]; then
187         run_cmd "Initializing USB HID interface" /sbin/modprobe hid 2> /dev/null
188     fi
189     if [ -n "$kbdoutput" ]; then
190         run_cmd "Initializing USB keyboard" /sbin/modprobe keybdev
191     fi
192     if [ -n "$mouseoutput" ]; then
193         run_cmd "Initializing USB mouse" /sbin/modprobe mousedev
194     fi
195 fi
196
197 if [ -f /fastboot ] || grep -iq "fastboot" /proc/cmdline 2> /dev/null ; then
198         fastboot=yes
199 else
200         fastboot=
201 fi
202
203 if [ -f /fsckoptions ]; then
204         fsckoptions=$(cat /fsckoptions)
205 else
206         fsckoptions=''
207 fi
208
209 if [ -f /forcefsck ]; then
210         fsckoptions="-f $fsckoptions"
211 fi
212
213 if is_yes "$COLOR_INIT"; then
214         fsckoptions="-C $fsckoptions"
215 else
216         fsckoptions="-V $fsckoptions"
217 fi
218
219 _RUN_QUOTACHECK=0
220 _ROOTFS_TYPE=$(grep " / " /proc/mounts | awk '{ print $3 }')
221
222 if [ -z "$fastboot" -a "$_ROOTFS_TYPE" != "nfs" -a "$_ROOTFS_TYPE" != "romfs" ]; then 
223             show "Checking root filesystems."; started
224             initlog -c "fsck -T -a $fsckoptions /"
225
226             rc=$?
227
228             # A return of 2 or higher means there were serious problems.
229             if [ $rc -gt 1 ]; then
230                     # don't use '\n' in nls macro !
231                     echo
232                     echo
233                     nls "*** An error occurred during the file system check."
234                     nls "*** Dropping you to a shell; the system will reboot"
235                     nls "*** when you leave the shell."
236                     echo
237
238                     PS1="$(nls '(Repair filesystem)# ')"; export PS1
239                     if is_yes "$RUN_SULOGIN_ON_ERR"; then
240                             sulogin
241                     else
242                             /bin/sh
243                     fi
244
245                     run_cmd "Unmounting file systems" umount -a
246                     mount -n -o remount,ro /
247                     run_cmd "Automatic reboot in progress." reboot
248             elif [ "$rc" = "1" ]; then
249                     _RUN_QUOTACHECK=1
250             fi
251 fi
252
253 # check for arguments 
254 if grep -iq nopnp /proc/cmdline; then
255         PNP=
256 else
257         PNP=yes
258 fi
259
260 # set up pnp and kernel pnp
261 if [ -n "$PNP" ]; then
262     if is_yes "$RUN_USERPNP" && [ -x /sbin/isapnp -a -f /etc/isapnp/isapnp.conf ]; then
263         run_cmd "Setting up ISA PNP devices (userspace pnp)" /sbin/isapnp /etc/isapnp/isapnp.conf
264     fi
265     if is_yes "$RUN_KERNELPNP"; then
266         /sbin/modprobe -k isa-pnp 2> /dev/null
267         if [ -e /proc/isapnp -a -f /etc/isapnp/isapnp-kernel.conf ]; then
268             show "Setting up ISA PNP devices (kernelspace pnp)"; busy
269             grep -v "^#" /etc/isapnp/isapnp-kernel.conf > /proc/isapnp && (deltext; ok) || (deltext; fail)
270         fi
271     fi
272 fi
273
274 # Remount the root filesystem read-write.
275 run_cmd "Remounting root filesystem in rw mode" mount -n -o remount,rw /
276
277 # Find and activate volume groups
278 if [ -e /proc/lvm -a -x /sbin/vgscan -a -x /sbin/vgchange -a -e /etc/lvmtab ]; then
279         run_cmd "Scanning for LVM volume groups" /sbin/vgscan && \
280         run_cmd "Activating LVM volume groups" /sbin/vgchange -a y
281 fi
282
283 # Clear mtab
284 >/etc/mtab
285
286 # Remove stale backups
287 rm -f /etc/mtab~ /etc/mtab~~
288
289 # Enter root, /proc and (potentially) /proc/bus/usb and devfs into mtab.
290 mount -f /
291 mount -f /proc
292 [ -f /proc/bus/usb/devices ] && mount -f -t usbdevfs usbdevfs /proc/bus/usb
293 [ -e /dev/.devfsd ] && mount -f -t devfs devfs /dev 
294
295 # Setup hdparm thing (if exists and is needed)
296 if ! grep -iq nohdparm /proc/cmdline; then
297         [ -x /etc/rc.d/rc.hdparm ] && /etc/rc.d/rc.hdparm
298 fi
299
300 # Update quotas if fsck was run on /.
301 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
302         if [ -x /sbin/convertquota ]; then
303             if [ -f /quota.user ]; then
304                 /sbin/convertquota -u / && rm -f /quota.user
305             fi
306             if [ -f /quota.group ]; then
307                 /sbin/convertquota -g / && rm -f /quota.group
308             fi
309         fi
310         run_cmd "Checking root filesystem quotas"  /sbin/quotacheck -v /
311 fi
312
313 # /etc/nologin when starting system
314 [ -f /etc/nologin.boot ] && rm -f /etc/nologin /etc/nologin.boot
315
316 if is_yes "$DELAY_LOGIN" && [ ! -f /etc/nologin ]; then
317         show "Enabling Delay Login"; busy
318         echo > /etc/nologin
319         nls "System bootup in progress  - please wait" >> /etc/nologin
320         echo >> /etc/nologin
321         chmod 644 /etc/nologin
322         cp -fp /etc/nologin /etc/nologin.boot
323         ok
324 fi
325
326 # The root filesystem is now read-write, so we can now log via
327 # syslog() directly..
328 if [ -n "$IN_INITLOG" ]; then
329     IN_INITLOG=
330 fi
331     
332 if [ ! -f /proc/modules ]; then
333         USEMODULES=
334 elif ! grep -iq nomodules /proc/cmdline; then
335         USEMODULES=y
336 else
337         USEMODULES=
338 fi
339
340 # Adjust symlinks as necessary in /boot to keep system services from
341 # spewing messages about mismatched System maps and so on.
342 if is_yes "$SET_SLINKS"; then
343     if [ -L /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
344         ln -s -f System.map-`uname -r` /boot/System.map
345     fi
346     if [ ! -e /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
347         ln -s -f System.map-`uname -r` /boot/System.map
348     fi
349 fi
350
351 # Run depmod if RUN_DEPMOD != "no" and:
352 #  a) user requested or RUN_DEPMOD="";
353 #  b) modules.dep is missing
354 #  c) modules.dep is older than /etc/modules.conf or /lib/modules/$mver
355 _RUN_DEPMOD=0
356 if ! is_no "$RUN_DEPMOD" && [ -n "$USEMODULES" ]; then
357   is_yes "$RUN_DEPMOD" && _RUN_DEPMOD=1
358   [ "$RUN_DEPMOD" = "ifmissing" -a ! -r /lib/modules/$mver/modules.dep ] && _RUN_DEPMOD=1
359   [ /lib/modules/$mver/modules.dep -ot /etc/modules.conf ] && _RUN_DEPMOD=1
360   [ /lib/modules/$mver/modules.dep -ot /lib/modules/$mver ] && _RUN_DEPMOD=1
361 fi
362
363 if [ "$_RUN_DEPMOD" = "1" ]; then
364     run_cmd "Finding module dependencies" depmod -a
365 fi
366
367 # Load sound modules iff they need persistent DMA buffers
368 if grep -q "options sound dmabuf=1" /etc/modules.conf 2>/dev/null ; then
369   RETURN=0
370   alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound[[:space:]]+" | awk '{ print $3 }')
371   if [ -n "$alias" -a "$alias" != "off" ] ; then
372       run_cmd "$(nls 'Loading sound module') ($alias)" /sbin/modprobe -k $alias
373       RETURN=$?
374   fi
375   alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound-slot-0[[:space:]]+" | awk '{ print $3 }')
376   if [ -n "$alias" -a "$alias" != "off" ] ; then
377       run_cmd "$(nls 'Loading sound module') ($alias)" /sbin/modprobe -k $alias
378       RETURN=$?
379   fi
380 fi
381
382 if [ -f /proc/sys/kernel/modprobe ]; then
383         if [ -n "$USEMODULES" ]; then
384                 sysctl -w kernel.modprobe="/sbin/modprobe" >/dev/null 2>&1
385                 sysctl -w kernel.hotplug="/sbin/hotplug" >/dev/null 2>&1
386         else
387                 # We used to set this to NULL, but that causes
388                 # 'failed to exec' messages"
389                 sysctl -w kernel.modprobe="/bin/true" >/dev/null 2>&1
390                 sysctl -w kernel.hotplug="/bin/true" >/dev/null 2>&1
391         fi
392 fi
393
394 # Load modules
395 if [ -x /etc/rc.d/rc.modules ]; then
396         /etc/rc.d/rc.modules
397 fi
398
399 # Add raid devices
400 if [ ! -f /proc/mdstat ]; then
401         modprobe -s md >/dev/null 2>&1
402 fi      
403         
404 # Add raid devices
405 if [ -f /proc/mdstat -a -f /etc/raidtab ]; then
406
407         rc=0
408         
409         for i in $(grep -v "^#" /etc/raidtab | grep "raiddev" | awk '{print $2}')
410         do
411                 RAIDDEV=$(basename $i)
412                 RAIDSTAT=$(grep "^$RAIDDEV : active" /proc/mdstat)
413                 show "Starting up RAID device %s" $RAIDDEV
414                 busy
415                 if [ -z "$RAIDSTAT" ]; then
416                         # Try raidstart first...if that fails then
417                         # fall back to raid0run and if that fails, too
418                         # fall back to raidadd, raidrun.
419                         RESULT=1
420                         if [ -x /sbin/raidstart ]; then
421                                 /sbin/raidstart $i
422                                 RESULT=$?
423                         fi
424                         if [ $RESULT -gt 0 -a -x /sbin/raid0run ]; then
425                                 /sbin/raid0run $i
426                                 RESULT=$?
427                         fi
428                         if [ $RESULT -gt 0 -a -x /sbin/raidadd -a -x /sbin/raidrun ]; then
429                                 /sbin/raidadd $i
430                                 /sbin/raidrun $i
431                                 RESULT=$?
432                         fi
433                         if [ $RESULT -gt 0 ]; then
434                                 rc=1
435                                 fail
436                         else
437                                 ok
438                         fi
439                 else
440                         ok
441                 fi
442         done
443
444         # A non-zero return means there were problems.
445         if [ $rc -gt 0 ]; then
446                 show "Starting up RAID devices."; fail
447                 echo
448                 echo
449                 nls "*** An error occurred during the RAID startup"
450                 nls "*** Dropping you to a shell; the system will reboot"
451                 nls "*** when you leave the shell."
452                 echo
453
454                 PS1="$(nls '(RAID Repair)# ')"; export PS1
455                 if is_yes "$RUN_SULOGIN_ON_ERR"; then
456                         sulogin
457                 else
458                         /bin/sh
459                 fi
460
461                 run_cmd "Unmounting file systems" umount -a
462                 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
463                 run_cmd "Automatic reboot in progress" reboot
464         fi
465         show "Starting up RAID devices."; ok
466 fi
467
468 _RUN_QUOTACHECK=0
469 # Check filesystems
470 if [ -z "$fastboot" ] && ! grep -q nofsck /proc/cmdline; then
471         show "Checking filesystems"; started
472         initlog -c "fsck -T -R -A -a $fsckoptions"
473
474         rc=$?
475
476         # A return of 2 or higher means there were serious problems.
477         if [ $rc -gt 1 ]; then
478                 echo
479                 echo
480                 nls "*** An error occurred during the file system check."
481                 nls "*** Dropping you to a shell; the system will reboot"
482                 nls "*** when you leave the shell."
483                 echo
484
485                 PS1="$(nls '(Repair filesystem)# ')"; export PS1
486                 if is_yes "$RUN_SULOGIN_ON_ERR"; then
487                         sulogin
488                 else
489                         /bin/sh
490                 fi
491
492                 run_cmd "Unmounting file systems" umount -a
493                 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
494                 run_cmd "Automatic reboot in progress." reboot
495         elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
496                 _RUN_QUOTACHECK=1
497         fi
498 fi
499
500 # Mount all other filesystems (except for NFS and /proc, which is already
501 # mounted). Contrary to standard usage,
502 # filesystems are NOT unmounted in single user mode.
503 run_cmd "Mounting local filesystems." mount -a -t nonfs,smbfs,ncpfs
504
505 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
506         if [ -x /sbin/convertquota ]; then
507             # try to convert old quotas
508             for mountpt in $(cat /etc/mtab | awk '$4 ~ /quota/{print $2}'); do
509                 if [ -f "$mountpt/quota.user" ]; then
510                     /sbin/convertquota -u $mountpt && \
511                         rm -f $mountpt/quota.user
512                 fi
513                 if [ -f "$mountpt/quota.group" ]; then
514                     /sbin/convertquota -g $mountpt && \
515                         rm -f $mountpt/quota.group
516                 fi
517             done
518         fi
519         run_cmd "Checking filesystem quotas"  /sbin/quotacheck -v -R -a
520 fi
521
522 # Turn on quota
523 if [ -x /sbin/quotaon ]; then
524     run_cmd "Turning on user and group quotas for local filesystems" /sbin/quotaon -a
525 fi
526
527 # Turn on process accounting
528 if [ -x /sbin/accton ] ; then
529         run_cmd "Turning on process accounting" /sbin/accton /var/log/pacct
530 fi
531
532 # Set the clock if timezone definition wasn't available (eg. /usr not mounted)
533 if is_yes "$TIME_SETUP_DELAYED"; then
534         if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
535                 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
536         fi
537 fi
538
539 # Initialize the serial ports.
540 if [ -f /etc/rc.d/rc.serial ]; then
541         . /etc/rc.d/rc.serial
542 fi
543
544 if [ -f /proc/sys/kernel/panic -a "$PANIC_REBOOT_TIME" -gt "0" ]; then
545         show 'Setting %s seconds for kernel reboot after panic' "$PANIC_REBOOT_TIME"; busy
546         if (sysctl -w kernel.panic=$PANIC_REBOOT_TIME 2> /dev/null); then ok; else fail; fi
547 fi
548
549 # Clean out /etc.
550 rm -f /fastboot /fsckoptions /forcefsck /halt /poweroff
551
552 # Clean up /var
553 # I'd use find, but /usr may not be mounted.
554 for afile in /var/lock/* /var/run/*; do
555    if [ -d "$afile" ]; then
556         bafile=$(basename $afile)
557         [ "$bafile" != "news" -a "$bafile" != "sudo" -a "$bafile" != "mon" ] && rm -f $afile/*
558    else
559         rm -f $afile
560    fi
561 done
562
563 {
564 # Clean up utmp/wtmp
565 rm -f /var/run/utmp?
566 if ! is_no "$NEED_XFILES" ; then
567         :>/var/run/utmpx
568         touch /var/log/wtmpx
569         chown root.utmp /var/run/utmpx /var/log/wtmpx
570         chmod 0664 /var/run/utmpx /var/log/wtmpx
571 else
572         :>/var/run/utmp
573         touch /var/log/wtmp
574         chown root.utmp /var/run/utmp /var/log/wtmp
575         chmod 0664 /var/run/utmp /var/log/wtmp
576 fi
577
578 # Clean /tmp
579 if is_yes "$CLEAN_TMP"; then
580         rm -rf /tmp/*
581 fi
582
583 # Delete X locks
584 rm -f /tmp/.X*-lock
585
586 # Delete Postgres sockets
587 rm -f /tmp/.s.PGSQL.*
588
589 # Right, now turn on swap in case we swap to files.
590 swapon -a >/dev/null 2>&1
591 run_cmd "Enabling swap space" /bin/true
592
593 # If a SCSI tape has been detected, load the st module unconditionally
594 # since many SCSI tapes don't deal well with st being loaded and unloaded
595 if [ -f /proc/scsi/scsi ] && grep -q 'Type:   Sequential-Access' /proc/scsi/scsi 2>/dev/null ; then
596         if grep -qv ' 9 st' /proc/devices ; then
597                 if [ -n "$USEMODULES" ] ; then
598                         # Try to load the module.  If it fails, ignore it...
599                         insmod -p st >/dev/null 2>&1 && /sbin/modprobe st >/dev/null 2>&1
600                 fi
601         fi
602 fi
603
604 # Load usb storage here, to match most other things
605 if [ -n "$needusbstorage" ]; then
606         /sbin/modprobe usb-storage >/dev/null 2>&1
607 fi
608
609 # If they asked for ide-scsi, load it
610 if grep -q "ide-scsi" /proc/cmdline ; then
611         /sbin/modprobe -k ide-cd >/dev/null 2>&1
612         /sbin/modprobe -k ide-scsi >/dev/null 2>&1
613 fi
614
615 # Adjust symlinks as necessary in /boot to keep system services from
616 # spewing messages about mismatched System maps and so on.
617 if [ -L /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
618         ln -s -f System.map-`uname -r` /boot/System.map
619 fi
620 if [ ! -e /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
621         ln -s -f System.map-`uname -r` /boot/System.map
622 fi
623
624 # there could be a new kernel version.  remove old psdevtab database
625 rm -f /etc/psdevtab
626
627 # Now that we have all of our basic modules loaded and the kernel going,
628 # let's dump the syslog ring somewhere so we can find it later
629 dmesg > /var/log/dmesg
630 chmod 640 /var/log/dmesg
631 sleep 1
632
633 # Now that we have all of our basic modules loaded and the kernel going,
634 # let's dump the syslog ring somewhere so we can find it later
635 kill -TERM $(/sbin/pidof getkey) >/dev/null 2>&1
636 } &
637 if is_yes "$PROMPT"; then
638    /sbin/getkey i && touch /var/run/confirm
639 fi
640 wait
641 echo
642
643 # This must be last line !
644 # vi:syntax=sh:tw=78:ts=8:sw=4
645
This page took 0.069786 seconds and 3 git commands to generate.