Knopix’s Weblog

December 7, 2007

Compile kernel on debian

Filed under: Linux — knopix @ 8:38 am
  • debian:~# apt-get install kernel-package libncurses5-dev
  • wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-2.4.20.tar.gz
  • debian:~# cd /usr/src/
    debian:/usr/src# tar xzf /root/linux-2.4.20.tar.gz
    debian:/usr/src# ls -la
    total 2
    drwxr-xr-x    3 root     root           80 Jun 12 12:00 .
    drwxr-xr-x   14 root     root          360 Jun 12 12:00 ..
    drwxr-xr-x   14 573      573           536 Nov 29  2002 linux-2.4.20
  • debian:/usr/src# mv linux-2.4.20 linux-2.4.20-mh9
    debian:/usr/src# cd linux-2.4.20-mh9
    debian:/usr/src/linux-2.4.20-mh9# zcat /root/patch-2.4.20-mh9.gz | patch -p1
    patching file Documentation/Configure.help
    patching file Makefile
    patching file arch/sparc64/kernel/ioctl32.c
    patching file drivers/bluetooth/Config.in
    patching file drivers/bluetooth/Makefile
    patching file drivers/bluetooth/btuart_cs.c
    patching file drivers/bluetooth/hci_bcsp.c
    patching file drivers/bluetooth/hci_bcsp.h
    patching file drivers/bluetooth/hci_h4.c
    patching file drivers/bluetooth/hci_h4.h
    patching file drivers/bluetooth/hci_ldisc.c
    patching file drivers/bluetooth/hci_uart.h
    patching file drivers/bluetooth/hci_usb.c
    patching file drivers/bluetooth/hci_usb.h
    patching file drivers/char/pcmcia/serial_cs.c
    patching file drivers/char/serial.c
    patching file drivers/usb/Config.in
    patching file include/net/bluetooth/bluetooth.h
    patching file include/net/bluetooth/hci.h
    patching file include/net/bluetooth/hci_core.h
    patching file include/net/bluetooth/l2cap.h
    patching file include/net/bluetooth/rfcomm.h
    patching file include/pcmcia/ciscode.h
    patching file net/bluetooth/Config.in
    patching file net/bluetooth/Makefile
    patching file net/bluetooth/af_bluetooth.c
    patching file net/bluetooth/bnep/Config.in
    patching file net/bluetooth/bnep/Makefile
    patching file net/bluetooth/bnep/bnep.h
    patching file net/bluetooth/bnep/core.c
    patching file net/bluetooth/bnep/netdev.c
    patching file net/bluetooth/bnep/sock.c
    patching file net/bluetooth/hci_conn.c
    patching file net/bluetooth/hci_core.c
    patching file net/bluetooth/hci_sock.c
    patching file net/bluetooth/l2cap.c
    patching file net/bluetooth/rfcomm/Config.in
    patching file net/bluetooth/rfcomm/Makefile
    patching file net/bluetooth/rfcomm/core.c
    patching file net/bluetooth/rfcomm/crc.c
    patching file net/bluetooth/rfcomm/sock.c
    patching file net/bluetooth/rfcomm/tty.c
    patching file net/bluetooth/sco.c
    patching file net/bluetooth/syms.c
  • debian:/usr/src/linux-2.4.20-mh9# cp /root/config-2.4.20 .config
    debian:/usr/src/linux-2.4.20-mh9# make oldconfig
    rm -f include/asm
    ( cd include ; ln -sf asm-i386 asm)
    /bin/sh scripts/Configure -d arch/i386/config.in
    #
    # Using defaults found in .config
    #
    .
    .
    .
    
    *** End of Linux kernel configuration.
    *** Check the top-level Makefile for additional configuration.
    *** Next, you must run "make dep".
    
    debian:/usr/src/linux-2.4.20-mh9# make-kpkg kernel-image
    .
    .
    .
  • debian:/usr/src/linux-2.4.20-mh9# cd ..
    debian:/usr/src# ls -la
    total 3534
    drwxr-xr-x    3 root     root          144 Jun 13 12:00 .
    drwxr-xr-x   14 root     root          360 Jun 12 12:00 ..
    -rw-r--r--    1 root     root      3612714 Jun 11 12:42 kernel-image-2.4.20-mh9_10.00.Custom_i386.deb
    drwxr-xr-x   15 573      573           856 Jun 11 12:42 linux-2.4.20-mh9
    debian:/usr/src# dpkg -i kernel-image-2.4.20-mh9_10.00.Custom_i386.deb
    Selecting previously deselected package kernel-image-2.4.20-mh9.
    (Reading database ... 80275 files and directories currently installed.)
    Unpacking kernel-image-2.4.20-mh9 (from kernel-image-2.4.20-mh9_10.00.Custom_i386.deb) ...
    Setting up kernel-image-2.4.20-mh9 (10.00.Custom) ...
    A new kernel image has been installed, and usually that means
    that some action has to be taken to make sure that the new
    kernel image is used next time the machine boots. Usually,
    this entails running a "bootloader" like SILO, loadlin, LILO,
    ELILO, QUIK, VMELILO, ZIPL, or booting from a floppy.   (Some
    boot loader, like grub, for example, do not need to be run on
    each new image install, so please ignore this if you are using
    such a boot loader).
    
    A new kernel image has been installed. at /boot/vmlinuz-2.4.20-mh9
     (Size: 761kB)
    
    Symbolic links, unless otherwise specified, can be found in /
    
    LILO sets up your system to boot Linux directly from your hard
    disk, without the need for booting from a boot floppy.
    
    WARNING
    If you are keeping another operating system or another version
    of Linux on a separate disk partition, you should not have LILO
    install a boot block now. Wait until you read the LILO documentation.
    That is because installing a boot block now might make the other
    system un-bootable. If you only want to run this version of Linux,
    go ahead and install the boot block here. If it does not work, you
    can still boot this system from a boot floppy.
    
    Would you like to create a boot floppy now? [No] No
    You already have a LILO configuration in /etc/lilo.conf
    Install a boot block using the existing /etc/lilo.conf? [Yes] Yes
    Testing lilo.conf ...
    Testing successful.
    Installing the partition boot sector...
    Installation successful.
  • SRC : http://www.holtmann.org/linux/kernel/debian.html
    
    debian:/usr/src#
    
    debian:/usr/src/linux-2.4.20-mh9#
    debian:/usr/src/linux-2.4.20-mh9#
    debian:/usr/src#

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.