#!/bin/sh [ -z $PREPKG ] && exit 1 VERSION=$(awk '/^VERSION/ {print $3}' Makefile) PATCHLEVEL=$(awk '/^PATCHLEVEL/ {print $3}' Makefile) SUBLEVEL=$(awk '/^SUBLEVEL/ {print $3}' Makefile) EXTRAVERSION=$(awk '/^EXTRAVERSION/ {print $3}' Makefile) KERNELRELEASE=$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION mkdir -p $PREPKG/{install,boot}/ # http://distcc.samba.org/faq.html#linux2.2 [ "$PATCHLEVEL" = "2" ] && unset MAKEJOBS make mrproper &> make_mrproper.output make menuconfig make dep &> make_dep.output make $MAKEJOBS bzImage &> make_bzImage.output make $MAKEJOBS modules &> make_modules.output make INSTALL_MOD_PATH=$PREPKG modules_install &> make_modules-install.output find $PREPKG/lib/modules/$KERNELRELEASE/ -type f -name '*.o' -exec gzip -9 {} \; # regenerate modules.* to take the above into account /sbin/depmod -ae -F System.map -b $PREPKG -r $KERNELRELEASE cp -p System.map $PREPKG/boot/System.map-$KERNELRELEASE ln -s System.map-$KERNELRELEASE $PREPKG/boot/System.map cp -p .config $PREPKG/boot/config-$KERNELRELEASE ln -s config-$KERNELRELEASE $PREPKG/boot/config cp -p arch/i386/boot/bzImage $PREPKG/boot/vmlinuz-$KERNELRELEASE ln -s vmlinuz-$KERNELRELEASE $PREPKG/boot/vmlinuz