Xmister
May 7th, 2008, 02:30 PM
If you don't know what is kexec take a look here (https://wiki.ubuntu.com/RapidReboot).
For me kexec hasn't worked until 8.04.
The examples that I saw before just boot to the current kernel, but this will boot the newest installed one.
First you have to install kexec-tools:
sudo apt-get install kexec-tools
Then we need to edit the reboot script.
First make a backup of it:
sudo cp /etc/init.d/reboot /etc/init.d/reboot_normal
Then edit:
sudo gedit /etc/init.d/reboot
Find the do_stop function, it looks like this:
do_stop () {
# Message should end with a newline since kFreeBSD may
# print more stuff (see #323749)
log_action_msg "Will now restart"
reboot -d -f -i
}
And replace it with this:
do_stop () {
# Message should end with a newline since kFreeBSD may
# print more stuff (see #323749)
log_action_msg "Will now restart"
if [ -x /sbin/kexec ]; then
kexec -l --append="`cat /proc/cmdline`" --initrd=/boot/initrd.img-`ls /lib/modules | sort -nr | head -n 1` /boot/vmlinuz-`ls /lib/modules | sort -nr | head -n 1`
sync
umount -a
kexec -e
else
reboot -d -f -i
fi
}
For me kexec hasn't worked until 8.04.
The examples that I saw before just boot to the current kernel, but this will boot the newest installed one.
First you have to install kexec-tools:
sudo apt-get install kexec-tools
Then we need to edit the reboot script.
First make a backup of it:
sudo cp /etc/init.d/reboot /etc/init.d/reboot_normal
Then edit:
sudo gedit /etc/init.d/reboot
Find the do_stop function, it looks like this:
do_stop () {
# Message should end with a newline since kFreeBSD may
# print more stuff (see #323749)
log_action_msg "Will now restart"
reboot -d -f -i
}
And replace it with this:
do_stop () {
# Message should end with a newline since kFreeBSD may
# print more stuff (see #323749)
log_action_msg "Will now restart"
if [ -x /sbin/kexec ]; then
kexec -l --append="`cat /proc/cmdline`" --initrd=/boot/initrd.img-`ls /lib/modules | sort -nr | head -n 1` /boot/vmlinuz-`ls /lib/modules | sort -nr | head -n 1`
sync
umount -a
kexec -e
else
reboot -d -f -i
fi
}