fox2mike 06/02/26 15:17:34
Added: xml/htdocs/doc/en/handbook/draft handbook-mips.xml
hb-install-mips-bootloader.xml
hb-install-mips-disk.xml hb-install-mips-kernel.xml
hb-install-mips-medium.xml
hb-install-mips-stage.xml
Log:
mips stuff for 2006.0
Revision Changes Path
1.20 +94 -27 xml/htdocs/doc/en/handbook/draft/handbook-mips.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/handbook-mips.xml?rev=1.20&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/handbook-mips.xml?rev=1.20&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/handbook-mips.xml.diff?r1=1.19&r2=1.20&cvsroot=gentoo
1.13 +673 -38
xml/htdocs/doc/en/handbook/draft/hb-install-mips-bootloader.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-bootloader.xml?rev=1.13&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-bootloader.xml?rev=1.13&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-bootloader.xml.diff?r1=1.12&r2=1.13&cvsroot=gentoo
1.10 +304 -32 xml/htdocs/doc/en/handbook/draft/hb-install-mips-disk.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-disk.xml?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-disk.xml?rev=1.10&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-disk.xml.diff?r1=1.9&r2=1.10&cvsroot=gentoo
1.10 +245 -263 xml/htdocs/doc/en/handbook/draft/hb-install-mips-kernel.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-kernel.xml?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-kernel.xml?rev=1.10&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-kernel.xml.diff?r1=1.9&r2=1.10&cvsroot=gentoo
1.10 +844 -184 xml/htdocs/doc/en/handbook/draft/hb-install-mips-medium.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-medium.xml?rev=1.10&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-medium.xml?rev=1.10&content-type=text/plain&cvsroot=gentoo
diff :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-medium.xml.diff?r1=1.9&r2=1.10&cvsroot=gentoo
1.1 xml/htdocs/doc/en/handbook/draft/hb-install-mips-stage.xml
file :
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-stage.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain:
http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/handbook/draft/hb-install-mips-stage.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo
Index: hb-install-mips-stage.xml
===================================================================
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE sections SYSTEM "/dtd/book.dtd">
<!-- The content of this document is licensed under the CC-BY-SA license -->
<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
<!-- $Header:
/var/cvsroot/gentoo/xml/htdocs/doc/en/handbook/draft/hb-install-mips-stage.xml,v
1.1 2006/02/26 15:17:34 fox2mike Exp $ -->
<sections>
<version>2.5</version>
<date>2005-11-22</date>
<section>
<title>Installing a Stage Tarball</title>
<subsection>
<title>Setting the Date/Time Right</title>
<body>
<p>
Before you continue you need to check your date/time and update it. A
misconfigured clock may lead to strange results in the future!
</p>
<p>
To verify the current date/time, run <c>date</c>:
</p>
<pre caption="Verifying the date/time">
# <i>date</i>
Fri Mar 29 16:21:18 CEST 2005
</pre>
<p>
If the date/time displayed is wrong, update it using the <c>date
MMDDhhmmYYYY</c> syntax (<b>M</b>onth, <b>D</b>ay, <b>h</b>our, <b>m</b>inute
and <b>Y</b>ear). For instance, to set the date to March 29th, 16:21 in the
year 2005:
</p>
<pre caption="Setting the date/time">
# <i>date 032916212005</i>
</pre>
</body>
</subsection>
<subsection>
<title>Making your Choice</title>
<body>
<p>
The next step you need to perform is to install the <e>stage</e> tarball of
your choice onto your system.
<!--You have the option of downloading the required
tarball from the Internet or, if you are booted from one of the Gentoo
Universal Installation CDs, copy it over from the CD itself. If you have a
Universal CD and the stage you want to use is on the CD, downloading it from
the Internet is just a waste of bandwidth as the stage files are the same. In
most cases, the command <c>uname -m</c> can be used to help you decide which
stage file to download. -->
</p>
<!--
<ul>
<li><uri link="#doc_chap2">Default: Using a Stage from the Internet</uri></li>
<li>
<uri link="#doc_chap3">Alternative: Using a Stage from the Installation
CD</uri>
</li>
</ul>-->
</body>
</subsection>
</section>
<section>
<title>Using a Stage from the Internet</title>
<subsection>
<title>Downloading the Stage Tarball</title>
<body>
<p>
Go to the Gentoo mountpoint at which you mounted your filesystems
(most likely <path>/gentoo</path>):
</p>
<pre caption="Going to the Gentoo mountpoint">
# <i>cd /gentoo</i>
</pre>
<p>
The table below specifies exactly which stages you need for your system.
Stages may be downloaded
off the <uri link="/main/en/mirrors.xml">official Gentoo mirrors</uri> under the
<c>releases/mips/current</c> directory.
</p>
<table>
<tr>
<th>Endianness</th>
<th>CPU</th>
<th>Location</th>
</tr>
<tr>
<ti>
Big Endian<br />
<e>(SGI Users)</e>
</ti>
<ti>
R4000<br />
R4400<br />
R4600
</ti>
<ti><c>mips3/stage#-mips3-RELEASE.tar.bz2</c></ti>
</tr>
<tr>
<ti>
Big Endian<br />
<e>(SGI Users)</e>
</ti>
<ti>
R5000<br />
RM5200<br />
RM7000<br />
R10000<br />
R12000<br />
R14000
</ti>
<ti><c>mips4/stage#-mips4-RELEASE.tar.bz2</c></ti>
</tr>
<tr>
<ti>
Little Endian<br />
<e>(Cobalt Users)</e>
</ti>
<ti>
RM5230<br />
RM5231
</ti>
<ti><c>cobalt/stage#-mipsel4-RELEASE.tar.bz2</c></ti>
</tr>
</table>
<p>
If you need to go through a proxy, export the <c>http_proxy</c> and
<c>ftp_proxy</c> variables:
</p>
<pre caption="Setting proxy information for wget">
# <i>export http_proxy="http://proxy.server.com:port"</i>
# <i>export ftp_proxy="http://proxy.server.com:port"</i>
</pre>
<p>
The Gentoo/MIPS netboot images provide <c>wget</c> as a means of downloading
files. Due to space constraints, it is not possible to provide more capable
browsers on SGI netboot images. LiveCD users may use <c>elinks</c>.
</p>
<pre caption="Fetching the tarball via wget">
# <i>wget -c
http://distfiles.gentoo.org/releases/mips/mips4/stage3-mips4-2005.1.tar.bz2</i>
</pre>
<p>
If you want to check the integrity of the downloaded stage tarball, use
<c>md5sum</c> and compare the output with the MD5 checksum provided on the
mirror. For instance, to check the validity of the mips4 stage tarball:
</p>
<pre caption="Example checking integrity of a stage tarball">
# <i>md5sum -c stage3-mips4-2005.1.tar.bz2.md5</i>
stage3-mips4-2005.1.tar.bz2: OK
</pre>
</body>
</subsection>
<subsection>
<title>Unpacking the Stage Tarball</title>
<body>
<p>
Now unpack your downloaded stage onto your system. We use GNU's <c>tar</c> to
proceed as it is the easiest method:
</p>
<pre caption="Unpacking the stage">
# <i>tar -xjpf stage?-*.tar.bz2</i>
</pre>
<p>
Make sure that you use the same options (<c>-xjpf</c>). The <c>x</c> stands for
<e>Extract</e>, the <c>j</c> for <e>Decompress with bzip2</e>, the <c>p</c> for
<e>Preserve permissions</e> and the <c>f</c> to denote that we want to extract
a file, not standard input.
</p>
<p>
Now that the stage is installed, continue with <uri
link="#installing_portage">Installing Portage</uri>.
</p>
</body>
</subsection>
</section>
<!--
<section>
<title>Alternative: Using a Stage from the Installation CD</title>
<subsection>
<title>Extracting the Stage Tarball</title>
<body>
<p>
The stages on the CD reside in the <path>/mnt/cdrom/stages</path> directory. To
see a listing of available stages, use <c>ls</c>:
</p>
<pre caption="List all available stages">
# <i>ls /mnt/cdrom/stages</i>
</pre>
<p>
If the system replies with an error, you may need to mount the CD-ROM first:
</p>
<pre caption="Mounting the CD-ROM">
# <i>ls /mnt/cdrom/stages</i>
ls: /mnt/cdrom/stages: No such file or directory
# <i>mount /dev/cdroms/cdrom0 /mnt/cdrom</i>
# <i>ls /mnt/cdrom/stages</i>
</pre>
<p>
Now go into your Gentoo mountpoint (usually <path>/mnt/gentoo</path>):
</p>
<pre caption="Changing directory to /mnt/gentoo">
# <i>cd /mnt/gentoo</i>
</pre>
<p>
We will now extract the stage tarball of your choice. We will do this with the
GNU <c>tar</c> tool. Make sure you use the same options (<c>-xvjpf</c>)! Again,
the <c>v</c> argument is optional and not supported in some <c>tar</c> versions.
In the next example, we extract the stage tarball
<path>stage3-<subarch>-2005.1.tar.bz2</path>.
Be sure to substitute the tarball filename with your stage.
</p>
<pre caption="Extracting the stage tarball">
# <i>tar -xvjpf /mnt/cdrom/stages/stage3-<subarch>-2005.1.tar.bz2</i>
</pre>
<!- - 2005.1: stage3 for athlon xp, pentium3 and pentium4 are b0rked - ->
<warn>
The <path>stage3-athlon-xp-2005.1.tar.bz2</path>,
<path>stage3-pentium3-2005.1.tar.bz2</path> and
<path>stage3-pentium4-2005.1.tar.bz2</path> files have a serious permission
error. After extracting any of these, run <c>chmod 0755 /mnt/gentoo</c> to fix
the error <e>before</e> continuing with the installation.
</warn>
<p>
Now that the stage is installed, continue with <uri
link="#installing_portage">Installing Portage</uri>.
</p>
</body>
</subsection>
</section>-->
<section id="installing_portage">
<title>Installing Portage</title>
<subsection>
<title>Unpacking a Portage Snapshot</title>
<body>
<p>
You now have to install a Portage snapshot, a collection of files that inform
Portage what software titles you can install, which profiles are available, etc.
</p>
</body>
</subsection>
<subsection id="installing_from_Internet">
<title>Download and Install a Portage Snapshot</title>
<body>
<p>
Go to the mountpoint where you mounted your filesystem (most likely
<path>/gentoo</path>):
</p>
<pre caption="Going to the Gentoo mountpoint">
# <i>cd /gentoo</i>
</pre>
<p>
Download a portage snapshot from a <uri
link="/main/en/mirrors.xml">local mirror</uri>.
You'll find them in the <path>snapshots/</path> directory. Transfer it to the
target system in the same manner that you did for the stage tarball.
</p>
<pre caption="Extracting the Portage snapshot">
# <i>tar -xjf portage-*.tar.bz2 -C /gentoo/usr</i>
</pre>
</body>
</subsection>
</section>
<section id="compile_options">
<title>Configuring the Compile Options</title>
<subsection>
<title>Introduction</title>
<body>
<p>
To optimize Gentoo, you can set a couple of variables which impact Portage
behaviour. All those variables can be set as environment variables (using
<c>export</c>) but that isn't permanent. To keep your settings, Portage provides
you with <path>/etc/make.conf</path>, a configuration file for Portage. It is
this file we will edit now.
</p>
<note>
A commented listing of all possible variables can be found in
<path>/gentoo/etc/make.conf.example</path>. For a successful Gentoo
installation you'll only need to set the variables which are mentioned beneath.
</note>
<p>
Fire up a text editor so we can alter the optimization variables we will discuss
hereafter. Two editors are provided, <c>vi</c> (part of Busybox) and
<c>nano</c>. We will assume you're using <c>nano</c>.
</p>
<pre caption="Opening /etc/make.conf">
# <i>nano -w /gentoo/etc/make.conf</i>
</pre>
<p>
As you probably noticed, the <path>make.conf.example</path> file is
structured in a generic way: commented lines start with "#", other lines define
variables using the <c>VARIABLE="content"</c> syntax. The <path>make.conf</path>
file uses the same syntax. Several of those variables are discussed next.
</p>
</body>
</subsection>
<!--<subsection>
<title>CHOST</title>
<body>
<warn>
Although it might be tempting for non-stage1 users, they should <e>not</e>
change the <c>CHOST</c> setting in <path>make.conf</path>. Doing so might render
their system unusable. Again: only change this variable if you use a
<e>stage1</e> installation.
</warn>
<p>
The <c>CHOST</c> variable defines what architecture <c>gcc</c> has to
compile programs for, as well as the <c>libc</c> (<c>glibc</c> or
<c>µClibc</c>) used
for linking.
</p>
<table>
<tr>
<th>Endianness</th>
<th>Userland/ABI</th>
<th>CHOST Setting</th>
</tr>
<tr>
<ti>Big Endian <e>(SGI Users)</e></ti>
<ti><c>glibc</c> <c>o32</c></ti>
<ti>mips-unknown-linux-gnu</ti>
</tr>
<tr>
<ti>Big Endian <e>(SGI Users)</e></ti>
<ti><c>µClibc</c> <c>o32</c></ti>
<ti>mips-unknown-linux-uclibc (1)</ti>
</tr>
<tr>
<ti>Big Endian <e>(SGI Users)</e></ti>
<ti><c>glibc</c> <c>n32</c> & <c>n64</c></ti>
<ti>mips64-unknown-linux-gnu (2)</ti>
</tr>
<tr>
<ti>Little Endian <e>(Cobalt Users)</e></ti>
<ti><c>glibc</c> <c>o32</c></ti>
<ti>mipsel-unknown-linux-gnu</ti>
</tr>
<tr>
<ti>Little Endian <e>(Cobalt Users)</e></ti>
<ti><c>µClibc</c> <c>o32</c></ti>
<ti>mipsel-unknown-linux-uclibc (1)</ti>
</tr>
<tr>
<ti>Little Endian <e>(Cobalt Users)</e></ti>
<ti><c>glibc</c> <c>n32</c> & <c>n64</c></ti>
<ti>mips64el-unknown-linux-gnu (2)</ti>
</tr>
</table>
<warn>
(1) µClibc stages are the realm of the
<uri link="/proj/en/base/embedded/">Gentoo Embedded</uri>
team, and are therefore not officially supported by the
Gentoo/MIPS team. This <c>CHOST</c> setting is only mentioned here for
completeness.
</warn>
<warn>
(2) Currently we do not provide <c>n64</c> stages, and only provide <c>n32</c>
stages on the Big Endian MIPS4 architecture. These are highly experimental
stages and are known to be totally broken in places. Users are thus
<e>highly</e> recommended to avoid these like the plague.
The only reason one would need the <c>mips64(el)</c> <c>CHOST</c>, is to use a
64-bit (<c>n32</c> or <c>n64</c>) userland. This <c>CHOST</c> setting is only
mentioned here for completeness.
</warn>
</body>
</subsection>-->
<subsection>
<title>CFLAGS and CXXFLAGS</title>
<body>
<p>
The <c>CFLAGS</c> and <c>CXXFLAGS</c> variables define the optimization flags
for the <c>gcc</c> C and C++ compiler respectively. Although we define those
generally here, you will only have maximum performance if you optimize these
flags for each program separately. The reason for this is because every program
is different.
</p>
<p>
In <path>make.conf</path> you should define the optimization flags you think
will make your system the most responsive <e>generally</e>. Don't place
experimental settings in this variable; too much optimization can make
programs behave bad (crash, or even worse, malfunction).
</p>
<p>
We will not explain all possible optimization options. If you want to know
them all, read the <uri link="http://gcc.gnu.org/onlinedocs/">GNU
Online Manual(s)</uri> or the <c>gcc</c> info page (<c>info gcc</c> -- only
works on a working Linux system). The <path>make.conf.example</path> file
itself also contains lots of examples and information; don't forget to read it
too.
</p>
<p>
A first setting is the <c>-march=</c> flag, which specifies the name of the
target architecture. Possible options are described in the
<path>make.conf.example</path> file (as comments). Examples include ISA levels
(<c>mips1</c> ... <c>mips4</c>) and CPU models (<c>r4400</c>, <c>r4600</c> ...
etc). For pure ISA level architectures, one can simply specify <c>-mips3</c>
rather than <c>-march=mips3</c>.
</p>
<pre caption="The GCC -march and -mips# settings">
<comment>(For an R4600 system...)</comment>
-march=r4600
<comment>(Any MIPS4-class CPU...)</comment>
-march=mips4
<comment>(Or just specify the ISA level directly...)</comment>
-mips4
</pre>
<p>
A second one is the <c>-O</c> flag (that is a capital O, not a zero),
which specifies the <c>gcc</c> optimization
class flag. Possible classes are <c>s</c> (for size-optimized),
<c>0</c> (zero - for no optimizations), <c>1</c>, <c>2</c> or <c>3</c> for more
speed-optimization flags (every class has the same flags as the one before, plus
some extras). For instance, for a class-2 optimization:
</p>
<pre caption="The GCC O setting">
-O2
</pre>
<p>
A very important setting in the MIPS world, is the <c>-mabi=</c> flag. MIPS has
3 different ABIs; <c>32</c> (pure 32-bit, aka <c>o32</c>), <c>64</c> (full
64-bit, aka <c>n64</c>) and <c>n32</c>
(a mix of 32-bit data structures with 64-bit instructions). This
flag selects which of these you wish to use. Note you need libraries for the
ABI you select. In layman's terms, this means, for example, you can't use
<c>-mabi=64</c> on a 32-bit userland (or even a <c>n32</c> userland).
</p>
<p>
Another popular optimization flag is <c>-pipe</c> (use pipes rather than
temporary files for communication between the various stages of compilation).
</p>
<p>
Mind you that using <c>-fomit-frame-pointer</c> (which doesn't keep the frame
pointer in a register for functions that don't need one) might have serious
repercussions on the debugging of applications!
</p>
<p>
When you define the <c>CFLAGS</c> and <c>CXXFLAGS</c>, you should combine
several optimization flags, like in the following example:
</p>
<pre caption="Defining the CFLAGS and CXXFLAGS variable">
CFLAGS="-mabi=32 -mips4 -pipe -O2"
CXXFLAGS="${CFLAGS}" <comment># Use the same settings for both
variables</comment>
</pre>
</body>
</subsection>
<subsection>
<title>MAKEOPTS</title>
<body>
<p>
With <c>MAKEOPTS</c> you define how many parallel compilations should occur when
you install a package. A good choice is the number of CPUs in your system plus
one, but this guideline isn't always perfect.
</p>
<pre caption="MAKEOPTS for a regular, 1-CPU system">
MAKEOPTS="-j2"
</pre>
</body>
</subsection>
<subsection>
<title>Ready, Set, Go!</title>
<body>
<p>
Update your <path>/gentoo/etc/make.conf</path> to your own preference and
save (<c>nano</c> users would hit <c>Ctrl-X</c>). You are now ready to continue
with <uri link="?part=1&chap=6">Installing the Gentoo Base System</uri>.
</p>
</body>
</subsection>
</section>
</sections>
--
[email protected] mailing list