rc.local 620 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. #
  3. # rc.local
  4. #
  5. # This script is executed at the end of each multiuser runlevel.
  6. # Make sure that the script will "exit 0" on success or any other
  7. # value on error.
  8. #
  9. # In order to enable or disable this script just change the execution
  10. # bits.
  11. #
  12. set +e
  13. export PATH=/bin:/usr/bin:/sbin:/usr/sbin
  14. export LC_ALL=C LANGUAGE=C LANG=C
  15. # Workaround firmware issue leaving i2c0 in an non-ALT0 state.
  16. for i in 28 29; do
  17. echo $i > /sys/class/gpio/export
  18. echo in > /sys/class/gpio/gpio${i}/direction
  19. done
  20. # Add /dev/ttyS0 link for convenience.
  21. if ! [ -e /dev/ttyS0 ]; then
  22. ln -s /dev/ttyAMA0 /dev/ttyS0
  23. fi
  24. exit 0