Slashdot Mirror


A Walk Through the Gentoo Linux Install Process

Anonymous American (Sherman Boyd) writes: "I was looking for a flexible, powerful distribution that makes it easy to build a 'custom' Linux box that meets my exacting specifications. I think I found it. Gentoo Linux has just released version 1.0 of their innovative meta-distribution and to celebrate I decided to throw it on my laptop and write this article based on my experiences." And good news for anyone interested in trying Gentoo: yesterday, Daniel Robbins announced the release of version 1.1a. Read on for AA's detailed look at putting Gentoo on his machine -- Gentoo has a different style than today's typical distributions, and it bears some explanation.

Gentoo solved many problems for me. Some distros install everything, whether you really need it or not. Not Gentoo; other than the base packages required for Linux to run, the only software installed on the system is the software you put there. Gentoo resolves dependencies automatically, eliminating RPM prerequisite hell. As an added bonus I got something I wasn't even expecting. Speed. Blinding, blazing, incredible speed.

The main advantage to the Gentoo distribution is Portage, a python-based ports system similar to BSD ports. For those of you unfamiliar with BSD ports, Portage is a package management tool that downloads and installs source instead of precompiled packages. When I need a program I download, install and compile it with one command:

emerge nmap

The above will download the nmap source code, compile and install it. Of course this method is slow, but it has its rewards. You can also opt to use prebuilt binaries if you are not extremely patient. It took me five hours to get the base Gentoo installed on my PIII with 128 megs of ram. It wasn't a big deal as I had other things to do, but I would like to see the installation process optimized so that it doesn't require any babysitting.

Gentoo is running two of my mission-critical servers right now, I consider it to be stable and mature. A warning, though: this is not a distribution for dummies. This is bare metal Linux, powerful and dangerous. If you do something without thinking you may fall into a bucket of pain.

Let's begin my story.

I download the iso from http://www.ibiblio.org/gentoo/releases/build /. There is a choice of install images here. My favorite way of installing Gentoo is to compile everything, a time consuming process. This method requires a slim 16-meg iso. You may want to grab an iso with pre-built binaries to speed things up, however. This fat iso weighs in at 103 meg. I download the big one with the prebuilt binaries even though I won't use them -- just in case.

I boot my laptop with my shiny new Gentoo CD. The Gentoo install uses isolinux by Peter Anvin. I like the fact that they don't obscure it, giving credit where it is due. It boots quickly and there is a PCI autodetection process, it shouldn't find much on my laptop. Interesting, it loads a SCSI module. Perhaps it has detected my IDE CD burner. Usually this will detect any PCI NIC cards that are installed, but it does not detect my PCMCIA device (of course). After the PCI detection I get a command prompt. I use nano (a small text editor) to open up install.txt, the excellent install doc. Usually these docs are sufficient but the latest ones can be found here:

http://www.gentoo.org/doc/build.html

Keeping the install doc open in this virtual terminal, I hit alt-f2 to open a new one. I begin by loading the pcmcia drivers and installing networking. This is all done at the command line ( insmod, ifconfig, route, dhcpcd, etc.). I use nano to add my DNS servers to /etc/resolv.conf. A word of caution; get in the habit of always using the -w switch with nano. If you do not use the -w switch nano's word wrap feature will jack up your config files. I ping a reliable site, networking is up!

Next I partition my system using fdisk. I choose a simple layout with a swap partition, a root partition and a small boot partition. The boot partition remains unmounted during use, a nice precaution. For filesystems you have a choice of ext2, ext3, ReiserFS and XFS. In my personal experience I've noticed that Reiser performance really rocks when combined with SCSI drives, but as this is an IDE system I think I'll go with XFS. Besides, the XFS tools seem to be a lot more mature than the offerings from Reiser. I format and mount the partitions from the command line creating a /mnt/gentoo directory. I then untar the root filesystem; here I have the choice of the small tarball that requires you to compile everything or a larger tarball that contains pre-built binaries. If you untar the big guy you are almost finished with your install at this point. Using chroot and some scripts you chroot the /mnt/gentoo directory. From this point on you are operating under your new gentoo system.

The first thing I do under my chrooted system is issue this command:

emerge rsync

This downloads the latest version of the portage tree. The portage tree is found under /usr/portage and contains the ebuild scripts used to compile/install programs. Currently there are over 1000 up to date emerge sripts. Next I edit /etc/make.conf, here I can choose compiler settings. I optimize everything for i686. Now it's time to build the GNU compiler and libraries. I run the bootstrap script and leave for lunch. On my PIII 500 the boostrap process takes 2 hours and 2 minutes.

The second emerge command I issue is:

emerge system

Now emerge downloads, compiles and installs my base system packages. I sit back, relax and take the time to fax my legislators a rant about the DMCA. One hour and 30 minutes later it is finished.

Now it is time to download and install the kernel. First I make a link updating my timezone, and then I issue another emerge command:

emerge linux-sources

This grabs the latest kernel, 2.4.19, and drops the source in /usr/src/linux. Ten minutes have elapsed. Now comes the fun, compiling your kernel. That's right, everyone who installs Gentoo compiles their own kernel as a matter of process. I like this. There are some distributions out there that actually say you should never compile your own kernel. Shame on them. I use make menuconfig and the standard commands to compile my kernel. Since Gentoo uses devfs I select /dev file system support and I am also careful to compile in support for XFS. I don't have the kernel mount devfs automatically at boot as the Gentoo startup scripts take care of this for me. Virtual Memory file system support is also enabled.

At this point in time I get to choose a logger. My choices are sysklogd, syslog-ng or metalog. I choose metalog, because it's got the coolest name. I download, compile and install it using a single command:

emerge metalog

XFS has some nice utilities, I better install those. I have some other essential programs to install, and I'm feeling a bit lazy so I chain them all in one big command.

emerge xfsprogs;emerge bitchx;emerge vim;emerge links

At this point I'm feeling pretty 7-Up. I edit my /etc/fstab file, my /etc/hostname file and /etc/hosts. The passwd command is run to set the root passwd. I add my NIC module to the file /etc/modules.autoload and edit /etc/conf.d/net. conf.d/net allows me to configure my IP address and settings, default gateway and alias. I take a look at /etc/init.d/net.eth0, even though I don't need to edit it. I can then add it to the startup script using this command:

rc-update add net.eth0 default

This adds the script to the default runlevel to be executed at startup. Startup scripts are another place Gentoo really shines. The startup scripts have a system of dependencies. For example net.eth0 can depend on pcmcia. The pcmcia drivers get loaded before net.eth0 - this is good.

Next I install grub. If you haven't used grub before, it's nice. You can boot to a kernel directly from the grub shell, without having to edit a config file. lilo is still available, for those of you who prefer it. Gentoo likes to let you make the decisions.

I exit my chrooted shell and unmount all directories. Reboot! Gentoo comes up and the install process is complete.

The Gentoo install process has taught me a lot about Linux, and I like the fact that the command line is embraced, instead of hidden behind gui or scripts. I also like the speed (which is debatable since all I can supply is anecdotal evidence). I wasn't too happy about waiting five hours for everything to compile, but I think it was worth it. I can tell you it compiles and greps noticeably faster than other distros I have run on the exact same machines. I really enjoy using portage, and the packages seem to stay up to date -- if not bleeding edge. This is not a conservative distribution like Debian, however I like the aggressive and intelligent direction gentoo is taking.

If you are considering trying out Gentoo I highly suggest #gentoo on irc.openprojects.net. Also subscribe to the mailing lists found at www.gentoo.org. The Gentoo community has helped me out of several jams in the past, I think they will treat you good too.

While writing this, I received help from a lot of people. However I would like to personally thank the people I ripped off word for word. Thanks notafurry of www.kuro5hin.org for your pointed help with the stilted second paragraph and thank you Ween from #gentoo on openprojects.net for your clean description of portage.

17 of 351 comments (clear)

  1. dfgdfg by Anonymous Coward · · Score: -1, Offtopic

    dfgdfgdfgfg

  2. FP? by Anonymous Coward · · Score: -1, Offtopic

    finally!!!

    1. Re:FP? by Anonymous Coward · · Score: -1, Offtopic

      Haha! Sorry to burst your bubble, little boy!

      Run home crying to Mommy now, that's a good boy.

  3. Exile by Walmart+Security · · Score: -1, Offtopic

    It was late, nearly seven in the morning. The sun was rising; it crept through my window, seemingly in defiance of the darkness that was beginning to elude it. Its effluence of light had proven itself to be more beautiful every day. A mere twenty years of age, I'd not yet experienced a job in which people trusted you, especially with their well-being. Searching futily for the cable that connected the remote control to the new Zenith television that I'd purchased from my parents, I realized that my appointment was only an hour away. I hadn't any time to leisurely brew coffee and catch up on the country's events. As I stepped out of bed, I cringed slightly. The tile floor always seemed gelid to my bare feet during the winter, especially after one of those egregiously arctic nights when it seemed as though the season would never enter the transition to spring.

    According to popular rumor, William Robinson, the man who would later interview me, was facilely impressed by somebody who wore fashionable clothing. I had purchased a pink polo shirt and dress pants a week prior from the Sears catalog. Today I would exhibit them as I attempted to become a security assistant. I stepped into the five year old maroon, 1947 Plymouth that I'd inherited from my grandfather. It operated immaculately. The bleak, uneventful drive to Robinson's office seemed like an eternity; I was quite eager to commence my interview.

    "So you're Peter Geralds," a stocky man greeted me. He pointed at a chair. "Come, sit. May I offer you something to drink? Water? Coffee?"

    "No, thank you." I replied with all of the calmness that I could muster.

    He chuckled. "A martini?"

    I had anticipated that William would be a businesslike, humorless man. What a pleasant surprise it was to meet somebody in an executive position that was so laid-back. "So, you want to be a security..." He flipped through my application. "... assistant, do you?"

    "Why yes sir, I do." I hadn't been in a mood as pleasant as this for months, perhaps even years.

    Then his smile turned to a rather maniacal glare. "You won't live long enough to be one." He hastily produced a Smith and Wesson revolver from his desk drawer and fired twice. I screamed as the bullets penetrated my chest. The man then walked over to my chair and pushed me to the floor. After a moment, I was drowning in my own warm blood, unable to think of anything but the searing pain...

    ... "Yeah, yeah. No, patient two-four-seven isn't conscious. Yeah, I want a cheeseburger. With mayo. Go get them, Rhonda. Now!" A man said commandingly.

    "Fine, you anal-retentive... Ugh." The second voice was that of a woman; she seemed to be unwilling to comply.

    I opened my eyes attenuately. Unbearable pain indicated that I hadn't utilized them for days. My unfocused eyes created a vision of a white blur overhead. Perhaps I'd entered the afterlife. "Are you an angel?" I queried.

    Whoever was standing over me began laughing feverishly. "I'm Thomas, your doctor. You certainly have a good sense of humor for somebody who has been unconscious for two days." His voice increased in intensity. "Hey Rhonda, before you leave, mark two-four-seven as conscious!"

    "Where am I? Where's Robert? What happened?!" I was fretting. After all, he was my direct responsibility. If he had died, I promised myself that I would leave the security business permanently both in mourning and to prevent another tragedy occuring on my watch.

    "You're at Christus Jasper Memorial. I'm afraid to say that Robert Arishima..." I interrupted the doctor in mid-sentence. "No!" I screamed, on the edge of tears. "He can't be dead! Not Robert! Why not me?"

    Thomas placed his hand on my shoulder, comforting me. "I'm afraid to say that Mr. Arishima was released without injury two days ago, so you can't see him presently. Would you like me to call him?"

    I felt as though I was a simpleton. How humiliating. Hopefully the doctor would practice a lot of discretion with both his peers and other patients, as well as Robert. "Yes, if it isn't bothersome."

    "No, not at all," he replied. "Also, I have your incident report here, would you like to read it?"

    Predictably, I responded with one word: "yes." Maybe it would shed light on the accident that Robert and I were involved in. My eyes, fortunately, were now focused. I grasped the paper as Thomas handed it to me and began reading the hastily constructed, rather inaccurate report:

    "Incident report submitted by Harris on 3 April at 4 AM.

    Two security attendants at Jasper Walmart Supercenter (Robert Arishima, Peter Geralds; blue EZSECURE golf cart, 1992) involved in vehicular collision with Paul Cryer (silver Mercedes-Benz SUV, 2001). Cryer reports that an unprovoked altercation (Arishima and Geralds being the aggressors) between the three preceded the accident..."

    "Hey, Peter?" It was Robert! I ceased reading as he entered the room. "I've got bad news. You've um, been suspended as a security guard until EZSECURE investigates what happened. I'm sorry... Are you okay?"

  4. Re:k5 by Anonymous Coward · · Score: -1, Offtopic

    Speaking of which, K5 has been unavailable all morning, so I've resorted to looking at Slashdot.

    *Wince*

    We started to digest the last batch of stupid slashdot fuckheads over there, don't encourage more... please!

  5. Re:k5 by Anonymous Coward · · Score: -1, Offtopic

    Too bad K5's servers are Pentium 75s with 16MB of RAM and are, once again, down.

  6. Goddammit! by Anonymous Coward · · Score: -1, Offtopic

    I just got killed by the same damn grey unicorn on a Nethack bones level that killed me before! Fucking unicorns...next time I see one I'm gonna rip its horn off and shove it up its ass!

  7. DO NOT CLICK THE ABOVE LINK! by Anonymous Coward · · Score: -1, Offtopic

    It redirects you to somewhere much worse than goatse.cx!

  8. First Hug A Root Post by Anonymous Coward · · Score: -1, Offtopic

    Hug a Root

    greetings fellow losers and lowlifes!

  9. Well by wiredog · · Score: 1, Offtopic
    It does suck today. Been down/unreachable/ungodly slow for several hours now...

    Dammit, how can I post a comment that'll piss off streetlawyer AND trhurler at the same time if the site is dead?

  10. Oh...would you believe it? by Anonymous Coward · · Score: -1, Offtopic

    Next game and I got the bones level again. That unicorn is so dead...just wait til I find it.

  11. Re:53. by OccSub · · Score: 0, Offtopic

    This sort of thing really does need to stop. As long as the moderators keep modding down these attacks on people's faith, many people don't have to see them. But some people enjoy the -1 posts, eh? GafTheHorseInTears obvioulsy has some deep, long-running hatred of Christianity, and feels that expressing it here is either: a) funny, or b) gonna get him noticed as a "free thinker" or something. Since when is Slashdot a place for putting people's religions down?

  12. Re:k5 by geekoid · · Score: 1, Offtopic

    "Extreme Programming - Embrace the protective blanket of fear "

    haha, well put.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  13. There were 2 of them! by Anonymous Coward · · Score: -1, Offtopic

    But they always stay a knight's move from you so you can't hit them. My housecat took care of them though. Good kitty.

  14. Re:k5 by geekoid · · Score: 1, Offtopic

    Telling someone it sucks is sure to get exactly the people you don't want there to go there.
    see:
    it sucks==not known very well==obscure==cool

    The people with that mentality are usually about 16, and like to type with numbers in their words.

    What you want to say is "k5 is so cool, my mom likes it!"

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  15. Re:k5 by smileyy · · Score: 0, Offtopic

    Hmm...maybe...

    Come check out the Jon Katz story-of-the-day at k5!

    --
    pooptruck
  16. Re:k5 by grnbrg · · Score: 2, Offtopic
    Oh god. What have I done? No, k5 sucks. Really. Stay away. Stay far, far away. You have absolutely no desire to get a k5 account.


    You don't need to see these stories.

    This isn't the site you're looking for.

    Move along. Move along.


    grnbrg