On Thursday 26 Jun 2003 08:27, Martin Gramatke wrote:
> How do you know, which packages needs to be reemerged?

#====================================================
#!/bin/sh
# /usr/local/bin/kernel-deps
# list the ebuilds that depend on kernel version.
# suggested by Georgi Georgiev <[EMAIL PROTECTED]>

for i in `grep -l ' /lib/modules/' /var/db/pkg/*/*/CONTENTS`; do
        ii=`dirname $i`;
        cat $ii/COUNTER; echo " $ii";
done | sort -n | cut -f5,6 -d/ | sed -e 's/^/>=/'
#====================================================

I use these two scripts for building kernels:
#====================================================
#!/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

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

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

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

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

make dep clean
if [ $(echo $?) -ne 0 ] ; then
        echo
        echo "    make dep clean failed"
        exit 1
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
        kernel-deps | env ACCEPT_KEYWORDS="~x86" xargs emerge
        # These modules not needed and always have unresolved symbols:
        rm /lib/modules/$(uname -r)/misc/i2c-hydra.o
        rm /lib/modules/$(uname -r)/misc/i2c-i810.o
        rm /lib/modules/$(uname -r)/misc/i2c-savage4.o
        rm /lib/modules/$(uname -r)/misc/i2c-via.o
        rm /lib/modules/$(uname -r)/misc/i2c-voodoo3.o
else
        echo
        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"
#====================================================

#====================================================
#!/bin/sh
# /usr/local/bin/build-kernel-2
# Run this after booting into a new kernel
kernel-deps | env ACCEPT_KEYWORDS="~x86" xargs emerge
#AUTOCLEAN="no" ACCEPT_KEYWORDS="~x86" emerge lm-sensors nvidia-kernel
# These modules not needed and always have unresolved symbols:
rm /lib/modules/$(uname -r)/misc/i2c-hydra.o
rm /lib/modules/$(uname -r)/misc/i2c-i810.o
rm /lib/modules/$(uname -r)/misc/i2c-savage4.o
rm /lib/modules/$(uname -r)/misc/i2c-via.o
rm /lib/modules/$(uname -r)/misc/i2c-voodoo3.o
#====================================================

Peter
-- 
==================================================
Gentoo Linux:   Gentoo Base System version 1.4.3.8p1
kernel-2.4.21_rc8-gss i686 AMD Athlon(tm) XP 1600+
==================================================


--
[EMAIL PROTECTED] mailing list

Reply via email to