On Wednesday 31 Dec 2003 10:04, [EMAIL PROTECTED] wrote:
> On Wed, 31 Dec 2003, Peter Ruskin wrote:
> > On Tuesday 30 Dec 2003 22:21, [EMAIL PROTECTED] wrote:
> > > I have experience in various other distro's so I know the usual
> > > procedure ... BUT this time things don't work. Modules won't
> > > load, insmod module gives me a series of unresolved symbols. Note
> > > that I have done depmod -a, System.map is correct, the system
> > > boots ok (important things are not as modules).
> >
> > One thing refugees from other linux distros often forget to do when
> > rolling their own kernels is to mount /boot (Gentoo's /boot is not
> > mounted by default).
>
> Yes, I was wandering about that .. but I did mount /boot before
> installing the relevant files, and "genkernel --config" kernel works
> on the gentoo system without having /boot mounted so mine should too
> shouldn't it ? Or must /boot be mounted _during_ the kernel build
> process for some reason ? Or is the fact I'm not using an initrd
> image the problem ? As soon as I rebuild the kernel (still need some
> fine adjustment I feel, but best to have a few things to do together
> all in one time) I'll try again with make mrproper too.

This is what I use.  You could try it step-by-step first by copy/paste 
to an xterm line-by-line:

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

### NOTES ###
# To build Mandrake kernels, chroot from Gentoo, because otherwise
# you'll never get in if your drives are hd{e,f,g} etc.  This is
# because Mandrake always sets "CONFIG_BLK_DEV_OFFBOARD".
#
# If you want to do `make oldconfig`, run "build-kernel old"
#############

# 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
echo "Removing 'linux' symbolic link..."
echo
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 ..
echo "Making 'linux' symbolic link..."
echo
ln -sf linux${kernel} 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

### MANDRAKE ONLY ###
# mkinitrd /boot/initrd${kernel}.img $( echo ${kernel} | cut -d- -f2-9 )
#####################

echo
# 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
        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-gentoo-w4l)       i686 AMD Athlon(tm) XP 3200+
======================================================================


--
[EMAIL PROTECTED] mailing list

Reply via email to