Compiling Your Own Kernel
This section is an overview, not a tutorial
Before proceeding any further, make sure you have completed the steps listed in the Configuring A Kernel section.
Please note that all kernel configuration and compile operations assume you are logged in as the root user.
Go to the Linux kernel source directory ( cd /usr/src/linux ).
After completing the configuration process, you must update dependencies and remove old object files. To do this, enter:
make dep ; make clean
Now compile the kernel with make. This will take some time, so take a few minutes to reread other portions of this document. After the compile finishes you can compress the kernel with gzip, which will decrease the amount of time it takes to load Linux into memory (especially from OFS and AFS disks).
make
If there are no errors, compress the kernel image so it will load faster.
gzip vmlinux
Now copy the resulting vmlinux file to your AFFS disk partition, naming it something like vmlinux-test.
cp vmlinux.gz /dh1/redhat/images/vmlinux-test
Note: /dh1/ is my AFFS partition from where I boot Linux from AmigaDos.
Issue the linux reboot command to restart your system under AmigaDos. Linux, Unix, and NT temporarily cache disk contents to memory to increase system performance. NEVER power-down your system without performing an orderly shutdown procedure; otherwise you risk corruption of the disk filesystem. The normal method of shutting Linux down is to enter the command shutdown -h now from a root shell.
Once AmigaDos is up, enter the amiboot command shown in the Post-Install Setup section, substituting your freshly-compiled vmlinux-test file instead of the stock kernel.
amiboot-5.6 -k vmlinux-test root=<desired dev> video=<desired video mode>
With luck your system should restart under Linux, with a smaller, faster kernel.
During startup you will probably see several warnings concerning .o files. This is because the symbols in the downloaded modules do not match your freshly-compiled kernel. To resolve the symbol mismatches and to provide reliable system operation you must recompile the modules:
cd /usr/src/linux
make modules
make modules_install
depmod -a
This will go a bit faster than the kernel compile did.
Now reboot your test (vmlinux-test) system again by typing the command reboot. You should see very few, if any module warnings. If you do, you might want to delete the individual (unused) .o files in the subdirectories below /lib/modules/2.0.3x/ causing the warning(s), and re-execute the depmod -a command.
Make sure you take the time to test everything before deleting any module files.
Hint: If you have enough memory and CPU horsepower, there is a way you can speed up your kernel compiles. About 40 lines into the /usr/src/linux Makefile there is an entry that says:
MAKE = make
Change it to:
MAKE = make -j3
This allows make to launch several concurrent compiles (3 in this case). This makes much more efficient use of system memory since all instances of the compiler can share the same codespace, instead of reloading the compiler over and over. Reduce the number of concurrent compiles if your CPU utilization stays above 95% full-time or swap starts thrashing. Excessive swap usage can result is significantly longer compile times. You can watch jobs being launched, CPU and swap utilization by using the top -i command, just make sure to renice top (using top's r command) to a value of at least 5 or it will suck too many CPU cycles.
My 16-meg 68040-33 works best with a value of -j3, but my 64-meg K6-233 can handle values high as -j16.
Some common m68k kernel-module issues:
Startup message: modprobe: can't locate module net-pf-4 and modprobe: can't locate module net-pf-5:
These will appear if you disable IPX support, which is why the modules can't be found. The simple solution is to add two new lines at the end of the file /etc/conf.modules:
alias net-pf-4 off
alias net-pf-4 off