init 779 B

12345678910111213141516171819202122
  1. #!/bin/sh
  2. echo "System initialization ..."
  3. export PATH=/bin:/sbin:/usr/bin:/usr/sbin
  4. mount -nt proc proc /proc
  5. mount -o nosuid,nodev,noexec -t sysfs sysfs /sys
  6. [ ! -f /etc/notmpfs ] && {
  7. size=$(awk '/MemTotal:/ { if ($2 > 16000) { print 4096 } else { print 2048 }}' /proc/meminfo)
  8. mount none /tmp -t tmpfs -o size=${size}k
  9. mount none /tmp -t tmpfs -o remount,nosuid,nodev,mode=1777
  10. }
  11. mount -o nosuid,size=128k,mode=0755 -t tmpfs mdev /dev
  12. mkdir /dev/pts /dev/shm
  13. mount -o nosuid,noexec -t devpts devpts /dev/pts
  14. exec 0<>/dev/console >&0 2>&0
  15. echo >/dev/mdev.seq
  16. echo "/sbin/mdev" >/proc/sys/kernel/hotplug
  17. mdev -s
  18. mount -o remount,rw /
  19. cat /etc/.rnd >/dev/urandom 2>&1
  20. [ -f /etc/fstab ] && mount -a
  21. [ -x /sbin/cfgfs ] && { cfgfs setup; mount -o remount,ro /;}
  22. exec /sbin/init