rcS 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 /Storage/root
  48. mkdir -p /UsbFlash
  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. #--------------------------------------------------------
  61. #/sbin/ifconfig eth0:0 192.168.0.20 netmask 255.255.255.0
  62. #/sbin/ifconfig eth0 down
  63. #sleep 1
  64. #/sbin/ifconfig eth0 up
  65. #/sbin/route add default gw 192.168.0.1
  66. #--------------------------------------------------------
  67. #echo -n " Starting telnetd : "
  68. #/usr/sbin/telnetd -l /bin/login
  69. #status $? 0
  70. #echo -e " Starting SSH : \n"
  71. #/sbin/dropbear
  72. #echo -e " Starting FTPD : \n"
  73. #/sbin/pure-ftpd &
  74. #echo -e " Starting LIGHTTPD : \n"
  75. #/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf -m /lib
  76. #cp /root/.tmate.conf /
  77. #/usr/sbin/crond &
  78. #id=CSU3_$(cat /sys/class/net/eth0/address)
  79. #echo $id > /etc/hostname
  80. #hostname -F /etc/hostname
  81. #status $? 0
  82. # ---------------------------------------------
  83. # Softlink
  84. # ---------------------------------------------
  85. #cd lib
  86. #ln -sf libbz2.so.1.0.6 libbz2.so.1
  87. # ---------------------------------------------
  88. # Loading CCS Apps
  89. # ---------------------------------------------
  90. echo -e " Loading CCS Apps : \n"
  91. cp -rfv /Storage/root/* /root/
  92. # ---------------------------------------------
  93. # Start demo app
  94. # ---------------------------------------------
  95. echo -e " Starting CCS Apps : \n"
  96. /root/main &