This document describes steps you need to go through in order to make CD-ROM for booting SGI MIPS-based machines. It was developed with SGI O2 in mind, but will most likely apply to Indy, Indigo2, and possibly Origin as well. Success/failure reports are welcome.
There are few ways this problem can be solved.
First solution was done by Andrew Clausen, and can be found on his page. I am not going to address this method here. Instead I'm going to describe second one. Maybe I will explore third option later - it seems like the best way to solve the problem, but I am too far down the way of doing it second way at this moment.
Now for the fun part.
dd if=/dev/zero of=SGI.img bs=1M count=650
parted ./SGI.img
mklabel dvh
mkpart <-------- This has to be repeated 8 times
Type: primary
Start: 1
End: 1
mkpart
Type: extended
Start: 1
End: 100
rm 1
....
rm 8
resize 9
Start: 0
End: 100
mkpart
Type: primary
File System: [ext2]
Start:100
End:650
o2 root # fdisk /dev/sdb
Note: sector size is 2048 (not 512)
Command (m for help): p
Disk /dev/sdb (SGI disk label): 20 heads, 61 sectors, 251 cylinders
Units = cylinders of 1220 * 512 bytes
----- partitions -----
Pt# Device Info Start End Sectors Id System
2: /dev/sdb1 boot 168 1007 1023744 83 Linux native
9: /dev/sdb2 0 167 204928 0 SGI volhdr
11: /dev/sdb3 0 1007 1228800 6 SGI volume
----- Bootinfo -----
----- Directory Entries -----
That is with 600M image. Placing IRIX install CD gave different numbers.
Again - don't ask me why.losetup -o $((168*1220*512)) /dev/loop0 SGI.img
mke2fs -b 4096 -i 4096 -vm0 -L CDBOOT /dev/loop0
mkisofs -o /dev/loop0 -lLR .
mount /dev/loop0 /mnt/SGIimage
losetup -d /dev/loop0
dvhtool -d SGI.img --unix-to-vh /usr/src/linux-mips/vmlinux.64 linux.64
boot -f dks(0,4,8)/linux.64 root=/dev/sdb1 ro
I discovered while playing with my O2 that when When you hit "Install System Software" (ISS from now on ;-), firmware sets parameter (not environment variable) OSLoadOptions to "mini" and runs sashARCS from chosen device volume header(CD-ROM). Nothing else special. I still haven't figured out what exactly is relationship between miniroot and PROM is, but I suspect that it is sashARCS that loads miniroot, not PROM itself, so we probably don't have to worry about it at all. What we do have to worry about however, is loading correct kernel. To that end I modified arcboot to try to load <label><arch><CPU>, if that fails, <label><arch>, and only then just <label>. <arch> is ip22/ip27/ip32, etc. (note lower case). CPU is r5k, r10k, and more will probably be added. For now R10000 and R12000 are both r10k, as they would use same kernel. Maybe it is better lo leave it alone, though - it's more flexible to add two entries in arcboot.conf. I also modified arcboot to try to infer config partition from device where it was booted from (rather then from OSLoadPartition) first. Modified version will go to OSLoadPartition, only if that fails. OTOH, for installation purposes, it would probably be easier to forget about OSLoadPartition alltogether.
Finally, to reward you for reading all the way through, here is a script that I made that does all of above.
Authoright © Total Knowledge: 1999-2013