secondrun 966 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. ### BEGIN INIT INFO
  3. # Provides: secondrun
  4. # Required-Start: $all
  5. # Required-Stop:
  6. # Should-Start:
  7. # Default-Start: 2 3 4 5
  8. # Default-Stop: 0 1 6
  9. # Short-Description: Script to run when second starting
  10. # Description: Expanding rottfs
  11. ### END INIT INFO
  12. # script from https://github.com/igorpecovnik/lib
  13. # modified by https://github.com/bleuchtang/sunxi-debian
  14. N=/etc/init.d/secondrun
  15. case "$1" in
  16. start)
  17. echo ""
  18. echo "##########################################"
  19. echo "## SECONDRUN INIT SCRIPT ##"
  20. echo "## WAIT SOME MINUTES FOR CONFIGURATIONS ##"
  21. echo "##########################################"
  22. echo ""
  23. echo "##############################"
  24. echo "# Expanding rootfs partition #"
  25. echo "##############################"
  26. echo ""
  27. /sbin/resize2fs /dev/mmcblk0p1
  28. /sbin/insserv -r secondrun
  29. ;;
  30. *)
  31. echo "Usage: $N {start}" >&2
  32. exit 1
  33. ;;
  34. esac
  35. exit 0