blob: c2d1ae24c4cf5282e4b8ac66b6e804201e6c38ba (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
#!/bin/bash
cd /usr/src/linux || ( echo "No kernel directory"; exit 1 )
[ -f .config ] || ( echo "No kernel configuration"; exit 1 )
make -j2 || ( echo "Make failed" ; exit 1 )
make modules -j2 || ( echo "Make modules failed" ; exit 1 )
make modules_install -j2 || ( echo "Make modules install failed" ; exit 1 )
emerge -q1 @module-rebuild || exit 1
make install -j2 || ( echo "Make install failed" ; exit 1 )
KV=$(head $(ls -1t /boot/config-* | head -n1) -n3 | tail -n1 | cut -d ' ' -f 3)
if [ -x /usr/bin/dracut ] ; then
/usr/bin/dracut -H -f --lzma /boot/initramfs-$KV.img $KV
fi
if [ -x /usr/sbin/kexec ] ; then
if [ -x /run/openrc/started/kexec ] ; then
/run/openrc/started/kexec stop
fi
kexec -l "/boot/vmlinuz-$KV" --append="`cat /proc/cmdline`" --initrd=/boot/initramfs-$KV.img
fi
grub2-mkconfig -o /boot/grub2/grub.cfg
|