Re: Summary of kernel building procedure


Subject: Re: Summary of kernel building procedure
From: Timothy A. Seufert (tas@mindspring.com)
Date: Sat Sep 29 2001 - 15:58:34 MDT


At 11:29 AM -0500 9/29/01, Kitt Thompson wrote:

> 2. Edit the Makefile and make EXTRAVERSION be something else
> like:
>
> EXTRAVERSION = -sf
>
> i.e., your initials.
>?? Why do this? What is EXTRAVERSION?

Look at the makefile. There are four fields that define the complete
version string. EXTRAVERSION is used to add tags to distinguish
kernels between the times that official versions are released. E.G.
right now the latest official is 2.4.10, and soon Linus Torvalds will
release 2.4.11-pre1. To get the -pre1 he will set EXTRAVERSION to
-pre1.

Setting EXTRAVERSION to your initials can help you keep track of
whether a particular kernel was built by you but isn't necessary.

> 3. make xconfig
>** Runs the xwindows based kernel configuration program. Can also
>enter "make config" for
> prompted, terminal based program.

I recommend "make menuconfig" in place of either plain config or
xconfig. It's a text based menu system, and (I think) the easiest to
use of the lot.

> 4. Load the old config from the configs subdirectory.
>?? Do we do this if we are compiling a version of the kernel we have
>compiled before? Or
> Does this config file transcend kernel versions? By load, I assume
>it means copy the
> old config to the current source directory?

Dunno. There isn't usually a "configs" subdirectory. He's probably
talking about a distribution-supplied kernel source tree with a
directory full of config files supplied by the distribution.

If you don't have any config files to start from, do a "make
mrproper" before "make config" or its relatives. This will give you
a reasonable starting point.

> 5. Add in IrDA as shown on my pages.
>?? I have no idea why we do this. Where are the pages this is referring to?

Part of Paul Lucas's web pages. His goal in building a kernel was
(in part) to get IrDA to work on his PowerBook. Don't worry about it
if you don't need IrDA.

> 6. Save and exit.
>?? Is this part of the load old config of step 4 above?

Part of using xconfig or menuconfig. When you're done you have to
tell it to save (the new config) and exit.

> 7. make dep
>** Gather dependencies for each of the sourcefiles.
>
> 8. make ...
>** or "make vmlinux" but not "make zImage" as we want an
>umcompressed kernel image.
> [REFERENCE: Timothy A. Seufert response Thursday, September 27,
>2001 10:27 PM -0700
> Message ID# p05101001b7d9b487b046@[10.0.0.42]
> Ken Schweigert response on Thursday, September 27, 2001
>2:02 PM -0400
> Message ID# 20010927140206.E1449@byte-productions.com ]
>
>?? Is this true for yaboot as well as xBoot?

Yes

> 9. Install the kernel:
>
> strip vmlinux
>?? The shell command "strip" discards symbols from object files. Why
>do we do this?

You don't have to. It makes the kernel image smaller by removing
debug information (symbol tables etc.). Might be important to some
people who have limited RAM.

> cp vmlinux /boot/vmlinux-2.4.x-sf
>** Copy the newly compiled kernel to the boot directory.
>?? Can this kernel file be named anything we choose? For example.
>could I rename it
> just vmlinux?

Yes but that's not a good idea. Keeping a version number on the file
lets you keep multiple kernel versions around. And that's a very
good thing for those times when you compile a kernel that doesn't
work and need to go back to an earlier one.

> cp System.map /boot/System.map-2.4.x-sf
>?? What is the System.map? Is it created at the same time the kernel
>is compiled?

More debug info. Yes, it's created with the kernel.

> (Substitute 2.4.x with your actual kernel version.)
>
>.. to which for BootX you add this ...
>
> 10. Use the "mount" command to mount your boot HFS partition
> e.g. mount -thfs /dev/sda6 /mnt/sda6
> where you replace /dev/sda6 and /mnt/sda6 with the appropriate
> details for your boot device and its assigned mount point
>?? I assume you have to have installed the hfsutilities to use this command?
> For those of us with HFS+ formatted drives, we need hfsplus uitilities?

They are both included with YDL. Might not be installed with some
installer options, but they got installed by default on my system at
least.

No more questions until you've tried doing it! :) You're wasting
time worrying about minutiae that can be figured out on the fly. If
you get stuck, ask, but the best way to learn this stuff is to try to
do it (sink or swim theory).

-- 
Tim Seufert



This archive was generated by hypermail 2a24 : Sat Sep 29 2001 - 15:08:34 MDT