]> git.pld-linux.org Git - projects/rc-scripts.git/blob - rc.d/rc.sysinit
4001ba1a2a1e09c480e00b64283c2570e47294d4
[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.13 2001/10/22 08:51:13 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 [ -e /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 # Clear mtab
278 >/etc/mtab
279
280 # Remove stale backups
281 rm -f /etc/mtab~ /etc/mtab~~
282
283 # Enter root, /proc and (potentially) /proc/bus/usb and devfs into mtab.
284 mount -f /
285 mount -f /proc
286 [ -f /proc/bus/usb/devices ] && mount -f -t usbdevfs usbdevfs /proc/bus/usb
287 [ -e /dev/.devfsd ] && mount -f -t devfs devfs /dev 
288
289 # Setup hdparm thing (if exists and is needed)
290 if ! grep -iq nohdparm /proc/cmdline; then
291         [ -x /etc/rc.d/rc.hdparm ] && /etc/rc.d/rc.hdparm
292 fi
293
294 # Update quotas if fsck was run on /.
295 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
296         if [ -x /sbin/convertquota ]; then
297             if [ -f /quota.user ]; then
298                 /sbin/convertquota -u / && rm -f /quota.user
299             fi
300             if [ -f /quota.group ]; then
301                 /sbin/convertquota -g / && rm -f /quota.group
302             fi
303         fi
304         run_cmd "Checking root filesystem quotas"  /sbin/quotacheck -v /
305 fi
306
307 # /etc/nologin when starting system
308 [ -f /etc/nologin.boot ] && rm -f /etc/nologin /etc/nologin.boot
309
310 if is_yes "$DELAY_LOGIN" && [ ! -f /etc/nologin ]; then
311         show "Enabling Delay Login"; busy
312         echo > /etc/nologin
313         nls "System bootup in progress  - please wait" >> /etc/nologin
314         echo >> /etc/nologin
315         chmod 644 /etc/nologin
316         cp -fp /etc/nologin /etc/nologin.boot
317         ok
318 fi
319
320 # The root filesystem is now read-write, so we can now log via
321 # syslog() directly..
322 if [ -n "$IN_INITLOG" ]; then
323     IN_INITLOG=
324 fi
325     
326 if [ ! -f /proc/modules ]; then
327         USEMODULES=
328 elif ! grep -iq nomodules /proc/cmdline; then
329         USEMODULES=y
330 else
331         USEMODULES=
332 fi
333
334 # Adjust symlinks as necessary in /boot to keep system services from
335 # spewing messages about mismatched System maps and so on.
336 if is_yes "$SET_SLINKS"; then
337     if [ -L /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
338         ln -s -f System.map-`uname -r` /boot/System.map
339     fi
340     if [ ! -e /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
341         ln -s -f System.map-`uname -r` /boot/System.map
342     fi
343 fi
344
345 # Run depmod if RUN_DEPMOD != "no" and:
346 #  a) user requested or RUN_DEPMOD="";
347 #  b) modules.dep is missing
348 #  c) modules.dep is older than /etc/modules.conf or /lib/modules/$mver
349 _RUN_DEPMOD=0
350 if ! is_no "$RUN_DEPMOD" && [ -n "$USEMODULES" ]; then
351   is_yes "$RUN_DEPMOD" && _RUN_DEPMOD=1
352   [ "$RUN_DEPMOD" = "ifmissing" -a ! -r /lib/modules/$mver/modules.dep ] && _RUN_DEPMOD=1
353   [ /lib/modules/$mver/modules.dep -ot /etc/modules.conf ] && _RUN_DEPMOD=1
354   [ /lib/modules/$mver/modules.dep -ot /lib/modules/$mver ] && _RUN_DEPMOD=1
355 fi
356
357 if [ "$_RUN_DEPMOD" = "1" ]; then
358     run_cmd "Finding module dependencies" depmod -a
359 fi
360
361 # Load sound modules iff they need persistent DMA buffers
362 if grep -q "options sound dmabuf=1" /etc/modules.conf 2>/dev/null ; then
363   RETURN=0
364   alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound[[:space:]]+" | awk '{ print $3 }')
365   if [ -n "$alias" -a "$alias" != "off" ] ; then
366       run_cmd "$(nls 'Loading sound module') ($alias)" /sbin/modprobe -k $alias
367       RETURN=$?
368   fi
369   alias=$(/sbin/modprobe -c | egrep -s "^alias[[:space:]]+sound-slot-0[[:space:]]+" | awk '{ print $3 }')
370   if [ -n "$alias" -a "$alias" != "off" ] ; then
371       run_cmd "$(nls 'Loading sound module') ($alias)" /sbin/modprobe -k $alias
372       RETURN=$?
373   fi
374 fi
375
376 if [ -f /proc/sys/kernel/modprobe ]; then
377         if [ -n "$USEMODULES" ]; then
378                 sysctl -w kernel.modprobe="/sbin/modprobe" >/dev/null 2>&1
379                 sysctl -w kernel.hotplug="/sbin/hotplug" >/dev/null 2>&1
380         else
381                 # We used to set this to NULL, but that causes
382                 # 'failed to exec' messages"
383                 sysctl -w kernel.modprobe="/bin/true" >/dev/null 2>&1
384                 sysctl -w kernel.hotplug="/bin/true" >/dev/null 2>&1
385         fi
386 fi
387
388 # Load modules
389 if [ -x /etc/rc.d/rc.modules ]; then
390         /etc/rc.d/rc.modules
391 fi
392
393 # Find and activate volume groups
394 modprobe -s lvm-mod >/dev/null 2>&1
395 if [ -e /proc/lvm -a -x /sbin/vgscan -a -x /sbin/vgchange -a -e /etc/lvmtab ]; then
396         run_cmd "Scanning for LVM volume groups" /sbin/vgscan && \
397         run_cmd "Activating LVM volume groups" /sbin/vgchange -a y
398 fi
399
400 # Add raid devices
401 if [ ! -f /proc/mdstat ]; then
402         modprobe -s md >/dev/null 2>&1
403 fi      
404         
405 # Add raid devices
406 if [ -f /proc/mdstat -a -f /etc/raidtab ]; then
407
408         rc=0
409         
410         for i in $(grep -v "^#" /etc/raidtab | grep "raiddev" | awk '{print $2}')
411         do
412                 RAIDDEV=$(basename $i)
413                 RAIDSTAT=$(grep "^$RAIDDEV : active" /proc/mdstat)
414                 show "Starting up RAID device %s" $RAIDDEV
415                 busy
416                 if [ -z "$RAIDSTAT" ]; then
417                         # Try raidstart first...if that fails then
418                         # fall back to raid0run and if that fails, too
419                         # fall back to raidadd, raidrun.
420                         RESULT=1
421                         if [ -x /sbin/raidstart ]; then
422                                 /sbin/raidstart $i
423                                 RESULT=$?
424                         fi
425                         if [ $RESULT -gt 0 -a -x /sbin/raid0run ]; then
426                                 /sbin/raid0run $i
427                                 RESULT=$?
428                         fi
429                         if [ $RESULT -gt 0 -a -x /sbin/raidadd -a -x /sbin/raidrun ]; then
430                                 /sbin/raidadd $i
431                                 /sbin/raidrun $i
432                                 RESULT=$?
433                         fi
434                         if [ $RESULT -gt 0 ]; then
435                                 rc=1
436                                 fail
437                         else
438                                 ok
439                         fi
440                 else
441                         ok
442                 fi
443         done
444
445         # A non-zero return means there were problems.
446         if [ $rc -gt 0 ]; then
447                 show "Starting up RAID devices."; fail
448                 echo
449                 echo
450                 nls "*** An error occurred during the RAID startup"
451                 nls "*** Dropping you to a shell; the system will reboot"
452                 nls "*** when you leave the shell."
453                 echo
454
455                 PS1="$(nls '(RAID Repair)# ')"; export PS1
456                 if is_yes "$RUN_SULOGIN_ON_ERR"; then
457                         sulogin
458                 else
459                         /bin/sh
460                 fi
461
462                 run_cmd "Unmounting file systems" umount -a
463                 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
464                 run_cmd "Automatic reboot in progress" reboot
465         fi
466         show "Starting up RAID devices."; ok
467 fi
468
469 _RUN_QUOTACHECK=0
470 # Check filesystems
471 if [ -z "$fastboot" ] && ! grep -q nofsck /proc/cmdline; then
472         show "Checking filesystems"; started
473         initlog -c "fsck -T -R -A -a $fsckoptions"
474
475         rc=$?
476
477         # A return of 2 or higher means there were serious problems.
478         if [ $rc -gt 1 ]; then
479                 echo
480                 echo
481                 nls "*** An error occurred during the file system check."
482                 nls "*** Dropping you to a shell; the system will reboot"
483                 nls "*** when you leave the shell."
484                 echo
485
486                 PS1="$(nls '(Repair filesystem)# ')"; export PS1
487                 if is_yes "$RUN_SULOGIN_ON_ERR"; then
488                         sulogin
489                 else
490                         /bin/sh
491                 fi
492
493                 run_cmd "Unmounting file systems" umount -a
494                 run_cmd "Remounting root filesystem in ro mode" mount -n -o remount,ro /
495                 run_cmd "Automatic reboot in progress." reboot
496         elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
497                 _RUN_QUOTACHECK=1
498         fi
499 fi
500
501 # Mount all other filesystems (except for NFS and /proc, which is already
502 # mounted). Contrary to standard usage,
503 # filesystems are NOT unmounted in single user mode.
504 run_cmd "Mounting local filesystems." mount -a -t nonfs,smbfs,ncpfs
505
506 if [ "$_RUN_QUOTACHECK" = "1" -a -x /sbin/quotacheck ]; then
507         if [ -x /sbin/convertquota ]; then
508             # try to convert old quotas
509             for mountpt in $(cat /etc/mtab | awk '$4 ~ /quota/{print $2}'); do
510                 if [ -f "$mountpt/quota.user" ]; then
511                     /sbin/convertquota -u $mountpt && \
512                         rm -f $mountpt/quota.user
513                 fi
514                 if [ -f "$mountpt/quota.group" ]; then
515                     /sbin/convertquota -g $mountpt && \
516                         rm -f $mountpt/quota.group
517                 fi
518             done
519         fi
520         run_cmd "Checking filesystem quotas"  /sbin/quotacheck -v -R -a
521 fi
522
523 # Turn on quota
524 if [ -x /sbin/quotaon ]; then
525     run_cmd "Turning on user and group quotas for local filesystems" /sbin/quotaon -a
526 fi
527
528 # Turn on process accounting
529 if [ -x /sbin/accton ] ; then
530         run_cmd "Turning on process accounting" /sbin/accton /var/log/pacct
531 fi
532
533 # Set the clock if timezone definition wasn't available (eg. /usr not mounted)
534 if is_yes "$TIME_SETUP_DELAYED"; then
535         if run_cmd "$(nls 'Setting clock')$CLOCKDEF" /sbin/hwclock $CLOCKFLAGS; then
536                 show "$(nls 'Today`s date:') $(LC_CTYPE=C date)"; ok
537         fi
538 fi
539
540 # Initialize the serial ports.
541 if [ -f /etc/rc.d/rc.serial ]; then
542         . /etc/rc.d/rc.serial
543 fi
544
545 if [ -f /proc/sys/kernel/panic -a "$PANIC_REBOOT_TIME" -gt "0" ]; then
546         show 'Setting %s seconds for kernel reboot after panic' "$PANIC_REBOOT_TIME"; busy
547         if (sysctl -w kernel.panic=$PANIC_REBOOT_TIME 2> /dev/null); then ok; else fail; fi
548 fi
549
550 # Clean out /etc.
551 rm -f /fastboot /fsckoptions /forcefsck /halt /poweroff
552
553 # Clean up /var
554 # I'd use find, but /usr may not be mounted.
555 for afile in /var/lock/* /var/run/*; do
556    if [ -d "$afile" ]; then
557         bafile=$(basename $afile)
558         [ "$bafile" != "news" -a "$bafile" != "sudo" -a "$bafile" != "mon" ] && rm -f $afile/*
559    else
560         rm -f $afile
561    fi
562 done
563
564 {
565 # Clean up utmp/wtmp
566 rm -f /var/run/utmp?
567 if ! is_no "$NEED_XFILES" ; then
568         :>/var/run/utmpx
569         touch /var/log/wtmpx
570         chown root.utmp /var/run/utmpx /var/log/wtmpx
571         chmod 0664 /var/run/utmpx /var/log/wtmpx
572 else
573         :>/var/run/utmp
574         touch /var/log/wtmp
575         chown root.utmp /var/run/utmp /var/log/wtmp
576         chmod 0664 /var/run/utmp /var/log/wtmp
577 fi
578
579 # Clean /tmp
580 if is_yes "$CLEAN_TMP"; then
581         rm -rf /tmp/*
582 fi
583
584 # Delete X locks
585 rm -f /tmp/.X*-lock
586
587 # Delete Postgres sockets
588 rm -f /tmp/.s.PGSQL.*
589
590 # Right, now turn on swap in case we swap to files.
591 swapon -a >/dev/null 2>&1
592 run_cmd "Enabling swap space" /bin/true
593
594 # If a SCSI tape has been detected, load the st module unconditionally
595 # since many SCSI tapes don't deal well with st being loaded and unloaded
596 if [ -f /proc/scsi/scsi ] && grep -q 'Type:   Sequential-Access' /proc/scsi/scsi 2>/dev/null ; then
597         if grep -qv ' 9 st' /proc/devices ; then
598                 if [ -n "$USEMODULES" ] ; then
599                         # Try to load the module.  If it fails, ignore it...
600                         insmod -p st >/dev/null 2>&1 && /sbin/modprobe st >/dev/null 2>&1
601                 fi
602         fi
603 fi
604
605 # Load usb storage here, to match most other things
606 if [ -n "$needusbstorage" ]; then
607         /sbin/modprobe usb-storage >/dev/null 2>&1
608 fi
609
610 # If they asked for ide-scsi, load it
611 if grep -q "ide-scsi" /proc/cmdline ; then
612         /sbin/modprobe -k ide-cd >/dev/null 2>&1
613         /sbin/modprobe -k ide-scsi >/dev/null 2>&1
614 fi
615
616 # Adjust symlinks as necessary in /boot to keep system services from
617 # spewing messages about mismatched System maps and so on.
618 if [ -L /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
619         ln -s -f System.map-`uname -r` /boot/System.map
620 fi
621 if [ ! -e /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
622         ln -s -f System.map-`uname -r` /boot/System.map
623 fi
624
625 # there could be a new kernel version.  remove old psdevtab database
626 rm -f /etc/psdevtab
627
628 # Now that we have all of our basic modules loaded and the kernel going,
629 # let's dump the syslog ring somewhere so we can find it later
630 dmesg > /var/log/dmesg
631 chmod 640 /var/log/dmesg
632 sleep 1
633
634 # Now that we have all of our basic modules loaded and the kernel going,
635 # let's dump the syslog ring somewhere so we can find it later
636 kill -TERM $(/sbin/pidof getkey) >/dev/null 2>&1
637 } &
638 if is_yes "$PROMPT"; then
639    /sbin/getkey i && touch /var/run/confirm
640 fi
641 wait
642 echo
643
644 # This must be last line !
645 # vi:syntax=sh:tw=78:ts=8:sw=4
646
This page took 0.06338 seconds and 2 git commands to generate.