pstore_crash_test 844 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. # pstore_crash_test - Pstore test shell script which causes crash and reboot
  3. #
  4. # Copyright (C) Hitachi Ltd., 2015
  5. # Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
  6. #
  7. # Released under the terms of the GPL v2.
  8. # exit if pstore backend is not registered
  9. . ./common_tests
  10. prlog "Causing kernel crash ..."
  11. # enable all functions triggered by sysrq
  12. echo 1 > /proc/sys/kernel/sysrq
  13. # setting to reboot in 3 seconds after panic
  14. echo 3 > /proc/sys/kernel/panic
  15. # save uuid file by different name because next test execution will replace it.
  16. mv $TOP_DIR/uuid $TOP_DIR/prev_uuid
  17. # create a file as reboot flag
  18. touch $REBOOT_FLAG
  19. sync
  20. # cause crash
  21. # Note: If you use kdump and want to see kmesg-* files after reboot, you should
  22. # specify 'crash_kexec_post_notifiers' in 1st kernel's cmdline.
  23. echo c > /proc/sysrq-trigger