1#!/bin/sh 2# SPDX-License-Identifier: GPL-2.0-only 3 4# pstore_crash_test - Pstore test shell script which causes crash and reboot 5# 6# Copyright (C) Hitachi Ltd., 2015 7# Written by Hiraku Toyooka <hiraku.toyooka.gu@hitachi.com> 8# 9 10# exit if pstore backend is not registered 11. ./common_tests 12 13prlog "Causing kernel crash ..." 14 15# enable all functions triggered by sysrq 16echo 1 > /proc/sys/kernel/sysrq 17# setting to reboot in 3 seconds after panic 18echo 3 > /proc/sys/kernel/panic 19 20# save uuid file by different name because next test execution will replace it. 21mv $TOP_DIR/uuid $TOP_DIR/prev_uuid 22 23# create a file as reboot flag 24touch $REBOOT_FLAG 25sync 26 27# cause crash 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. 30echo c > /proc/sysrq-trigger 31