File: pstore_crash_test

package info (click to toggle)
linux 6.17.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,734,900 kB
  • sloc: ansic: 26,684,436; asm: 271,195; sh: 147,406; python: 75,980; makefile: 57,306; perl: 36,943; xml: 19,562; cpp: 5,899; yacc: 4,909; lex: 2,943; awk: 1,556; sed: 29; ruby: 25
file content (30 lines) | stat: -rwxr-xr-x 842 bytes parent folder | download | duplicates (31)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only

# pstore_crash_test - Pstore test shell script which causes crash and reboot
#
# Copyright (C) Hitachi Ltd., 2015
#  Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>
#

# exit if pstore backend is not registered
. ./common_tests

prlog "Causing kernel crash ..."

# enable all functions triggered by sysrq
echo 1 > /proc/sys/kernel/sysrq
# setting to reboot in 3 seconds after panic
echo 3 > /proc/sys/kernel/panic

# save uuid file by different name because next test execution will replace it.
mv $TOP_DIR/uuid $TOP_DIR/prev_uuid

# create a file as reboot flag
touch $REBOOT_FLAG
sync

# cause crash
# Note: If you use kdump and want to see kmesg-* files after reboot, you should
#       specify 'crash_kexec_post_notifiers' in 1st kernel's cmdline.
echo c > /proc/sysrq-trigger