sslug-teknik team mailing list archive
-
sslug-teknik team
-
Mailing list archive
-
Message #77039
Re: kernekompilering the debian way
On Sat, 16 Oct 2004 10:56:15 +0200, Kristian Nørgaard wrote:
> Hejsa
>
> Jeg besluttede mig for at prøve at kompilere min kerne "the debian way",
> så kompileringen resulterer i en debian pakke. Det gik fint og jeg kan
> egentlig godt lide metoden.
>
> Dog:
>
> Når jeg lavede en ændring, fik jeg bøvl med mindre jeg lavede en
> make-kpkg clean før næste kompilering.
>
> Kan jeg ikke undgå at kompilere forfra hver gang i stil med traditionel
> 'make depend'
Ehh - det ved jeg ikkke. men jeg har lavet et fint shell script der gør
alt for mig, så kan jeg jo bare gå og hente en kop kaffe.
Scriptet benyter sig af de ikke så kendte --append-to-version og
--revision flags, hvilket gør det til en leg at holde styr på
forskellige kerner under debian systemet
hilsen, Marc Cromme
#!/bin/bash -v
echo "YOU MUST STAND IN THE KERNEL SOURCE ROOT DIR TO RUN THIS SCRIPT"
# some practical things to keep in mind in /etc/kernel-pkg.conf:
# maintainer := Marc Cromme
# email := marc@xxxxxxxxx
# do_clean := no
# get needed packages
# sudo apt-get install kernel-package
# sudo apt-get install gcc libc6-dev binutils make bin86 modutils
# sudo apt-get install libqt3-mt-dev g++ # for xconfig
# sudo apt-get install libgtk2.0-dev libglade2-dev # for gconfig
# the $VER variable will be appended to the dpkg name of the
# installed kernel package and the package name,
# the $REV variable only to the package name
export VER='-mc3'
export REV=`date -u +%Y%m%d`
export CONF=/boot/config-`uname -r`
# needed to build external modules like nvidia
export SRC=/usr/src
export MODULE_LOC=`pwd`/modules
echo "INSTALLING AND UNTARRING SOURCE - SOMEWHERE IN USERLAND"
#sudo apt-get install kernel-source-2.6.8
#tar xvjf $SRC/kernel-source-2.6.8.tar.bz2
#zcat /usr/share/doc/kernel-source-2.6.8/debian.README.gz | less
#cd kernel-source-2.6.8
echo "CLEAN IF SECOND ATTEMPT"
make clean
echo "GET START CONFIGURE - CHOOSE ONE OF THESE"
#make defconfig ARCH=i386
#cp $CONF .config
echo "CONFIGURE KERNEL - CHOOSE ONE OF THESE"
# configure kernel - some things to check out on 2.6.x kernels:
# * the correct processor for your system (AMD vs Pentium vs P4, etc)
# * Symmetric Multi-Processing; "No" if you only have a single processor
# * Loadable module support; "Yes" to all three sub-items.
# * Parallel port support; "No" to keep things simple for now.
# * Character devices; turn on Direct Rendering if your video card is
# listed, and turn on agpgart if your video chipset is listed;
# mice if you have a PS/2 mouse
# * Sound - use ALSA, and remember CONFIG_SND_OSSEMUL=y and friends for
# OSS emulation for almost all sound software - find your card
# * Input core support
# * USB support - definitely enable
# CONFIG_USB=y CONFIG_USB_DEVICEFS=y CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_UHCI_HCD=y CONFIG_USB_AUDIO=y CONFIG_USB_PRINTER=y
# CONFIG_USB_STORAGE=y
# * ATA/IDE/MFM/RLL support - remember CONFIG_BLK_DEV_IDECD=y for
# cd burning under 2.6.x kernels
# * You probably won't need to touch the following:
# - General Setup
# - Memory Technology
# - Block devices
# - Multi-device support
# - Networking options
# - Telephony support
# - Fusion MPT device support
# - I20 device support
# - Amateur Radio support
# - Infrared support
# - ISDN subsystem
# - Old CD-ROM drivers (unless you have a non-ATAPI CD-ROM
# drive for now; wait till you've compiled a kernel or
# two)
# - Multimedia devices (unless you have a tv tuner, etc;
# too complicated for now; wait)
# - File Systems (unless you'll be accessing a
# DOS/FAT/NTFS/etc partition, or Windows shares via smb,
# etc)
# - Console Drivers (play with different text modes at bootup)
# - kernel hacking
#make oldconfig
#make menuconfig
make xconfig
#make gconfig
echo "PREPARE THE BUILD"
#make-kpkg --help
#make-kpkg --targets
make-kpkg --rootcmd fakeroot clean
echo "BUILD THE KERNEL AND HEADER PACKAGES - CHOOSE ONE OR MORE"
#make-kpkg --rootcmd fakeroot --append-to-version $VER --revision=$REV buildp
ackage
#make-kpkg --rootcmd fakeroot --append-to-version $VER --revision=$REV binary
make-kpkg --rootcmd fakeroot --append-to-version $VER --revision=$REV kernel_
image
#make-kpkg --rootcmd fakeroot --append-to-version $VER --revision=$REV kernel
_headers
#make-kpkg --rootcmd fakeroot --append-to-version $VER --revision=$REV kernel
_doc
#make-kpkg --rootcmd fakeroot --append-to-version $VER --revision=$REV kernel
_source
echo "OPTIONAL:"
echo "IF YOU WISH TO BUILD EXTERNAL MODULES STORED IN /usr/src/modules"
#when building nvidia module, make sure that the binary object is in place!
tar xzf $SRC/nvidia-kernel-source.tar.gz
#ls modules/nvidia-kernel/nv/nv-kernel.o
#make-kpkg --rootcmd fakeroot --append-to-version $VER --revision=$REV module
s_clean
make-kpkg --rootcmd fakeroot --append-to-version $VER --revision=$REV modules
_image
echo "INSTALL THE KERNEL AND HEADERS - MAKE BOOTDISK FIRST!"
#sudo dpkg -i kernel-image-$VER.$REV_i386.deb
echo "MAKE SURE THAT YOUR LILO/GRUB IS CONFIGURED CORRECTLY BEFORE REBOOT"
echo "DO NOT REMOVE THE OLD WORKING KERNEL IMAGE FROM THE BOOTLOADER!!!"
echo "OPTIONAL KERNEL MODULE INSTALL"
#apt-get install nvidia-kernel-common
#sudo dpkg -i nvidia-kernel-KVER*.deb
References