using CRIU to checkpoint a kernel build
CRIU stands for Checkpoint/Restart in Userspace. As the criu package should be landing in Utopic soon, and I wanted to test drive it to see how it handles.
I thought of an interesting example of being in the middle of a linux kernel build and a security update needing to be installed and the machine rebooted. While most of us could probably just reboot and rebuild, why not checkpoint it and save the progress; then restore after the system update? I admit its not the most useful example; but it is pretty cool nonetheless.
sudo apt-get install criu # start build; save the PID for later cd linux; make clean; make defconfig make & echo $! > ~/make.pid # enter a clean directory that isn't tmp and dump state mkdir ~/cr-build && cd $_ sudo criu dump --shell-job -t $(cat ~/make.pid) # install and reboot machine # restore your build cd ~/cr-build sudo criu restore --shell-job -t $(cat ~/make.pid)
And you’re building again!