COMP 3000 2011 Report: Funtoo Linux: Difference between revisions

From Soma-notes
 
(30 intermediate revisions by the same user not shown)
Line 2: Line 2:


== Background ==
== Background ==
<div style="float: left;">
<div style="float: left;">
[[File:Funtoo logo.png]]
[[File:Funtoo logo.png]]
Line 8: Line 9:
<div style="float:right;">
<div style="float:right;">
==== Download ====
==== Download ====
<table style="margin-bottom: 1em;" border="1" cellpadding="4" cellspacing="0">
<table style="" border="1" cellpadding="4" cellspacing="0">
     <tr>
     <tr>
         <td>Official Download Page</td><td>http://www.funtoo.org/wiki/Download</td>
         <td>Official Download Page</td><td>http://www.funtoo.org/wiki/Download</td>
Line 17: Line 18:
</table>
</table>
</div>
</div>


<div style="clear: both"></div>
<div style="clear: both"></div>


[http://www.funtoo.org/ Funtoo Linux] is a distribution that aims to improve the core technologies of [http://www.gentoo.org/ Gentoo].
[http://www.funtoo.org/ Funtoo Linux] is a distribution that aims to improve the core technologies of [http://www.gentoo.org/ Gentoo].
It is a [[#Source-based distribution|source-based distribution]] which features a git-based Portage tree, GPT/GUID
It is a [[#Source-based distribution|source-based distribution]] which features a [[#Git-Based Portage Tree|git-based Portage tree]], GUID (Globally unique identifier) partition tables (GPT)
boot support, enhanced network configuration and native UTF-8 support.
boot support, enhanced network configuration and native UTF-8 support.
<ref>http://distrowatch.com/table.php?distribution=funtoo, </ref>
<ref>Funtoo Linux. Retrieved on October 16, 2011 from http://distrowatch.com/table.php?distribution=funtoo</ref>
It is targeted at experienced Linux users and is extremely configurable, sometimes even referred to as a meta-distribution.
It is targeted at experienced Linux users and is extremely configurable, sometimes even referred to as a [[#Meta-distribution|meta-distribution]].
It is also very fast.
It is also very fast.
<ref>http://www.gentoo.org/main/en/about.xml</ref>
<ref>About Gentoo. (September 17, 2007). Retrieved on October 16, 2011 from http://www.gentoo.org/main/en/about.xml</ref>


Because Funtoo Linux is a meta-distribution, it is hard to say what size it is. That said, the core system is 110M.
Funtoo's core system, the [[#Stage tarballs|stage3 tarball]], is 110 megabytes.


One of the features of Funtoo Linux is that it allows GUID partition tables. The main advantage of the GPT partitioning
One of the features of Funtoo Linux is that it allows GUID partition tables. This partitioning scheme supports partitions greater than 2TiB, which is the size limit of the standard MBR (Master Boot Record) partitioning scheme.
scheme is that it supports partitions greater than 2TiB, which is the size limit of the standard MBR partitioning scheme.
This is essential for systems using RAID (redundant array of independent disks) logical volumes, as it is easy to exceed the partition size limit imposed by the MBR.
This is essential for systems using RAID logical volumes, as it is easy to exceed the partition size limit imposed by MBR.
<ref>GUID Booting Guide. (March 4, 2011). Retrieved on October 16, 2011 from http://www.funtoo.org/wiki/GUID_Booting_Guide</ref>
<ref>http://www.funtoo.org/wiki/GUID_Booting_Guide</ref>
<br>


== History ==
== History ==
Funtoo's history is closely tied to that of Gentoo. Daniel Robbins was the project creator,
Funtoo's history is closely tied to that of Gentoo. Daniel Robbins was the project creator,
chief architect and project leader of the Gentoo development team until April 26, 2004,
chief architect and project leader of the Gentoo development team until April 26, 2004,
where he had to leave because of personal issues. <ref>http://article.gmane.org/gmane.linux.gentoo.nfp/65</ref>
where he had to leave because of personal issues.
Before leaving, Daniel created a non-profit foundation, Gentoo Technologies, which would
<ref>CDs and t-shirts, Gentoo mailing list. (April 24, 2004). Retrieved on October 16, 2011 http://article.gmane.org/gmane.linux.gentoo.nfp/65</ref>
Before leaving, Mr. Robbins created a non-profit foundation, Gentoo Technologies, which would
hold all of the Gentoo copyrights.
hold all of the Gentoo copyrights.
<ref>http://linux.sys-con.com/node/44614 Founder of Gentoo Linux, Daniel Robbins, Resigns as Chief Architect.</ref>
<ref> Founder of Gentoo Linux, Daniel Robbins, Resigns as Chief Architect. LBN Industry News Desk. (April 27, 2004). Retrieved on October 16, 2011 from http://linux.sys-con.com/node/44614</ref>
After working at Microsoft for two years, he joins back the Gentoo development team in 2007. He started working
After working at Microsoft for two years, Mr. Robbins rejoins the Gentoo development team. In 2007, the Gentoo Foundation looses its status due
on Funtoo after his proposals to fix problem with the Gentoo foundation were refused, due to his absence.
to negligence. Daniel Robbins submitted a proposal to fix this problem but it was refused due to his prolonged absence. Mr. Robbins created
<ref>http://en.wikipedia.org/wiki/Funtoo</ref>
Funtoo Linux because of this.
<ref>Goal of Funtoo. (October, 2008). Retrieved on October 16, 2011 from http://blog.funtoo.org/2008/10/goal-of-funtoo.html</ref>
<br>


== Virtualization Setup ==
== Virtualization Setup ==
Line 51: Line 56:
I do this because my desktop machine is faster at compiling.
I do this because my desktop machine is faster at compiling.


<div style="float: left; margin-right: 3em;">
==== Hosts ====
==== Hosts ====
{|
{|
|'''Gentoo Linux x64 w/ 3.0.4-gentoo kernel (Laptop)'''
|'''Gentoo Linux x64 w/ linux-3.0.4-gentoo kernel (Laptop)'''
|-
|-
|Intel Core 2 Duo CPU P8400 @ 2.26GHz
|Intel Core 2 Duo CPU P8400 @ 2.26GHz
Line 67: Line 73:
|Allocating 4 cores, 2048Mb RAM to VM.
|Allocating 4 cores, 2048Mb RAM to VM.
|}
|}
</div>


<div style="float: left">
==== Guest ====
==== Guest ====
* Enabled IO APIC.
* Enabled IO APIC.
Line 73: Line 81:
* Enabled VT-x/AMD-V.
* Enabled VT-x/AMD-V.
* Using VHD format, 20GB.
* Using VHD format, 20GB.
</div>
<br>
<div style="clear: both"></div>


== Installation ==
== Installation ==
Line 90: Line 101:
# Setup users and boot-time services.
# Setup users and boot-time services.
# Reboot.
# Reboot.
''Taken from the official install guide.''<ref>http://www.funtoo.org/wiki/Funtoo_Linux_Installation</ref>
''Taken from the official install guide.''
<ref>Funtoo Linux Installation. (October 8, 2011). Retrieved on October 17, 2011 from http://www.funtoo.org/wiki/Funtoo_Linux_Installation</ref>


[[File:Gparted-in-systemrescuecd.png|thumb|Partitioning with Gparted under SystemRescueCD]]
[[File:Gparted-in-systemrescuecd.png|thumb|Partitioning with Gparted under SystemRescueCD]]
Line 104: Line 116:
After booting in the Linux system of your choice, you must first prepare the disk that Funtoo will be installed on.  
After booting in the Linux system of your choice, you must first prepare the disk that Funtoo will be installed on.  
This is the preferred way of partitioning your disk for a Linux system. That said, I had to use MBR partitioning because
This is the preferred way of partitioning your disk for a Linux system. That said, I had to use MBR partitioning because
VirtualBox's BIOS does not support booting from GPT disks. <ref>https://forums.virtualbox.org/viewtopic.php?f=4&t=23279</ref>
VirtualBox's BIOS does not support booting from GPT disks.
<ref>Huge Hard Disk support >2TB discussion. Technologov. (October 11, 2009). Retrieved on October 17, 2011 from https://forums.virtualbox.org/viewtopic.php?f=4&t=23279</ref>
No big deal: I am not planning on using a > 2TiB disk for my virtual machine.  
No big deal: I am not planning on using a > 2TiB disk for my virtual machine.  


Line 113: Line 126:


Then, using git, you pull the Portage tree from Github. Funtoo Linux uses a git-based portage system, which allows
Then, using git, you pull the Portage tree from Github. Funtoo Linux uses a git-based portage system, which allows
smaller manifest sizes because it leverages Git's file integrity checking mechanisms. In the rsync-based system,  
smaller [[#Manifest File|manifest file]] sizes because it leverages Git's file integrity checking mechanisms. In the rsync-based system,  
you would also need a change log. With Git, commit messages are used instead. <ref>http://www.funtoo.org/wiki/Funtoo_Linux_FAQ#What_is_mini-manifest.3F</ref>
you would also need a change log. With Git, commit messages are used instead.
<ref>Funtoo Linux FAQ, What is a mini-manifest. (August 29, 2011). Retrieved on October 17, 2011 from http://www.funtoo.org/wiki/Funtoo_Linux_FAQ#What_is_mini-manifest.3F</ref>


After tweaking a few config files, I had to get a kernel. I opted to use a kernel that would be generated by genkernel because I was not sure
After tweaking a few config files, I had to get a kernel. I opted to use a kernel that would be generated by genkernel because I was not sure
Line 120: Line 134:
the problem was, I decided to hop on the Funtoo irc channel and see if somebody could help me. Here's the chat log (Surjikal is me):
the problem was, I decided to hop on the Funtoo irc channel and see if somebody could help me. Here's the chat log (Surjikal is me):


<pre>
<pre style="overflow: hidden; white-space: pre-wrap;">
23:08 < Surjikal> I get some kind of weird error when I use emerge sysrescue-std-sources. gcc: Internal
23:08 < Surjikal> I get some kind of weird error when I use emerge sysrescue-std-sources:
                  error: Killed (program cc1)
                  gcc: Internal error: Killed (program cc1)
23:09 < angry_vincent> oh
23:09 < angry_vincent> oh
23:09 < angry_vincent> do you have enough space?
23:09 < angry_vincent> do you have enough space?
Line 134: Line 148:
23:10 < drobbins> since it said it was killed
23:10 < drobbins> since it said it was killed
23:11  * drobbins wonders what to call Portage 1.0
23:11  * drobbins wonders what to call Portage 1.0
23:11 < Surjikal> You know what, that could be it actually. I don't have lots of RAM allocate on that VM, and
23:11 < Surjikal> You know what, that could be it actually. I don't have lots of RAM allocated on that VM,
                   I'm running the sysrescue live disk
                   and I'm running the sysrescue live disk
23:11 < drobbins> Surjikal: did you do swapon first?
23:11 < drobbins> Surjikal: did you do swapon first?
23:11 < drobbins> Surjikal: maybe if you add swap it will work ok
23:11 < drobbins> Surjikal: maybe if you add swap it will work ok
Line 149: Line 163:
nothing Funtoo Linux specific about that step.
nothing Funtoo Linux specific about that step.


That's it! Now all that's needed is a reboot.
That's it! A reboot is all that is needed.
<br>


== Basic Operation ==
== Basic Operation ==
[[File:Funtoo-xorg-installed.png|thumb|Showing xterm and twm after emerging xorg-server]]
 
<div style="border:1px solid #999; background-color: #f9f9f9; color: #343434; padding: 0em 1em; font-size: 0.9em; display: inline-block; margin-bottom: 1em">
'''Note:'''
This section may be easier to understand after reading the [[#Software Packaging|software packaging]] section.
</div>


Funtoo Linux gives you the power to customize almost any aspect of your distribution. This is why after installation, you are only presented with a simple bash prompt.
Funtoo Linux gives you the power to customize almost any aspect of your distribution. This is why after installation, you are only presented with a simple bash prompt.
While I had no problem with the command line, I needed some kind of window manager in order to stay sane. This means I had to install an X server.
[[File:Funtoo-xorg-installed.png|thumb|Installed ''xorg-server'' successfully]]
=== Installing an X Server ===
First, I must configure my use flags since I want to keep my installation as lightweight as possible. I removed the ''gnome'', ''kde'' and ''qt4'' [[#Use flags|use flags]] in my
[[#/etc/make.conf|''make.conf'']] file, as only wanted ''GTK+'' support.
<pre style="overflow: hidden; white-space: pre-wrap;">
USE="-gnome -kde -qt4"
</pre>
Then, I added configuration entries in my ''make.conf'' that specified which video card and input devices my computer had.
<ref name="vbox-guest">VirtualBox Guest. (December 14, 2011). Retrieved on December 14, 2011 from http://en.gentoo-wiki.com/wiki/Virtualbox_Guest</ref>
<pre style="overflow: hidden; white-space: pre-wrap;">
INPUT_DEVICES="evdev keyboard mouse vmmouse"
VIDEO_CARDS="virtualbox"
</pre>
Then, I had to install the virtualbox input and video drivers:
<pre style="overflow: hidden; white-space: pre-wrap;">
emerge --ask --verbose xf86-video-virtualbox xf86-input-virtualbox
</pre>
Finally, I installed X:
<pre style="overflow: hidden; white-space: pre-wrap;">
emerge --ask --verbose xorg-server
</pre>
To check if my X server was working properly, I installed ''twm'' (window manager) and ''xterm'' (terminal emulator):
<pre style="overflow: hidden; white-space: pre-wrap;">
emerge --ask --verbose twm xterm
</pre>
Then, I started the X server:
<pre style="overflow: hidden; white-space: pre-wrap;">
startx
</pre>
After I have successfully installed ''xorg-server'', I removed ''twm'' and ''xterm'' as I only needed them for testing:
<pre style="overflow: hidden; white-space: pre-wrap;">
emerge --unmerge twm xterm
</pre>
[[File:Funtoo-awesome.png|thumb|Showing ''nano'' and ''irssi'' using the default ''awesome'' configuration]]
=== Installing Awesome ===
''Awesome'' is a fast [http://en.wikipedia.org/wiki/Tiling_window_manager tiling window manager] that has true multihead support and can be
extended via its [http://www.lua.org/about.html Lua] interface.
<ref>Awesome window manager home page. Retrieved on December 14, 2011 from http://awesome.naquadah.org/</ref>
Installing ''awesome'' is simple in Funtoo Linux:
<pre style="overflow: hidden; white-space: pre-wrap;">
root# emerge -av awesome
</pre>
===== Customization =====
The default ''awesome'' configuration is good enough for most people, but here are some of the
modifications I did to mine:
* This will populate ''awesome'''s menu with your installed applications: https://github.com/terceiro/awesome-freedesktop
* I also stole some parts of these config files: http://git.sysphere.org/awesome-configs/
<div style="clear:both"></div>


I wanted some kind of window manager, so I had to install an X server. In order to do this, I had to specify which video card and input devices I had in the portage configuration file. I also had to install the virtual box video card and input device driver, as well as the guest additions. I installed ''twm'' and ''xterm'' to make sure my X server worked correctly.


But ''twm'' is extremely ugly, and is not a very good window manager. So, I decided to install ''awesome'', a nice tiling window manager. I disabled the ''gnome'', ''kde'' and ''qt4'' use flags, as I really only need ''GTK+'' support. ''xterm'' is also
=== Compiling and installing a kernel ===
horrible to look at, so I installed ''lxterminal''.


Using portage is as easy to use as ''apt-get''.
It is very easy to compile and install a Linux kernel in Funtoo Linux. Indeed, as shown [[#Linux Kernels | later]], there are many variations
<div style="clear: both"></div>
to choose from. I decided to install the Gentoo kernel, because it is stable and I am familiar with it.
 
First, I had to retrieve the source code of the kernel:
emerge -av gentoo-sources
 
The source was unpacked to ''/usr/src/linux-3.1.1-gentoo/''. I went to that directory and I started configuring the kernel:
cd /usr/src/linux-3.1.1-gentoo
make menuconfig
 
I had to customize my kernel configuration so that it could run properly in virtual box as a guest. Here's what had to be enabled/disabled: <ref name="vbox-guest" />
<pre>
Processor type and features  --->
    [*] Tickless System (Dynamic Ticks)
    [ ] High Resolution Timer Support
    [X] Symmetric multi-processing support (keep this enabled for multiple cores, too!)
        Subarchitecture Type (PC-compatible)  --->
    [ ] Machine Check / overheating reporting
    [X] SMT (Hyperthreading) scheduler support (This too, for i7's)
Power management and ACPI options  --->
    [*] Power Management support
    [ ] Suspend to RAM and standby
    [ ] Hibernation (aka 'suspend to disk')
    [*] ACPI (Advanced Configuration and Power Interface) Support  --->
Device Drivers  --->
    < > ATA/ATAPI/MFM/RLL support
    <*> Serial ATA and Parallel ATA drivers
        <*> AHCI SATA Support
        [*] ATA SFF support
        <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
    [*] Network device support  --->
        [*] Ethernet (10 or 100Mbit)  --->
            [*] EISA, VLB, PCI and on board controllers
                <M>  AMD PCnet32 PCI support
        [*] Ethernet (1000 Mbit)  --->
            <M> Intel(R) PRO/1000 Gigabit Ethernet support
        [ ] Ethernet (10000 Mbit)  --->
    Input device support --->
        [*] Mice --->
          <*> PS/2 mouse
    Graphics support --->
        <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->
            < > all options can be empty
    <M> Sound card support --->
        <M> Advanced Linux Sound Architecture --->
            [*] PCI sound Devices --->
                <M> Intel/SiS/nVidia/AMD/ALi AC97 Controller
</pre>
 
After I was done configuring, I compiled the kernel:
make && make modules_install
 
Then, I moved the kernel to my boot partition, and renamed it to something more descriptive. The compiled kernel is located at ''./arch/x86/boot/bzImage''.
mv arch/x86/boot/bzImage /boot/linux-3.1.1-gentoo
 
Furthermore, I added the following lines to my boot configuration file (''/etc/boot.conf''):
"Funtoo Linux (compiled kernel)" {
      kernel linux-3.1.1-gentoo
}
 
Finally, I generated the boot-loader (''grub'') configuration:
boot-update


<br>


== Usage Evaluation ==
== Usage Evaluation ==
[[File:Funtoo-awesome.png|thumb|Awesome window manager running 2 lxterminals, showing irssi and make.conf]]
Funtoo Linux is an extremely capable source-based distribution. The process of compiling applications is painless,
Funtoo Linux is an extremely capable source-based distribution. The process of compiling applications is painless,
but it is lengthy. However, for big applications such as ''firefox'', you can set the ''binary'' use flag to
but it is lengthy. However, for big applications such as ''firefox'', you can set the ''binary'' use flag to
simply download and install the binary, instead of compiling from source.
simply download and install the binary, instead of compiling from source.


The portage tree contains a lot of packages, and most of them are up to date. If a package is unavailable,
The portage tree contains a lot of packages, and most of them are up to date. If a package is unavailable you can most likely find it through an overlays.
Gnome 3 for example, you can most likely find it through a third party overlays (Gnome 3 is in the Gnome
For example, you can install the Gnome3 package from the Gnome overlay.
overlay).


Funtoo Linux is extremely customizable. It is the reason why I chose this distribution: I was tired of some distribution maker deciding what is best for me.
Funtoo Linux is extremely customizable. It is the reason why I chose this distribution: I was tired of some distribution maker deciding what is best for me.
That said, Funtoo Linux can be a bit frustrating when it comes to errors. Since you are dealing with the source directly, it can be hard
That said, Funtoo Linux can be a bit frustrating when it comes to errors. Since you are dealing with the source directly, it can be hard
to get everything configured properly. Also, updating your system can be quite a chore and it can take several days to complete the process.
to get everything configured properly. Also, updating your system can be quite a chore and it can take several days to complete the process.
Line 185: Line 325:


<div style="clear: both"></div>
<div style="clear: both"></div>
 
<br>


== Software Packaging ==
== Software Packaging ==
Line 193: Line 333:
Instead, a package is a directory which contains an ''ebuild'' script, a manifest
Instead, a package is a directory which contains an ''ebuild'' script, a manifest
file, patch files and configuration files. Funtoo Linux allows you to customize
file, patch files and configuration files. Funtoo Linux allows you to customize
which parts of the package you want to compile via ''USE flags''.
which parts of the package you want to compile via ''use flags''.


===== Ebuild Scripts =====
===== Ebuild Scripts =====
Line 200: Line 340:
and install a package. The ebuild usually downloads a ''distfile'', which
and install a package. The ebuild usually downloads a ''distfile'', which
is a source tarball, but can also pull the source from a repository.
is a source tarball, but can also pull the source from a repository.
<ref>http://en.gentoo-wiki.com/wiki/Writing_Ebuilds</ref>
<ref>Writing Ebuilds. (28 June, 2011). Retrieved on November 11, 2011 from http://en.gentoo-wiki.com/wiki/Writing_Ebuilds</ref>


===== Manifest File =====
===== Manifest File =====
Line 211: Line 351:


To illustrate the difference in package management between Gentoo and Funtoo,
To illustrate the difference in package management between Gentoo and Funtoo,
here's a comparaison of the Manifest file for the ''cowsay'' package:
here's a comparison of the Manifest file for the ''cowsay'' package:


Gentoo:
''Gentoo''
  AUX cowsay-3.03-mech.patch 490 RMD160 bc2318e9832108a39728e92806578566618fad8e SHA1 cec033ce530daa01736a841f351144f3ca5aea3d ...
  AUX cowsay-3.03-mech.patch 490 RMD160 bc2318e9832108a39728e92806578566618fad8e SHA1 cec033ce530daa01736a841f351144f3ca5aea3d ...
  AUX cowsay-3.03-tongue.patch 358 RMD160 9de33eec59e44fd2a375bca1419313f856bade7f SHA1 4cb24d5ea35df531c1e8ad2d000d643e41e97964 ...
  AUX cowsay-3.03-tongue.patch 358 RMD160 9de33eec59e44fd2a375bca1419313f856bade7f SHA1 4cb24d5ea35df531c1e8ad2d000d643e41e97964 ...
  AUX cowsay-3.03-utf8.patch 454 RMD160 00ea66c1561dd6ec2a31156c49f7f8d067b7b119 SHA1 f8eca4fa5dd4c7d404b215ca98601715042a7b62 ...
  AUX cowsay-3.03-utf8.patch 454 RMD160 00ea66c1561dd6ec2a31156c49f7f8d067b7b119 SHA1 f8eca4fa5dd4c7d404b215ca98601715042a7b62 ...
  <span style="color:green">DIST cowsay-3.03.tar.gz 15189 RMD160 f26b9ffe3d5551ee8049979c628bbe198817044a SHA1 cc65a9b13295c87df94a58caa8a9176ce5ec4a27 ... </span>
  <span style="color: green;">DIST cowsay-3.03.tar.gz 15189 RMD160 f26b9ffe3d5551ee8049979c628bbe198817044a SHA1 cc65a9b13295c87df94a58caa8a9176ce5ec4a27 ... </span>
  EBUILD cowsay-3.03-r2.ebuild 1245 RMD160 14bce76715480958f0dfa33d1c95e7033965c4d1 SHA1 7c73d1ef3dc0166174acfb28749a896ce8832272 ...
  EBUILD cowsay-3.03-r2.ebuild 1245 RMD160 14bce76715480958f0dfa33d1c95e7033965c4d1 SHA1 7c73d1ef3dc0166174acfb28749a896ce8832272 ...
  MISC ChangeLog 4354 RMD160 5681d5b0ee3d5c8a343451258269797fb9140793 SHA1 0378422a1656d493aad0e31aad66c42cf0a10e71 ...
  MISC ChangeLog 4354 RMD160 5681d5b0ee3d5c8a343451258269797fb9140793 SHA1 0378422a1656d493aad0e31aad66c42cf0a10e71 ...
  MISC metadata.xml 158 RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea SHA1 be5251fa1dacef5c41b74761bb1c8c54fb633b9e ...
  MISC metadata.xml 158 RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea SHA1 be5251fa1dacef5c41b74761bb1c8c54fb633b9e ...


Funtoo:
''Funtoo''
  <span style="color:green"> DIST cowsay-3.03.tar.gz 15189 RMD160 f26b9ffe3d5551ee8049979c628bbe198817044a SHA1 cc65a9b13295c87df94a58caa8a9176ce5ec4a27 ... </span>
  <span style="color: green;">DIST cowsay-3.03.tar.gz 15189 RMD160 f26b9ffe3d5551ee8049979c628bbe198817044a SHA1 cc65a9b13295c87df94a58caa8a9176ce5ec4a27 ... </span>


[[File:Porthole.png|thumb|Porthole, a Portage GUI frontend]]
===== Portage =====
===== Portage =====
[[File:Porthole.png|thumb|Porthole, a Portage GUI frontend]]
''Portage'' is the software management tool of Funtoo Linux.
''Portage'' is the software management tool of Funtoo Linux.
<ref>http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=1</ref>
<ref>Portage. (September 23, 2011). Retrieved on December 18, 2011 from http://www.funtoo.org/wiki/Portage</ref>
It is composed of two programs: ''Ebuild'' and ''Emerge''. ''Ebuild'' is the tool  
It is composed of two programs: ''Ebuild'' and ''Emerge''. ''Ebuild'' is the tool  
which runs ebuild scripts. ''Emerge'' is the tool that keeps track of installed
which runs ebuild scripts. ''Emerge'' is the tool that keeps track of installed
packages, resolves dependencies and provides the main portage interface.
packages, resolves dependencies and provides the main portage interface.


''Porthole'' is a GUI frontend to portage. It is very useful if you are a first time
''Porthole'' is a GUI front end to portage. It is very useful if you are a first time
Funtoo Linux or Gentoo user and works great as a package and use flag browser.
Funtoo Linux or Gentoo user and works great as a package and use flag browser.


The ''portage tree'' is the set of all packages available on the system. It is a
The ''portage tree'' is the set of all packages available on the system. It is a
a directory tree, rooted at ''/usr/portage''. In Funtoo Linux, the tree is composed of
a directory tree, usually rooted at ''/usr/portage''.
the Gentoo overlay, the Funtoo overlay, and the slashbeast, multimedia, tarsius, golodhrim
third party overlays.
 
<div style="clear: both"></div>


===== Overlays =====
===== Overlays =====
Overlays are simply a set of ebuilds, which can be merged into the main portage tree.
An overlay is a set of ebuilds which can be merged with the main portage tree of your
<ref>http://www.gentoo.org/proj/en/overlays/userguide.xml</ref>
distribution.
<ref>Gentoo Overlays: Users' Guide. (July 25, 2011). Retrieved on November 11, 2011 from http://www.gentoo.org/proj/en/overlays/userguide.xml</ref>
The Funtoo Linux tree is composed of the Gentoo overlay, the Funtoo overlay, and the
''slashbeast'', multimedia, ''tarsius'', ''golodhrim'' third party overlays.
<ref>Funtoo Linux. (November 8, 2011). Retrieved on December 18, 2011 from http://www.funtoo.org/wiki/Funtoo_Linux</ref>


===== USE Flags =====
===== Use Flags =====
Use flags are used to specify which component of a package you want/don't want to compile.
Use flags are used to specify which component of a package you want/don't want to compile.
Doing this cuts down compilation by a significant amount because it greatly reduces the number
Doing this cuts down compilation by a significant amount because it greatly reduces the number
Line 257: Line 396:
and KDE components of packages, globally, this is how I would modify my ''make.conf'' file:
and KDE components of packages, globally, this is how I would modify my ''make.conf'' file:


  DONT_USE="<span style="color:red">-kde -gnome</span>"
  DONT_USE="<span style="color:red;">-kde -gnome</span>"
  XORG_USE="udev nptl xorg dri"
  OTHER_USE="freetype laptop"
  USE="$XORG_USE $DONT_USE"
  USE="$OTHER_USE $DONT_USE"


===== Other Tools =====
===== Other Tools =====
Line 266: Line 405:
and it is part of the ''gentoolkit'' package. This program uses the ''/var/db/pkg'' directory
and it is part of the ''gentoolkit'' package. This program uses the ''/var/db/pkg'' directory
which contains the state of ''portage''.
which contains the state of ''portage''.
<ref>http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3&chap=1, Gentoo Files and Directories</ref>
<ref>Gentoo Files and Directories. (March 2, 2011). Retrieved on November 13, 2011 from http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3&chap=1</ref>
 


==== How can you use these utilities to get a list of installed packages? ====
==== How can you use these utilities to get a list of installed packages? ====
Line 278: Line 416:
To see which packages were emerged explicitly:
To see which packages were emerged explicitly:
  cat /var/lib/portage/world
  cat /var/lib/portage/world


==== How do you add and remove packages? ====
==== How do you add and remove packages? ====
Line 284: Line 421:
  emerge <package>
  emerge <package>


Adding a package with custom flags:
Alternatively, this will show you the package and its use flags, and ask you to confirm
the package installation:
emerge --ask --verbose <package> # you can also use the -av flags instead of --ask --verbose
 
Adding a package with custom use flags:
  echo "<package> <use flags>" >> /etc/portage/package.use
  echo "<package> <use flags>" >> /etc/portage/package.use
  emerge <package>
  emerge <package>
'''Example'''<br>
Installing the ''sudo'' package with the ''offensive'' use flag, which causes ''sudo'' to insult you when you type bad passwords:
echo "app-admin/sudo offensive" >> /etc/portage/package.use
emerge -av sudo


Removing packages:
Removing packages:
Line 296: Line 442:
Updating the system:
Updating the system:
  emerge -pv --update --deep --newuse world
  emerge -pv --update --deep --newuse world


==== How extensive is the software catalog for this distribution? ====
==== How extensive is the software catalog for this distribution? ====
Line 302: Line 447:
command:
command:
  find /usr/portage -maxdepth 2 -type d | wc -l
  find /usr/portage -maxdepth 2 -type d | wc -l


== Major Package Versions ==
== Major Package Versions ==
Line 314: Line 458:
!| Upstream Version
!| Upstream Version
!| Upstream URL
!| Upstream URL
!| Why choose this?
!| Reason to install
|-
|-
| Gentoo
| Gentoo
Line 320: Line 464:
| 3.1.1
| 3.1.1
| http://dev.gentoo.org/~mpagano/genpatches/
| http://dev.gentoo.org/~mpagano/genpatches/
| Stable, works on many architectures and is patched for some security vulnerabilities. <ref name="Gentoo Kernel Guide">Gentoo Linux Kernel Guide. (September 5, 2011). Retrieved December 18, 2011 from http://www.gentoo.org/doc/en/gentoo-kernel.xml</ref>
| Stable, works on many architectures and is patched for some security vulnerabilities. <ref name="Gentoo Kernel Guide">Gentoo Linux Kernel Guide. (September 5, 2011). Retrieved on December 18, 2011 from http://www.gentoo.org/doc/en/gentoo-kernel.xml</ref>
|-
|-
| Vanilla
| Vanilla
Line 326: Line 470:
| 3.1.1
| 3.1.1
| http://kernel.org, http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
| http://kernel.org, http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary
| Testing, kernel hacking.
| Testing or kernel hacking.
|-
|-
| TuxOnIce  
| TuxOnIce  
Line 332: Line 476:
| 3.0-rc7
| 3.0-rc7
| http://tuxonice.net, http://git.tuxonice.net/?p=tuxonice-3.0.git;a=summary
| http://tuxonice.net, http://git.tuxonice.net/?p=tuxonice-3.0.git;a=summary
| Ideal for laptop users. It enables an enhanced hibernation mode. It also contains the patches from the Gentoo kernel.<ref name="Gentoo Kernel Guide" /><ref>TuxOnIce home page. Retrieved December 18, 2011 from http://tuxonice.net/</ref>
| Ideal for laptop users. It enables an enhanced hibernation mode. It also contains the patches from the Gentoo kernel.<ref name="Gentoo Kernel Guide" /><ref>TuxOnIce home page. December 18, 2011 from http://tuxonice.net/</ref>
|-
|-
| Git snapshot
| Git snapshot
Line 338: Line 482:
| 3.2-rc1
| 3.2-rc1
| http://kernel.org, http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary
| http://kernel.org, http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary
| Testing, kernel hacking.
| Testing or kernel hacking.
|}
|}


Line 344: Line 488:
The source is simply downloaded from upstream. It is your job to configure and compile the kernel.
The source is simply downloaded from upstream. It is your job to configure and compile the kernel.


===== Packages =====
==== Packages ====
This is a list of some of the packages that are contained in the stage3 tarball:
This is a list of some of the packages that are contained in the stage3 tarball.
 
{| border="1" cellpadding="4"
{| border="1" cellpadding="4"
!| Name
!| Name
!| Package name
!| Package
!| Funtoo Version
!| Funtoo Version
!| Upstream Version
!| Upstream Version
Line 373: Line 516:
|-
|-
| Portage
| Portage
| n/a
| 2.2.2
| 2.2.2
| 2.1.10.11
| 2.1.10.11
| http://gentoo.org/
| http://www.gentoo.org/proj/en/portage/index.xml
|}
|}
<br>


This is a list of some of the packages I usually install in my Funtoo Linux/Gentoo distribution:
This is a list of some of the packages I usually install in my Funtoo Linux/Gentoo distribution:
Line 382: Line 527:
{| border="1" cellpadding="4"
{| border="1" cellpadding="4"
!| Name
!| Name
!| Package name
!| Package
!| Funtoo Version
!| Funtoo Version
!| Upstream Version
!| Upstream Version
Line 393: Line 538:
| 1.11.2
| 1.11.2
| http://www.x.org/releases/individual/xserver/
| http://www.x.org/releases/individual/xserver/
| Provides the ability to run graphical user interfaces.<ref>The X Server Configuration HOWTO. (September 2, 2011). Retrieved December 18, 2011 from http://www.gentoo.org/doc/en/xorg-config.xml</ref>
| Provides the ability to run graphical user interfaces.<ref>The X Server Configuration HOWTO. (September 2, 2011). Retrieved on December 18, 2011 from http://www.gentoo.org/doc/en/xorg-config.xml</ref>
|-
|-
| Awesome
| Awesome
Line 400: Line 545:
| 3.4.10
| 3.4.10
| http://awesome.naquadah.org
| http://awesome.naquadah.org
| Tiling managers maximizes the use of your screen real estate, which greatly improves productivity. I use ''awesome'' because of its good multihead support.
| Tiling managers maximizes the use of your screen real estate, which can greatly increase your productivity. I use ''awesome'' because of its good multihead support.
|-
|-
| Portage
| Firefox
| 2.2.2
| www-client/firefox
| 2.1.10.11
| http://gentoo.org/
|-
| Firefox
| 8.0
| 8.0
| 8.0
| 8.0
| http://www.mozilla.org/projects/firefox/
| http://www.mozilla.org/projects/firefox/
| I use this web browser because it supports the [http://noscript.net/ ''noscript''] extension, which removes most ads and improves page responsiveness.
|-
|-
| Vim
| Vim
| app-editors/vim
| 7.3
| 7.3
| 7.3
| 7.3
| http://www.vim.org/
| http://www.vim.org/
| Has syntax highlighting for most of the file-types that I care about. I am also trying to learn it. Emacs scares me.
|-
|-
| Cowsay
| Cowsay
| games-misc/cowsay
| 3.03
| 3.03
| 3.03-r2
| 3.03-r2
| http://www.nog.net/~tony/warez/cowsay.shtml
| http://www.nog.net/~tony/warez/cowsay.shtml
| It makes me laugh, especially when used in scripts.
|-
| Layman
| app-portage/layman
| 2.0.0 rc3
| 2.0.0 rc3
| http://layman.sourceforge.net/
| Nice tool to manage overlays.
|}
|}
<br>


Again, the source tarballs are downloaded directly from upstream. That said, Funtoo Linux or Gentoo specific patches are applied to certain packages after the source is unpacked:
Again, the source tarballs are downloaded directly from upstream. That said, Funtoo Linux or Gentoo specific patches are applied to certain packages after the source is unpacked:
Line 429: Line 583:
!| Patches and modifications
!| Patches and modifications
|-
|-
| Cowsay
| glibc
| UTF-8 support added, added customizable tongue and eyes for the ascii cow.
| Two security patches (disable ld audit and dst expansion fix).
|-  
| gcc
| Fixed LANG variable, added support for GCC_SPEC variable, added default protection for stack smashing attacks.
|-
| Bash
| Many patches related to compilation configuration, patch to allow negative return values.
|-
|-
| Awesome
| Portage
| Added support for the release of xcb-util-0.3.8
| Git based, uses mini manifest files.
|-
|-
| Xorg Server
| Xorg Server
| Removed acpi code, security vulnerability fix when creating lock file
| Removed acpi code, security vulnerability fix when creating lock file
|-
|-
| Portage
| Awesome
| Git based, uses mini manifest files
| Added support for the release of xcb-util-0.3.8
|-
|-
| glibc
| Firefox
| Two security patches (disable ld audit and dst expansion fix).
| Gentoo preferences fix, xulrunner 1.9.2 with gtk 2.21 patch
|-
| gcc
| Fixed LANG var, added support for GCC_SPEC var, added default protection for stack smashing attacks.
|-
|-
| Vim
| Vim
| Interix patches, Darwin bootloader patch
| Interix patches, Darwin bootloader patch
|-
|-
| Firefox
| Cowsay
| Gentoo preferences fix, xulrunner 1.9.2 with gtk 2.21 patch
| UTF-8 support added, added customizable tongue and eyes for the ascii cow.
|-
|-
| Bash
| Layman
| Many patches related to compilation configuration, allow negative values to 'return' statement.
| n/a
|}
|}
<br>


== Initialization ==
== Initialization ==


Funtoo Linux uses OpenRC for its initialization purposes. It supports running services in parallel, named runlevels and dependencies. It uses POSIX shell scripts as its init scripts.<ref>http://www.gentoo.org/proj/en/base/openrc/</ref> Funtoo Linux uses a fork of OpenRC, since it needs to be modified because of the way the distribution handles networking.<ref>http://www.funtoo.org/wiki/OpenRC_(Funtoo)</ref>
Funtoo Linux uses OpenRC for its initialization purposes. It supports running services in parallel, named runlevels and dependencies. It uses POSIX shell scripts as its init scripts.<ref>Gentoo OpenRC Project. (June 23, 2011). Retrieved on November 12, 2011 from http://www.gentoo.org/proj/en/base/openrc/</ref>
Funtoo Linux uses a fork of OpenRC, since it needs to be modified because of the way the distribution handles networking.
<ref>OpenRC (Funtoo). (December 27, 2010). Retrieved on November 12, 2011 from http://www.funtoo.org/wiki/OpenRC_(Funtoo)</ref>


There are 4 named runlevels in Funtoo Linux: ''sysinit'', ''boot'', ''default'' and ''shutdown''.
There are 4 named runlevels in Funtoo Linux: ''sysinit'', ''boot'', ''default'' and ''shutdown''.
Line 531: Line 691:
==== Initialization Order ====
==== Initialization Order ====
The order of initialization is hard to determine since the services are initialized in parallel. That said, here's a table
The order of initialization is hard to determine since the services are initialized in parallel. That said, here's a table
of services with their dependencies:
of some services along with their dependencies:


<div style="float:left">
<div style="float:left">
Line 582: Line 742:
====== After ======
====== After ======
The service is initialized after a given service, if it is in the same runlevel.
The service is initialized after a given service, if it is in the same runlevel.
<ref>http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4#doc_chap4</ref>
<ref>Initscripts, Writing init scripts. (September 17, 2011). Retrieved on November 12, 2011. http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4#doc_chap4</ref>
</div>
</div>


Line 592: Line 752:
== Terms ==
== Terms ==


=== Meta-Distribution ===
=== Meta-distribution ===
A distribution that allows you to build your own distribution. Funtoo Linux is called a meta-distribution due
A distribution that allows you to build your own distribution. Funtoo Linux is called a meta-distribution due
to its ability to be totally customized.
to its ability to be totally customized.
Line 598: Line 758:
=== Source-based distribution ===
=== Source-based distribution ===
A source-based distribution is a distribution that all of the packages are downloaded as source and compiled, as opposed to downloading a precompiled binary.
A source-based distribution is a distribution that all of the packages are downloaded as source and compiled, as opposed to downloading a precompiled binary.
<ref>https://wiki.archlinux.org/index.php/Arch_Compared_to_Other_Distributions#Source-based</ref>
<ref>Arch Compared to Other Distributions, Source-based. (November 7, 2011). Retrieved on November 12, 2011 from https://wiki.archlinux.org/index.php/Arch_Compared_to_Other_Distributions#Source-based</ref>


===== Advantages of source-based distributions (ex. Gentoo, Funtoo) =====
===== Advantages of source-based distributions (ex. Gentoo, Funtoo) =====
Line 612: Line 772:
A stage tarball is a precompiled system used as a starting point to a Funtoo/Gentoo Linux install. Typically, you would use a stage3 tarball to do a Funtoo/Gentoo Linux installation but
A stage tarball is a precompiled system used as a starting point to a Funtoo/Gentoo Linux install. Typically, you would use a stage3 tarball to do a Funtoo/Gentoo Linux installation but
some people may want to do a stage1 installation. This means that they would have to compile all the core tools (udev, portage, etc.) first.
some people may want to do a stage1 installation. This means that they would have to compile all the core tools (udev, portage, etc.) first.
<ref>http://www.funtoo.org/wiki/Funtoo_Linux_Installation#Installing_the_Stage_3_tarball</ref>
<ref>Funtoo Linux Installation, Installing the Stage3 tarball. (November 12, 2011). Retrieved on November 12, 2011 from http://www.funtoo.org/wiki/Funtoo_Linux_Installation#Installing_the_Stage_3_tarball</ref>
 
=== Git-Based Portage Tree ===
A portage tree is a collection of ebuilds scripts. Funtoo Linux uses a git-based portage tree as opposed to Gentoo's rsync-based tree.
The advantage of a git-based portage tree is that git's file integrity mechanisms can be used to check the integrity of an ebuild.
Also, commit messages are used to describe ebuild changes as opposed to dedicated log files.
Creating an [[#Overlay|overlay]] is as easy as forking off the [https://github.com/funtoo/portage Funtoo Linux portage tree repository].
Read the [[#Software Packaging|Software Packaging]] section for more details.


=== /etc/make.conf ===
=== /etc/make.conf ===
The main portage configuration file.
The main portage configuration file.
<br>


== References ==
== References ==
<references/>
<references/>

Latest revision as of 04:28, 19 December 2011

Background

Download

Official Download Pagehttp://www.funtoo.org/wiki/Download
Github Profilehttps://github.com/Funtoo


Funtoo Linux is a distribution that aims to improve the core technologies of Gentoo. It is a source-based distribution which features a git-based Portage tree, GUID (Globally unique identifier) partition tables (GPT) boot support, enhanced network configuration and native UTF-8 support. <ref>Funtoo Linux. Retrieved on October 16, 2011 from http://distrowatch.com/table.php?distribution=funtoo</ref> It is targeted at experienced Linux users and is extremely configurable, sometimes even referred to as a meta-distribution. It is also very fast. <ref>About Gentoo. (September 17, 2007). Retrieved on October 16, 2011 from http://www.gentoo.org/main/en/about.xml</ref>

Funtoo's core system, the stage3 tarball, is 110 megabytes.

One of the features of Funtoo Linux is that it allows GUID partition tables. This partitioning scheme supports partitions greater than 2TiB, which is the size limit of the standard MBR (Master Boot Record) partitioning scheme. This is essential for systems using RAID (redundant array of independent disks) logical volumes, as it is easy to exceed the partition size limit imposed by the MBR. <ref>GUID Booting Guide. (March 4, 2011). Retrieved on October 16, 2011 from http://www.funtoo.org/wiki/GUID_Booting_Guide</ref>

History

Funtoo's history is closely tied to that of Gentoo. Daniel Robbins was the project creator, chief architect and project leader of the Gentoo development team until April 26, 2004, where he had to leave because of personal issues. <ref>CDs and t-shirts, Gentoo mailing list. (April 24, 2004). Retrieved on October 16, 2011 http://article.gmane.org/gmane.linux.gentoo.nfp/65</ref> Before leaving, Mr. Robbins created a non-profit foundation, Gentoo Technologies, which would hold all of the Gentoo copyrights. <ref> Founder of Gentoo Linux, Daniel Robbins, Resigns as Chief Architect. LBN Industry News Desk. (April 27, 2004). Retrieved on October 16, 2011 from http://linux.sys-con.com/node/44614</ref> After working at Microsoft for two years, Mr. Robbins rejoins the Gentoo development team. In 2007, the Gentoo Foundation looses its status due to negligence. Daniel Robbins submitted a proposal to fix this problem but it was refused due to his prolonged absence. Mr. Robbins created Funtoo Linux because of this. <ref>Goal of Funtoo. (October, 2008). Retrieved on October 16, 2011 from http://blog.funtoo.org/2008/10/goal-of-funtoo.html</ref>

Virtualization Setup

Using Virtual Box 4.1.2. I am sharing my virtual hard drive with two hosts, each running different virtual machines. I do this because my desktop machine is faster at compiling.

Hosts

Gentoo Linux x64 w/ linux-3.0.4-gentoo kernel (Laptop)
Intel Core 2 Duo CPU P8400 @ 2.26GHz
Allocating 2 cores, 1024Mb RAM to VM.
Windows 7 Professional x64 (Desktop)
Intel Core 2 Quad CPU Q6700 @ 4.0GHz
Allocating 4 cores, 2048Mb RAM to VM.

Guest

  • Enabled IO APIC.
  • Enabled PAE/NX.
  • Enabled VT-x/AMD-V.
  • Using VHD format, 20GB.


Installation

Installing Funtoo Linux is a manual process. It does not have an automated installer because it is not needed. You can actually install Funtoo Linux while being booted in you current OS, provided you have the tools (ex. fdisk, git).

Overview

  1. Boot in an arbitrary Linux system (Live CD or otherwise).
  2. Prepare the disk where Funtoo Linux will be installed.
  3. Install the Funtoo stage tarball of your choice.
  4. Chroot into the new Funtoo Linux system.
  5. Pull the Portage tree repository.
  6. Customize the system configuration.
  7. Install a kernel.
  8. Install a bootloader.
  9. Setup users and boot-time services.
  10. Reboot.

Taken from the official install guide. <ref>Funtoo Linux Installation. (October 8, 2011). Retrieved on October 17, 2011 from http://www.funtoo.org/wiki/Funtoo_Linux_Installation</ref>

Partitioning with Gparted under SystemRescueCD
Compiling kernel under SystemRescueCD
Finished installing Funtoo Linux!

To perform a Funtoo install, you must use an existing Linux system or a live CD. Unlike Gentoo, Funtoo Linux does not have a dedicated live CD. That is because its Metro build tool does not support live CD builds yet. Instead, it recommends the use of SystemRescueCD, a Linux system rescue disk, because it comes with all the software you need for the installation. For my installation, I used SystemRescueCD. I would have used my Linux machine but I could not find a way to use fdisk with VHD's.

After booting in the Linux system of your choice, you must first prepare the disk that Funtoo will be installed on. This is the preferred way of partitioning your disk for a Linux system. That said, I had to use MBR partitioning because VirtualBox's BIOS does not support booting from GPT disks. <ref>Huge Hard Disk support >2TB discussion. Technologov. (October 11, 2009). Retrieved on October 17, 2011 from https://forums.virtualbox.org/viewtopic.php?f=4&t=23279</ref> No big deal: I am not planning on using a > 2TiB disk for my virtual machine.

I installed from a stage3 tarball, because I am not crazy enough to start from stage1. Stage3 is the recommended one to use anyway. To install from a stage3 tarball, you first download the stage tarball and then you extract its contents in the Funtoo Linux's root partition. Now that all the core Funtoo Linux programs are installed, you switch to the Funtoo Linux system by chrooting into it.

Then, using git, you pull the Portage tree from Github. Funtoo Linux uses a git-based portage system, which allows smaller manifest file sizes because it leverages Git's file integrity checking mechanisms. In the rsync-based system, you would also need a change log. With Git, commit messages are used instead. <ref>Funtoo Linux FAQ, What is a mini-manifest. (August 29, 2011). Retrieved on October 17, 2011 from http://www.funtoo.org/wiki/Funtoo_Linux_FAQ#What_is_mini-manifest.3F</ref>

After tweaking a few config files, I had to get a kernel. I opted to use a kernel that would be generated by genkernel because I was not sure what kind of configuration was needed for a virtual machine. During compilation, I got some strange gcc error. Since I was not sure what the problem was, I decided to hop on the Funtoo irc channel and see if somebody could help me. Here's the chat log (Surjikal is me):

23:08 < Surjikal> I get some kind of weird error when I use emerge sysrescue-std-sources:
                  gcc: Internal error: Killed (program cc1)
23:09 < angry_vincent> oh
23:09 < angry_vincent> do you have enough space?
23:09 < drobbins> Surjikal: possibly bad memory
23:09 < Surjikal> Ahh I suspected that was it
23:10 < Surjikal> Yes I might be low on space, doing this on a VM
23:10 < drobbins> Surjikal: random segfaults during compile is generally bad mem
23:10 < drobbins> Surjikal: that could be it too
23:10 < drobbins> Surjikal: either bad mem or low mem
23:10 < drobbins> it may be the OOM killer
23:10 < drobbins> since it said it was killed
23:11  * drobbins wonders what to call Portage 1.0
23:11 < Surjikal> You know what, that could be it actually. I don't have lots of RAM allocated on that VM,
                  and I'm running the sysrescue live disk
23:11 < drobbins> Surjikal: did you do swapon first?
23:11 < drobbins> Surjikal: maybe if you add swap it will work ok

Turns out the 256MB of RAM I allocated to the VM was insufficient to compile a kernel. But what really surprised me it was that the chief architect (drobbins) helped me out! Compilation took about 3 hours, but its not too bad since the process is automated.

After compiling the kernel, you must setup the bootloader. This involves installing the GRUB package, modifying a config file and running a GRUB config generator script. This step is much easier and much more automated than on Gentoo, where you would have to edit the GRUB configuration directly. Setting up users was a breeze. There's nothing Funtoo Linux specific about that step.

That's it! A reboot is all that is needed.

Basic Operation

Note: This section may be easier to understand after reading the software packaging section.

Funtoo Linux gives you the power to customize almost any aspect of your distribution. This is why after installation, you are only presented with a simple bash prompt. While I had no problem with the command line, I needed some kind of window manager in order to stay sane. This means I had to install an X server.

Installed xorg-server successfully

Installing an X Server

First, I must configure my use flags since I want to keep my installation as lightweight as possible. I removed the gnome, kde and qt4 use flags in my make.conf file, as only wanted GTK+ support.

USE="-gnome -kde -qt4"

Then, I added configuration entries in my make.conf that specified which video card and input devices my computer had. <ref name="vbox-guest">VirtualBox Guest. (December 14, 2011). Retrieved on December 14, 2011 from http://en.gentoo-wiki.com/wiki/Virtualbox_Guest</ref>

INPUT_DEVICES="evdev keyboard mouse vmmouse"
VIDEO_CARDS="virtualbox"

Then, I had to install the virtualbox input and video drivers:

emerge --ask --verbose xf86-video-virtualbox xf86-input-virtualbox

Finally, I installed X:

emerge --ask --verbose xorg-server

To check if my X server was working properly, I installed twm (window manager) and xterm (terminal emulator):

emerge --ask --verbose twm xterm

Then, I started the X server:

startx

After I have successfully installed xorg-server, I removed twm and xterm as I only needed them for testing:

emerge --unmerge twm xterm


Showing nano and irssi using the default awesome configuration

Installing Awesome

Awesome is a fast tiling window manager that has true multihead support and can be extended via its Lua interface. <ref>Awesome window manager home page. Retrieved on December 14, 2011 from http://awesome.naquadah.org/</ref>

Installing awesome is simple in Funtoo Linux:

root# emerge -av awesome
Customization

The default awesome configuration is good enough for most people, but here are some of the modifications I did to mine:


Compiling and installing a kernel

It is very easy to compile and install a Linux kernel in Funtoo Linux. Indeed, as shown later, there are many variations to choose from. I decided to install the Gentoo kernel, because it is stable and I am familiar with it.

First, I had to retrieve the source code of the kernel:

emerge -av gentoo-sources

The source was unpacked to /usr/src/linux-3.1.1-gentoo/. I went to that directory and I started configuring the kernel:

cd /usr/src/linux-3.1.1-gentoo
make menuconfig

I had to customize my kernel configuration so that it could run properly in virtual box as a guest. Here's what had to be enabled/disabled: <ref name="vbox-guest" />

Processor type and features  --->
    [*] Tickless System (Dynamic Ticks)
    [ ] High Resolution Timer Support
    [X] Symmetric multi-processing support (keep this enabled for multiple cores, too!)
        Subarchitecture Type (PC-compatible)  --->
    [ ] Machine Check / overheating reporting
    [X] SMT (Hyperthreading) scheduler support (This too, for i7's)
Power management and ACPI options  --->
    [*] Power Management support
    [ ] Suspend to RAM and standby
    [ ] Hibernation (aka 'suspend to disk')
    [*] ACPI (Advanced Configuration and Power Interface) Support  --->
Device Drivers  --->
    < > ATA/ATAPI/MFM/RLL support
    <*> Serial ATA and Parallel ATA drivers
        <*> AHCI SATA Support
        [*] ATA SFF support
        <*> Intel ESB, ICH, PIIX3, PIIX4 PATA/SATA support
    [*] Network device support  --->
        [*] Ethernet (10 or 100Mbit)  --->
            [*] EISA, VLB, PCI and on board controllers
                <M>   AMD PCnet32 PCI support
        [*] Ethernet (1000 Mbit)  --->
            <M> Intel(R) PRO/1000 Gigabit Ethernet support
        [ ] Ethernet (10000 Mbit)  --->
    Input device support --->
        [*] Mice --->
           <*> PS/2 mouse
    Graphics support --->
        <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)  --->
            < > all options can be empty
    <M> Sound card support --->
        <M> Advanced Linux Sound Architecture --->
            [*] PCI sound Devices --->
                <M> Intel/SiS/nVidia/AMD/ALi AC97 Controller

After I was done configuring, I compiled the kernel:

make && make modules_install

Then, I moved the kernel to my boot partition, and renamed it to something more descriptive. The compiled kernel is located at ./arch/x86/boot/bzImage.

mv arch/x86/boot/bzImage /boot/linux-3.1.1-gentoo

Furthermore, I added the following lines to my boot configuration file (/etc/boot.conf):

"Funtoo Linux (compiled kernel)" {
      kernel linux-3.1.1-gentoo
}

Finally, I generated the boot-loader (grub) configuration:

boot-update


Usage Evaluation

Funtoo Linux is an extremely capable source-based distribution. The process of compiling applications is painless, but it is lengthy. However, for big applications such as firefox, you can set the binary use flag to simply download and install the binary, instead of compiling from source.

The portage tree contains a lot of packages, and most of them are up to date. If a package is unavailable you can most likely find it through an overlays. For example, you can install the Gnome3 package from the Gnome overlay.

Funtoo Linux is extremely customizable. It is the reason why I chose this distribution: I was tired of some distribution maker deciding what is best for me. That said, Funtoo Linux can be a bit frustrating when it comes to errors. Since you are dealing with the source directly, it can be hard to get everything configured properly. Also, updating your system can be quite a chore and it can take several days to complete the process. Also, if a library is updated, and the ABI or API changes, then everything that depends on this library must be recompiled. To be fair, these problems usually happens when you waiting too long (>6 months) before updating. And of course, all the tools to help you update your system are available through portage.


Software Packaging

What packaging format and utilities are used?

There are no packages or archives like .deb or .rpm files in Funtoo Linux. Instead, a package is a directory which contains an ebuild script, a manifest file, patch files and configuration files. Funtoo Linux allows you to customize which parts of the package you want to compile via use flags.

Ebuild Scripts

An ebuild or ebuild script is a bash script which runs in a special environment, and describe how to download, compile, configure and install a package. The ebuild usually downloads a distfile, which is a source tarball, but can also pull the source from a repository. <ref>Writing Ebuilds. (28 June, 2011). Retrieved on November 11, 2011 from http://en.gentoo-wiki.com/wiki/Writing_Ebuilds</ref>

Manifest File

The manifest file is used to determine the integrity of source tarballs (called distfiles). In Gentoo, it is also used to check all files in the package. This is not required in Funtoo Linux since git takes care of that. The manifest files are still needed because the source tarballs are not contained in the git repository and so they must be checked after the ebuild downloads them.

To illustrate the difference in package management between Gentoo and Funtoo, here's a comparison of the Manifest file for the cowsay package:

Gentoo

AUX cowsay-3.03-mech.patch 490 RMD160 bc2318e9832108a39728e92806578566618fad8e SHA1 cec033ce530daa01736a841f351144f3ca5aea3d ...
AUX cowsay-3.03-tongue.patch 358 RMD160 9de33eec59e44fd2a375bca1419313f856bade7f SHA1 4cb24d5ea35df531c1e8ad2d000d643e41e97964 ...
AUX cowsay-3.03-utf8.patch 454 RMD160 00ea66c1561dd6ec2a31156c49f7f8d067b7b119 SHA1 f8eca4fa5dd4c7d404b215ca98601715042a7b62 ...
DIST cowsay-3.03.tar.gz 15189 RMD160 f26b9ffe3d5551ee8049979c628bbe198817044a SHA1 cc65a9b13295c87df94a58caa8a9176ce5ec4a27 ... 
EBUILD cowsay-3.03-r2.ebuild 1245 RMD160 14bce76715480958f0dfa33d1c95e7033965c4d1 SHA1 7c73d1ef3dc0166174acfb28749a896ce8832272 ...
MISC ChangeLog 4354 RMD160 5681d5b0ee3d5c8a343451258269797fb9140793 SHA1 0378422a1656d493aad0e31aad66c42cf0a10e71 ...
MISC metadata.xml 158 RMD160 cbd9984bb6b426c8c9cee5022fe0a26261612fea SHA1 be5251fa1dacef5c41b74761bb1c8c54fb633b9e ...

Funtoo

DIST cowsay-3.03.tar.gz 15189 RMD160 f26b9ffe3d5551ee8049979c628bbe198817044a SHA1 cc65a9b13295c87df94a58caa8a9176ce5ec4a27 ... 
Porthole, a Portage GUI frontend
Portage

Portage is the software management tool of Funtoo Linux. <ref>Portage. (September 23, 2011). Retrieved on December 18, 2011 from http://www.funtoo.org/wiki/Portage</ref> It is composed of two programs: Ebuild and Emerge. Ebuild is the tool which runs ebuild scripts. Emerge is the tool that keeps track of installed packages, resolves dependencies and provides the main portage interface.

Porthole is a GUI front end to portage. It is very useful if you are a first time Funtoo Linux or Gentoo user and works great as a package and use flag browser.

The portage tree is the set of all packages available on the system. It is a a directory tree, usually rooted at /usr/portage.

Overlays

An overlay is a set of ebuilds which can be merged with the main portage tree of your distribution. <ref>Gentoo Overlays: Users' Guide. (July 25, 2011). Retrieved on November 11, 2011 from http://www.gentoo.org/proj/en/overlays/userguide.xml</ref> The Funtoo Linux tree is composed of the Gentoo overlay, the Funtoo overlay, and the slashbeast, multimedia, tarsius, golodhrim third party overlays. <ref>Funtoo Linux. (November 8, 2011). Retrieved on December 18, 2011 from http://www.funtoo.org/wiki/Funtoo_Linux</ref>

Use Flags

Use flags are used to specify which component of a package you want/don't want to compile. Doing this cuts down compilation by a significant amount because it greatly reduces the number of dependencies pulled in. Use flags can be set globally or they can be package specific. Global use flags are specified in /etc/make.conf.

For example, if I want to disable the Gnome and KDE components of packages, globally, this is how I would modify my make.conf file:

DONT_USE="-kde -gnome"
OTHER_USE="freetype laptop"
USE="$OTHER_USE $DONT_USE"
Other Tools

Equery is a collection of modules for querying the state of Funtoo Linux packages, files and USE flags.<ref>Equery man page</ref> It is not bundled with the distribution and it is part of the gentoolkit package. This program uses the /var/db/pkg directory which contains the state of portage. <ref>Gentoo Files and Directories. (March 2, 2011). Retrieved on November 13, 2011 from http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3&chap=1</ref>

How can you use these utilities to get a list of installed packages?

Equery can be used to get a list of installed packages:

equery list "*"

Alternatively, you can list the directories in /var/db/pkg.

find /var/db/pkg -maxdepth 2 -type d

To see which packages were emerged explicitly:

cat /var/lib/portage/world

How do you add and remove packages?

Adding packages:

emerge <package>

Alternatively, this will show you the package and its use flags, and ask you to confirm the package installation:

emerge --ask --verbose <package> # you can also use the -av flags instead of --ask --verbose

Adding a package with custom use flags:

echo "<package> <use flags>" >> /etc/portage/package.use
emerge <package>

Example
Installing the sudo package with the offensive use flag, which causes sudo to insult you when you type bad passwords:

echo "app-admin/sudo offensive" >> /etc/portage/package.use
emerge -av sudo

Removing packages:

emerge --unmerge <package>

Checking for reverse dependencies before removing:

emerge --pretend --verbose --depclean <package>

Updating the system:

emerge -pv --update --deep --newuse world

How extensive is the software catalog for this distribution?

Funtoo linux contains 15483 packages. We can determine this by running the following command:

find /usr/portage -maxdepth 2 -type d | wc -l

Major Package Versions

A plain Funtoo Linux distribution contains very few programs. Contrary to Ubuntu or Fedora, it only includes programs that are absolutely needed in order to chroot into the system during installation. You are expected to completely update your system as soon as you are done configuring portage. It is actually one of the installation steps. When you install Funtoo Linux, you are essentially building your own distribution. Therefore, this question is not directly applicable. What I will show instead is a list of packages that I normally install on my Funtoo Linux/Gentoo systems and pretend that they are included in the distribution.

Linux Kernels

Here are some of the available Linux kernels available in Funtoo Linux:

Kernel Funtoo Version Upstream Version Upstream URL Reason to install
Gentoo 3.1.1 3.1.1 http://dev.gentoo.org/~mpagano/genpatches/ Stable, works on many architectures and is patched for some security vulnerabilities. <ref name="Gentoo Kernel Guide">Gentoo Linux Kernel Guide. (September 5, 2011). Retrieved on December 18, 2011 from http://www.gentoo.org/doc/en/gentoo-kernel.xml</ref>
Vanilla 3.1.1 3.1.1 http://kernel.org, http://git.kernel.org/?p=linux/kernel/git/stable/linux-stable.git;a=summary Testing or kernel hacking.
TuxOnIce 3.0.7 3.0-rc7 http://tuxonice.net, http://git.tuxonice.net/?p=tuxonice-3.0.git;a=summary Ideal for laptop users. It enables an enhanced hibernation mode. It also contains the patches from the Gentoo kernel.<ref name="Gentoo Kernel Guide" /><ref>TuxOnIce home page. December 18, 2011 from http://tuxonice.net/</ref>
Git snapshot 3.2-rc1 3.2-rc1 http://kernel.org, http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=summary Testing or kernel hacking.

After reading the ebuilds for these packages, I saw that no Funtoo Linux specific patches are applied. The source is simply downloaded from upstream. It is your job to configure and compile the kernel.

Packages

This is a list of some of the packages that are contained in the stage3 tarball.

Name Package Funtoo Version Upstream Version Upstream URL
GNU C Library sys-libs/glibc 2.13-r4 2.14 http://www.gnu.org/software/libc/libc.html
The GNU Compiler Collection sys-devel/gcc 2.6.2 2.6.2 http://gcc.gnu.org/
Bash app-shells/bash 4.2-p10 (patch bash42-101 applied) 4.2, latest patch is bash42-010 http://www.gnu.org/s/bash/
Portage n/a 2.2.2 2.1.10.11 http://www.gentoo.org/proj/en/portage/index.xml


This is a list of some of the packages I usually install in my Funtoo Linux/Gentoo distribution:

Name Package Funtoo Version Upstream Version Upstream URL Reason for installation
Xorg Server x11-base/xorg-server 1.11.2 1.11.2 http://www.x.org/releases/individual/xserver/ Provides the ability to run graphical user interfaces.<ref>The X Server Configuration HOWTO. (September 2, 2011). Retrieved on December 18, 2011 from http://www.gentoo.org/doc/en/xorg-config.xml</ref>
Awesome x11-wm/awesome 3.4.10 3.4.10 http://awesome.naquadah.org Tiling managers maximizes the use of your screen real estate, which can greatly increase your productivity. I use awesome because of its good multihead support.
Firefox www-client/firefox 8.0 8.0 http://www.mozilla.org/projects/firefox/ I use this web browser because it supports the noscript extension, which removes most ads and improves page responsiveness.
Vim app-editors/vim 7.3 7.3 http://www.vim.org/ Has syntax highlighting for most of the file-types that I care about. I am also trying to learn it. Emacs scares me.
Cowsay games-misc/cowsay 3.03 3.03-r2 http://www.nog.net/~tony/warez/cowsay.shtml It makes me laugh, especially when used in scripts.
Layman app-portage/layman 2.0.0 rc3 2.0.0 rc3 http://layman.sourceforge.net/ Nice tool to manage overlays.


Again, the source tarballs are downloaded directly from upstream. That said, Funtoo Linux or Gentoo specific patches are applied to certain packages after the source is unpacked:

Package Patches and modifications
glibc Two security patches (disable ld audit and dst expansion fix).
gcc Fixed LANG variable, added support for GCC_SPEC variable, added default protection for stack smashing attacks.
Bash Many patches related to compilation configuration, patch to allow negative return values.
Portage Git based, uses mini manifest files.
Xorg Server Removed acpi code, security vulnerability fix when creating lock file
Awesome Added support for the release of xcb-util-0.3.8
Firefox Gentoo preferences fix, xulrunner 1.9.2 with gtk 2.21 patch
Vim Interix patches, Darwin bootloader patch
Cowsay UTF-8 support added, added customizable tongue and eyes for the ascii cow.
Layman n/a


Initialization

Funtoo Linux uses OpenRC for its initialization purposes. It supports running services in parallel, named runlevels and dependencies. It uses POSIX shell scripts as its init scripts.<ref>Gentoo OpenRC Project. (June 23, 2011). Retrieved on November 12, 2011 from http://www.gentoo.org/proj/en/base/openrc/</ref> Funtoo Linux uses a fork of OpenRC, since it needs to be modified because of the way the distribution handles networking. <ref>OpenRC (Funtoo). (December 27, 2010). Retrieved on November 12, 2011 from http://www.funtoo.org/wiki/OpenRC_(Funtoo)</ref>

There are 4 named runlevels in Funtoo Linux: sysinit, boot, default and shutdown.

Initialization Log

Sysinit runlevel
                            * /proc is already mounted, skipping
netif.lo                  | * Bringing up network interface lo ...
sysfs                     | * Mounting security filesystem ...
sysfs                     | * Mounting debug filesystem ...
udev-mount                | * udev: /dev already mounted, skipping...
udevd                     | * Starting udevd daemon ...
devfs                     | * Mounting /dev/shm ...
udevd                     | * Populating /dev with existing devices through uevents ...

Boot runlevel
hwclock                   | * Setting system clock using the hardware clock [UTC] ...
sysctl                    | * Configuring kernel parameters ...
hostname                  | * Setting hostname to localhost ...
modules                   | * Autoloaded 0 module(s)
fsck                      | * Checking local filesystems  ...
fsck                      |/dev/sda3: clean, 303480/1163264 files, 1113195/4650817 blocks
fsck                      |/dev/sda1: clean, 196/64000 files, 22223/256000 blocks
root                      | * Remounting root filesystem read/write ...
mtab                      | * Updating /etc/mtab ...
localmount                | * Mounting local filesystems ...
urandom                   | * Initializing random number generator ...
swap                      | * Activating swap devices ...
udev-postmount            | * udev: storing persistent rules ...
procfs                    | * Mounting USB device filesystem [usbfs] ...
bootmisc                  | * Creating user login records ...
bootmisc                  | * Cleaning /var/run ...
procfs                    | * Mounting misc binary format filesystem ...
bootmisc                  | * Wiping /tmp directory ...
termencoding              | * Setting terminal encoding [UTF-8] ...
keymaps                   | * Setting keyboard mode [UTF-8] ...
keymaps                   | * Loading key mappings [us] ...
Default runlevel
metalog                   | * Starting metalog ...
netmount                  | * Mounting network filesystems ...
dhcpcd                    | * Starting DHCP Client Daemon ...
local                     | * Starting local
Shutdown runlevel
swap                      | * Deactivating swap devices ...
local                     | * Stopping local
metalog                   | * Stopping metalog ...
dhcpcd                    | * Stopping DHCP Client Daemon ...
netmount                  | * Unmounting network filesystems ...
urandom                   | * Saving random seed ...
udevd                     | * Stopping udevd daemon ...
netif.lo                  | * Shutting down network interface lo ...
localmount                | * Unmounting loop devices
localmount                | * Unmounting filesystems

I was able to get this information by enabling OpenRC logging. This was done by editing the /etc/rc.conf file.


Initialization Order

The order of initialization is hard to determine since the services are initialized in parallel. That said, here's a table of some services along with their dependencies:

Service Runlevel Need Before After
dhcpcd (DHCP daemon) Default bootmisc, modules localmount dns
udevd (udev daemon) Sysinit udev-mount checkfs, fsck n/a
fsck Boot n/a n/a n/a
hostname Boot n/a n/a n/a
bootmisc Boot localmount logger clock, sysctl
Need

Hard dependencies; program needed must have been initialized otherwise the current service initialization will fail.

Before

The service is initialized before a given service, if it is in the same runlevel.

After

The service is initialized after a given service, if it is in the same runlevel. <ref>Initscripts, Writing init scripts. (September 17, 2011). Retrieved on November 12, 2011. http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2&chap=4#doc_chap4</ref>


I was able to get this information by looking at the service's init script, located in /etc/init.d.

Terms

Meta-distribution

A distribution that allows you to build your own distribution. Funtoo Linux is called a meta-distribution due to its ability to be totally customized.

Source-based distribution

A source-based distribution is a distribution that all of the packages are downloaded as source and compiled, as opposed to downloading a precompiled binary. <ref>Arch Compared to Other Distributions, Source-based. (November 7, 2011). Retrieved on November 12, 2011 from https://wiki.archlinux.org/index.php/Arch_Compared_to_Other_Distributions#Source-based</ref>

Advantages of source-based distributions (ex. Gentoo, Funtoo)
  • Packages are optimized for your hardware.
  • You can exclude unwanted features from packages in order to minimize dependencies and reduce the binary size. For example, if your system uses Gnome, in most cases you will never need the KDE component of a package. In Funtoo/Gentoo, you are able to do this via 'use' flags.
  • Improved security: You can actually inspect the source of the package instead of trusting that the binary your distribution provides is not malicious.
Advantages of binary-based distributions (ex. Debian, Fedora)
  • Much faster to install large programs such as Firefox.
  • More user-friendly, since the user does not have to deal with compilation issues.

Stage tarballs

A stage tarball is a precompiled system used as a starting point to a Funtoo/Gentoo Linux install. Typically, you would use a stage3 tarball to do a Funtoo/Gentoo Linux installation but some people may want to do a stage1 installation. This means that they would have to compile all the core tools (udev, portage, etc.) first. <ref>Funtoo Linux Installation, Installing the Stage3 tarball. (November 12, 2011). Retrieved on November 12, 2011 from http://www.funtoo.org/wiki/Funtoo_Linux_Installation#Installing_the_Stage_3_tarball</ref>

Git-Based Portage Tree

A portage tree is a collection of ebuilds scripts. Funtoo Linux uses a git-based portage tree as opposed to Gentoo's rsync-based tree. The advantage of a git-based portage tree is that git's file integrity mechanisms can be used to check the integrity of an ebuild. Also, commit messages are used to describe ebuild changes as opposed to dedicated log files. Creating an overlay is as easy as forking off the Funtoo Linux portage tree repository. Read the Software Packaging section for more details.

/etc/make.conf

The main portage configuration file.

References

<references/>