31 lines · plain
1#!/bin/sh2# SPDX-License-Identifier: GPL-2.0-only3 4# pstore_crash_test - Pstore test shell script which causes crash and reboot5#6# Copyright (C) Hitachi Ltd., 20157# Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com>8#9 10# exit if pstore backend is not registered11. ./common_tests12 13prlog "Causing kernel crash ..."14 15# enable all functions triggered by sysrq16echo 1 > /proc/sys/kernel/sysrq17# setting to reboot in 3 seconds after panic18echo 3 > /proc/sys/kernel/panic19 20# save uuid file by different name because next test execution will replace it.21mv $TOP_DIR/uuid $TOP_DIR/prev_uuid22 23# create a file as reboot flag24touch $REBOOT_FLAG25sync26 27# cause crash28# Note: If you use kdump and want to see kmesg-* files after reboot, you should29# specify 'crash_kexec_post_notifiers' in 1st kernel's cmdline.30echo c > /proc/sysrq-trigger31