2 # SPDX-License-Identifier: GPL-2.0-only
4 # pstore_crash_test - Pstore test shell script which causes crash and reboot
6 # Copyright (C) Hitachi Ltd., 2015
7 # Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
10 # exit if pstore backend is not registered
13 prlog
"Causing kernel crash ..."
15 # enable all functions triggered by sysrq
16 echo 1 > /proc
/sys
/kernel
/sysrq
17 # setting to reboot in 3 seconds after panic
18 echo 3 > /proc
/sys
/kernel
/panic
20 # save uuid file by different name because next test execution will replace it.
21 mv $TOP_DIR/uuid
$TOP_DIR/prev_uuid
23 # create a file as reboot flag
28 # Note: If you use kdump and want to see kmesg-* files after reboot, you should
29 # specify 'crash_kexec_post_notifiers' in 1st kernel's cmdline.
30 echo c
> /proc
/sysrq-trigger