cvs commit: hints multi-kernel-versions.txt

tushar at tushar at
Tue Oct 28 21:55:15 PST 2003

tushar      03/10/28 22:55:15

  Added:       .        multi-kernel-versions.txt
  Added Hint: multi-kernel-versions
  Revision  Changes    Path
  1.1                  hints/multi-kernel-versions.txt
  Index: multi-kernel-versions.txt
  AUTHOR: Bruce Dubbs <bdubbs at linuxfromscratch dot org>
  DATE: 2003-10-26
  LICENSE: GNU Free Documentation License Version 1.2
  SYNOPSIS: Manage multiple kernels in an LFS system.
  The instructions in LFS provide for a single kernel.  This hint provides
  a way to manage multiple kernels for different objectives.
  This hint is applicable for anyone building multiple kernels in an 
  LFS system.
  When building the kernel, there is a method of tagging it to make
  configuration of different versions easier.  This method uses the 
  EXTRAVERSION parameter to tag the kernel.  The build process looks like:
  DATE=`date +-%Y%m%d`
  make mrproper
  make EXTRAVERSION=$DATE menuconfig
  make CC=/opt/gcc-2.95.3/bin/gcc EXTRAVERSION=$DATE dep
  make CC=/opt/gcc-2.95.3/bin/gcc EXTRAVERSION=$DATE bzImage
  make CC=/opt/gcc-2.95.3/bin/gcc EXTRAVERSION=$DATE modules
  make CC=/opt/gcc-2.95.3/bin/gcc EXTRAVERSION=$DATE modules_install
  make mandocs 
  cp -a Documentation/man /usr/share/man/man9 
  cp arch/i386/boot/bzImage /boot/linux-${VERSION}${DATE}
  cp /boot/${VERSION}${DATE}
  At this point, you need to edit /boot/grub/grub.conf to
  add your new kernel and then reboot.
  What this does
  First we set a DATE variable in the current shell in the form 20031026. We
  also set the VERSION variable to the version of the kernel we are creating.
  We then build the configuration.  make menuconfig will create a .config
  file in the linux source directory and the include/linux/version.h file
  where the version resides.  If you want to upgrade an existing 
  configuration, after you run make mrproper, you can copy a saved copy of 
  your .config file to the top kernel source directory and use:
  yes "" | make  EXTRAVERSION=$DATE oldconfig
  This will reuse your old configuration and use the defaults for any changed
  configuration parameters in an updated kernel.
  The EXTRAVERSION variable will embed a string into the kernel version.  This 
  will create a response to the `uname -r` command which will look something
  like "2.4.22-20030915".  It will also insert any modules you make into the 
  directory /lib/modules/<version number>.  For example:
  Copying the kernel image, bzImage, to /boot/linux-${VERSION}${DATE} will
  identify the kernel version and date compiled for future reference.
  Copying to /boot/${VERSION}${DATE} will allow the
  kernel to always find the proper without any symbolic links
  because it always looks for the map in this form before it looks for
  a plain file.
  There are several variations you can use by merely changing the DATE variable.
  For instance if you want to add a time (hours and minutes) to the kernel 
  version, you can use:
  DATE=`date +-%Y%m%d%H%M`
  or you can use a simple version number (-1, -2, -3, etc.) that you might want
  to set manually:
  In all cases, the method above will properly match up your file to 
  the kernel when booting.  I recommend always starting the EXTRAVERSION with a 
  dash (-).
  Alternative Method
  Instead of adding the EXTRAVERSION to each make file, you can just change it
  in the Makefile with:
  sed -i -e "s/^EXTRAVERSION =.*/EXTRAVERSION = $DATE/" Makefile 
  make menuconfig
  make CC=/opt/gcc-2.95.3/bin/gcc dep
  make CC=/opt/gcc-2.95.3/bin/gcc bzImage
  make CC=/opt/gcc-2.95.3/bin/gcc modules
  make CC=/opt/gcc-2.95.3/bin/gcc modules_install
  and continue as above.
    * Add EXTRAVERSION to make oldconfig
    * Add EXTRAVERSION to make menuconfig
    * Add alternative sed method
    * Initial hint.

More information about the hints mailing list