4 KERNEL
="/mnt/boot/kernel"
6 if [ $ARCH = "arm" ]; then
7 KEXEC_ARGS
="$KEXEC_ARGS --atags"
15 Syntax: $me [-k kernel]
17 -k give the path to the kernel eg. /boot/vmlinuz-4.7.4
23 while getopts "k:" ch
; do
26 # if default does not fit, give the actual keren via -k otion eg "-k /boot/vmlinuz-4.7.4
39 # get the Bootargs and replace the current Partition with
40 # the one in $1 e.g. replace /dev/mmcblk0p2 with /dev/mmcblk0p3
41 BOOT_ARGS
="$(cat /proc/cmdline | sed s#$CURRENT_PART#$1#g)"
42 # echo "kexec $KEXEC_ARG --append=\"$BOOT_ARGS\" $KERNEL"
44 # Load the new kernel, unmount the partition and exec the new kernel
45 kexec
$KEXEC_ARGS --append=\""$BOOT_ARGS"\" $KERNEL
51 umount
/mnt
2> /dev
/null
53 # get the partiton of the current kernel
54 PART
="/dev/$(readlink /dev/root)"
55 # extract the partition number
56 C_M_PART_NUM
=$
(readlink
/dev
/root |
grep -o -e '[[:digit:]]*$')
58 # cut off the Partition Number
59 C_M_PART
=$
(readlink
/dev
/root |
sed "s/$C_M_PART_NUM\$//")
61 CURRENT_PART
="/dev/${C_M_PART}${C_M_PART_NUM}"
65 DEVICE
="/dev/${C_M_PART}${PART_B}"
70 DEVICE
="/dev/${C_M_PART}${PART_A}"