unos-repository

APK repository for unos
git clone git://git.finwo.net/misc/unos-repository
Log | Files | Refs | README

rcS (1169B)


      1 #!/bin/sh
      2 exec >/dev/console 2>&1
      3 echo "rcS: mounting pseudo-filesystems"
      4 mount -t proc proc /proc 2>/dev/null || true
      5 mount -t sysfs sys /sys 2>/dev/null || true
      6 mount -t devtmpfs devtmpfs /dev 2>/dev/null || true
      7 mkdir -p /dev/pts 2>/dev/null || true
      8 mount -t devpts devpts /dev/pts -o gid=5,mode=620 2>/dev/null || mount -t devpts devpts /dev/pts 2>/dev/null || true
      9 [ -c /dev/ptmx ] || mknod /dev/ptmx c 5 2 2>/dev/null || true
     10 chmod 666 /dev/ptmx 2>/dev/null || true
     11 mkdir -p /run /tmp 2>/dev/null || true
     12 mount -t tmpfs tmpfs /run 2>/dev/null || true
     13 mount -t tmpfs tmpfs /tmp 2>/dev/null || true
     14 chmod 1777 /tmp 2>/dev/null || true
     15 if [ -f /etc/hostname ]; then
     16   hostname -F /etc/hostname 2>/dev/null || hostname unos 2>/dev/null || true
     17   echo "rcS: hostname $(hostname 2>/dev/null || cat /etc/hostname)"
     18 fi
     19 
     20 runlevel=default
     21 for arg in $(cat /proc/cmdline 2>/dev/null); do
     22   [ -d "/etc/runit/runsvdir/${arg}" ] && runlevel="${arg}"
     23 done
     24 runsvchdir "${runlevel}"
     25 echo "rcS: runlevel ${runlevel}"
     26 
     27 mkdir -p /run/runit/runsvdir
     28 ln -s /etc/runit/runsvdir/current /run/runit/runsvdir/current
     29 echo "rcS: starting runsvdir"
     30 runsvdir -P /run/runit/runsvdir/current &