Jean Robertson (jean@cc.mcgill.ca)
Tue, 13 Apr 1999 11:18:20 -0400 (EDT)
I was faced with an aggravating problem. I had installed LinuxPPC on
the ANS 500 as per the instructions in "Installing Linux-PPC on an
Apple Network Server" <http://www.demonsys.com/ans/>
I then got myself a copy of the 2.2.4 kernel (with ANS patches) from
ftp://ftp.ppc.kernel.org/pub/linuxppc/patches/ans
I compiled the kernel by configuring it and running "make zImage"
which produced a floppy sized bootable image for me ("vmlinux.coff" in
/usr/src/linux/arch/ppc/coffboot/ ).
I put the image on a Mac formatted floppy, but I could never get
the machine to boot from the hard drive. But I could boot from the
floppy, but this was not a long term solution.
So I started to experiment.
Here are some details on how I got the ANS 500 to boot from the hard
drive.
- What I started with:
1) ANS 500
2) 2 GB hard drive (internal) in the third slot from the top
3) Zip Drive (external)
4) quik version 1.31 (I don't think this makes a difference)
1) When partitioning the internal hard drive, I added a small (40 MB)
partition that was to hold all the kernel images that I wanted to
boot.
I would mount the small partition under "/boot".
I chose to make the "/boot" partition the first (after the map).
My partition map looks like this:
.........................................................
Partition map (with 512 byte blocks) on '/dev/sda'
#: type name length base ( size )
1: Apple_partition_map Apple 63 @ 1
2: Apple_UNIX_SVR2 booter 81920 @ 64 ( 40.0M)
3: Apple_UNIX_SVR2 swap 261496 @ 81984 (127.7M)
4: Apple_UNIX_SVR2 root 1249280 @ 343480 (610.0M)
5: Apple_UNIX_SVR2 var 1228800 @ 1592760 (600.0M)
6: Apple_UNIX_SVR2 home 1372498 @ 2821560 (670.2M)
Device block size=512, Number of Blocks=4194058 (2.0G)
DeviceType=0x0, DeviceId=0x0
.........................................................
As you can see, partition "2" is tiny, root, var and home are more or
less equal in size.
2) put an ext2 filesystem on the partition.
3) Copy every boot image I ever wanted, I put on that partition.
Additionally, I put the quik.conf file there as well.
4) Edit the quik.conf file to include things like: the boot image, the
root device, etc.
My quik.conf looks like this:
.......................................................
# timeout is in tenths of seconds
timeout=300
image=/vmlinux-224
label=sda4
root=/dev/sda4
image=/vmlinux-224
label=sdb7
root=/dev/sdb7
image=/vmlinux-224
label=sda7
root=/dev/sda7
image=/vmlinux-221
label=221-sda4
root=/dev/sda4
image=/vmlinux.old
label=old
.......................................................
Some notes:
a) the "image=" lines do *not* say "/boot/vmlinux<whatever>".
This is because when the ANS boots up, no filesystems have yet been
mounted. All it knows is what it sees at the moment. For humans, once
booted up into a state that we can use, we will find the files under
the "/boot" directory. So, as far as it knows, there is only one
directory. The leading slash in front of "vmlinux" is important. It
won't work without it.
b) this way at boot time I can choose which image and which root I
want at boot up. The "sda7" reference was when I was using the external
Zip drive as my root file system (before the internal drives were put
back into their slots). The "sdb7" reference was once the internal
drive was put back in, the external became "/dev/sdb". The first entry
is the default.
3) unmounted the filesystem.
4) run e2fsk on the filesystem
5) re-mount the filesystem.
6) run quik with
/sbin/quik -v -C /boot/quik.conf
7) IMPORTANT NOTE: never, never, never, ever re-run quik without a
reason. It will make your partition un-bootable. Valid reasons are: a
new kernel image, a change in the quik.conf file.
8) Set the tiny filesystem to never be checked by e2fsck. The line in
the /etc/fstab file should read:
/dev/sda2 /boot ext2 defaults 1 0
This line has to be *after* the root filesystem. Order is important!
The sixth field in the entry, the "0", says to never run e2fsck on the
filesystem.
Why? Because all the files on the filesystem have to stay in the same
place for the bootloader. e2fsck might move files around. Nasty.
So, my /etc/fstab looks like this:
................................................................
/dev/sda4 / ext2 defaults 1 1
/dev/sda2 /boot ext2 defaults 1 0
/dev/sda3 swap swap defaults 0 0
/dev/sda5 /var ext2 defaults 1 2
/dev/sda6 /home ext2 defaults 1 2
/dev/fd0 /mnt/floppy ext2 noauto 0 0
none /proc proc defaults 0 0
................................................................
Should anything go wrong, I can always boot up with a floppy,
copy the files in boot onto another filesystem, nuke the
/boot partition, re-install the ext2 filesystem on the partition,
replace the boot images, quik.conf and all, unmount the filesystem,
run e2fsck on it, re-mount the filesystem and finally, run quik (only
once!).
9) Now on to the Open Firmware variables:
The default value for "boot-device" is "disk2:aix". I changed it to
"disk2:0". I presume that this means "boot anything that you find in
block 0 of disk2". "disk2" being defined ("aliased" in Open-
Firmware-speak) as the internal disk with the SCSI ID 2.
I left the "boot-file" empty.
10) switch the key on the from of the ANS from the "service" state
to the "unlock" state (move it from the wrench icon to the unlocked
padlock icon).
If the key is left in the "service" (wrench) mode, Open Firmware will
boot the "diag-device" which is defined as "cd fd:diags" by default --
not what I wanted because it first looks for a bootable CD, then by
looking for a Mac formatted floppy with a "diags" executable on it.
Set "auto-boot?" back to "true" so that it does not stop at the Open
Firmware screen.
11) shut it down and re-boot. You should see mention of a "second
stage booter" and then a "boot:" prompt.
If you wait 30 seconds (as per the quik.conf file above) it should
boot all by itself.
If you hit "return" because you are impatient, it should boot the first image.
If you choose from the list by typing whatever the "label=" reference is,
then it will boot with the chosen root filesystem.
This makes quik behave in exactly the same way as "lilo" behaves on
Intel-IDE hardware, which was what I was looking for, after all.
Let me know if it works for you!
Jean
-- ......................................................... Jean Robertson jean@cc.mcgill.ca .........................................................
This archive was generated by hypermail 2.0b3 on Tue Apr 13 1999 - 12:31:43 PDT