Subject:	Installing arm-linux from the Clan CD x-files archive
Date:		01st August, 1998
Author:		Phil Norman
Version:	2
Related files:	Normal installation guide from armlinux ftp site





 9:00pm, 28th November, 1997	->	01:44am, 29th November, 1997


Welcome!
~~~~~~~~

Please note:  This is a simple installation guide.  It includes all the programs that you will need to install arm-linux except for those used in the normal installation process.  I suggest you get those programs not included here from the arm-linux ftp site, together with the normal installation guide.

This package consists of a text file (this one) describing how to install armlinux, and several useful files whose purpose will be explained later in this file.  It is NOT a complete installation guide, since much of what you need for installation is included in the normal installation guide.  Follow the normal installation guide right up to the point where you're actually about to boot into linux using the boot discs, and then start on this file.  Please note that for the Clan CD installation you will need BOTH the root boot disc and the supplemental boot disc.  These are both available on the ftp site.


You will need several things:

1: This package, complete and unaltered.

If the copy you have is incomplete, you can download the whole thing from my web site (http://newton.ex.ac.uk/general/ug/norman/)


2: A precompiled linux kernel.

If you do not have one of these, you can find precompiled kernels at the arm-linux ftp site (ftp://ftp.arm.uk.linux.org/pub/armlinux/).  Just get the last-uploaded version and it should work fine.  Please make sure the boot discs you have are compiled for the kernel you get.  Having a kernel and boot discs which don't match will cause things to break.


3: The Clan CD.

Well actually, this guide can be used by those without the CD but with the RPMs in some other form (ie on floppies).


4: Boot AND supplemental disc images.

These can be found on the arm-linux ftp site (address above) and will be named something like 'root_xxx' where xxx corresponds to your machine type, and 'suppimage'.


5: The normal installation guide, and everything that it tells you to get hold of.



Doing the installation thing
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

By now, you should have been through a fair amount of the normal installation guide, although you shouldn't have booted into linux yet.  The following things should have been done:

1: You should have two discs with 'root_xxx' and 'suppimg' written onto them using !WriteDisc.

2: You should have created at least one linux native partition, and a swap partition.

3: You should have the bootloader ready with a precompiled kernel.


So we're almost ready to boot into linux.  Only a few things to do.  Since the .rpm files are in an x-files partition you will need to move them into another kind of archive.  There is an x-files archive reader, but I don't have a copy and do not know where to get it, so I cannot test this.  If you manage to find the x-files archive reader you can, of course, use that instead of my zip method, and everything else should be pretty much the same.

Create one or more zip files (using zip -0, since .rpm files are already compressed) of the contents of the x-files archive.  You don't need to include all the rpm files, just the ones you want.  A word of warning: don't try using SparkFS to create the zip files, since it doesn't like doing so for some peculiar reason - the RiscOS command line zip program is very good for this.  These zip files should be put somewhere on your ADFS drive so that they'll be fairly easy to get to later, when in linux.

You will need to copy the binaries 'cp', 'mv', 'tar' and 'unzip' included in this package onto a DOS-formatted disc.  The 'instim/tar' and 'base/tar' archives should be placed in a fairly easy-to-get-to location.

Now it's time to boot into linux.  Follow the steps in the original installation guide until you get to the section where you choose which method you wish to install by (hard disc/CDROM/ftp/NFS).  Choose 'hard disc' and do the supplemental disc thing.

Right - time for me to disassemble my computer and put my spare hard disc in so I can check what you'll need to do next....

Righty!  That's done then - after many reboots, a trip down to the computer room to ask about mknod and quite a bit of coffee, I've now got arm-linux installed on my spare hard disc.  And here's how I did it:

By now, you will have gone past the installation method selection (and will have chosen 'hard disc') and you'll have inserted the supplemental floppy disc and that will have been loaded into memory.  Now comes the tricky part.  Please follow the following instructions CAREFULLY and to the letter.  You will need the binaries on your third floppy disc now (the msdos-formatted one).

Firstly, we need to get rid of the graphical interface and bring up a nice unfriendly command line.  Do this by pressing Alt-F2.  Now follow the steps below.  I am assuming that the ADFS partition all the tar and zip files are on is hda1 (ie ADFS::4.$) and the partition you wish to install linux onto is hda3 (the first partition created with PartMan - the ADFS one is '1', the linux partition table is '2' and the first partition is '3' (your swap drive is probably '4').  If you are using a different drive, make any appropriate changes.  There are more in-depth changes to be made when mknod is used - I'll explain that when we get to it.  Any lines beginning with a '#' are comments.


#Start
mkdir mnt
mkdir adfs
mount -t msdos /dev/fd0 mnt
mount -t adfs /dev/hda1 adfs
OLDPATH=$PATH
PATH=$PATH:/mnt
##########################
# In the mknod below, the first '3' after the 'b' says that this is an IDE
# disc.  The second 3 is the drive_number*64+partition_number
# Therefore, for drive 0 (first IDE disc) and partition 3, it is 64*0+3 = 3
# If you're using hdb (ADFS::5.$), the number is 64*1+3 = 67
# ENSURE YOU GET THIS RIGHT, since you'll then reformat the drive with 'mke2fs'
# and if you specify the wrong drive with mknod, you'll obliterate a different
# partition, which could be a VERY bad thing.
mknod /dev/hda3 b 3 3
mke2fs /dev/hda3
mkdir hd
mount -t ext2 /dev/hda3 hd
cd hd
mkdir RedHat
mkdir RedHat/RPMS
cd RedHat/RPMS
unzip /adfs/ARMLinux/RPMs.zip
cd /hd/RedHat
tar -xvf /adfs/ARMLinux/base.tar
tar -xvf /adfs/ARMLinux/instim.tar
cd ..
tar -xvf /adfs/ARMLinux/instim.tar
PATH=$OLDPATH
cd /
umount mnt
umount hd
umount adfs
#End


Now press Alt-F1 to get back to the installer.

Now you should have a complete RedHat installation tree on your newly-formatted hard disc.  You should go through the rest of the RedHat installer just as you normally would.  You will still need to initialise the swap space, but it is VITALLY important that you don't reformat the partition you just put your installation tree on.  When the installer asks you which partition to install on, mention hda3, and the same for the partition that the RedHat installation tree is on.  It should then install perfectly.

Do note that right at the end, when it asks you for root's password, and then says 'Couldn't find a kernel!', it's just the installer being stupid.  It can't find a kernel because there isn't one.  This is a hang-over from the PC LILO boot thing, and most arm-linux systems, to my knowledge, use a kernel on the RiscOS partition and boot from there.  Unfortunately, the installer hangs a bit here and you can't get past the 'LILO setup' thing.  So the only thing to do is to resync the drives and Ctrl-Alt-Del out of there.

Note that in this case simply umounting your new ext2 drive won't work; it says 'devices is busy' or similar.  So you will have to have 'sync', which should be in '/mnt/bin/sync' if you've installed the correct .rpm file (which is probably the e2fsprogs or fileutils, but I'm not sure).  It's probably best, when choosing what to install, to install everything that looks even vaguely useful.

Anyway, now you should have a fully working copy of linux.  Next time you boot, since your drive wasn't umounted properly, fsck will have a go at it.  Don't worry - it should be perfectly intact, since you did a sync (or at least I hope you did) just before you Ctrl-Alt-Delled it to death.

Anyway, I think it's about bedtime now - it's 1:40 am and I think the coffee's wearing off ;-)

Before I go, I'd like to say a big thankyou to Matthew Wilcox, who told me what the numbers mean in mknod.  If it weren't for him I'd probably have reformatted kmem by now, so I'm very grateful :-).

Many thanks also, of course, to Russell King for the astonishing amounts of work he puts into the linux kernel.

Bye for now,
Phil
