[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Kernel Panic~: Rebuild Kernel: miniHOWTO draft .001



Michael Olds wrote:
> 
> Russell, et al
> 
> Still a draft! Please note questions and also corrected typo in 2 "libc6"
> 
> <!--\*#---------REBUILD KERNEL------------#*\--!>
> 
> References:
> read (/usr/src/linux/ and this documentation may not be present if you have
> not previously rebuilt your kernel; they come in the kernel source package
> you will need to begin):
>   /usr/src/linux/Documentation/initrd.txt
>   /usr/src/linux/Documentation/modules.txt
>   /usr/src/linux/README
>   /usr/src/linux/README.Debian
> 
> http://qref.sourceforge.net/Debian/reference/ch-kernel.en.html
> 
> http://infocom.cqu.edu.au/Units/aut99/85321/Resources/Print_Resources/Textbo
> ok/chap13/
> 
> http://www.google.com/search?q=%22kernel+headers%22+linus+quote&hl=en&lr=&ie
> =UTF-8&start=10&sa=N
> 
> http://www.linuxfromscratch.org/faq/#AEN334
> http://www.uwsg.iu.edu/hypermail/linux/kernel/0007.3/0587.html
> 
> Bear in mind that debian does things a bit differently than other
> distros. What is that difference? In essence, in stead of reconfiguring the
> kernel and replacing it directly, the reconfigured kernel is made into a
> package (.deb) primarily so that the rebuild will remain integrated into the
> debian package system so that future updates of the kernel can be made using
> dpkg. (I have stated this in these boldly confident terms not being sure
> that this is the essence at all...hoping for confirmation or education...mo)

The way that kernel headers are handled on a debian system may be different
to other distros, so clarification would be worthwhile just to avoid
confusion.

> <---Step-by-Step--->
> 
> [ ]1. Download the latest kernel to /usr/src/linux/kernel/ (if no
> /usr/src/linux/kernel dir exists, make it.

In the links above, Linus says it's bad to do builds in /usr/src,
whereas i think the debian manual says to do it that way. An
explanation for this would avoid confusion.

> Question: the kernel source
> package downloaded directly to /usr/src for me...is it safe to move the
> source tar.bz2 to /usr/src/linux (for order under src)? before unpacking it)
> and unpack it.

I've been unpacking the source into /usr/src/kernel-source-2.4.18 and
symlinking /usr/src/linux to /usr/src/kernel-source-2.4.18. That way,
you can have multiple source trees in /usr/src and just change the
/usr/src/linux symlink to the new tree.

> [ ]2. Make sure
>    [ ]"bin86"
>    [ ]"libc6-dev"
>    [ ]"debianutils"
>    [ ]"make"
>    [ ]"bzip2" and
>    [ ]"kernel-package" are installed.

IIRC, don't use gcc 3.x, but something like gcc 2.95.

> [ ]3. (on 2nd and subsequent rebuilds) Copy configuration file to
> /usr/src/linux/kernel_version_source_directory/

Don't think that's needed.

> [ ]4. # cd to /usr/src/linux/kernel_version_source_directory
>    # make menuconfig
> and make your selections

If you're using --initrd, make sure "Compressed ROM file system
support" is built in, or you'll get a kernel panic (need CramFS).

> [ ]5. # make-kpkg clean
>    # make-kpkg -revision=<!--insert your own personal rebuild version number
> here: i.e.: -revision=0001) --initrd kernel_image

If you don't want --initrd, leave out that option, and make sure
/etc/lilo.conf doesn't have it either for that build.

> [ ]6. A new kernel.version-0001_i386.deb will be placed in the
> /usr/src/linux directory (or one up from where the sources are held)
> [ ]7. Install the new kernel using # dpkg -i kernel.~.deb



Reply to: