rcS 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #! /bin/ash
  2. # ---------------------------------------------
  3. # MDEV Support
  4. # (Requires sysfs support in the kernel)
  5. # ---------------------------------------------
  6. mount -n -t proc /proc /proc
  7. mount -n -t sysfs sysfs /sys
  8. mount -n -t tmpfs mdev /dev
  9. mkdir /dev/pts
  10. mount -t devpts devpts /dev/pts
  11. #echo -n " Enabling hot-plug : "
  12. echo "/sbin/mdev" > /proc/sys/kernel/hotplug
  13. #echo -n " Populating /dev : "
  14. mkdir /dev/input
  15. mkdir /dev/snd
  16. mdev -s
  17. # ---------------------------------------------
  18. # Disable power management
  19. # (Requires sysfs support in the kernel)
  20. # ---------------------------------------------
  21. # echo -n " Disabling Power mgmt : "
  22. # echo -n "1" > /sys/power/cpuidle_deepest_state
  23. # status $? 1
  24. # ---------------------------------------------
  25. # Mount the default file systems
  26. # ---------------------------------------------
  27. #echo -n " Mounting other filesystems : "
  28. mount -a
  29. mount -t tmpfs tmpfs /mnt
  30. chmod 777 /Storage
  31. mount -t jffs2 /dev/mtdblock13 /Storage
  32. mkdir -p /Storage/EventLog
  33. mkdir -p /Storage/ChargeLog
  34. mkdir -p /Storage/SystemLog
  35. mkdir -p /Storage/OCPP
  36. mkdir -p /UsbFlash
  37. ln -s /mnt /var/www
  38. # ---------------------------------------------
  39. # Set PATH
  40. # ---------------------------------------------
  41. export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
  42. # ---------------------------------------------
  43. # Start other daemons
  44. # ---------------------------------------------
  45. #echo 110 > /sys/class/gpio/export
  46. #echo "out" > /sys/class/gpio/gpio110/direction
  47. #echo 1 > /sys/class/gpio/gpio110/value
  48. #sleep 2
  49. /sbin/ifconfig eth0 192.168.1.10 netmask 255.255.255.0
  50. /sbin/ifconfig eth0 down
  51. sleep 1
  52. /sbin/ifconfig eth0 up
  53. /sbin/route add default gw 192.168.1.1
  54. #echo -n " Starting telnetd : "
  55. #/usr/sbin/telnetd -l /bin/login
  56. #status $? 0
  57. echo -e " Starting SSH : \n"
  58. /sbin/dropbear
  59. echo -e " Starting FTPD : \n"
  60. tcpsvd -vE 0.0.0.0 21 ftpd -w -t 30 / &
  61. echo -e " Starting LIGHTTPD : \n"
  62. /sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -m /lib
  63. cp /root/.tmate.conf /
  64. /usr/sbin/crond &
  65. id=CSU3_$(cat /sys/class/net/eth0/address)
  66. echo $id > /etc/hostname
  67. hostname -F /etc/hostname
  68. #status $? 0
  69. # ---------------------------------------------
  70. # Softlink
  71. # ---------------------------------------------
  72. cd lib
  73. ln -sf libbz2.so.1.0.6 libbz2.so.1
  74. # ---------------------------------------------
  75. # Start demo app
  76. # ---------------------------------------------
  77. /root/main &