rcS 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. ubiattach /dev/ubi_ctrl -m 13
  33. if [ "$?" -eq "0" ]
  34. then
  35. echo "Success."
  36. else
  37. echo "Erase /dev/mtd13 jffs2 block"
  38. flash_eraseall /dev/mtd13
  39. ubiattach /dev/ubi_ctrl -m 13
  40. fi
  41. ubimkvol /dev/ubi0 -N ubiNandFs -m
  42. mount -t ubifs ubi0:ubiNandFs /Storage
  43. mkdir -p /Storage/EventLog
  44. mkdir -p /Storage/ChargeLog
  45. mkdir -p /Storage/SystemLog
  46. mkdir -p /Storage/OCPP
  47. mkdir -p /UsbFlash
  48. ln -s /mnt /var/www
  49. # ---------------------------------------------
  50. # Set PATH
  51. # ---------------------------------------------
  52. export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin
  53. # ---------------------------------------------
  54. # Start other daemons
  55. # ---------------------------------------------
  56. #echo 110 > /sys/class/gpio/export
  57. #echo "out" > /sys/class/gpio/gpio110/direction
  58. #echo 1 > /sys/class/gpio/gpio110/value
  59. #sleep 2
  60. #/sbin/ifconfig eth0 192.168.1.10 netmask 255.255.255.0
  61. #/sbin/ifconfig eth0 down
  62. #sleep 1
  63. #/sbin/ifconfig eth0 up
  64. #/sbin/route add default gw 192.168.1.1
  65. #echo -n " Starting telnetd : "
  66. #/usr/sbin/telnetd -l /bin/login
  67. #status $? 0
  68. echo -e " Starting SSH : \n"
  69. /sbin/dropbear
  70. echo -e " Starting FTPD : \n"
  71. tcpsvd -vE 0.0.0.0 21 ftpd -w -t 30 / &
  72. #echo -e " Starting LIGHTTPD : \n"
  73. #/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -m /lib
  74. cp /root/.tmate.conf /
  75. /usr/sbin/crond &
  76. id=CSU3_$(cat /sys/class/net/eth0/address)
  77. echo $id > /etc/hostname
  78. hostname -F /etc/hostname
  79. #status $? 0
  80. # ---------------------------------------------
  81. # Softlink
  82. # ---------------------------------------------
  83. cd lib
  84. ln -sf libbz2.so.1.0.6 libbz2.so.1
  85. # ---------------------------------------------
  86. # Start demo app
  87. # ---------------------------------------------
  88. /root/main &