Guest User

Untitled

a guest
Feb 11th, 2013
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 18.51 KB | None | 0 0
  1. #!/bin/sh
  2. #
  3. # /etc/rc.sysinit - run once at boot time
  4. #
  5. # Taken in part from Miquel van Smoorenburg's bcheckrc.
  6. #
  7.  
  8. #/sbin/cklcd >/dev/null 2>&1
  9. #LCD=$?
  10. #if expr $LCD = 0 >/dev/null 2>&1
  11. #then
  12. # modprobe -q sis900
  13. # PROBE=$?
  14. # if expr $PROBE = 0 >/dev/null 2>&1
  15. # then
  16. # LCD=2
  17. # touch /tmp/.nolcd
  18. # fi
  19. #fi
  20.  
  21. #if expr $LCD != 0 >/dev/null 2>&1
  22. #then
  23. /sbin/apromessage.static "Initializing" "Stage 1" "===================" "Please wait..."
  24. #else
  25. # /sbin/promessage.static "Initializing" "Stage 1"
  26. #fi
  27.  
  28. # Rerun ourselves through initlog
  29. if [ -z "$IN_INITLOG" ]; then
  30. [ -f /sbin/initlog ] && exec /sbin/initlog $INITLOG_ARGS -r /etc/rc.sysinit
  31. fi
  32.  
  33. # If we're using devfs, start devfsd now - we need the old device names
  34. [ -e /dev/.devfsd -a -x /sbin/devfsd ] && /sbin/devfsd /dev
  35.  
  36. # Set the path
  37. PATH=/bin:/sbin:/usr/bin:/usr/sbin
  38. export PATH
  39.  
  40. HOSTNAME=`/bin/hostname`
  41.  
  42. # Read in config data.
  43. if [ -f /etc/sysconfig/network ]; then
  44. . /etc/sysconfig/network
  45. else
  46. NETWORKING=no
  47. fi
  48.  
  49. if [ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then
  50. HOSTNAME=localhost
  51. fi
  52.  
  53. #/promessage
  54. # Source functions
  55. . /etc/init.d/functions
  56.  
  57. # Print a banner. ;)
  58. echo -en "\t\t\tWelcome to "
  59. [ "$BOOTUP" != "serial" ] && echo -en "\\033[1;31m"
  60. echo -en "Red Hat"
  61. [ "$BOOTUP" != "serial" ] && echo -en "\\033[0;39m"
  62. echo " Linux"
  63. if [ "$PROMPT" != "no" ]; then
  64. echo -en "\t\tPress 'I' to enter interactive startup."
  65. echo
  66. sleep 1
  67. fi
  68.  
  69. # Fix console loglevel
  70. /bin/dmesg -n $LOGLEVEL
  71.  
  72. # Mount /proc (done here so volume labels can work with fsck)
  73.  
  74. action "Mounting proc filesystem: " mount -n -t proc /proc /proc
  75.  
  76. # Configure kernel parameters
  77.  
  78. action "Configuring kernel parameters: " sysctl -p /etc/sysctl.conf
  79.  
  80. # Set the system clock.
  81. ARC=0
  82. SRM=0
  83. UTC=0
  84.  
  85. if [ -f /etc/sysconfig/clock ]; then
  86. . /etc/sysconfig/clock
  87.  
  88. # convert old style clock config to new values
  89. if [ "${CLOCKMODE}" = "GMT" ]; then
  90. UTC=true
  91. elif [ "${CLOCKMODE}" = "ARC" ]; then
  92. ARC=true
  93. fi
  94. fi
  95.  
  96. CLOCKDEF=""
  97. CLOCKFLAGS="--hctosys"
  98.  
  99. case "$UTC" in
  100. yes|true)
  101. CLOCKFLAGS="$CLOCKFLAGS -u";
  102. CLOCKDEF="$CLOCKDEF (utc)";
  103. ;;
  104. no|false)
  105. CLOCKFLAGS="$CLOCKFLAGS --localtime";
  106. CLOCKDEF="$CLOCKDEF (localtime)";
  107. ;;
  108. esac
  109.  
  110. case "$ARC" in
  111. yes|true)
  112. CLOCKFLAGS="$CLOCKFLAGS -A";
  113. CLOCKDEF="$CLOCKDEF (arc)";
  114. ;;
  115. esac
  116. case "$SRM" in
  117. yes|true)
  118. CLOCKFLAGS="$CLOCKFLAGS -S";
  119. CLOCKDEF="$CLOCKDEF (srm)";
  120. ;;
  121. esac
  122.  
  123. /sbin/hwclock $CLOCKFLAGS
  124.  
  125. action "Setting clock $CLOCKDEF: `date`" date
  126.  
  127. # Load keymap
  128. if [ -x /bin/loadkeys ]; then
  129. KEYTABLE=
  130. KEYMAP=
  131. if [ -f /etc/sysconfig/console/default.kmap ]; then
  132. KEYMAP=/etc/sysconfig/console/default.kmap
  133. else
  134. if [ -f /etc/sysconfig/keyboard ]; then
  135. . /etc/sysconfig/keyboard
  136. fi
  137. if [ -n "$KEYTABLE" -a -d "/usr/lib/kbd/keymaps" ]; then
  138. KEYMAP=$KEYTABLE
  139. fi
  140. fi
  141. if [ -n "$KEYMAP" ]; then
  142. # Since this takes in/output from stdin/out, we can't use initlog
  143. if [ -n "$KEYTABLE" ]; then
  144. echo -n "Loading default keymap ($KEYTABLE): "
  145. else
  146. echo -n "Loading default keymap: "
  147. fi
  148. loadkeys $KEYMAP < /dev/tty0 > /dev/tty0 2>/dev/null && \
  149. success "Loading default keymap" || failure "Loading default keymap"
  150. echo
  151. fi
  152. fi
  153.  
  154. # Load system font
  155. if [ -x /sbin/setsysfont ]; then
  156. [ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n
  157. if [ -f /etc/sysconfig/console/$SYSFONT.psf.gz -o \
  158. -f /usr/lib/kbd/consolefonts/$SYSFONT.psf.gz -o \
  159. -f /etc/sysconfig/console/$SYSFONT.gz -o \
  160. -f /usr/lib/kbd/consolefonts/$SYSFONT.gz ]; then
  161. action "Setting default font ($SYSFONT): " /sbin/setsysfont
  162. fi
  163. fi
  164.  
  165. # Start up swapping.
  166. action "Activating swap partitions: " swapon -a
  167.  
  168. # Set the hostname.
  169. action "Setting hostname ${HOSTNAME}: " hostname ${HOSTNAME}
  170.  
  171. # Set the NIS domain name
  172. #if [ -n "$NISDOMAIN" ]; then
  173. # action "Setting NIS domain name $NISDOMAIN: " domainname $NISDOMAIN
  174. #else
  175. # domainname ""
  176. #fi
  177.  
  178. # Initialize USB controller and HID devices
  179. #usb=0
  180. #if ! grep -iq "nousb" /proc/cmdline 2>/dev/null && ! grep -q "usb" /proc/devices 2>/dev/null ; then
  181. # alias=`egrep -s "^alias[[:space:]]+usb-controller[[:space:]]+" /etc/modules.conf | awk '{ print $3 }'`
  182. # if [ -n "$alias" -a "$alias" != "off" ] ; then
  183. # action "Initializing USB controller ($alias): " modprobe $alias
  184. # [ $? -eq 0 ] && usb=1
  185. # fi
  186. #fi
  187.  
  188. #if [ $usb = "1" ]; then
  189. # sleep 5
  190. # action "Mounting USB filesystem: " mount -t usbdevfs usbdevfs /proc/bus/usb
  191. # mouseoutput=`cat /proc/bus/usb/devices|grep -E "^I.*Cls=03.*Prot=02"`
  192. # kbdoutput=`cat /proc/bus/usb/devices|grep -E "^I.*Cls=03.*Prot=01"`
  193. # if [ -n "$kbdoutput" ] || [ -n "$mouseoutput" ]; then
  194. # action "Initializing USB HID interface: " modprobe hid 2> /dev/null
  195. # fi
  196. # if [ -n "$kbdoutput" ]; then
  197. # action "Initializing USB keyboard: " modprobe keybdev
  198. # fi
  199. # if [ -n "$mouseoutput" ]; then
  200. # action "Initializing USB mouse: " modprobe mousedev
  201. # fi
  202. #fi
  203.  
  204. #if expr $LCD != 0 >/dev/null 2>&1
  205. #then
  206. /sbin/apromessage.static "Initializing" "Stage 2" "===================" "Please wait..."
  207. #else
  208. # /sbin/promessage.static "Initializing" "Stage 2"
  209. #fi
  210.  
  211. if [ -f /fastboot ] || grep -iq "fastboot" /proc/cmdline 2>/dev/null ; then
  212. fastboot=yes
  213. else
  214. fastboot=
  215. fi
  216.  
  217. if [ -f /fsckoptions ]; then
  218. fsckoptions=`cat /fsckoptions`
  219. else
  220. fsckoptions=
  221. fi
  222.  
  223. if [ -f /forcefsck ]; then
  224. fsckoptions="-f $fsckoptions"
  225. fi
  226.  
  227. if [ "$BOOTUP" != "serial" ]; then
  228. fsckoptions="-C $fsckoptions"
  229. else
  230. fsckoptions="-V $fsckoptions"
  231. fi
  232.  
  233. _RUN_QUOTACHECK=0
  234. ROOTFSTYPE=`grep " / " /proc/mounts | awk '{ print $3 }'`
  235. if [ -z "$fastboot" -a "$ROOTFSTYPE" != "nfs" ]; then
  236.  
  237. STRING="Checking root filesystem"
  238. echo $STRING
  239. initlog -c "fsck -f -T -y $fsckoptions /"
  240. rc=$?
  241.  
  242. if [ "$rc" = "0" ]; then
  243. success "$STRING"
  244. echo
  245. elif [ "$rc" = "1" ]; then
  246. passed "$STRING"
  247. echo
  248. fi
  249.  
  250. # A return of 2 or higher means there were serious problems.
  251. if [ $rc -gt 1 ]; then
  252. failure "$STRING"
  253. echo
  254. echo
  255. echo "*** An error occurred during the file system check."
  256. echo "*** Dropping you to a shell; the system will reboot"
  257. echo "*** when you leave the shell."
  258.  
  259. PS1="(Repair filesystem) \# # "; export PS1
  260. # sulogin
  261.  
  262. echo "Unmounting file systems"
  263. umount -a
  264. mount -n -o remount,ro /
  265. echo "Automatic reboot in progress."
  266. reboot -f
  267. elif [ "$rc" = "1" ]; then
  268. _RUN_QUOTACHECK=1
  269. fi
  270. fi
  271.  
  272. # check for arguments
  273.  
  274. if grep -iq nopnp /proc/cmdline >/dev/null 2>&1 ; then
  275. PNP=
  276. else
  277. PNP=yes
  278. fi
  279.  
  280. # set up pnp
  281. if [ -x /sbin/isapnp -a -f /etc/isapnp.conf ]; then
  282. if [ -n "$PNP" ]; then
  283. action "Setting up ISA PNP devices: " /sbin/isapnp /etc/isapnp.conf
  284. else
  285. action "Skipping ISA PNP configuration at users request: " /bin/true
  286. fi
  287. fi
  288.  
  289. # Remount the root filesystem read-write.
  290. action "Remounting root filesystem in read-write mode: " mount -n -o remount,rw,sync /
  291.  
  292. # Clear mtab
  293. >/etc/mtab
  294.  
  295. # Remove stale backups
  296. rm -f /etc/mtab~ /etc/mtab~~
  297.  
  298. # Enter root and /proc and /proc/bus/usb into mtab.
  299. mount -f /
  300. mount -f /proc
  301. #[ -f /proc/bus/usb/devices ] && mount -f -t usbdevfs usbdevfs /proc/bus/usb
  302.  
  303. # Turn on harddisk optimization
  304. if [ -f /etc/sysconfig/harddisks ] && [ -x /sbin/hdparm ]; then
  305. . /etc/sysconfig/harddisks
  306. HDFLAGS=
  307. if [ -n "$MULTIPLE_IO" ] && [ "$MULTIPLE_IO" != "0" ]; then
  308. HDFLAGS="-q -m$MULTIPLE_IO"
  309. fi
  310. if [ -n "$USE_DMA" ] && [ "$USE_DMA" != "0" ]; then
  311. HDFLAGS="$HDFLAGS -q -d$USE_DMA"
  312. fi
  313. if [ -n "$EIDE_32BIT" ]; then
  314. HDFLAGS="$HDFLAGS -q -c$EIDE_32BIT"
  315. fi
  316. if [ -n "$LOOKAHEAD" ]; then
  317. HDFLAGS="$HDFLAGS -q -A$LOOKAHEAD"
  318. fi
  319. if [ -n "$EXTRA_PARAMS" ]; then
  320. HDFLAGS="$HDFLAGS $EXTRA_PARAMS"
  321. fi
  322. if [ -n "$HDFLAGS" ]; then
  323. for i in a b c d e f g h ; do
  324. if [ -e "/proc/ide/hd$i/media" ] ; then
  325. hdmedia=`cat /proc/ide/hd$i/media`
  326. if [ "$hdmedia" = "disk" ]; then
  327. action "Setting hard drive parameters for hd$i: " /sbin/hdparm $HDFLAGS /dev/hd$i
  328. fi
  329. fi
  330. done
  331. fi
  332. fi
  333.  
  334. # Update quotas if fsck was run on /.
  335. if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then
  336. action "Checking root filesystem quotas: " /sbin/quotacheck -v /
  337. fi
  338.  
  339. #if expr $LCD != 0 >/dev/null 2>&1
  340. #then
  341. /sbin/apromessage.static "Initializing" "Stage 3" "===================" "Please wait..."
  342. #else
  343. # /sbin/promessage.static "Initializing" "Stage 3"
  344. #fi
  345.  
  346. # The root filesystem is now read-write, so we can now log via syslog() directly..
  347. if [ -n "$IN_INITLOG" ]; then
  348. IN_INITLOG=
  349. fi
  350.  
  351. if ! grep -iq nomodules /proc/cmdline >/dev/null 2>&1 && [ -f /proc/ksyms ]; then
  352. USEMODULES=y
  353. else
  354. USEMODULES=
  355. fi
  356.  
  357. # Our modutils don't support it anymore, so we might as well remove
  358. # the preferred link.
  359. rm -f /lib/modules/preferred
  360. rm -f /lib/modules/default
  361. if [ -x /sbin/depmod -a -n "$USEMODULES" ]; then
  362. # If they aren't using a recent sane kernel, make a link for them
  363. if [ ! -n "`uname -r | grep -- "-"`" ]; then
  364. ktag="`cat /proc/version`"
  365. mtag=`grep -l "$ktag" /lib/modules/*/.rhkmvtag 2> /dev/null`
  366. if [ -n "$mtag" ]; then
  367. mver=`echo $mtag | sed -e 's,/lib/modules/,,' -e 's,/.rhkmvtag,,' -e 's,[ ].*$,,'`
  368. fi
  369. if [ -n "$mver" ]; then
  370. ln -sf /lib/modules/$mver /lib/modules/default
  371. fi
  372. fi
  373. if [ -L /lib/modules/default ]; then
  374. INITLOG_ARGS= action "Finding module dependencies: " depmod -a default
  375. else
  376. INITLOG_ARGS= action "Finding module dependencies: " depmod -a
  377. fi
  378. fi
  379.  
  380. # Load sound modules
  381. #
  382. # I think this now qualifies as over-engineered.
  383. RETURN=0
  384. alias=`egrep -s "^alias[[:space:]]+sound[[:space:]]+" /etc/modules.conf | awk '{ print $3 }'`
  385. if [ -n "$alias" -a "$alias" != "off" ] ; then
  386. action "Loading sound module ($alias): " modprobe $alias
  387. RETURN=$?
  388. fi
  389. alias=`egrep -s "^alias[[:space:]]+sound-slot-0[[:space:]]+" /etc/modules.conf | awk '{ print $3 }'`
  390. if [ -n "$alias" -a "$alias" != "off" ] ; then
  391. action "Loading sound module ($alias): " modprobe $alias
  392. RETURN=$?
  393. fi
  394. alias=`egrep -s "^alias[[:space:]]+midi[[:space:]]+" /etc/modules.conf | awk '{ print $3 }'`
  395. if [ -n "$alias" -a "$alias" != "off" ]; then
  396. action "Loading midi module ($alias): " modprobe $alias
  397. fi
  398.  
  399. # Load mixer settings
  400. if grep -q "\(sparcaudio\|sound\)" /proc/devices 2>/dev/null && [ $RETURN -eq 0 -a -f /etc/.aumixrc -a -x /bin/aumix-minimal ]; then
  401. action "Loading mixer settings: " /bin/aumix-minimal -f /etc/.aumixrc -L
  402. fi
  403.  
  404. if [ -f /proc/sys/kernel/modprobe ]; then
  405. if [ -n "$USEMODULES" ]; then
  406. sysctl -w kernel.modprobe="/sbin/modprobe" >/dev/null 2>&1
  407. else
  408. # We used to set this to NULL, but that causes 'failed to exec' messages"
  409. sysctl -w kernel.modprobe="/bin/true" >/dev/null 2>&1
  410. fi
  411. fi
  412.  
  413.  
  414. # Add raid devices
  415. #if [ -f /proc/mdstat -a -f /etc/raidtab ]; then
  416. # echo -n "Starting up RAID devices: "
  417.  
  418. # rc=0
  419.  
  420. # for i in `grep "^raiddev" /etc/raidtab | awk '{print $2}'`
  421. # do
  422. # RAIDDEV=`basename $i`
  423. # RAIDSTAT=`grep "^$RAIDDEV : active" /proc/mdstat`
  424. # if [ -z "$RAIDSTAT" ]; then
  425. # # Try raidstart first...if that fails then
  426. # # fall back to raidadd, raidrun. If that
  427. # # also fails, then we drop to a shell
  428. # RESULT=1
  429. # if [ -x /sbin/raidstart ]; then
  430. # /sbin/raidstart $i
  431. # RESULT=$?
  432. # fi
  433. # if [ $RESULT -gt 0 -a -x /sbin/raid0run ]; then
  434. # /sbin/raid0run $i
  435. # RESULT=$?
  436. # fi
  437. # if [ $RESULT -gt 0 -a -x /sbin/raidadd -a -x /sbin/raidrun ]; then
  438. # /sbin/raidadd $i
  439. # /sbin/raidrun $i
  440. # RESULT=$?
  441. # fi
  442. # if [ $RESULT -gt 0 ]; then
  443. # rc=1
  444. # fi
  445. # echo -n "$RAIDDEV "
  446. # else
  447. # echo -n "$RAIDDEV "
  448. # fi
  449. # done
  450. # echo
  451.  
  452. # # A non-zero return means there were problems.
  453. # if [ $rc -gt 0 ]; then
  454. # echo
  455. # echo
  456. # echo "*** An error occurred during the RAID startup"
  457. # echo "*** Dropping you to a shell; the system will reboot"
  458. # echo "*** when you leave the shell."
  459.  
  460. # PS1="(RAID Repair) \# # "; export PS1
  461. # sulogin
  462.  
  463. # echo "Unmounting file systems"
  464. # umount -a
  465. # mount -n -o remount,ro /
  466. # echo "Automatic reboot in progress."
  467. # reboot -f
  468. # fi
  469. #fi
  470.  
  471. _RUN_QUOTACHECK=0
  472. # Check filesystems
  473. if [ -z "$fastboot" ]; then
  474. STRING="Checking filesystems"
  475. echo $STRING
  476. initlog -c "fsck -T -R -A -y $fsckoptions"
  477. rc=$?
  478. if [ "$rc" = "0" ]; then
  479. success "$STRING"
  480. echo
  481. elif [ "$rc" = "1" ]; then
  482. passed "$STRING"
  483. echo
  484. fi
  485.  
  486. # A return of 2 or higher means there were serious problems.
  487. if [ $rc -gt 1 ]; then
  488. failure "$STRING"
  489. echo
  490. echo
  491. echo "*** An error occurred during the file system check."
  492. echo "*** Dropping you to a shell; the system will reboot"
  493. echo "*** when you leave the shell."
  494.  
  495. PS1="(Repair filesystem) \# # "; export PS1
  496. # sulogin
  497.  
  498. echo "Unmounting file systems"
  499. umount -a
  500. mount -n -o remount,ro /
  501. echo "Automatic reboot in progress."
  502. reboot -f
  503. elif [ "$rc" = "1" -a -x /sbin/quotacheck ]; then
  504. _RUN_QUOTACHECK=1
  505. fi
  506. fi
  507.  
  508. #if expr $LCD != 0 >/dev/null 2>&1
  509. #then
  510. /sbin/apromessage.static "Initializing" "Stage 4" "===================" "Please wait..."
  511. #else
  512. # /sbin/promessage.static "Initializing" "Stage 4"
  513. #fi
  514.  
  515. # Mount all other filesystems (except for NFS and /proc, which is already
  516. # mounted). Contrary to standard usage,
  517. # filesystems are NOT unmounted in single user mode.
  518. action "Mounting local filesystems: " mount -a -t nonfs,smbfs,ncpfs,proc -o sync
  519.  
  520. if [ X"$_RUN_QUOTACHECK" = X1 -a -x /sbin/quotacheck ]; then
  521. action "Checking filesystem quotas: " /sbin/quotacheck -v -R -a
  522. fi
  523.  
  524. # Configure machine if necessary.
  525. if [ -f /.unconfigured ]; then
  526. if [ -x /usr/bin/passwd ]; then
  527. /usr/bin/passwd root
  528. fi
  529. if [ -x /usr/sbin/netconfig ]; then
  530. /usr/sbin/netconfig
  531. fi
  532. if [ -x /usr/sbin/timeconfig ]; then
  533. /usr/sbin/timeconfig
  534. fi
  535. if [ -x /usr/sbin/authconfig ]; then
  536. /usr/sbin/authconfig --nostart
  537. fi
  538. if [ -x /usr/sbin/ntsysv ]; then
  539. /usr/sbin/ntsysv --level 35
  540. fi
  541.  
  542. # Reread in network configuration data.
  543. if [ -f /etc/sysconfig/network ]; then
  544. . /etc/sysconfig/network
  545.  
  546. # Reset the hostname.
  547. action "Resetting hostname ${HOSTNAME}: " hostname ${HOSTNAME}
  548.  
  549. # Reset the NIS domain name.
  550. #if [ -n "$NISDOMAIN" ]; then
  551. # action "Resetting NIS domain name $NISDOMAIN: " domainname $NISDOMAIN
  552. #else
  553. # domainname ""
  554. #fi
  555. fi
  556.  
  557. rm -f /.unconfigured
  558. fi
  559.  
  560. if [ -x /sbin/quotaon ]; then
  561. action "Turning on user and group quotas for local filesystems: " /sbin/quotaon -a
  562. fi
  563.  
  564. # Clean out /etc.
  565. rm -f /fastboot /fsckoptions /forcefsck /halt /poweroff
  566.  
  567. # Do we need (w|u)tmpx files? We don't set them up, but the sysadmin might...
  568. _NEED_XFILES=
  569. [ -f /var/run/utmpx -o -f /var/log/wtmpx ] && _NEED_XFILES=1
  570.  
  571. # Clean up /var
  572. # I'd use find, but /usr may not be mounted.
  573. for afile in /var/lock/* /var/run/*; do
  574. if [ -d "$afile" ]; then
  575. [ "`basename $afile`" != "news" -a "`basename $afile`" != "sudo" ] && rm -f $afile/*
  576. else
  577. rm -f $afile
  578. fi
  579. done
  580.  
  581. {
  582. # Clean up utmp/wtmp
  583. >/var/run/utmp
  584. touch /var/log/wtmp
  585. chgrp utmp /var/run/utmp /var/log/wtmp
  586. chmod 0664 /var/run/utmp /var/log/wtmp
  587. if [ -n "$_NEED_XFILES" ]; then
  588. >/var/run/utmpx
  589. touch /var/log/wtmpx
  590. chgrp utmp /var/run/utmpx /var/log/wtmpx
  591. chmod 0664 /var/run/utmpx /var/log/wtmpx
  592. fi
  593.  
  594. # Delete X locks
  595. rm -f /tmp/.X*-lock
  596.  
  597. # Delete Postgres sockets
  598. rm -f /tmp/.s.PGSQL.*
  599.  
  600. # Now turn on swap in case we swap to files.
  601. swapon -a >/dev/null 2>&1
  602. action "Enabling swap space: " /bin/true
  603.  
  604. # Initialize the serial ports.
  605. if [ -f /etc/rc.serial ]; then
  606. . /etc/rc.serial
  607. fi
  608.  
  609. # If a SCSI tape has been detected, load the st module unconditionally
  610. # since many SCSI tapes don't deal well with st being loaded and unloaded
  611. #if [ -f /proc/scsi/scsi ] && grep -q 'Type: Sequential-Access' /proc/scsi/scsi 2>/dev/null ; then
  612. # if grep -qv ' 9 st' /proc/devices ; then
  613. # if [ -n "$USEMODULES" ] ; then
  614. # # Try to load the module. If it fails, ignore it...
  615. # insmod -p st >/dev/null 2>&1 && modprobe st >/dev/null 2>&1
  616. # fi
  617. # fi
  618. #fi
  619.  
  620. # Load agpgart here. This is a hack, and will probably go away soon.
  621. if grep "driver: agpgart" /etc/sysconfig/hwconf >/dev/null 2>&1 ; then
  622. modprobe agpgart >/dev/null 2>&1
  623. fi
  624.  
  625. # Generate a header that defines the boot kernel.
  626. KERNEL_TYPE=`uname -r | sed 's_^[^se]*\(\|smp\|enterprise\)$_-\1_;s_^-$__'`
  627. KERNEL_RELEASE=`uname -r | sed 's|smp\|enterprise||g'`
  628. KERNEL_ARCH=`rpm -q --qf '%{ARCH}' kernel$KERNEL_TYPE-$KERNEL_RELEASE 2>/dev/null`
  629. OLD_KERNEL_ARCH_TYPE=`sed -n 's_^/\* Kernel type \(.*\) \*/_\1_p' /boot/kernel.h 2>/dev/null`
  630. if [ -n "$KERNEL_ARCH" -a "$KERNEL_ARCH$KERNEL_TYPE" != "$OLD_KERNEL_ARCH_TYPE" ]; then
  631. ENTERPRISE="0"
  632. SMP="0"
  633. UP="0"
  634. case "$KERNEL_TYPE" in
  635. -smp) SMP="1";;
  636. -enterprise) ENTERPRISE="1";;
  637. *) UP="1";;
  638. esac
  639. cat > /boot/kernel.h << EOF
  640. /* This file is automatically generated at boot time. */
  641. #ifndef __BOOT_KERNEL_H_
  642. #define __BOOT_KERNEL_H_
  643.  
  644. /* Kernel type $KERNEL_ARCH$KERNEL_TYPE */
  645.  
  646. #ifndef __MODULE_KERNEL_$KERNEL_ARCH
  647. #define __MODULE_KERNEL_$KERNEL_ARCH 1
  648. #endif
  649.  
  650. #ifndef __BOOT_KERNEL_ENTERPRISE
  651. #define __BOOT_KERNEL_ENTERPRISE $ENTERPRISE
  652. #endif
  653.  
  654. #ifndef __BOOT_KERNEL_SMP
  655. #define __BOOT_KERNEL_SMP $SMP
  656. #endif
  657.  
  658. #ifndef __BOOT_KERNEL_UP
  659. #define __BOOT_KERNEL_UP $UP
  660. #endif
  661.  
  662. #endif
  663. EOF
  664. fi
  665.  
  666. # Adjust symlinks as necessary in /boot to keep system services from
  667. # spewing messages about mismatched System maps and so on.
  668. if [ -L /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
  669. ln -s -f System.map-`uname -r` /boot/System.map
  670. fi
  671. if [ ! -e /boot/System.map -a -r /boot/System.map-`uname -r` ] ; then
  672. ln -s -f System.map-`uname -r` /boot/System.map
  673. fi
  674.  
  675. # Now that we have all of our basic modules loaded and the kernel going,
  676. # let's dump the syslog ring somewhere so we can find it later
  677. dmesg > /var/log/dmesg
  678. kill -TERM `/sbin/pidof getkey` >/dev/null 2>&1
  679. } &
  680. if [ "$PROMPT" != "no" ]; then
  681. /sbin/getkey i && touch /var/run/confirm
  682. fi
  683.  
  684. # Load modules (for backward compatibility with VARs)
  685. if [ -f /etc/rc.d/rc.modules ]; then
  686. /etc/rc.d/rc.modules
  687. fi
  688.  
  689. #if expr $LCD != 0 >/dev/null 2>&1
  690. #then
  691. /sbin/apromessage.static "Initializing" "Stage 5" "===================" "Please wait..."
  692. #else
  693. # /sbin/promessage.static "Initializing" "Stage 5"
  694. #fi
  695.  
  696. /sbin/sethostname
  697. wait
Advertisement
Add Comment
Please, Sign In to add comment