crux-ports

My CRUX Linux ports
Log | Files | Refs | README

rc.init (1636B)


      1 #!/bin/sh
      2 umask 022
      3 
      4 . /etc/rc.conf
      5 
      6 echo "CRUX booting"
      7 
      8 /bin/mount -n -t proc -o nosuid,noexec,nodev proc /proc
      9 /bin/mount -n -t sysfs -o nosuid,noexec,nodev sysfs /sys
     10 
     11 /bin/mount -n -t tmpfs -o nosuid,mode=0755 dev /dev
     12 /bin/mkdir -p /dev/pts
     13 /bin/mount -n -t devpts -o gid=5,mode=0620 devpts /dev/pts
     14 
     15 /bin/mount -o remount,ro /
     16 
     17 echo Running smdev
     18 /bin/smdev -s
     19 
     20 echo Setting smdev as the kernel hotplug
     21 echo /bin/smdev >/proc/sys/kernel/hotplug
     22 
     23 cd /dev
     24 /bin/ln -sf /proc/self/fd/0 stdin
     25 /bin/ln -sf /proc/self/fd/1 stdout
     26 /bin/ln -sf /proc/self/fd/2 stderr
     27 /bin/ln -sf /proc/self/fd fd
     28 cd - >/dev/null
     29 
     30 echo Checking filesystems
     31 /bin/fsck -ATa
     32 if [ $? -eq 1 ]; then
     33 	echo Filesystems error exist, fix manually.
     34 	/bin/sh
     35 	/bin/halt -r
     36 fi
     37 
     38 echo Remounting root as read-write
     39 /bin/mount -o remount,rw /
     40 
     41 echo Mounting filesystems
     42 /bin/mount -a
     43 
     44 /bin/hostname $HOSTNAME
     45 
     46 echo Bringing up loopback
     47 /bin/ip addr add 127.0.0.1/8 dev lo broadcast + scope host
     48 /bin/ip link set lo up
     49 
     50 echo Setting hwclock
     51 [ -n "$TIMEZONE" ] && export TZ="$TIMEZONE"
     52 /bin/hwclock -s -u /dev/rtc0
     53 unset TZ
     54 
     55 [ -f /etc/random-seed ] && /bin/cat /etc/random-seed >/dev/urandom
     56 /bin/dd if=/dev/urandom of=/etc/random-seed count=1 bs=512 2>/dev/null
     57 
     58 echo Enabling core dumps
     59 ulimit -c unlimited
     60 
     61 if [ -x /etc/rc.local ]; then
     62 	echo Running rc.local
     63 	/etc/rc.local
     64 fi
     65 
     66 : >/var/run/utmp
     67 
     68 echo
     69 /bin/sh -c '/bin/respawn /bin/getty /dev/tty1 linux' &>/dev/null &
     70 /bin/sh -c '/bin/respawn /bin/getty /dev/tty2 linux' &>/dev/null &
     71 /bin/sh -c '/bin/respawn /bin/getty /dev/tty3 linux' &>/dev/null &
     72 /bin/sh -c '/bin/respawn /bin/getty /dev/tty4 linux' &>/dev/null &