[ale] New kernel for non-dev machine

Ben Coleman oloryn at benshome.net
Thu Oct 18 17:41:08 EDT 2001


On Thu, 18 Oct 2001 03:42:49 -0400 (EDT), Benjamin Dixon wrote:

>Or should I skip
>trying to get make on the machine altogether and just worry about doing
>the "make modules_install" by hand (also seems yucky)?

You don't have to do "make modules_install" by hand.  If the
environment variable INSTALL_MOD_PATH is defined, it is used as a
substitute root when doing 'make modules_install'.  E.g., you can say 

INSTALL_MOD_PATH=/tmp make modules_install

and the modules are put in /tmp/lib/modules/<kernel_version> instead of
in /lib/modules/<kernel_version>.  This means that you can do "make
modules_install" on the kernel build machine, and have it put the
modules into a different than normal directory, which you can then tar
up and move to the target machine.


E.g., when I'm compiling a kernel for a machine other than the machine
I'm compiling on, I'll do the compile through "make bzImage" and "make
modules".  Then I'll create a directory in which I intend to put the
files to be moved to the target machine.  E.g. suppose I'm building a
kernel for a machine called erebor.  Usually, I'll create /tmp/erebor. 
Within that, I also create /tmp/erebor/boot, and copy System.map and
config[1] to it.  I also copy the new kernel to /tmp/erebor/ [2]. 
Finally, I do a

INSTALL_MOD_PATH=/tmp/erebor make modules_install

this puts the modules into /tmp/erebor/lib/modules/<kernel_version>

At this point I can cd into /tmp/erebor, and tar up everything I
need[3] with

tar czf newkernel.tar.gz *

The resulting newkernel.tar.gz can now be copied to the target machine
and untar'd from the root directory, plopping everything down where it
needs to be.[4]


[1] I follow Slackware's convention of copying the .config file from
/usr/src/linux/.config to /boot/config on the target machine.  This way
I have a ready copy of the config file used to create a kernel in case
I need to change configuration or upgrade the kernel.  To change
configuration, I copy /boot/config to /usr/src/linux/.config, and run
"make menuconfig" or "make xconfig" to make what changes I need.  To
upgrade, I copy /boot/config to /usr/src/linux/.config, then run "make
oldconfig", which will prompt for any items that aren't defined in the
older kernel's config.

[2] Slackware puts the kernel in the root directory.  If your
distribution prefers it in /boot, then you would copy your new kernel
into /tmp/erebor/boot/.

[3] Actually, I usually make a Slackware package out of it, but it
essentially amounts to the same thing.

[4] Naturally, you'll want to move old versions out of the way first
(e.g. rename the old kernel, /boot/System.map, and /boot/config; and
(if you're doing a configuration change rather than an upgrade) rename
the old /lib/modules/<kernel_version> directory), so that you'll have
the old kernel around if something is wrong with the new one.


Ben

-- 
Ben Coleman oloryn at benshome.net      | The attempt to legislatively
http://oloryn.home.mindspring.com/   | micromanage equality results, at
Amateur Radio NJ8J                   | best, in equal misery for all.



---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list