Alpha DS25 Linux Challenge Part 2
Installing Debian GNU/Linux on the Alpha DS25
Hello everyone. I'm back with my two cents regarding installing Debian GNU/Linux on the Alpha DS25. Let me explain the problem as best I can.
The Problem
On Alpha Titan type systems there is a problem in the linux kernel which causes most distributions to be unbootable. I am only a amatuer coder and I cannot begin to describe the problem and how to fix it. I can only say that I tried to boot Debian, FreeBSD, and OpenBSD which all failed.
In looking for a solution I visited the guys in the #alpha channel on the freenode network. One person in particular told me of a patch for the linux kernel that fixes the booting problem. I briefly spoke of these patches in the previous article Alpha DS25 Linux Challenge.
I was told that only two distributions at present include the patches. Those distributions are CentOS and Alpha Core 2. What I wanted to do was install Debian GNU/Linux however. I began thinking about ways I could do this. The plan I eventually came up with was to install CentOS and then use debootstrap to build a debian system. I would then turn the debian system into the main OS on the DS25 and eliminate CentOS.
Read on to see the steps I took to acomplish my goal.
The Plan in Action
Installing CentOS was not the hard part. It's probably the most simple part of the plan. All you do is insert disk 1 of the CentOS alpha installation cds into the drive and boot off the device from the SRM console.
From what I know the SRM console is a firmware on alpha machines. It reminds me of the "ok" prompt on sun sparc machines.
To view the devices on your alpha machine try this command at the SRM prompt.
P00>>>show dev
This command should display a list of devices the system knows about. I wanted to boot from the cdrom devices which in my case is device dqa1. So to boot from that device I used this command.
P00>>>boot -flags 0 dqa1
The command above causes the system to boot from the cdrom device dqa1. The -flags 0 option causes the boot loader "aboot" to boot the first boot option "0" which is the default kernel to boot the installation media with.
Disk Partitioning
During the CentOS install just before the disk partitioning I switched from the GUI part of the installer to tty2 so that I could add custom partitioning to the drive. Alpha systems require BSD disklabels which I had to create with fdisk.
I created the BSD disklabel by using the "b" option of fdisk. Then I created a 7MB a: partition, 100MB b: partition, 8GB c: partition, 10GB d: partition, and the rest of the drive I gave to the e: partition.
The above partitions are BSD partitions. The a: partition is where aboot will install itself into the boot sector of the drive. I then created the normal linux partitions. Those were b: /mnt/boot, c: swap, d: /mnt, and e: /. The reason I did this was because my plan was to install CentOS into the e: partition and then create the debian system in /mnt. Once the debian system was installed and booting properly my idea was to delete everything from the e: partition and make it the /home partition for the debian system.
NOTE: I would have used a second hard drive but unfortunately it died on me so I had to improvise a bit.
Booting Into CentOS
After the CentOS installation was complete I rebooted the system and booted into CentOS. This time I had to boot from the hard drive device. In SRM notation it is device "dqa0". The command is:
P00>>>boot -flags 0 dqa0
Installing Debootstrap on CentOS
When CentOS was done booting up I logged in. I then proceeded to download the sarge version of debootstrap. I converted this to an rpm using alien and transferred it over to the alpha machine. The command to install the debootstrap rpm was:
localhost ~# rpm -Uhv debootstrap-.rpm
Using Debootstrap to Install a Base Debian GNU/Linux System
I then ran debootstrap to install a base debian sarge system to /mnt.
localhost ~# /usr/sbin/debootstrap --arch alpha sarge \
/mnt http://http.us.debian.org/debian
Chrooting Into The New Debian GNU/Linux System
Once debootstrap was had completed its job I had a nice new debian base installation in /mnt. The next move is to chroot into the new system and set things up.
localhost ~# LANG= chroot /mnt /bin/bash
Setting up /etc/fstab
localhost ~# nano -w /etc/fstab
Here is a sample. Edit it to your needs.
# /etc/fstab: static file system information.
#
# file system mount point type options dump pass
/dev/XXX / ext3 defaults 0 1
/dev/XXX /boot ext3 ro,nosuid,nodev 0 2
/dev/XXX none swap sw 0 0
proc /proc proc defaults 0 0
/dev/fd0 /mnt/floppy auto noauto,rw,sync,user,exec 0 0
/dev/cdrom /mnt/cdrom iso9660 noauto,ro,user,exec 0 0
/dev/XXX /tmp ext3 rw,nosuid,nodev 0 2
/dev/XXX /var ext3 rw,nosuid,nodev 0 2
/dev/XXX /usr ext3 rw,nodev 0 2
/dev/XXX /home ext3 rw,nosuid,nodev 0 2
Mounting Needed Partitions
localhost ~# mount -t proc proc /proc
localhost ~# mount /dev/XXXX /boot
localhost ~# mount -t devpts -o gid=5,mode=620 none /dev/pts
Creating Devices in /dev
localhost ~# cd /dev
localhost ~# ./MAKEDEV generic
Configure Your Keyboard
localhost ~# dpkg-reconfigure console-data
Setup Your Network
localhost ~# nano -w /etc/network/interfaces
Here is a sample /etc/network/interfaces file.
######################################################################
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)
# See the interfaces(5) manpage for information on what options are
# available.
######################################################################
# We always want the loopback interface.
#
auto lo
iface lo inet loopback
# To use dhcp:
#
# auto eth0
# iface eth0 inet dhcp
# An example static IP setup: (broadcast and gateway are optional)
#
# auto eth0
# iface eth0 inet static
# address 192.168.0.42
# network 192.168.0.0
# netmask 255.255.255.0
# broadcast 192.168.0.255
# gateway 192.168.0.1
Set up /etc/resolv.conf.
localhost ~# nano -w /etc/resolv.conf
Here is a sample /etc/resolv.conf.
search localdomain
nameserver 192.168.1.2
nameserver 192.168.1.3
Setup Your Hostname
localhost ~# echo > /etc/hostname
Setup The New Debian System
localhost ~# /usr/sbin/base-config new
To setup locales do the following.
locahost ~# apt-get install locales
localhost ~# dpkg-reconfigure locales
Compile and Install a Kernel
The whole reason we are going through this is to make a booting system. This means we must patch the kernel, compile it, and install it.
I will not go into the details patching, configuring, compiling, and installing the kernel. I will say I used the current latest kernel at time of this writing which was 2.6.18.1. When the kernel compile is done installing the modules and copy the System.map and /arch/alpha/boot/vmlinux.gz to the /boot partition.
localhost ~# cp /usr/src/linux/System.map /boot/System.map-2.6.18.1
localhost ~# cp /usr/src/linux/arch/alpha/boot/vmlinux.gz /boot/vmlinux.gz
Setup /etc/aboot.conf
localhost ~# nano -w /etc/aboot.conf
Here is a sample /etc/aboot.conf file.
#
# aboot default configurations
#
0:3/vmlinux.gz root=/dev/sda3
1:3/vmlinux.gz root=/dev/sda3 single
2:3/vmlinux.new.gz root=/dev/sda3
3:3/vmlinux root=/dev/sda3
8:- root=/dev/sda3 # fs-less boot of raw kernel
9:0/vmlinux.gz root=/dev/sda3 # fs-less boot of (compressed) ECOFF kernel
Bootloader Installation
localhost ~# swriteboot /dev/XXX /boot/bootlx
If you have done everything correctly according to the way your system is configured you should now be able to exit the chroot and reboot into your debian system.
