From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.54) id 1Euxbe-0004Mr-De for garchives@archives.gentoo.org; Fri, 06 Jan 2006 19:50:35 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.5/8.13.5) with SMTP id k06JoQKa000634; Fri, 6 Jan 2006 19:50:26 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [134.68.220.30]) by robin.gentoo.org (8.13.5/8.13.5) with ESMTP id k06JoP4h009030 for ; Fri, 6 Jan 2006 19:50:26 GMT Message-Id: <200601061950.k06JoP4h009030@robin.gentoo.org> Received: from lark.gentoo.osuosl.org ([140.211.166.177] helo=lark.gentoo.org) by smtp.gentoo.org with smtp (Exim 4.54) id 1EuxbV-00014A-Fb for gentoo-doc-cvs@lists.gentoo.org; Fri, 06 Jan 2006 19:50:25 +0000 Received: by lark.gentoo.org (sSMTP sendmail emulation); Fri, 6 Jan 2006 19:50:25 +0000 From: "swift" Date: Fri, 6 Jan 2006 19:50:25 +0000 To: gentoo-doc-cvs@lists.gentoo.org Subject: [gentoo-doc-cvs] cvs commit: bootstrapping-guide.xml Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-doc-cvs@gentoo.org Reply-to: docs-team@lists.gentoo.org X-Archives-Salt: f4d73b1c-c7d7-400f-ac57-cf054dfe70a3 X-Archives-Hash: f00f7c7b4eeea18dbe8433e6ff74ef28 swift 06/01/06 19:50:25 Modified: xml/htdocs/doc/en/draft bootstrapping-guide.xml Log: Tralalalala, some more text Revision Changes Path 1.6 +224 -3 xml/htdocs/doc/en/draft/bootstrapping-guide.xml file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/draft/bootstrapping-guide.xml?rev=1.6&content-type=text/x-cvsweb-markup&cvsroot=gentoo plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/draft/bootstrapping-guide.xml?rev=1.6&content-type=text/plain&cvsroot=gentoo diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/draft/bootstrapping-guide.xml.diff?r1=1.5&r2=1.6&cvsroot=gentoo Index: bootstrapping-guide.xml =================================================================== RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/draft/bootstrapping-guide.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- bootstrapping-guide.xml 5 Jan 2006 19:09:34 -0000 1.5 +++ bootstrapping-guide.xml 6 Jan 2006 19:50:25 -0000 1.6 @@ -1,6 +1,6 @@ - + @@ -52,6 +52,11 @@ native environment.

+

+Sounds strange to you? Don't despair, we'll discuss all that in the rest of this +document... +

+
@@ -87,6 +92,13 @@ +

+Each of those terms has a certain syntax used by the GNU compiler collection. It +is therefore adviseable to consult the online GCC documentation for more +information. +

+
@@ -228,7 +240,7 @@

-Our first task is to build a Linux kernel. +Our first task is to build a Linux kernel:

@@ -237,42 +249,224 @@
 $ make dep boot CROSS_COMPILE=<target>
 
+

+Next, build the core packages required to succesfully boot the system. The set +of packages you'll need are: +

+ +
+
coreutils
+
Standard set of (POSIX) commands
+
diffutils
+
Tools for displaying the differences between files
+
grep
+
Text pattern searcher
+
sed
+
Streaming text editor
+
make
+
Makefile parser
+
tar
+
Tape Archive tool
+
gzip
+
Compression tool
+
util-linux
+
Linux utilities
+
+ +

+All these tools should be fairly easy to build. Generally, you can set the +following variables to declare your platform; the configure and +make steps will then use those variables to make their platform-dependant +decisions: +

+ +
+$ export CC=your-platform-gcc
+$ export AR=your-platform-ar
+$ export RANLIB=your-platform-ranlib
+$ export LD=your-platform-ld
+$ export BUILD_CC=cc
+$ export HOST_CC=cc
+$ export CFLAGS=sane cflags -I~/cd/usr/include
+
+ +

+The build steps are then quite simple: +

+ +
+$ ./configure --prefix=/usr
+$ make
+$ make install prefix=~/cd/final
+
+ +

+The last thing you'll need is a statically linked version of a shell, for +instance, bash: +

+ +
+$ TODO
+
+
Bootstrapping the Toolchain +

+Now that you have build a minimal environment inside ~/cd, we'll +rebuild the toolchain so that it not only builds for the target platform (which +it does already) but also builds on the target platform (it currently +only works on the current system). +

+ +

+First, we rebuild the glibc package: +

+ +
+$ ./configure --prefix=/usr --libdir=~/cd/usr/lib --build=${BUILD} \
+  --host=${TARGET} --with-headers=~/cd/usr/include --without-cvs \
+  --disable-profile --disable-debug --without-gd --enable-add-ons=nptl \
+  --with-tls --enable-kernel=2.6 --enable-shared
+$ make
+$ make install install_root=~/cd/final
+
+ +

+Next, we rebuild the binutils package: +

+ +
+$ ./configure --prefix=/usr --target=${TARGET} --with-sysroot=~/cd/final \
+  --libdir=~/cd/usr/lib --with-headers=~/cd/usr/include
+$ make all
+$ make install
+
+ +

+Finally, we rebuild the gcc package: +

+ +
+$ ./configure --prefix=/usr --target=${TARGET} --with-sysroot=~/cd/final \
+  --with-headers=~/cd/usr/include --enable-threads=posix \
+  --enable-languages=c,c++
+$ make
+$ make install
+
+ +

+Now the directory ~/cd/final contains everything needed to +continue. +

+
-Building the Core System Packages +Booting the System +

+The next step is to try and boot the system. The easiest approach is to +NFS-mount ~/cd/final and boot the target platform using the kernel +built at the beginning. Don't forget to set init=/bin/sh since the entire +bootup sequence stuff (like init) isn't available yet. +

+ +

+TODO inform how to boot from the CD and use an NFS-mounted root +file system. +

+
Porting Portage +

+To be able to use Portage, we need to be able to use Python. Download the +sources in ~/cd/final/tmp (so that it is available for the booted +platform) and build it: +

+ +
+TODO
+
+ +

+Next, download a Portage rescue set and install it. As Portage is a set of +Python scripts with bash scripts, this should have no further requirements after +installation: +

+ +
+TODO
+
+ +

+Once installed, try to run emerge and ebuild to find out if they +appear to work: +

+ +
+$ emerge --info
+
+
Creating a Stage1 Tarball +

+Booted in the platform and with a working Portage, you are now ready to create a +stage1 tarball. Create a snapshot of your environment using tar: +

+ +
+TODO
+Don't forget to talk about unmasking all packages...
+
+
Creating a Bootable Environment +

+Next, to make sure that you'll always be able to boot the system (and help +others as well), we'll create a bootable environment for the platform. Assuming +that all platforms have a CD-ROM drive they can boot from, we'll focus on such +environment. +

+ +

+TODO talk about creating bootable CD. +

+
Finishing Off +

+All set. Right? Nope, but almost :-) +

+ +

+The most important step now is to inform the Gentoo community about what you've +accomplished. Make sure you pay a visit at #gentoo-dev on +irc.freenode.net and use our Gentoo +Forums to tell about the up and downfalls of your expedition. The most +difficult steps are finished! +

+
@@ -347,6 +541,33 @@ +
+Creating a Fully Working Installation CD + + +

+If your entire installation has succeeded it is best to try and create an +installation CD for your platform using catalyst. Not only will this +require an additional profile (to support the new platform) but also some help +from the Gentoo developers themselves. On the other hand, if you've succeeded in +following all I've written until this part, you're probably already on your way +to become a developer yourself :) +

+ +

+The major benefit of using catalyst is that Gentoo is then able to create +official support for the platform. Not only will there be a fully functional +profile and keyword setting, but the core packages will be accepted for your +platform, stages will be build and a working installation CD, just like those +for the other architectures, will be available. +

+ +

+TODO Talk about using catalyst to create all needed stuff. +

+ + +
-- gentoo-doc-cvs@gentoo.org mailing list