Search:  
Gentoo Wiki

Installing_Gentoo_on_SGI_O2

This is a small guide for beginners with some hints and links about installation of Gentoo on SGI o2 machine, based on my experience. If you are familiar to Gentoo, you should be fine with just official Gentoo Handbook. However, I believe those hints might be useful for newcomers, just like myself. I described here problems I encountered and solutions I found (or that have been presented to me, mostly on irc channel #gentoo-mips - thanks guys!).

How to read this document

I refer mostly to the Gentoo Handbook (see below). Headlines specify chapters of the Handbook to which the hints apply.

Contents


Machine

>>>>

...here be dragons

<<<<

I tried to use a dedicated monitor and keyboard (which turned out to be the first problem...) I used Gentoo LiveCD (MIPS3-gcc4-x-rc6).

Good starting point

In general, follow the instruction in the Gentoo manual: http://www.gentoo.org/doc/en/handbook/handbook-mips.xml?full=1

After putting the CD into the drive and rebooting the computer, press ESC key to enter maintains menu. Then choose "Installing additional software" and follow instructions. If your monitor goes black just after "Entering kernel" message, it is quite possible you encountered the same problem as I did. Solution is to connect through serial port from another computer running terminal program in it (eg. HyperTerm under you-know-which-OS, or gtkterm under Linux) and throw away the monitor. But before that, go to PROM and switch default output and input variables into console (printenv will show you the current status). And then throw away the monitor.

Personally, I ssh from my comp as soon as possible.

Chapter 4. Preparing the Disks

HINT: Good way to partition small drive (like mine - 4GB) is to separate partitions /boot and swap, and leave all the rest to root partition (/). But don't forget about SGI Volume Header (see the manual, 4.c. Using fdisk on MIPS to Partition your Disk)

Before starting the installation you DO want to make sure that your disk is error-free. Disk and Cd-Rom's malfunctions are quite common in this machines. I suggest running:

e2fsck -c

on every partition in order to find and mark all bad-sectors. Moreover, disabling auto read-only mount in case of error might be quite useful as well:

tune2fs -e continue /dev/sda3

You can see disk's error behavior by:

 tune2fs -l /dev/sda3  

Search for the line that says "Error behavior".

Chapter 5.d. Configuring the Compile Options

Read carefully the part about "-mabi".

You DO want to set:

-mabi=32

even if your architecture is 64 bits. It is because mabi refers to userland (which is 32 bits) and not the processor. Do NOT use anything else there, as for now 32 is the only one fully supported. It was costly mistake for me so learn from it.

In practice, I nearly didn't touch the make.config file, apart from adding CFLAGS="-mabi=32 -mips4 -pipe -O2", some mirrors and rsync's. I think it's safer not to mess with USE flags etc., unless you know exactly what you're doing (and obviously you don't since you're still reading).

Chapter 7.c. Kernel Compilation & Installation

On SGI O2 use:

make vmlinux.32 modules modules_install CROSS_COMPILE=mips64-unknown-linux-gnu-

When building the kernel, you may run into problems like:

mips64-unknown-linux-gnu-ld: cannot open linker script file ldscripts/elf64btsmip.xr: No such file or directory 
make[1]: *** [init/mounts.o] Error 1 
make: *** [init] Error 2

Try this:

ln -s $(find /usr/lib -name ldscripts) /usr/mips-unknown-linux-gnu/lib/ldscripts
binutils-config --mips
source /etc/profile

or just

find /usr/ -name 'elf64btsmip.xr' 

and take that ldscripts dir and add it to your LDPATH

If it doesn't help try to emerge binutils (takes a lot of time! Possibly overnight) with "multitarget" flag enabled (create package.use in portage and place name of that package and flag in there):

echo sys-devel/binutils multitarget >> /etc/portage/package.use

...and repeat first steps.

HINT: You might want to disable CONFIG_PREEMPT_VOLUNTARY variable in your .config file. This option might give unexpected memory errors.

Visit for more about memory errors and ldscripts problems:

http://www.nabble.com/O2-IP32-%7C-mips-sources-fails-to-find-ldscripts-t3253853.html http://forums.gentoo.org/viewtopic-p-4199594.html?sid=efc2a397f88f3b069a202e15fbeaf9ad

So far I got, kernel is being compiled... Let's see what brings a new day :)

EDIT (31.08): So here we are, new day, new problem:

LD      .tmp_vmlinux1
lib/lib.a: could not read symbols: Archive has no index; run ranlib to add one
make: *** [.tmp_vmlinux1] Error 1
Retrieved from "http://www.gentoo-wiki.info/Installing_Gentoo_on_SGI_O2"

Last modified: Fri, 05 Sep 2008 11:04:00 +0000 Hits: 222