On Monday 17 Nov 2003 19:58, Joel Konkle-Parker wrote:
> By default, genkernel --config always uses menuconfig. Is there an
> option that will tell it to use xconfig if available?
This is what I use:
#################################################################
#!/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".
#############
# 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
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
### MANDRAKE ONLY ###
# mkinitrd /boot/initrd${kernel}.img $( echo ${kernel} | cut -d-
-f2,3,4 )
#####################
echo
echo " All done. Now edit /boot/grub/grub.conf and reboot"
#################################################################
Peter
--
======================================================================
Portage 2.0.49-r15 (default-x86-1.4, gcc-3.2.3, glibc-2.3.2-r3,
2.4.23_pre8-gss)
i686 AMD Athlon(tm) XP 3200+
======================================================================
--
[EMAIL PROTECTED] mailing list