S83app 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/sh
  2. mount -o remount rw /
  3. echo "==================== Start App ===================="
  4. /usr/sbin/telnetd
  5. eval $( /usr/bin/awk '/\/dev\/root/ {printf("flashfs=%s", $3)}' /proc/mounts)
  6. eval $( /usr/bin/awk '/nfs/ {printf("fstype=%s", $3)}' /proc/mounts)
  7. eval $( /usr/bin/awk '/system/{$a=substr($0,4,1);printf("system_name=/dev/mtdblock%d",$a)}' /proc/mtd)
  8. eval $( /usr/bin/awk '/dav1/{$a=substr($0,4,1);printf("para1_name=/dev/mtdblock%d", $a)}' /proc/mtd)
  9. eval $( /usr/bin/awk '/dav2/{$a=substr($0,4,1);printf("para2_name=/dev/mtdblock%d",$a)}' /proc/mtd)
  10. echo "partition information:"
  11. echo "current filesystem on:$flashfs$fstype"
  12. echo system_name=$system_name
  13. echo para1_name=$para1_name
  14. echo para2_name=$para2_name
  15. if [ "$flashfs" == "ext2" ] ; then
  16. echo "==================== flash filesystem ===================="
  17. if [ "$system_name" != "" ] ; then
  18. /bin/mount -t yaffs2 "$system_name" /boot/
  19. if [ -e /boot/app.tar.gz ] ; then
  20. /bin/tar -zxf /boot/app.tar.gz -C /
  21. echo "mount yaffs2 filesystem done."
  22. else
  23. echo "no application package!!!."
  24. fi
  25. fi
  26. if [ "$para1_name" != "" ] ; then
  27. /bin/mount -t yaffs2 "$para1_name" /dav1/
  28. fi
  29. if [ "$para2_name" != "" ] ; then
  30. /bin/mount -t yaffs2 "$para2_name" /dav2/
  31. fi
  32. elif [ "$fstype" == "nfs" ] ; then
  33. echo "==================== network filesystem ===================="
  34. else
  35. echo "==================== unknown filesystem ===================="
  36. fi
  37. sh /home/startapp.sh