xref: /linux/tools/testing/selftests/liveupdate/do_kexec.sh (revision 509d3f45847627f4c5cdce004c3ec79262b5239c)
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