Re: script for compiling the kernel

Riley Williams (rhw@MemAlpha.CX)
Mon, 12 Jul 1999 12:52:15 +0100 (GMT)


Hi Marc.

>>> I tend to leave zImage the default because:

>>> - You can see something is wrong at compiling time not at
>>> boot time.
>>> - It is very easy to determine what is wrong.
>>> - You are told what is wrong.

>>> So I consider this as the safe choice.

>> on most of my machines it is NOT safe, since the kernel simply
>> gets too large using zImage. there is no special hardware,
>> just lot's of useful network options and scsi ...

> Steffen's arguments on that have convinced me. He does not say
> that zImage is 'safe', because it runs always everywhere (what
> it does not), but that it is 'safe', because you can tell 100%
> that zImage failed at compile time.

> You can have the output of make zImage piped through grep
> "kernel too big" or whatever it says...

In fact, you don't even need to do that. Here's why:

Q> The first part of the compilation process for BOTH `make zImage`
Q> and `make bzImage` is identical, and results in the file vmlinux
Q> (note the 'x' at the end) in /usr/src/linux (or whatever the base
Q> directory is).

Therefore, the following script will work, if run from the relevant
base directory - replace menuconfig as preferred:

Q> #!/bin/bash
Q> make menuconfig
Q> if [ ! -f .config ]; then
Q> echo 'ERROR 99: Kernel configuration not available.' >&2
Q> exit 99
Q> fi
Q> if [ ! -f .depend ] || [ .config -nt .depend ]; then
Q> make dep clean
Q> if [ $? -gt 0 ]; then
Q> exit $?
Q> fi
Q> fi
Q> if grep 'CONFIG_MODULES=y' < .config > /dev/null ; then
Q> make modules modules_install
Q> if [ $? -gt 0 ]; then
Q> exit $?
Q> fi
Q> fi
Q> make zImage
Q> if [ $? -gt 0 -a -f vmlinux ]; then
Q> make bzImage
Q> fi
Q> exit $?

Best wishes from Riley.

+----------------------------------------------------------------------+
| There is something frustrating about the quality and speed of Linux |
| development, ie., the quality is too high and the speed is too high, |
| in other words, I can implement this XXXX feature, but I bet someone |
| else has already done so and is just about to release their patch. |
+----------------------------------------------------------------------+
* ftp://ftp.MemAlpha.cx/pub/rhw/Linux
* http://www.MemAlpha.cx/kernel.versions.html

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/