On Thursday 04 Dec 2003 17:15, Paul Varner wrote:
> I am aware of that and the first comment in the script says that it
> evolved from the simple script 'emerge -v `qpkg -I -nc -f
> /lib/modules`'

Here's my kernel build script that includes this:

##################################################
#!/bin/sh
# /usr/local/bin/build-kernel

# start this script from the kernel source directory,
# for example /usr/src/linux-2.4.20-xfs-r2
# ...test for that...
grep -q "Linux kernel" ./README
if [ "$(echo $?)" != "0" ] ; then
        echo "ERROR: You don't appear to be in a kernel source directory"
        echo
        exit 1
fi

# remove symlink
if [ "$( file ../linux | grep 'symbolic link' )" != "" ]; then
        rm -f ../linux
fi

# This kernel variable produces something like "-2.4.20-xfs-r2"
kernel=$(pwd | cut -dx -f2-9)

# make symlink
cd ..
ln -sf linux${kernel} linux
ln -sf . ../linux

cd linux${kernel}

# comment these 3 lines if you don't need mrproper
#cp .config ..
#make mrproper
#cp ../.config .

# check timestamp of .config
CONFTIME=$(ls -l .config | awk '{print $6,$7,$8}')

# use old if you told it to, or preferably xconfig if it can, else
# menuconfig.
if [ "$1" == "old" ]; then
        make oldconfig
else
        make xconfig
        [ $(echo $?) -eq 0 ] || make menuconfig
fi

if [ "$(ls -l .config | awk '{print $6,$7}')" == "$CONFTIME" ] ; then
        echo
        echo "    .config file unchanged...aborting"
        exit 0
fi

# NOTE**  make dep not required for 2.6 kernels
PATCHLEVEL=$(grep 'PATCHLEVEL =' /usr/src/linux/Makefile | \
        cut -d= -f2 | cut -d' ' -f2)
if [ ${PATCHLEVEL} -gt 5 ]; then
        make clean
        if [ $(echo $?) -ne 0 ] ; then
                echo
                echo "    make clean failed"
                exit 1
        fi
else
        make dep clean
        if [ $(echo $?) -ne 0 ] ; then
                echo
                echo "    make dep clean failed"
                exit 1
        fi
fi

make bzImage
if [ $(echo $?) -ne 0 ] ; then
        echo
        echo "    make bzImage failed"
        exit 1
fi

make modules
if [ $(echo $?) -ne 0 ] ; then
        echo
        echo "    make modules failed"
        exit 1
fi

make modules_install
if [ $(echo $?) -ne 0 ] ; then
        echo
        echo "    make modules_install failed"
        exit 1
fi

[ "$(grep boot /etc/mtab)" == "" ] && mount /boot
cp arch/i386/boot/bzImage /boot/vmlinuz$kernel
cp System.map /boot/System.map$kernel
cp .config /boot/.config$kernel
sync

# if just rebuilding booted kernel...
if [[ "-$(uname -r)" == "$kernel" ]] ; then
        if [ ${PATCHLEVEL} -gt 5 ]; then
                env AUTOCLEAN="no" ACCEPT_KEYWORDS="~x86" \
emerge -v $(qpkg -I -nc -f /lib/modules | \
grep -v i2c | grep -v lm-sensors)
        else
                env AUTOCLEAN="no" ACCEPT_KEYWORDS="~x86" \
emerge -v $(qpkg -I -nc -f /lib/modules)
        fi
else
        echo
        # build-kernel-2 contains the first if clause above
        echo "Run build-kernel-2 after next reboot to"
        echo "update lm_sensors, nvidia-kernel, etc."
fi

echo
echo "    All done.  Now edit /boot/grub/grub.conf and reboot"
##################################################

Peter
-- 
======================================================================
Gentoo Linux:   Portage 2.0.49-r18 (default-x86-1.4, gcc-3.2.3, 
glibc-2.3.2-r3, 2.6.0-test11-gentoo-r1-win4lin) i686 AMD Athlon(tm) XP 
3200+
======================================================================


--
[EMAIL PROTECTED] mailing list

Reply via email to