How to build a 2.6 Linux kernel for
DS10, DS20, Miata, and AlphaStation 200 Alphas
This isn't that hard, really.
It just takes some patience...
Install the kernel source
-
Get the kernel source from
http://www.kernel.org/
-
Make sure it really is the kernel
source,
and that it really is from the
Linux kernel organization.
Check the digital signature!
-
Install the source, replacing
x.y
as appropriate for the version you downloaded:
# cd /usr/src
# tar xvfj /tmp/linux-2.6.x.y.tar.bz2
# ln -s linux-2.6.x.y linux
Configure a kernel build
-
Change into the kernel source tree root,
/usr/src/linux.
Beyond this point, every command should be run
in that directory:
# cd /usr/src/linux
-
Copy your current kernel configuration into place,
replacing current as appropriate for
the kernel you installed:
# cp /boot/config-version .config
-
Start the kernel build configuration tool:
# make gconfig
-
That should bring up a graphical interface.
-
If it does not, you probably need to
install some additional software packages.
Carefully read any error messages printed
by that command
make gconfig
and see if it provides any useful suggestions.
If not, I suggest starting with this:
# yum install gtk+ libglade2-devel
-
Make any desired changes in the build
configuration — at least, any changes
within reason...
Then save your changes and exit.
The result is an updated .config
file.
Build and install the kernel
-
Build the components:
# make all
This is where you are going to need the patience...
-
Install the modules:
# make modules_install
Note that this may fail if you have only 128 MB of RAM,
as it runs out of memory building System.map.
If that is the case, don't panic yet, you can boot
and run without that file.
However, you will need some other files it creates
to build in initial RAM disk image file...
-
Install the bootable kernel:
# cp arch/alpha/boot/vmlinux.gz /boot/vmlinuz-2.6.x.y
# cp System.map /boot/System.map-2.6.x.y
-
Create an initial RAM disk image:
# mkinitrd /boot/initrd-2.6.x.y.img 2.6.x.y
-
Modify /etc/aboot.conf.
Presumably you followed
my suggestions for installing Linux
on an Alpha,
so your SRM boot variables are set up correctly,
and the boot_osflags variable is
set to 0.
That means that you /etc/aboot.conf file
looks like this, where current and
previous are the releases of your current
kernel and a previous kernel:
# aboot default configurations
# NOTICE: You have a /boot partition. This means that
# all kernel paths are relative to /boot/
0:2/vmlinuz-current initrd=/initrd-current root=/dev/sda4 quiet
1:2/vmlinuz-previous initrd=/initrd-previous root=/dev/sda4 quiet
Let's say that your new kernel is release 2.6.x.y,
and you think it will work —
change your /etc/aboot.conf
so it looks like this:
# aboot default configurations
# NOTICE: You have a /boot partition. This means that
# all kernel paths are relative to /boot/
0:2/vmlinuz-2.6.x.y initrd=/initrd-2.6.x.y root=/dev/sda4 quiet
1:2/vmlinuz-current initrd=/initrd-current root=/dev/sda4 quiet
2:2/vmlinuz-previous initrd=/initrd-previous root=/dev/sda4 quiet
Reboot, and enjoy!
-
If all went well, this will just simply work!
-
If things went poorly, your system will not boot!
-
If you need to:
-
Carefully examine what you see
on the console, to decide how far it got before
things went wrong (and therefore what you
need to fix!).
-
Reset the system
to return to the SRM prompt.
-
Boot the kernel referred to above as
current with this:
>>>boot -flags "1"
Or, the kernel referred to above as
previous with this:
>>>boot -flags "2"
-
Go back to the
make gconfig
step,
and get it right this time!
-
If it worked, and you want to copy the kernel to
another Alpha:
-
Create a tar archive
including the relevant files and
directory hierarchies:
/boot/vmlinuz-2.6.x.y
/boot/System-map.2.6.x.y
/boot/config.2.6.x.y
/boot/initrd.2.6.x.y.img
/lib/modules/2.6.x.y
-
Copy that tar file to the
target system and extract it.
-
Modify /etc/aboot.conf on the
target system.
Where next?