LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1298|回复: 7

从stage1开始,ntpl+udev+gcc-3.4(转自官方论坛,想装gentoo的现看看这个)

[复制链接]
发表于 2004-11-26 13:41:20 | 显示全部楼层 |阅读模式
Gentoo 2004.3 Has officially been released and this tutorial has been updated to support 2004.3

Currently Gentoo 2004.3 is stable and if your after every ounce of bleeding edge performance from the x86 architecture you've found the right install tutorial. The mania linux user ventures here with a millisecond stop watch and low lat coffee. The minimal 2004.3 is all you will require as a default for livecd selection. The other subarch specific cd's have precompiled binaries on them that will nevertheless require massive updating over the duration of the current grp cd's release currency and do not have support for nptl by default. I don't use them personally since Gentoo is a full network capable install that only meets my strict specifications when built according to these methods. Listen up and you'll have the sweetest nix box on your block.

Here's the NPTL From Scratch Primer couresy of Gentoo Linux and EliteitMinds Technologies

Few Props and Mentions =]
---------------------------------
Credit goes out to SyN-AcK for the text template and Kerin Millar for all the low latency coffee. Go kerf!

Greets to old buds at Betasirc. Wouldn't be the admin i am today without ya'll
Davetha, End3r, DR, UnNaturalHigh, OneEightSeven, n30, phantam, metwo, expunge and all the rest of ya.
Cudos to Logan for his amazing work with mrtgout and for his "Description of screen" =]

Many thanks to all the developers of Gentoo Linux that helped me learn.
kleiber, Ramareth, solar, lcars, jforman and so many more. Gentoo Linux Infrastructure was a lesson that has some of the greatest collective agility in the industry. What was learned will most certainly be a contributing foundation for many years to come.

May you all Compile Long and Prosper ;]

Obtaining Gentoo Linux Livecd and ensuring you boot from a "stable" linux kernel
--------------------------------------------------------------------------------------------------------------------------------
Use my official Gentoo Linux file and rsync mirrors if you like to obtain a stable gentoo livecd.

http://gentoo.eliteitminds.com 100MBit bgp4 Stage1 Posix Hardened 2.6 Gentoo
rsync://rsync.eliteitminds.com 100MBit bgp4 Stage1 Posix Hardedned 2.6 Gentoo

Pimp the latest LiveCD that the dev's have to offer mere mortals.
http://mirror.datapipe.net/gento ... -minimal-2004.3.iso
iit's small, (70~90 megs) innocent and builds the most massive choke proof servers known to man aslong as your using stable kernels. 2.4.x will not get the job done here.

After burn the cd as a dao image, boot from the cd ensuring you have a dhcp server reachable by network to simplify your initial network setup for the actual installation. Make sure to boot from "smp" kernel on the cd wiether you have an smp system or not. Booting with smp has i've been informed no detrimental affects and this will reward you with a 2.6.5-r1 or newer linux kernel that can properly link toolchain with 2.6.x stable linux headers and native linux posix threading. The default 2.4.x kernel and headers will leave you very disapointed when it halts in mid bootstrap.

Why use Screen Before Installing and Starting Screen
--------------------------------------------------------------
Screen could be described as a terminal emulator... or maybe a multi user terminal. More than one user can join an ssh session simultaneously with very little frustration making those moments when assistance would be super benificial all that more easy to accomplish. I prefer it best for "holding" a terminal open while your not actually even connected to the tty that you started when screen was executed or for having more than one user join a common workspace inside a linux system. If your following me this has some very good advantages while your installing gentoo. One major advantage is if your disconnected your running compile will not fail or halt but rather continue while your have gone off to eat hotdogs and drink beer over the football game or to have an experienced user help you throught the course of an installation. It can suck running bootstrap twice if you loose a remote connection or something goes awry. For those of you that have personally had me install your systems congratulations and thank you for the experience.

To start screen type "screen" at the command prompt and continute with your work. should you need to "disconnect from screen to use irc with irssi simply type ctrl+a+d. To re-attach to screen type "screen -x" Sure beats logging off and killing your compile by accident =]

Setting hard disk and cdrom transer modes with hdparm for maximum disk performance
------------------------------------------------------------------------------------------------------
So you have the sexiest windows box in the universe eh...? Think it's quick..? I think not.
In windows you do not have a utility to physically affect changes to the hard drives performance parameters. Linux does. hdparm is that utility that allows you to set your hard disks and cdroms to utilize the fastest 32bit and udma transfer modes for supported by your hard disks. Keep in mind that hdparm is intended more for ide ~ udma ~ ata based systems because sata and scsi disks have the ability to dynamically affect these changes from the scsi controller's chipset. gentoo linux adds hdparm in all the livecd's. Even minimal livecd's. The results from using it can save you days of waiting for apps to compile if your motherboards ide chipset does not automatically set the hard drives performance parameters to use 32bit i/o, multcount and readahead disk modes tuned just for your system. Hard disks, cdroms, cdrw's, dvdrw's all may require these modes to be set to allow your system to truly achieve the performance linux can really offer. Below you will see four examples. The first is a non optimized drive offering no dma, 32bit i/o, multicount or unmaskirq usage, The second and third shows how to set these modes for hard disks and optical storage readers and writers. The fourth are the results of the settings.

The un-optimized view would or could look such as this does


Code:


  1. gateway ~ # hdparm /dev/hda

  2. /dev/hda:
  3.   multcount    =  0 (off)
  4.   IO_support   =  0 (default 16-bit)
  5.   unmaskirq    =  0 (off)
  6.   using_dma    =  0 (off)
  7.   keepsettings =  0 (off)
  8.   readonly     =  0 (off)
  9.   readahead    = 256 (on)
  10.   geometry     = 16383/255/63, sectors = 78165360, start = 0

复制代码


To set the optimized transfer modes for most hard disks from the livecd do the following



Code:


  1. gateway ~ # hdparm -d1c1u1m16 /dev/hda

复制代码


To set the optimized transfer modes for most cdrom/rw and dvdrom/rw devices from the livecd do the following if your livecd is in the master cd device for all cdroms. If your livecd is the second of two cd devices substitute cdroms0 with cdroms1 or use hdparm and set the parameters for both devices to ensure they are set to achieve maximum performance. Your system runs from this cd while it builds so giving it all the data bandwidth it can use would be very benificial. keep in mind that cdroms do not use multicount.



Code:


  1. gateway ~ # hdparm -d1c1u1 /dev/cdroms/cdrom0
复制代码



The optimized results



Code:


  1. gateway ~ # hdparm -d1c1u1m16 /dev/hda

  2. /dev/hda:
  3.   setting 32-bit IO_support flag to 1
  4.   setting multcount to 16
  5.   setting unmaskirq to 1 (on)
  6.   setting using_dma to 1 (on)
  7.   multcount    = 16 (on)
  8.   IO_support   =  1 (32-bit)
  9.   unmaskirq    =  1 (on)
  10.   using_dma    =  1 (on)

复制代码


Setting up network
-----------------------------
2004.1 has a minor issue with loading modules for nic drivers occasionally so were going to ensure your nic loaded properly. If your using the 2004.2 Livecd then you should be ok but it's good to check anyway and make sure everthing is operational. There is also an ssh server on every livecd that you can use to allow remote access to your system for build assitance or to work from a second pc while you play enemy-territory on my et server =]



Code:


  1. ifconfig eth0
  2. If you recieve and error you will need to research which kernel module your nic needs to load driver support. If users have problems with their network cards, they should use lspci to find what type of nic they have and then look up what drivers it should use.
  3. mine is a Realtek that doesn't require the c++ module,
  4. modprobe 8139too
  5. ifconfig eth0
  6. dhcpcd eth0
  7. ping -c4 yahoo.com

复制代码


If you see packet traffic it's time to continue. If not your quite welcome to join me in gentoo's irc chans for user support

Fdisk Primer && Setting up filesystems
---------------------------------------------


First check your system for available disks if this command prints nothing you have a problem that is outside the scope of this tutorial



Code:


  1. firewall2 / # fdisk -l

  2. Disk /dev/sda: 54.8 GB, 54896492544 bytes
  3. 255 heads, 63 sectors/track, 6674 cylinders
  4. Units = cylinders of 16065 * 512 = 8225280 bytes



  5. Using fdisk - fdisk in a nutshell.. The manual of fdisk

复制代码


Code:


  1. The number of cylinders for this disk is set to 14593.
  2. There is nothing wrong with that, but this is larger than 1024,
  3. and could in certain setups cause problems with:
  4. 1) software that runs at boot time (e.g., old versions of LILO)
  5. 2) booting and partitioning software from other OSs
  6. (e.g., DOS FDISK, OS/2 FDISK)

  7. Command (m for help): m
  8. Command action
  9. a toggle a bootable flag
  10. b edit bsd disklabel
  11. c toggle the dos compatibility flag
  12. d delete a partition
  13. l list known partition types
  14. m print this menu
  15. n add a new partition
  16. o create a new empty DOS partition table
  17. p print the partition table
  18. q quit without saving changes
  19. s create a new empty Sun disklabel
  20. t change a partition's system id
  21. u change display/entry units
  22. v verify the partition table
  23. w write table to disk and exit
  24. x extra functionality (experts only)

复制代码


Fdisk your available disks
----------------------------------------

Everyone has a preference. Thats fine. I prefer fdisk over cfdisk due to fdisk giving you more granular control over the partitioning process which lets you better plan for your installation and set the partition numbers, size, and attributes yourself. Trust me folks... Gentoo does not use swap often but why risk it. I've seen a 3.2HT p4 eat 1gb of ram AND 1gb of swap. When your applications are compiled to utilize every available cpu register they don't need a place to sit down and take 5. Swap will become something a high capacity system with hundreds of users will nevertheless utilize. I highly recommend using +100M or larger boot partitions for a 2.6 kernel install. 2.6 kernels use allot more space than 2.4 and hey.. why redo it later. This setup lasted me for more than a year. Till asshat stole my server... No logical partitions are required if your using the entire disk for Gentoo Linux in a basic configuration with no raid or LVMs



Code:


  1. n0id root # fdisk /dev/hd#  where # = the letter of your hard disk you would like to install gentoo on. substitute hd# with sd# if you have scsi or sata devices.
复制代码





Code:


  1. your boot partition should be hda1 if you have an ide disk or sda1 if your using scsi or sata

复制代码




Code:


  1. hda2 or sda2 for swap
  2. +1024M for 512MB of ram and 1024M for 1GB of ram
复制代码





Code:


  1. hda3 or sda3 for / using the remainder of your physical disk.

复制代码




Code:


  1. Set hda1 to Active with "a" and also change the swap partitioon "type" of hda2 to swap By pressing "t" and entering type "82 See the fdisk manual above if your confused
复制代码



********* Mucho Grande Importante ************



Code:


  1. w - to write out the partition table and exit fdisk.

复制代码


Here's what your partition table should look like after your done. The below code snippet is the partition table from a fully posix fueled dual 3.06 xeon with AACRAID and 2GB of ram that serves as a gbit bgp4 packet shaper at a datacenter i admin for that hosts an oc192 dark fiber pop. I personally installed this server myself.



Code:


  1. Device Boot Start End Blocks Id System
  2. /dev/sda1 * 1 13 104422 83 Linux
  3. /dev/sda2 14 257 1959930 82 Linux swap
  4. /dev/sda3 258 6674 51544552+ 83 Linux
  5. firewall2 / #

复制代码



Creating Filesystems
--------------------------------

Using ext2 or ext3 would be such a waste. It's slow, it cannot output i/o at the rates of reiserfs 3.6 or reiser4... Yes i tested Reiser4 stability for Gentoo and it's fuckin killa over 80MB/s i/o on hard drives *not* properly tuned with hdparm for udma133 with no raid. For this example we'll use reiserfs 3.6.

Reiser4 was recently released as a stable filesystem. and if you've been folIowing the news on reiser4.. It's the fastest filesystem on the planet. I will be adding Reiser4 as an optional filesystem in this tutorial in the very near future as time permits.

To create file systems:



Code:


  1. mkreiserfs /dev/hda1 --format 3.6
  2. mkreiserfs /dev/hda3 --format 3.6
  3. mkswap /dev/hda2
  4. swapon /dev/hda2

复制代码


Mounting
--------------


Code:


  1. mount /dev/hda3 /mnt/gentoo
  2. mkdir /mnt/gentoo/boot
  3. mount /dev/hda1 /mnt/gentoo/boot

复制代码


Retrieving a Base System Stage
-------------------------------------------------

If your planning a stage1 installation use a generic x86 stage1 gentoo stage. It's the only stage that will let you build a full posix install with the native linux posix threading model that makes pthreading look like childs play. To use it you must compile every application to support it specifically toolchain which primarily consists of glibc and gcc. For this example were goin for brutal speed and agility so if you've been following it's stage1 were planning to build. Precompilied applications in a can will leave you with broken libs or unsupported features. Just build it how you wish and get the best results by compiling it all. Linux is a house of cards. Build the base cockeyed and the top will not resemble it's true form. This true form i speak of earned the amd64 herd a major reward for linux gaming @ 570 Fps using these methods.



Code:


  1. cd /mnt/gentoo/
  2. wget [url]http://mirror.datapipe.net/gentoo/releases/x86/2004.3/stages/x86/stage1-x86-2004.3.tar.bz2[/url]
  3. tar xjpvf stage1*.bz2



  4. Selecting fast mirrors
  5. -------------------------
  6. # mirrorselect -a -s4 -o | grep 'GENTOO_MIRRORS=' >> /mnt/gentoo/etc/make.conf
复制代码


Setting make.conf - updated
-----------------------------------
There's way too many variables to cover..
checkout my running make.conf and edit it to your requirements.
http://www.ali3nx.info/make.conf


Code:


  1. cd /mnt/gentoo/etc && rm -f make.conf && wget [url]http://www.ali3nx.info/make.conf[/url]
复制代码



Mounting /proc and /dev into the stage
---------------------------------------------
Before chrooting you must mount procfs from the running
livecd into the hard drive's newly extracted filesystem for stuff to
operate properly while chrooted.



Code:


  1. mount -t proc none /mnt/gentoo/proc


复制代码

-ptional:- Also /dev on the livecd should be mounted into the chroot also as you may experience some dufficulties setting up grub if your using a promise or other offboard ide card


Code:


  1. mount -o bind /dev /mnt/gentoo/dev

复制代码


Chrooting
---------------


Code:


  1. cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
  2. chroot /mnt/gentoo /bin/bash
  3. env-update && source /etc/profile


复制代码

Setting your date and time
-------------------------------
Source built linux does "tag" some of the compiles with dates and times of the compiles and if your date is not set this could create a problem. Later in the installation we will setup a network time client to eliminate "clock skew" that can cause compiles to halt. Perl is especially more fragile to this condition.

1.) Setting your system date and time



Code:


  1. n0id ~ # date --help
  2. Usage: date [OPTION]... [+FORMAT]
  3.    or:  date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
  4. Display the current time in the given FORMAT, or set the system date.

  5. n0id var # date 090316002004
  6. Fri Sep  3 16:00:00 CDT 2004

复制代码


Getting the Portage Tree
--------------------------------------


Code:


  1. emerge sync

复制代码


2.6.x Stable linux-headers are a must for nptl - updated
-----------------------------------------------------------------
The developers have been slowly making the migration to 2.6 allot easier and it's no longer nessesary to unmask linux2.6-headers to allow use of the latest linux headers. Previously I would add sys-kernel/linux26-headers ~x86 to package.keywords but Lv changed the ebuilds to allow unfettered use of these packages with no special keywording if your using ~x86 in make.conf. Regardless you must remove the default 2.4.x headers favoring building toolchain for a 2.6 linux kernel *using* 2.6.x linux-headers not the latter 2.4 fodder that runs like redhat/fedora or a kid with a soggy diaper if you prefer... Were after capacity servers that eat 200.00 loads and not choke. Using 2.4 linux headers with nptl bootstraps will break toolchain and possibly your marrage when your sitting at your desk on sunday morning  

Setting USE=
----------------

!! Important!! Ensure your USE= is set properly before you proceed our your results will be unsatisfactory at best. Not setting USE= will have better results that setting USE=攆oo17and *not* adding use flags as make.conf overrides the portage defaults leaving you with a broken installation. The very minimum of USE= will not bootstrap for nptl. If your completely lost and have no clue what use flags to use are properly defined in your portage profile. You must add USE="nptl" regardless to bootstrap supporting nptl threading.



Code:


  1. ali3n@gateway ~ $ cat /usr/portage/profiles/default-x86-2004.2/make.defaults
  2. # Copyright 2002-2004 Gentoo Foundation.
  3. # System-wide defaults for the >=gcc 3.2 Portage system

  4. #Experimental: trying to use these USE variables to build up from stage 2->3
  5. #thus eliminating the inherent fragility of using USE for this

  6. GRP_STAGE23_USE="ipv6 pam tcpd readline nls ssl gpm perl python berkdb acl ncurses"

  7. # Please avoid enabling things by default in here if possible. Understand any
  8. # implications with core packages. For example, if "java" is in USE and db
  9. # has a conditional dependency on java (which it does,) then a JDK will be
  10. # pulled in during *emerge system*!

  11. USE="x86 oss apm arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm gtk gtk2 imlib jpeg kde gnome libg++ libwww mad mikmod motif mpeg ncurses nls oggvorbis opengl pam pdflib png python qt quicktime readline sdl slang spell ssl svga tcpd truetype X xml2 xmms xv zlib"

  12. ARCH="x86"
  13. ACCEPT_KEYWORDS="x86"


复制代码


Bootstrapping the System, Emerging System, Setting Runlevels - All One Command
-------------------------------------------------------------------------------------------------
-:editorial comment:- Procedures change and things will get updated and the build process is no exception. The bootstrap process and supporting scripts have again changed this week. bootstrap-26.sh and bootstrap-cascade.sh have been deleted from portage supporting a unified bootstrap process. Since they aren't available to mere mortals they should no longer be used favoring the venerable bootstrap.sh; October/04 was a bumpy ride for everyone but fortunately the bootstrap bug was fixed. After recieving reports that my oneliner was creating some /lib/cpp sanity errors we got down in the trenches and found a solution and a workaround for those that would have it no other way but gentooed. The following onleliner has been updated with to reflect the changes that the bootstrap fix has solved. rac's suggestion for fixing the sanity errors wasn't related to the gcc profile bug but is nevertheless a very valuble one so i'll be leaving it right where it is. oktane had a suggestion in this thread and in the other bug thread for sidestepping the gcc bug before running bootstrap and it appears it works very well and was a valuble aid to the hardcore gentooed ones willing to accept no second best made by the corporation of redmond  The dev's are also migrating us all to cascading profiles soon also and so will we. Any changes in a system are subject to regression testing and this install tutorial is no exception. Also the confusion over having multiple bootstrap scripts has finally come to an end. Should something not work of you experience any sanity errors post a reply in this thread and someone will investigate it as soon as possible - updated 22/09/04

The sooper dooper spectacular bootstrap-bugfixed oneliner magic


Code:


  1. env-update && source /etc/profile && emerge -C linux-headers && USE="-* build bootstrap" emerge linux26-headers && cd /usr/portage && scripts/bootstrap.sh && emerge system && emerge syslog-ng xinetd grub hotplug coldplug vixie-cron reiserfsprogs reiser4progs sysfsutils udev && emerge --nodeps acpid ntp && rc-update add syslog-ng default && rc-update add net.eth0 default && rc-update add vixie-cron default && rc-update add xinetd default && rc-update add sshd default && rc-update add hotplug default && rc-update add coldplug default && rc-update add acpid default
复制代码



Preparing for adding your kernel source tree by setting up ntp-client to eliminate clock skew
-------------------------------------------------------------------------------------------------------------
There's just not enough time in a day... and it's a little known fact that a computer has two clocks. One is a hardware clock and the second is a software clock that runs in the os. They however do not stay in sync which creates a condition known as clock skew that can cause havok with source build operating systems such as gentoo linux. Clock skew can cause source compiles to fail. We allieviate this problem by adding a network time protocol client into the installation.



Code:


  1. rc-update add ntp-client default && ntpdate -b -u pool.ntp.org

复制代码


Emerging linux kernel sources
----------------------------------



Code:


  1. emerge gentoo-dev-sources

复制代码


Setting your system's timezone symlink
-----------------------------------------------
List the timezone files in the system and find the timezone that closest matches your location ion our big blue ball in the dark liniverse. Keep in mind they will not be added until after bootstrap or until after glibc compiles.



Code:


  1. n0id var # ls /usr/share/zoneinfo/
  2. Africa      Atlantic   Canada  EST5EDT  Factory  GMT-0      Iceland  Japan      MST7MDT  Navajo   Portugal   Turkey     W-SU         posixrules
  3. America     Australia  Chile   Egypt    GB       GMT0       Indian   Kwajalein  Mexico   PRC      ROC        UCT        WET          right
  4. Antarctica  Brazil     Cuba    Eire     GB-Eire  Greenwich  Iran     Libya      Mideast  PST8PDT  ROK        US         Zulu         zone.tab
  5. Arctic      CET        EET     Etc      GMT      HST        Israel   MET        NZ       Pacific  Singapore  UTC        iso3166.tab
  6. Asia        CST6CDT    EST     Europe   GMT+0    Hongkong   Jamaica  MST        NZ-CHAT  Poland   SystemV    Universal  posix
复制代码



Now you must remove the default timezone symlink and create a new one which is linked to the timezone info file that matches your timezone. I'm currently in Pacific Standard Time (Vancouver, Canada) so i chose /usr/share/zoneinfo/America/Vancouver as my timezone file. Note that locating the closest city in your timezone will help your system automatically adjust for daylight savings time changes appropriately. replace /usr/share/zoneinfo/{path/to/your/timezonefile} in the code example below with the correct and appropriate timezone file for your location.



Code:


  1. rm /etc/localtime && ln -s /usr/share/zoneinfo/{path/to/your/timezonefile} /etc/localtime

复制代码


Configuring the Kernel - Now with udev and gensplash!!!
------------------------------------------------------------------
I've setup one of my domains to offer config files for this tutorial Thanks to Exovian Dedicated Hosting for providing the shell on thier 100MBit quad xeon .

Since devfs is being depreciated soon you should be prepared to switch to udev when your required. Hotplug and sysfsprogs are a must for udev. udev runs so much better for desktop environments than devfsd so i've decided to take you all under the knife. It's very simple to setup. Add Hotplug firmware loading in your kernel config, remove devfs filesystem support emerge udev sysfsutils and make one change to /etc/conf.d/rc that restrict devfsd from starting on boot. My kernel config has all the needed changes premade to utilize udev appropriately. Here's a cutout from /etc/conf.d/rc with the needed changes made. edit them in nano on your system and save the config file.


Code:


  1. RC_NET_STRICT_CHECKING="no"

  2. # Use this variable to control the /dev management behavior.
  3. #  auto   - let the scripts figure out what's best at boot
  4. #  devfs  - use devfs (requires sys-fs/devfsd)
  5. #  udev   - use udev (requires sys-fs/udev)
  6. #  static - let the user manage static nodes

  7. RC_DEVICES="udev"

  8. # Set to "yes" if you want to save /dev to a tarball on shutdown
  9. # and restore it on startup.  This is useful if you have a lot of
  10. # custom device nodes that udev does not handle/know about.
  11. # (ONLY used by UDEV enabled systems!)

  12. RC_DEVICE_TARBALL="yes"

复制代码


lspci && lsmod (copy the output to a txt file that you can use for reference then use my base kernel .config and modify to your requirements. Genkernel will get you up and going but your system will not run as efficiently as it could

To get the kernel config skel file do the following


Code:


  1. cd /usr/src/linux && wget [url]http://www.ali3nx.info/.config[/url] && make menuconfig

复制代码

Welcome to the linux kernel configuration menu. Here you must change a few items for your configuration if your using my kernel config. My config is sutable for most systems however it's built to run on my system.

Specifically you must change the following items to suit your configuration.



Code:


  1. 1) Processor type and features - mainly be concerned with your cpu type here
  2. 2) ATA/ATAPI/MFM/RLL support for storage controllers
  3. 3) Networking support - NIC Device drivers are your main concern Use Modules =]
  4. 4) Character devices - agpgart and agp chipset type, dri driver ( if required)
  5.      Note that if your using an nvidia videocard it's best to leave the character devices as-is
  6. 5) Sound support ~>> Advanced Linux Sound Architecture ~~> Pci devices
  7.       Set the correct driver module for your soundcard here. use a module as the alsa-utils package demands that modules be present for your system to use the startup script correctly
  8. 6) USB support - Three primary items to be concerned with here...
  9.       If you have usb2  add the EHCI module as <m>
  10.        the output recieved from lspci is important here as you cannot have both ohci AND uhci both included. you much choose one or the other and add it as a module
  11.       EHCI HCD (USB 2.0) support
  12.       OHCI HCD support
  13.       UHCI HCD (most Intel and VIA) support

复制代码

After configuring your kernel for supported devices exit from menuconfig and type the following



Code:


  1. make && make modules modules_install install

复制代码


Setting Up Hostnames and Domainnames
-------------------------------------------------


Code:


  1. echo h3x4g0n > /etc/hostname
  2. echo eliteitminds.com > /etc/dnsdomainname
  3. echo nis.eliteitminds.com > /etc/nisdomainname
  4. rc-update add domainname default

复制代码


Next you must edit /etc/hosts to allow linux to set uour hostnames while no nameservers are reachable. ipv6 will be here in the next few years. Dont get too cozy.. ipv4 will be depreciated and you will be assimilated. Here's an example of what /etc/hosts should contain...



Code:


  1. # /etc/hosts: This file describes a number of hostname-to-address
  2. # mappings for the TCP/IP subsystem. It is mostly
  3. # used at boot time, when no name servers are running.
  4. # On small systems, this file can be used instead of a
  5. # "named" name server. Just add the names, addresses
  6. # and any aliases to this file...
  7. # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/hosts,v 1.7 2002/11/18 19:39:22 azarah Exp $
  8. #

  9. 127.0.0.1 gateway.eliteitminds.com gateway localhost.localdomain localhost

  10. # IPV6 versions of localhost and co
  11. ::1 ip6-localhost ip6-loopback
  12. fe00::0 ip6-localnet
  13. ff00::0 ip6-mcastprefix
  14. ff02::1 ip6-allnodes
  15. ff02::2 ip6-allrouters
  16. ff02::3 ip6-allhosts

复制代码


Setting drivers to load at boot network load at boot
---------------------------------------------------------------------------------

I allways build tons of modules wherever possible unless doing so is not advisable. lsmod is your eyes into a running modular linux system but it's only usable with modules. NIC modules are an excellent example. Adding them to insmod at boot is required as hotplug doesn't load nic drivers dynamically possibly leaving you with an booted system without network.



Code:


  1. echo foo >>/etc/modules.autoload.d/kernel-2.6
  2. **substitute "foo" with your correct nic module name**

复制代码


Creating a Second Initscript If You Have 2 nic's and Starting the Second at Boot (optional)
--------------------------------------------------------------------------------------------


Code:


  1. cd /etc/init.d
  2. ln -s net.lo net.eth1
  3. rc-update add net.eth1 default
  4. echo foo >>/etc/modules.autoload.d/kernel-2.6
  5. **substitute "foo" with your correct nic module name**

复制代码


Setting up a Boot Loader - Setting up grub - Now with gensplash and grub skins
---------------------------------------------------------------------------------------------
There's nothing cooloer than spock  well or spock the gentoo developer's tizzight gensplash on the system you've managed to build by following this tutorial  
so like that bitchin splash image on the livecd? hehe so do i... and why horde it to myslef and cackle and laugh alone looking at my computer boot gentoo linux for fun and kix. So here it is folks. More creature features courtesy of ali3nx

1). adding gensplash
------------------------


Code:


  1. emerge splashutils && splash_geninitramfs -v -g /boot/fbsplash-emergence-1024x768 -r 1024x768 emergence

复制代码


The magic is done... Now you have an initrd that you must load with grub in menu.lst
since the 'ol mirror has been playing tricks on us all here it is with gensplash config entries setup for use with the vesafb-tng driver in gentoo-dev-sources

2). menu.lst grub config file example
------------------------------------------


Code:


  1. gateway ~ # cat /boot/grub/menu.lst
  2. #
  3. # Grub boot menu configuration file
  4. #
  5. # Boot automatically after 30 secs.
  6. timeout 30

  7. # By default, boot the first entry.
  8. default 0

  9. # Fallback to the second entry.
  10. fallback 1

  11. splashimage=(hd0,0)/grub/gentoo.xpm.gz
  12. #
  13. # For booting GNU/Linux
  14. title  Gentoo-2.6.8-r10 by EliteitMinds Technologies
  15. root (hd0,0)
  16. kernel (hd0,0)/vmlinuz ro root=/dev/hda4 video=vesafb:ywrap,pmipal,1024x768-32@85 splash=verbose,theme:emergence
  17. initrd (hd0,0)/fbsplash-emergence-1024x768
  18. # note make certain the kernel line does not wrap to the next line!!!!
  19. title Gentoo-2.6.8-r10-backup by EliteitMinds Technologies
  20. root (hd0,0)
  21. kernel (hd0,0)/vmlinuz.old ro root=/dev/hda4 video=vesafb:ywrap,pmipal,1024x768-32@85 splash=verbose,theme:emergence
  22. # note make certain the kernel line does not wrap to the next line!!!!
  23. initrd (hd0,0)/fbsplash-emergence-1024x768

  24. # For installing GRUB into the hard disk
  25. title Install GRUB into the hard disk
  26. root    (hd0,0)
  27. setup   (hd0)

  28. # Change the colors.
  29. title Change the colors
  30. color light-green/brown blink-red/blue

复制代码


3). installing the bootsectors
---------------------------------


Code:


  1. grub
  2. grub> root (hd0,0)
  3. grub> setup (hd0)
  4. grub> quit
  5. cd /boot/grub
  6. nano -w /boot/grub/menu.lst
复制代码


copy the text from the code section above for menu.lst and paste it into the console or type it. It's gonna have to do for a couple days till i can get my config's uploaded to a shell.
Last but not least ensure all your symlinks match and Eliteitminds Technologies gets the credit for the beautiful config files =]

4). selecting and installing a custom gentoo linux labelled grub skin
-----------------------------------------------------------------------------
I recently found a pimp grub splash themed just for gentoo linux that everyone and there momma's momma needs for gentoo boxen =] That would include users of this tutorial.


Code:


  1. cd /boot/grub && wget [url]http://www.schultz-net.dk/downloads/grub/gentoo.xpm.gz[/url]

复制代码


Setting Up fstab
-------------------------
Tis is a step you do not want to do before installing grub... for some reason grub has a spaz attack and calls die() when it finds an fstab in completed fashion.



Code:


  1. nano -w /etc/fstab

复制代码


Here's mine:



Code:


  1. # /etc/fstab: static file system information.
  2. # $Header: /home/cvsroot/gentoo-src/rc-scripts/etc/fstab,v 1.14 2003/10/13 20:03:38 azarah Exp $
  3. #
  4. # noatime turns off atimes for increased performance (atimes normally aren't
  5. # needed; notail increases performance of ReiserFS (at the expense of storage
  6. # efficiency). It's safe to drop the noatime options if you want and to
  7. # switch between notail and tail freely.

  8. # <fs> <mountpoint> <type> <opts> <dump/pass>

  9. # NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
  10. /dev/hda1 /boot reiserfs noauto,notail 1 1
  11. /dev/hda3 / reiserfs notail 0 1
  12. /dev/hda2 none swap sw 0 0
  13. /dev/cdroms/cdrom0 /mnt/dvdrw iso9660 user,noauto,ro,exec 0 0
  14. /dev/cdroms/cdrom1 /mnt/cdrw iso9660 user,noauto,ro,exec 0 0
  15. #/dev/fd0 /mnt/floppy auto noauto 0 0

  16. # NOTE: The next line is critical for boot!
  17. none /proc proc defaults 0 0

  18. # glibc 2.2 and above expects tmpfs to be mounted at /dev/shm for
  19. # POSIX shared memory (shm_open, shm_unlink).
  20. # (tmpfs is a dynamically expandable/shrinkable ramdisk, and will
  21. # use almost no memory if not populated with files)
  22. # Adding the following line to /etc/fstab should take care of this:

  23. none /dev/shm tmpfs nodev,nosuid 0 0

复制代码


Setting hdparm for use after boot
-----------------------------------------
We've gone throught he procedures above for utilizing hdparm for obtaining the fastest i/o transfer modes for your hard drive however the changes made only affect the livecd's running kernel therefore we should setup hdparm for the installation that you have created so that performance is maintained after booting into your running system. Allot of very useful options for Gentoo Linux dwell in /etc/conf.d This time we are to be concerned with the contents of /etc/conf.d/hdparm Below you will see an example of hdparm's config file. Change to suit the layout of your disks for your system appropriately. Each device may need the modes set for your systems hardware configuration. Here's a typical configuration for a system with one cdrom and hard disk. You can safely skip this step if using sata or scsi.



Code:


  1. gateway  # cat /etc/conf.d/hdparm
  2. # Copyright 1999-2004 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. # $Header: /var/cvsroot/gentoo-x86/sys-apps/hdparm/files/hdparm-conf.d.3,v 1.2 2004/09/06 02:17:08 swegener Exp $

  5. # You can either set hdparm arguments for each drive using disc*_args and cdrom*_args..
  6. # eg.
  7. disc0_args="-d1c1u1m16"
  8. # disc1_args"-d1"
  9. cdrom0_args="-d1c1u1"
  10. #cdrom1_args="-d1c1u1"
  11. # Or, you can set hdparm options for ALL drives using all_args..
  12. # eg.
  13. # this mimics the behavior of the current script
  14. #all_args="-d1"

复制代码


After editing the contents of /etc/conf.d/hdparm type the following command to add hdparm to the boot runlevel. I recommend boot as it will help with faster startup times.


Code:


  1. rc-update add hdparm boot

复制代码


Set Up Users
---------------
We must change the password of the root user in the installed system to ensure it's usable after booting the system and also add a user for yourself with the appropriate groups that would be required for an average desktop-server hybrid gentoo linux system. Substitute my nick with your own username or add me a shell and pm me the login should you feel generous  


Code:


  1. passwd to change root's pass
  2. useradd ali3n -m -k /etc/skel -g users -G audio,cron,wheel,portage,games -d /home/ali3n -s /bin/bash
  3. passwd ali3n

复制代码


Exiting Chroot and Unmounting Partitions
-----------------------------------------------
Since we used screen during our installation we will need to exit or logout twice... once to quit screen, once to exit from chroot following with unmounting the partitions used for installation and disabling swap... A "clean" shutdown is allways a good idea...



Code:


  1. exit && exit
  2. cd ~/
  3. umount /mnt/gentoo/proc
  4. umount /mnt/gentoo/boot
  5. umount /mnt/gentoo/dev
  6. umount /mnt/gentoo
  7. swapoff /dev/hda2

复制代码


Rebooting to your newly installed Gentoo Linux
-------------------------------------------------------



Code:


  1. millenium root # shutdown -r now
复制代码
发表于 2004-11-26 13:43:07 | 显示全部楼层
转贴请给出原贴的链结,thanks。
 楼主| 发表于 2004-11-26 13:48:06 | 显示全部楼层
原帖在此原帖
官方论坛太慢加上近期很多人想装gentoo,个人觉得这个做安装指南很好
发表于 2004-11-26 13:55:07 | 显示全部楼层
想知道nptl怎么才算弄好了
用的~x86
发表于 2004-11-26 15:11:26 | 显示全部楼层
env-update && source /etc/profile && emerge -C linux-headers && USE="-* build bootstrap" emerge linux26-headers && cd /usr/portage && scripts/bootstrap.sh && emerge system && emerge syslog-ng xinetd grub hotplug coldplug vixie-cron reiserfsprogs reiser4progs sysfsutils udev && emerge --nodeps acpid ntp && rc-update add syslog-ng default && rc-update add net.eth0 default && rc-update add vixie-cron default && rc-update add xinetd default && rc-update add sshd default && rc-update add hotplug default && rc-update add coldplug default && rc-update add acpid default

似乎,没有看到gcc3.4的说
发表于 2004-11-26 15:40:05 | 显示全部楼层
最初由 orphen 发表
似乎,没有看到gcc3.4的说
发表于 2004-11-26 15:45:55 | 显示全部楼层
最初由 Glue 发表
想知道nptl怎么才算弄好了
用的~x86

USE='nptl' emerge glibc一下就OK了
发表于 2005-5-16 14:03:07 | 显示全部楼层
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表