rc.init 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. #!/bin/sh
  2. . /etc/conf.d/status
  3. . /etc/conf.d/main.conf
  4. . /etc/conf.d/static_network.conf
  5. export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/freon/bin:/freon/sbin
  6. export LD_LIBRARY_PATH=/lib:/lib64:/usr/lib:/freon/lib:/freon/lib64:/freon/lib/x86_64-linux-gnu
  7. # clear
  8. clear
  9. # Welcome message!
  10. echo "Welcome to Freon Linux!"
  11. # mount proc on boot
  12. echo -n "Mounting /proc..."
  13. /bin/mount -t proc proc /proc -o nosuid,noexec,nodev
  14. status
  15. # mount /sys
  16. echo -n "Mounting /sys..."
  17. /bin/mount -t sysfs sys /sys -o nosuid,noexec,nodev
  18. status
  19. # mount devpts
  20. echo -n "Mounting /dev/pts..."
  21. /bin/mount -t devpts /dev/pts
  22. status
  23. # Remount rootfs with read and write
  24. echo -n "Remounting rootfs... "
  25. /bin/mount -o remount,rw / > /dev/null
  26. status
  27. echo -n "Checking some local paths..."
  28. # Check if mtab is linked to mounts
  29. if [ ! -L /etc/mtab ]; then
  30. ln -s /proc/mounts /etc/mtab
  31. fi
  32. # Check to see if keymap exists
  33. if [ ! -f /share/kmap/$KMAP.kmap ]; then
  34. /bin/dumpkmap > /share/kmap/$KMAP.kmap
  35. fi
  36. status
  37. # Deal with mdev
  38. /sbin/mdev -s
  39. echo /sbin/mdev > /proc/sys/kernel/hotplug
  40. # Set hostname
  41. echo -n "Setting hostname... "
  42. /bin/hostname -F /etc/hostname > /dev/null
  43. status
  44. # Configure network loopback
  45. echo -n "Configuring network loopback... "
  46. /sbin/ifconfig lo 127.0.0.1 up
  47. /sbin/route add 127.0.0.1 lo
  48. status
  49. # Get eth0 linked up
  50. echo -n "Prepare $NETINTERFACE... "
  51. /sbin/ifconfig $NETINTERFACE up > /dev/null
  52. status
  53. # Start network
  54. if [ "$NETTYPE" = "dynamic" ] ; then
  55. echo -n "Starting UDHCPC... "
  56. /sbin/udhcpc -b -i $NETINTERFACE -p /var/run/udhcpc.$NETINTERFACE.pid > /dev/null
  57. status
  58. else
  59. echo -n "Static IP set, starting $IP on $NETINTERFACE... "
  60. /sbin/ifconfig $NETINTERFACE $IP netmask $MASK up
  61. /sbin/route add default gateway $GATEWAY
  62. echo -n "nameserver $DNS_SERVER" > /etc/resolv.conf
  63. fi
  64. echo -n "Loading Keymap..."
  65. /sbin/loadkmap < /share/kmap/$KMAP.kmap
  66. status
  67. /etc/init.d/dropbear start
  68. /etc/init.d/chttpd start
  69. export TERM="xterm"
  70. export TERMINFO="/share/terminfo"
  71. # Show login prompt
  72. getty 9600 tty1