2011-06-29 06:43:12 +02:00
|
|
|
set -ev
|
|
|
|
|
|
|
|
# (possibly) build the kernel
|
|
|
|
|
|
|
|
# If there is already a kernel in /boot and emerging the kernel only
|
|
|
|
# re-installs the same package, we can skip this
|
|
|
|
if [ -e /boot/vmlinuz ] && emerge -pq sys-kernel/${KERNEL}|grep '^\[.*R.*\]' >/dev/null
|
|
|
|
then
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
|
2011-07-18 00:10:57 +02:00
|
|
|
${EMERGE} ${USEPKG} --oneshot --noreplace dev-lang/perl
|
2011-06-29 06:43:12 +02:00
|
|
|
${EMERGE} ${USEPKG} sys-kernel/${KERNEL}
|
|
|
|
cp /root/kernel.config /usr/src/linux/.config
|
|
|
|
gcc-config 1
|
|
|
|
cd /usr/src/linux
|
|
|
|
make ${MAKEOPTS} oldconfig
|
|
|
|
make ${MAKEOPTS}
|
|
|
|
rm -rf /lib/modules/*
|
|
|
|
make ${MAKEOPTS} modules_install
|
|
|
|
rm -f /boot/vmlinuz*
|
|
|
|
make ${MAKEOPTS} install
|
|
|
|
cd /boot
|
|
|
|
k=`/bin/ls -1 vmlinuz-*`
|
|
|
|
ln -nsf $k vmlinuz
|
2011-07-18 00:10:57 +02:00
|
|
|
${EMERGE} --depclean dev-lang/perl
|