#!/bin/zsh
# Michael Weber <xmw at gentoo dot org> (Apr 23 2011)

setopt -e
cd /usr/src/linux
[ -f .config ] || zcat /proc/config.gz > .config
make oldconfig
make menuconfig
$EDITOR .config
time ( make -j4 && make modules_install && make install )
depmod -a
module-rebuild rebuild
[ -e /boot/initramfs.cpio.gz ] && mv /boot/initramfs.cpio.gz /boot/initramfs.cpio.old.gz
[ -e /usr/src/initramfs ] && rm -r /usr/src/initramfs
mkinitramfs.sh /usr/src/initramfs

