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

Revision 3727, 18.8 KB checked in by daisuke, 13 years ago (diff)

add lxc support code

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