xref: /linux/tools/testing/selftests/liveupdate/do_kexec.sh (revision b61104e7a6349bd2c2b3e2fb3260d87f15eda8f4)
1#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3set -e
4
5# Use $KERNEL and $INITRAMFS to pass custom Kernel and optional initramfs
6
7KERNEL="${KERNEL:-/boot/bzImage}"
8set -- -l -s --reuse-cmdline "$KERNEL"
9
10INITRAMFS="${INITRAMFS:-/boot/initramfs}"
11if [ -f "$INITRAMFS" ]; then
12    set -- "$@" --initrd="$INITRAMFS"
13fi
14
15kexec "$@"
16kexec -e
17