#!/bin/sh
[[ $UID = 0 ]] || { echo "restarting with sudo" >&2; exec sudo "$0" "$@"; }

kexec -l /boot/vmlinuz-linux-lts --initrd=/boot/initramfs-linux-lts.img  --reuse-cmdline
sync
for fs in `cat /etc/mtab  | egrep '(btrfs|ext)' | cut -f 2 -d' '`; do
    mount -o remount,ro $fs
done
systemctl kexec
