Hi there,
Documenting a method of compiling a kernel for a slow machine
on a faster machine, and installing kernel + modules over NFS
link.
Why? Old laptops with small hard drives, little room for compiler
+ development tools, and way too slow for compiling custom kernels.
Requires: local network with a faster compile host, NFS running,
and target machine needs to export its root directory to localnet.
An installkernel script is used to automate some of the install,
see: <http://bugsplatter.mine.nu/bash/kernel/installkernel.gz>.
While not required, it is what I've been using for a long time.
The installkernel script is placed in /root/bin and is called
during the linux-kernel 'make install' script execution.
target requirements
````````````````````
NFS export the / partition, if you have a separate /boot, export
that too:
~$ cat /etc/exports
# See exports(5) for a description.
# This file contains a list of all directories exported to other computers.
# It is used by rpc.nfsd and rpc.mountd.
# for hosted kernel compile
/ 192.168.1.0/24(sync,rw,no_root_squash)
host
`````
define target's mountpoints:
~$ cat /etc/fstab
# /etc/fstab for slackware on sempro -- 2006-04-02
....
# we do hosted compiles for these slow boxen:
deltree:/ /home/deltree nfs noauto,user,hard,intr
hal:/ /home/hal/ nfs noauto,user,hard,intr
I keep kernel source under ~/linux and the various source trees are
hardlinked to save space while keeping current source state:
~/linux$ ls -1
host-deltree/
host-hal/
custom kernel example
``````````````````````
For this, I compile 2.4.33-pre3 for the laptop called 'hal' using
the .config from previously compiled 2.4.32-hf32.4 kernel:
$ cd host-hal
$ cp -al ../linux-2.4.33-pre3 .
$ cd linux-2.4.33-pre3
$ make mrproper
$ mount /home/hal/
$ cp /home/hal/boot/config-2.4.32-hf32.4 .config
$ make oldconfig; make dep; time make bzImage modules
....
real 3m14.053s
user 2m58.540s
sys 0m13.300s
Install kernel and modules to target over NFS:
$ su
# INSTALL_PATH=/home/hal/boot make install
# INSTALL_MOD_PATH=/home/hal make modules_install
# exit
$ umount /home/hal/
Open a root console to the target, verify expected kernel was
installed, edit /etc/lilo.conf if required, then run lilo:
root@hal:~# ls -lrt /boot/
....
-rw-r--r-- 1 root root 17314 2006-05-23 11:42 config-2.4.33-pre3
-rw-r--r-- 1 root root 795946 2006-05-23 11:42 bzImage-2.4.33-pre3
-rw-r--r-- 1 root root 300790 2006-05-23 11:42 System.map-2.4.33-pre3
root@hal:~# lilo
Added 2.4.33-pre3 *
Added 2.4.32-hf32.4
Added slack <<== always keep the distro kernel around

Added windoze
Timesaver? You betcha, box 'deltree' takes about 80 minutes to
compile a 2.4 kernel on a pentium-mmx/233. I've not compiled a
kernel on the 'hal' laptop, p100 with 24MB memory? Take hours.
For 2.6 series kernels merge the install commands like this:
# INSTALL_PATH=/home/hal/boot INSTALL_MOD_PATH=/home/hal make install
Grant.
--
Memory fault -- brain fried