source: projects/initscripts/trunk/rc.d/rc.sysinit @ 6538

Revision 6538, 19.0 KB checked in by daisuke, 12 years ago (diff)

support newer udev

Line 
1#!/bin/bash
2#
3# /etc/rc.sysinit - run once at boot time
4#
5# Taken in part from Miquel van Smoorenburg's bcheckrc.
6#
7
8# Set the path
9PATH=/bin:/sbin:/usr/bin:/usr/sbin
10export PATH
11
12HOSTNAME=`/bin/hostname`
13HOSTTYPE=`uname -m`
14KERNELRELEASE=`uname -r`
15KERNELVERSION=`echo $KERNELRELEASE | cut -f 1-2 -d.`
16
17# VLEE: make host dependent /etc
18if [ -x /etc/rc.diskless ]; then
19   echo -n "Preparing diskless setup :"
20   if /etc/rc.diskless ; then
21      echo " [  OK  ]"
22   else
23      echo " [  NG  ]"
24   fi
25elif [ -x /DLKit/etc/rc.diskless ]; then
26   echo -n "Preparing diskless setup :"
27   if /DLKit/etc/rc.diskless ; then
28      echo " [  OK  ]"
29   else
30      echo " [  NG  ]"
31   fi
32fi
33
34# Read in config data.
35if [ -f /etc/sysconfig/network ]; then
36    . /etc/sysconfig/network
37else
38    NETWORKING=no
39fi
40
41if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
42    HOSTNAME=localhost
43fi
44
45# Mount /run
46mount -n -t tmpfs none /run >/dev/null 2>&1
47# Mount /dev
48mount -n -t devtmpfs none /dev >/dev/null 2>&1
49# Mount /proc, /sys
50if [ ! -e /proc/mounts ]; then
51        mount -n -t proc /proc /proc
52        mount -n -t sysfs /sys /sys >/dev/null 2>&1
53fi
54if [ ! -d /proc/bus/usb ]; then
55        modprobe usbcore >/dev/null 2>&1 && mount -n -t usbfs /proc/bus/usb /proc/bus/usb
56else
57        mount -n -t usbfs /proc/bus/usb /proc/bus/usb
58fi
59
60# readahead
61if [ -f /.readahead_collect -a -r /etc/sysconfig/readahead ]; then
62    . /etc/sysconfig/readahead
63    if [ "x$READAHEAD_COLLECT" == "xyes" -a ! -f /forcefsck -a -x /sbin/readahead-collector ]; then
64          /sbin/readahead-collector
65    fi
66elif [ -x /sbin/readahead_early ]; then
67    /sbin/readahead_early &
68fi
69
70if [ -x /etc/rc.early.local ]; then
71    . /etc/rc.early.local
72fi
73
74# Source functions
75. /etc/init.d/functions
76
77PLYMOUTH=
78[ -x /usr/bin/plymouth ] && PLYMOUTH=yes
79
80# Print a banner. ;)
81echo -en $"\t\t\tWelcome to "
82[ "$BOOTUP" != "serial" ] && echo -en $"\\033[1;36m"
83echo -en $"Vine"
84[ "$BOOTUP" != "serial" ] && echo -en $"\\033[0;39m"
85echo $" Linux"
86if [ "$PROMPT" != "no" ]; then
87 echo -en $"\t\tPress 'I' to enter interactive startup."
88 echo
89fi
90
91# Fix console loglevel
92/bin/dmesg -n $LOGLEVEL
93
94# read /proc/cmdline once
95cmdline=$(cat /proc/cmdline)
96
97# Initialize hardware
98if [ -f /proc/sys/kernel/modprobe ]; then
99   if ! strstr "$cmdline" nomodules && [ -f /proc/modules ] ; then
100      sysctl -w kernel.modprobe="/sbin/modprobe" >/dev/null 2>&1
101   else
102      sysctl -w kernel.modprobe="/bin/true" >/dev/null 2>&1
103   fi
104fi
105
106touch /dev/.in_sysinit >/dev/null 2>&1
107
108# kill nash and start udev
109nashpid=$(pidof nash 2>/dev/null)
110[ -n "$nashpid" ] && kill $nashpid >/dev/null 2>&1
111unset nashpid
112if [ ! -f "/lxcroot" ]; then
113    /sbin/start_udev
114fi
115
116# static /dev filesystem
117if [ -x /etc/rc.MAKEDEV ]; then
118   action $"Making and Mounting /dev filesystem: " /etc/rc.d/rc.MAKEDEV
119elif [ -x /DLKit/etc/rc.MAKEDEV ]; then
120   action $"Making and Mounting /dev filesystem: " /DLKit/etc/rc.d/rc.MAKEDEV
121fi
122
123# Load user-defined modules
124for file in /etc/sysconfig/modules/*.modules ; do
125   [ -x $file ] && $file
126done
127
128# Load modules (for backward compatibility with VARs)
129if [ -f /etc/rc.modules ]; then
130        /etc/rc.modules
131fi
132
133# Unmount the initrd, if necessary
134if grep -q /initrd /proc/mounts && ! grep -q /initrd/loopfs /proc/mounts ; then
135   action $"Unmounting initrd: " umount /initrd
136   /sbin/blockdev --flushbufs /dev/ram0 >/dev/null 2>&1
137fi
138
139# load SCSI modules
140for module in `/sbin/modprobe -c | LC_ALL=C awk '/^alias[[:space:]]+scsi_hostadapter[0-9]*[[:space:]]/ { print $3 }'`
141do
142   if ( modprobe --dry-run $module 2> /dev/null ) ; then
143       action $"Loading SCSI module ($module): " /sbin/modprobe $module
144   fi
145done
146
147# Configure kernel parameters
148update_boot_stage RCkernelparam
149action $"Configuring kernel parameters: " sysctl -e -p /etc/sysctl.conf
150
151# Set the system clock.
152ARC=0
153SRM=0
154UTC=0
155
156if [ -f /etc/sysconfig/clock ]; then
157   . /etc/sysconfig/clock
158
159   # convert old style clock config to new values
160   if [ "${CLOCKMODE}" = "GMT" ]; then
161      UTC=true
162   elif [ "${CLOCKMODE}" = "ARC" ]; then
163      ARC=true
164   fi
165fi
166
167CLOCKDEF=""
168CLOCKFLAGS="$CLOCKFLAGS --hctosys"
169
170case "$UTC" in
171   yes|true)
172    CLOCKFLAGS="$CLOCKFLAGS --utc";
173    CLOCKDEF="$CLOCKDEF (utc)";
174   ;;
175   no|false)
176    CLOCKFLAGS="$CLOCKFLAGS --localtime";
177    CLOCKDEF="$CLOCKDEF (localtime)";
178   ;;
179esac
180
181case "$ARC" in
182     yes|true)
183        CLOCKFLAGS="$CLOCKFLAGS --arc";
184        CLOCKDEF="$CLOCKDEF (arc)";
185     ;;
186esac
187case "$SRM" in
188     yes|true)
189        CLOCKFLAGS="$CLOCKFLAGS --srm";
190        CLOCKDEF="$CLOCKDEF (srm)";
191     ;;
192esac
193
194/sbin/hwclock $CLOCKFLAGS
195
196action $"Setting clock $CLOCKDEF: `date`" date
197
198if [ "`/sbin/consoletype`" = "vt" ]; then
199  # Load keymap
200  if [ -x /bin/loadkeys ]; then
201    KEYTABLE=
202    KEYMAP=
203    if [ -f /etc/sysconfig/console/default.kmap ]; then
204      KEYMAP=/etc/sysconfig/console/default.kmap
205    else
206      if [ -f /etc/sysconfig/keyboard ]; then
207        . /etc/sysconfig/keyboard
208      fi
209      if [ -n "$KEYTABLE" -a -d "/lib/kbd/keymaps" ]; then
210        KEYMAP=$KEYTABLE
211      fi
212    fi
213    if [ -n "$KEYMAP" ]; then
214      # Since this takes in/output from stdin/out, we can't use initlog
215      if [ -n "$KEYTABLE" ]; then
216        echo -n $"Loading default keymap ($KEYTABLE): "
217      else
218        echo -n $"Loading default keymap: "
219      fi
220      loadkeys $KEYMAP < /dev/tty0 > /dev/tty0 2>/dev/null && \
221        success $"Loading default keymap" || failure $"Loading default keymap"
222      echo
223    fi   
224  fi
225fi
226
227# Start up swapping.
228action $"Activating swap partitions: " swapon -a -e
229
230# Set the hostname.
231update_boot_stage RChostname
232action $"Setting hostname ${HOSTNAME}: " hostname ${HOSTNAME}
233
234# Sync waiting for storage.
235{ rmmod scsi_wait_scan ; modprobe scsi_wait_scan ; rmmod scsi_wait_scan ; } >/dev/null 2>&1
236
237# Device mapper & related initialization
238if ! grep -q -F "device-mapper" /proc/devices >/dev/null 2>&1 ; then
239       modprobe dm-mod >/dev/null 2>&1
240fi
241
242[ -f /etc/mdadm.conf -a -x /sbin/mdadm ] && /sbin/mdadm -As --auto=yes --run
243
244if ! strstr "$cmdline" nompath && [ -f /etc/multipath.conf ] && [ -x /sbin/multipath ]; then
245        modprobe dm-multipath >/dev/null 2>&1
246        /sbin/multipath -v 0
247        if [ -x /sbin/kpartx ]; then
248                /sbin/dmsetup ls --target multipath --exec "/sbin/kpartx -a"
249        fi
250fi
251
252if ! strstr "$cmdline" nodmraid && [ -x /sbin/dmraid.static ]; then
253        modprobe dm-mirror > /dev/null 2>&1
254        dmraidsets=$(LC_ALL=C /sbin/dmraid -s -c -i)
255        if [ "$?" = "0" ]; then
256                for dmname in $dmraidsets; do
257                        if [[ "$dmname" == isw_* ]] && \
258                           ! strstr "$cmdline" noiswmd; then
259                                continue
260                        fi
261                        /sbin/dmraid.static -ay -i --rm_partitions -p "$dmname" >/dev/null 2>&1
262                        /sbin/kpartx -a -p p "/dev/mapper/$dmname"
263                 done
264         fi
265fi
266
267# Start any MD RAID arrays that haven't been started yet
268[ -r /proc/mdstat ] && [ -r /dev/md/md-device-map ] && /sbin/mdadm -IRs
269
270if [ -x /sbin/lvm ]; then
271        action $"Setting up Logical Volume Management:" /sbin/lvm vgchange -a y --sysinit
272        action $"Creating LVM devices:" /sbin/lvm vgscan --mknodes --ignorelockingfailure
273fi
274       
275update_boot_stage RCfsck
276
277if [ -f /fastboot ] || [ -f /lxcroot ] || strstr "$cmdline" fastboot ; then
278        fastboot=yes
279    else
280        fastboot=
281fi
282
283if [ -f /fsckoptions ]; then
284        fsckoptions=`cat /fsckoptions`
285    else
286        fsckoptions=
287fi
288
289READONLY=
290if [ -f /etc/sysconfig/readonly-root ]; then
291        . /etc/sysconfig/readonly-root
292fi
293if strstr "$cmdline" readonlyroot ; then
294        READONLY=yes
295fi
296if strstr "$cmdline" noreadonlyroot ; then
297        READONLY=no
298fi
299                                       
300
301if [ -f /forcefsck ]; then
302        fsckoptions="-f $fsckoptions"
303elif [ -f /.autofsck ] && [ ! -f /lxcroot ]; then
304        echo $"Your system appears to have shut down uncleanly"
305        AUTOFSCK_TIMEOUT=5
306        AUTOFSCK_DEF_CHECK=no
307        [ -f /etc/sysconfig/autofsck ] && . /etc/sysconfig/autofsck
308        if [ "$AUTOFSCK_DEF_CHECK" = "yes" ] ; then
309                AUTOFSCK_OPT=-f
310        else
311                AUTOFSCK_OPT=
312        fi
313
314        if [ "$PROMPT" != "no" ]; then
315                if [ "$AUTOFSCK_DEF_CHECK" = "yes" ] ; then
316                        if /sbin/getkey -c $AUTOFSCK_TIMEOUT -m $"Press N within %d seconds to not force file system integrity check..." n ; then
317                                AUTOFSCK_OPT=
318                        fi
319                else
320                        if /sbin/getkey -c $AUTOFSCK_TIMEOUT -m $"Press Y within %d seconds to force file system integrity check..." y ; then
321                                AUTOFSCK_OPT=-f
322                        fi
323                fi
324                echo
325        else
326                # PROMPT not allowed
327                if [ "$AUTOFSCK_DEF_CHECK" = "yes" ] ; then
328                        echo $"Forcing file system integrity check due to default setting"
329                else
330                        echo $"Not forcing file system integrity check due to default setting"
331                fi
332        fi
333        fsckoptions="$AUTOFSCK_OPT $fsckoptions"
334fi
335
336if [ "$BOOTUP" != "serial" ]; then
337        fsckoptions="-C $fsckoptions"
338else
339        fsckoptions="-V $fsckoptions"
340fi
341 
342_RUN_QUOTACHECK=0
343ROOTFSTYPE=`grep " / " /proc/mounts | awk '{ print $3 }'`
344if [ -z "$fastboot" -a "$READONLY" != "yes" -a "$ROOTFSTYPE" != "nfs" -a "$ROOTFSTYPE" != "reiserfs" -a "$ROOTFSTYPE" != "unionfs" -a "$ROOTFSTYPE" != "squashfs" ]; then
345
346        STRING=$"Checking root filesystem"
347        echo $STRING
348        fsck -T -a $fsckoptions /
349        rc=$?
350       
351        if [ "$rc" = "0" ]; then
352                success "$STRING"
353                echo
354        elif [ "$rc" = "1" ]; then
355                passed $"$STRING"
356                echo
357        fi
358       
359        # A return of 2 or higher means there were serious problems.
360        if [ $rc -gt 1 ]; then
361                [ -n "$PLYMOUTH" ] && plymouth --hide-splash
362
363                failure "$STRING"
364                echo
365                echo
366                echo $"*** An error occurred during the file system check."
367                echo $"*** Dropping you to a shell; the system will reboot"
368                echo $"*** when you leave the shell."
369
370                PS1=$"(Repair filesystem) \# # "; export PS1
371                sulogin
372
373                echo $"Unmounting file systems"
374                umount -a
375                mount -n -o remount,ro /
376                echo $"Automatic reboot in progress."
377                reboot -f
378        elif [ "$rc" = "1" ]; then
379                _RUN_QUOTACHECK=1
380        fi
381fi
382
383update_boot_stage RCquotacheck
384
385# Possibly update quotas if fsck was run on /.
386grep -E '[[:space:]]+/[[:space:]]+' /etc/fstab | \
387    awk '{ print $4 }' | \
388    grep -q quota
389_ROOT_HAS_QUOTA=$?
390if [ X"$_RUN_QUOTACHECK" = X1 -a \
391    "$_ROOT_HAS_QUOTA" -a \
392    -x /sbin/quotacheck ]; then
393        if [ -x /sbin/convertquota ]; then
394            if [ -f /quota.user ]; then
395                action $"Converting old user quota files: " \
396                    /sbin/convertquota -u / && rm -f /quota.user
397            fi
398            if [ -f /quota.group ]; then
399                action $"Converting old group quota files: " \
400                    /sbin/convertquota -g / && rm -f /quota.group
401            fi
402        fi
403        action $"Checking root filesystem quotas: " /sbin/quotacheck -nug /
404fi
405
406# check for arguments passed from kernel
407
408update_boot_stage RCmountfs
409
410# Remount the root filesystem in specified mode
411state=`awk '/(^\/dev\/root| \/ )/ { print $4 }' /proc/mounts`
412newstate=`awk '/^#/{next} $2 == "/" {print $4 }'  /etc/fstab`
413if strstr "$cmdline" no_remount_rootfs ;then
414    action $"Staying readonly root filesystem mode : " /bin/true
415else
416    [ "$state" != "rw" ] && [ ! -f "/lxcroot" ] && \
417      action $"Remounting root filesystem in specified mode($newstate): " mount -n -o remount,$newstate /
418fi
419
420if [ "$READONLY" != "yes" ]; then
421    # Clear mtab
422    (>/etc/mtab) &> /dev/null
423
424    # Remove stale backups
425    rm -f /etc/mtab~ /etc/mtab~~
426
427    # Enter root, /proc and (potentially) /proc/bus/usb and devfs into mtab.
428    mount -f /
429    mount -f /proc >/dev/null 2>&1
430    mount -f /sys >/dev/null 2>&1
431    mount -f /dev/pts >/dev/null 2>&1
432    mount -f /dev/shm >/dev/null 2>&1
433    mount -f /proc/bus/usb >/dev/null 2>&1
434fi
435
436if strstr "$cmdline" hdparm ;then
437update_boot_stage RChdparm
438
439# Turn on harddisk optimization
440# There is only one file /etc/sysconfig/harddisks for all disks
441# after installing the hdparm-RPM. If you need different hdparm parameters
442# for each of your disks, copy /etc/sysconfig/harddisks to
443# /etc/sysconfig/harddiskhda (hdb, hdc...) and modify it.
444# each disk which has no special parameters will use the defaults.
445 
446disk[0]=s; disk[1]=hda; disk[2]=hdb; disk[3]=hdc;
447disk[4]=hdd; disk[5]=hde; disk[6]=hdf; disk[7]=hdg; disk[8]=hdh;
448 
449 
450if [ -x /sbin/hdparm ]; then
451   for device in 0 1 2 3 4 5 6 7 8; do
452   unset MULTIPLE_IO USE_DMA EIDE_32BIT LOOKAHEAD EXTRA_PARAMS
453        if [ -f /etc/sysconfig/harddisk${disk[$device]} ]; then
454                . /etc/sysconfig/harddisk${disk[$device]}
455                HDFLAGS[$device]=
456                if [ -n "$MULTIPLE_IO" ]; then
457                    HDFLAGS[$device]="-q -m$MULTIPLE_IO"
458                fi
459                if [ -n "$USE_DMA" ]; then
460                    HDFLAGS[$device]="${HDFLAGS[$device]} -q -d$USE_DMA"
461                fi
462                if [ -n "$EIDE_32BIT" ]; then
463                    HDFLAGS[$device]="${HDFLAGS[$device]} -q -c$EIDE_32BIT"
464                fi
465                if [ -n "$LOOKAHEAD" ]; then
466                    HDFLAGS[$device]="${HDFLAGS[$device]} -q -A$LOOKAHEAD"
467                fi
468                if [ -n "$EXTRA_PARAMS" ]; then
469                    HDFLAGS[$device]="${HDFLAGS[$device]} $EXTRA_PARAMS"
470                fi
471        else
472                HDFLAGS[$device]="${HDFLAGS[0]}"
473        fi
474        if [ -e "/proc/ide/${disk[$device]}/media" ] ; then
475             hdmedia=`cat /proc/ide/${disk[$device]}/media`
476             if [ "$hdmedia" = "disk" ]; then
477                  if [ -n "${HDFLAGS[$device]}" ]; then
478                      action $"Setting hard drive parameters for ${disk[$device]}: "  /sbin/hdparm ${HDFLAGS[$device]} /dev/${disk[$device]}
479                  fi
480             fi
481        fi
482   done
483fi
484fi
485
486# The root filesystem is now read-write, so we can now log via syslog() directly..
487if [ -n "$IN_INITLOG" ]; then
488    IN_INITLOG=
489fi
490
491update_boot_stage RCfsck
492
493_RUN_QUOTACHECK=0
494# Check filesystems
495if [ -z "$fastboot" ]; then
496        STRING=$"Checking filesystems"
497        echo $STRING
498        fsck -T -R -A -a $fsckoptions
499        rc=$?
500        if [ "$rc" = "0" ]; then
501                success "$STRING"
502                echo
503        elif [ "$rc" = "1" ]; then
504                passed "$STRING"
505                echo
506        fi
507
508        # A return of 2 or higher means there were serious problems.
509        if [ $rc -gt 1 ]; then
510                failure "$STRING"
511                echo
512                echo
513                echo $"*** An error occurred during the file system check."
514                echo $"*** Dropping you to a shell; the system will reboot"
515                echo $"*** when you leave the shell."
516
517                PS1=$"(Repair filesystem) \# # "; export PS1
518                sulogin
519
520                echo $"Unmounting file systems"
521                umount -a
522                mount -n -o remount,ro /
523                echo $"Automatic reboot in progress."
524                reboot -f
525        elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
526                _RUN_QUOTACHECK=1
527        fi
528fi
529
530update_boot_stage RClocalfs
531
532# Mount all other filesystems (except for NFS and /proc, which is already
533# mounted). Contrary to standard usage,
534# filesystems are NOT unmounted in single user mode.
535if [ "$READONLY" != "yes" ] ; then
536    action $"Mounting local filesystems: " mount -a -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev >/dev/null 2>&1
537else
538    action $"Mounting local filesystems: " mount -a -n -t nonfs,nfs4,smbfs,ncpfs,cifs,gfs,gfs2 -O no_netdev >/dev/null 2>&1
539fi
540
541# check remaining quotas other than root
542if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then
543        if [ -x /sbin/convertquota ]; then
544            # try to convert old quotas
545            for mountpt in `cat /etc/mtab | awk '$4 ~ /quota/{print $2}'`; do
546                if [ -f "$mountpt/quota.user" ]; then
547                    action $"Converting old user quota files: " \
548                    /sbin/convertquota -u $mountpt && \
549                        rm -f $mountpt/quota.user
550                fi
551                if [ -f "$mountpt/quota.group" ]; then
552                    action $"Converting old group quota files: " \
553                    /sbin/convertquota -g $mountpt && \
554                        rm -f $mountpt/quota.group
555                fi
556            done
557        fi
558        action $"Checking local filesystem quotas: " /sbin/quotacheck -aRnug
559fi
560
561if [ -x /sbin/quotaon ]; then
562    action $"Enabling local filesystem quotas: " /sbin/quotaon -aug
563fi
564
565# Configure machine if necessary.
566if [ -f /.unconfigured ]; then
567    if [ -x /usr/bin/plymouth ]; then
568        /usr/bin/plymouth quit
569    fi
570    if [ -x /usr/bin/system-config-keyboard ]; then
571        /usr/bin/system-config-keyboard
572    fi
573    if [ -x /usr/bin/passwd ]; then
574        /usr/bin/passwd root
575    fi
576    if [ -x /usr/sbin/system-config-network-tui ]; then
577        /usr/sbin/system-config-network-tui
578    fi
579    if [ -x /usr/sbin/timeconfig ]; then
580        /usr/sbin/timeconfig
581    fi
582    if [ -x /usr/sbin/authconfig-tui ]; then
583        /usr/sbin/authconfig-tui --nostart
584    fi
585    if [ -x /usr/sbin/ntsysv ]; then
586        /usr/sbin/ntsysv --level 35
587    fi
588
589    # Reread in network configuration data.
590    if [ -f /etc/sysconfig/network ]; then
591        . /etc/sysconfig/network
592
593        # Reset the hostname.
594        action $"Resetting hostname ${HOSTNAME}: " hostname ${HOSTNAME}
595    fi
596
597    rm -f /.unconfigured
598fi
599
600# Clean out /etc.
601rm -f /fastboot /fsckoptions /forcefsck /.autofsck /halt /poweroff
602
603# Do we need (w|u)tmpx files? We don't set them up, but the sysadmin might...
604_NEED_XFILES=
605[ -f /var/run/utmpx -o -f /var/log/wtmpx ] && _NEED_XFILES=1
606
607# Clean up /var
608rm -rf /var/lock/cvs/* /var/run/screen/*
609find /var/lock /var/run -type f -exec rm -f {} \;
610
611rm -f /var/lib/rpm/__db* &> /dev/null
612rm -f /var/gdm/.gdmfifo &> /dev/null
613
614{
615# Clean up utmp/wtmp
616>/var/run/utmp
617touch /var/log/wtmp /var/log/btmp
618chgrp utmp /var/run/utmp /var/log/wtmp
619chmod 0664 /var/run/utmp /var/log/wtmp
620chmod 0600 /var/log/btmp
621if [ -n "$_NEED_XFILES" ]; then
622  >/var/run/utmpx
623  touch /var/log/wtmpx
624  chgrp utmp /var/run/utmpx /var/log/wtmpx
625  chmod 0664 /var/run/utmpx /var/log/wtmpx
626fi
627
628# Clean up various /tmp bits
629rm -f /tmp/.X*-lock /tmp/.lock.* /tmp/.gdm_socket /tmp/.s.PGSQL.* \
630      /tmp/.esd/*
631rm -rf /tmp/.X*-unix /tmp/.ICE-unix /tmp/.font-unix /tmp/hsperfdata_* \
632       /tmp/kde-* /tmp/ksocket-* /tmp/mc-* /tmp/mcop-* /tmp/orbit-*  \
633       /tmp/scrollkeeper-*  /tmp/ssh-* \
634       /dev/.in_sysinit
635# Make ICE directory
636mkdir -m 1777 -p /tmp/.ICE-unix >/dev/null 2>&1
637chown root:root /tmp/.ICE-unix
638
639# Now turn on swap in case we swap to files.
640update_boot_stage RCswap
641action $"Enabling swap space: " swapon -a -e
642
643# Initialize the serial ports.
644if [ -f /etc/rc.serial ]; then
645        . /etc/rc.serial
646fi
647
648update_boot_stage RCusbstorage
649
650# Load usb storage here, to match most other things
651if [ -n "$needusbstorage" ]; then
652        modprobe usb-storage >/dev/null 2>&1
653fi
654
655# Adjust symlinks as necessary in /boot to keep system services from
656# spewing messages about mismatched System maps and so on.
657if [ -L /boot/System.map -a -r /boot/System.map-`uname -r` ]; then
658        ln -s -f System.map-`uname -r` /boot/System.map
659fi
660if [ ! -e /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
661        ln -s -f System.map-`uname -r` /boot/System.map
662fi
663
664# Now that we have all of our basic modules loaded and the kernel going,
665# let's dump the syslog ring somewhere so we can find it later
666dmesg -s 131072 > /var/log/dmesg
667# Also keep kernel symbols around in case we need them for debugging
668i=5
669while [ $i -ge 0 ] ; do
670        if [ -f /var/log/ksyms.$i ] ; then
671                mv /var/log/ksyms.$i /var/log/ksyms.$(($i+1))
672        fi
673        i=$(($i-1))
674done
675_ksyms=/proc/kallsyms
676(/bin/date;
677 /bin/uname -a;
678 /bin/cat /proc/cpuinfo;
679 /bin/cat /proc/modules;
680 /bin/cat ${_ksyms}) >/var/log/ksyms.0
681# create the crash indicator flag to warn on crashes, offer fsck with timeout
682touch /.autofsck
683kill -TERM `/sbin/pidof getkey` >/dev/null 2>&1
684} &
685if [ "$PROMPT" != "no" ]; then
686   /sbin/getkey i && touch /var/run/confirm
687fi
688wait
689
690# let plymouth know that we're leaving rc.sysinit
691if [ -x /usr/bin/plymouth ]; then
692    /usr/bin/plymouth --sysinit
693fi
694   
Note: See TracBrowser for help on using the repository browser.