https://www.funtoo.org/api.php?action=feedcontributions&user=Edelwin&feedformat=atomFuntoo - User contributions [en]2024-03-29T06:17:41ZUser contributionsMediaWiki 1.36.2https://www.funtoo.org/index.php?title=Package:I3_(Window_Manager)&diff=5070Package:I3 (Window Manager)2014-08-19T06:24:36Z<p>Edelwin: </p>
<hr />
<div>== Introduction == <br />
i3 is a tiling window manager that is based upon experiences the developers shared while attempting to fix/hack wmii. i3 has the ability for either floating windows, which you can resize and move, and tiling windows. i3 uses a tree as a data structure to allow for more flexibility. i3 defaults with home-row key-bindings which are quick and easy to get beginners off the ground. <br />
<br />
'''NOTE: This wiki is made following the steps produced to get a working i3 using xrandr instead of xinerama, ATI proprietary drivers instead of radeon drivers, a dual-monitor setup, and no login manager. For Nvidia and Twinview users, a link is supplied in [[#X11 and xrandr|X11 and xrandr]]. Xinerama was initially used and worked in the dual-monitor setup so it possible to substitute xinerama for xrandr with minimal changes.''' <br />
<br />
== Installation ==<br />
<br />
=== Portage ===<br />
<br />
The easiest and quickest way:<br />
<console><br />
###i## emerge -avt x11-wm/i3<br />
</console><br />
<br />
=== Manual ===<br />
<br />
==== Tarball ====<br />
<br />
Download the latest version from the i3 website.<br />
[http://i3wm.org/downloads/i3-4.8.tar.bz2 i3-4.8]<br />
<br />
<console><br />
###i## cd /PATH/TO/TARBALL<br />
###i## make<br />
###i## sudo make install<br />
</console><br />
<br />
==== Git ====<br />
<br />
<console><br />
###i## git clone git://code.i3wm.org/i3<br />
###i## cd i3<br />
###i## make<br />
###i## sudo make install<br />
</console><br />
<br />
== Setup ==<br />
<br />
=== xinitrc ===<br />
<br />
Edit <tt>~/.xinitrc</tt>:<br />
<br />
<pre><br />
exec i3<br />
</pre><br />
<br />
<br />
For i3 logging, edit <tt>~/.xinitrc</tt>:<br />
<br />
<pre><br />
exec i3 -V -d all >~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1<br />
</pre><br />
<br />
If you are using Nvidia or for some reason don't use xrandr, edit ~/.xinitrc<br />
<pre style="color:green">exec i3 --force-xinerama</pre><br />
and nvidia with logging:<br />
<pre style="color:green">exec i3 --force-xinerama -V -d all >~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1</pre><br />
Example ~/.xinitrc that uses consolekit and dbus in launch and also logs on exit.<br />
<pre style="color:purple">#!/bin/zsh<br />
xrdb -merge ~/.Xresources<br />
xcompmgr &<br />
<br />
if [[ $1 == "i3" ]]; then<br />
exec ck-launch-session dbus-launch --sh-syntax --exit-with-session i3 -V -d all > ~/.i3/i3log-$(date +'%F-%k-%M-%S') 2>&1<br />
elif [[ $1 == "razor" ]]; then<br />
exec ck-launch-session dbus-launch startrazor<br />
elif [[ $1 == "awesome" ]]; then<br />
exec ck-launch-session dbus-launch awesome<br />
elif [[ $1 == "qtile" ]]; then<br />
exec ck-launch-session dbus-launch ~/.qtile-session<br />
else<br />
echo "Choose a window manager"<br />
fi</pre><br />
<br />
<div id="X11 and xrandr"></div><br />
<br />
=== X11 and xrandr ===<br />
<br />
=== X and RandR ===<br />
'''NOTE: RandR and Xinerama do not play together. Use one or the other.'''<br />
<br />
I use an AMD HD 6870 with 3 monitors (2 DVI and 1 with an AMD validated Mini DisplayPort™ to DVI dongle).<br />
<br />
Install {{Package|x11-apps/xrandr}}:<br />
<console><br />
###i## emerge x11-apps/xrandr<br />
</console><br />
and if you want a GUI with xrandr:<br />
<console><br />
###i## emerge x11-misc/arandr<br />
</console><br />
<br />
If you do not have X configured yet, follow the link on the [http://en.gentoo-wiki.com/wiki/X.Org Gentoo Wiki]<br />
<br />
My xorg.conf.d folder for example: [https://github.com/akiress/dotfiles/blob/master/etc/X11/xorg.conf.d/30-screen.conf 30-screen.conf]<br />
<br />
Since the names of the monitors are already known in xrandr, I just use those names in my 30-screen.conf configuration. It doesn't matter what you use in your X configuration however.<br />
<br />
Once you have X configured however you like, start qtile with either:<br />
<console><br />
###i## startx<br />
</console><br />
or, in a case similar to mine:<br />
<console><br />
###i## xinit qtile<br />
</console><br />
<br />
=== i3 config ===<br />
The i3 configuration file can be found in /etc/i3/config, but I suggest that you copy the file into a local ~/.i3 directory.<br />
<pre># mkdir -p ~/.i3 && cp /etc/i3/config ~/.i3/config</pre><br />
Open up ~/i3/config in your editor of choice.<br />
<code style="color:green">set $mod Mod1</code> assigns the variable $mod to be Mod1. In i3, Mod1 is the Alt key. If you wish to use the Windows key then use <code style="color:green">set $mod Mod4</code> In the keybinding section, $mod is used in place of Mod1 in the case that you do wish to change the modifier. In the workspace key, the keybindings are set with Mod1 instead of the variable, so remember to change those bindings manually if you are replacing the Mod1 modifier. Else you can change Mod1 in those sections to $mod and change all the keybindings at the same time by setting the $mod variable.<br />
<pre style="color:green">set $mod Mod1</pre><br />
To have programs start automatically in i3, use the command <code style="color:green">exec APPLICATION</code>. This is the section that the xrandr screen layout bash file created earlier will be placed. The i3bar is a tray and status bar combination. If you have applications that run in the system tray that you want to autostart, call those applications with exec.<br />
<pre style="color:green">exec /PATH/TO/XRANDR-BASH-FILE<br />
exec NAME OF BROWSER<br />
exec NAME OF EDITOR<br />
exec volumeicon<br />
exec dropbox</pre><br />
In the workspace section, you have the opportunity to name the workspaces by setting either the number of the workspace, the name of the workspace, or the number and name of the workspace. <code style="color:green">bindsym KEYBIND workspace NAME/NUMBER OF WORKSPACE</code>. Remember to use quotes when naming a workspace.<br />
<pre style="color:green">bindsym Mod1+1 workspace 1<br />
bindsym Mod1+1 workspace "my first workspace"<br />
bindsym Mod1+1 workspace "1: my first workspace"</pre><br />
To assign a workspace to a certain output you will need the output from running xrandr again if you do not remember which connections are being used. In the example from [#X11 and xrandr|X11 and xrandr], the connected outputs are DFP3 and DFP4. To assign the workspace, you need to add <code style="color:green">workspace NAME OF WORKSPACE or NUMBER output CONNECTED OUTPUT</code>. There are several types of outputs so make sure that you are using the connected outputs from xrandr when assigning workspaces, else the workspace will not show up.<br />
<pre style="color:green">workspace 1 output DFP3<br />
workspace "my first workspace" output DFP3<br />
workspace "1: my first workspace" output DFP3<br />
workspace "2: my second workspace" output DFP4</pre><br />
To assign a program to a certain workspace, you will need to run xprop. If you do not have xprop, emerge it.<br />
<pre># emerge -avt x11-apps/xprop</pre><br />
To run xprop, open a terminal and run <pre># xprop</pre> Your mouse cursor should become a crosshair and you will want to mouse over the window that contains the running application. Click on that window and xprop will then output the window information. The easiest way to assign a program is to look for <pre style="color:green">WM_CLASS(STRING) = "INSTANCE", "CLASS"</pre> Be sure to note that the window INSTANCE is before the window CLASS. In the config file, add <code style="color:green">assign [class="^INSTANCE$" instance="^CLASS$] NAME OF WORKSPACE</code>. For aesthetic purposes, you can add → before NAME OF WORKSPACE, but mind that the → is a UTF-8 character and not <code>-></code>. For the assignments, do not put the workspace name within quotes as you do when naming them and setting their output.<br />
<pre style="color:green"><br />
assign [class="^Chromium-browser$" instance="^chromium-browser$"] 1<br />
assign [class="^Chromium-browser$" instance="^chromium-browser$"] web<br />
assign [class="^Chromium-browser$" instance="^chromium-browser$"] 1: web<br />
assign [class="^Chromium-browser$" instance="^chromium-browser$"] → 1<br />
assign [class="^Chromium-browser$" instance="^chromium-browser$"] → web<br />
assign [class="^Chromium-browser$" instance="^chromium-browser$"] → 1: web</pre><br />
For aesthetic purposes, their are three types of borders for the windows. This can be set by adding <code style="color:green">new_window <normal|1pixel|none></code>. There are also keybindings that allow you to switch between the 3 border styles.<br />
<pre style="color:green">new_window 1pixel<br />
bindsym $mod+t border normal<br />
bindsym $mod+y border 1pixel<br />
bindsym $mod+u border none</pre><br />
The orientation for new workspaces can be set by adding <code style="color:green">default_orientation <horizontal|vertical|auto></code><br />
<pre style="color:green">default_orientation horizontal</pre><br />
<br />
A sample ~/.i3/config:<br />
<div style="height:250px;overflow:scroll;color:green"><pre><br />
set $mod Mod1<br />
<br />
########################################################<br />
######## Autostart ########<br />
########################################################<br />
exec ~/.screenlayout/dualdtop.sh <br />
exec chromium-browser <br />
exec gvim <br />
exec volumeicon <br />
exec parcellite<br />
exec dropbox<br />
<br />
########################################################<br />
######## Workspaces ########<br />
########################################################<br />
# switch to workspace<br />
bindsym Mod1+1 workspace "1: web"<br />
bindsym Mod1+2 workspace "2: irc"<br />
bindsym Mod1+3 workspace "3: gvim"<br />
bindsym Mod1+4 workspace "4: ranger"<br />
bindsym Mod1+5 workspace "5: terms"<br />
bindsym Mod1+6 workspace "6: mplayer"<br />
bindsym Mod1+7 workspace "7: mail"<br />
bindsym Mod1+8 workspace "8: firefox"<br />
bindsym Mod1+9 workspace "9: music"<br />
bindsym Mod1+0 workspace "10: office"<br />
<br />
## Output certain workspaces<br />
workspace "1: web" output DFP3<br />
workspace "2: irc" output DFP4<br />
workspace "3: gvim" output DFP4<br />
workspace "4: ranger" output DFP3<br />
workspace "5: terms" output DFP4<br />
workspace "6: mplayer" output DFP3<br />
workspace "7: mail" output DFP3<br />
workspace "8: firefox" output DFP3<br />
workspace "9: music" output DFP3<br />
workspace "10: office" output DFP4<br />
<br />
## Assign workspaces to programs<br />
assign [class="^Chromium-browser$" instance="^chromium-browser$"] → 1: web<br />
assign [class="^Gvim$" instance="^gvim$"] → 3: gvim<br />
assign [class="^MPlayer$" instance="^gl$"] → 6: mplayer<br />
assign [class="^Firefox$" instance="^Navigator$"] → 8: firefox<br />
assign [class="^Emacs$" instance="^emacs$"] → 9: emacs<br />
assign [class="^libreoffice-startcenter$" instance="^VCLSalFrame.DocumentWindow$"] 10: office<br />
<br />
# move focused container to workspace<br />
bindsym Mod1+Shift+1 move workspace 1<br />
bindsym Mod1+Shift+2 move workspace 2<br />
bindsym Mod1+Shift+3 move workspace 3<br />
bindsym Mod1+Shift+4 move workspace 4<br />
bindsym Mod1+Shift+5 move workspace 5<br />
bindsym Mod1+Shift+6 move workspace 6<br />
bindsym Mod1+Shift+7 move workspace 7<br />
bindsym Mod1+Shift+8 move workspace 8<br />
bindsym Mod1+Shift+9 move workspace 9<br />
bindsym Mod1+Shift+0 move workspace 10<br />
<br />
########################################################<br />
######## Aesthetics ########<br />
########################################################<br />
# Window border style: normal: border normal, with window title bar;<br />
# none: no border or window title bar; 1pixel: 1 pixel border.<br />
new_window 1pixel<br />
bindsym $mod+t border normal<br />
bindsym $mod+y border 1pixel<br />
bindsym $mod+u border none<br />
<br />
# font for window titles. ISO 10646 = Unicode<br />
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1<br />
<br />
# Orientation for new workspaces<br />
# Can be set <horizontal|vertical|auto><br />
default_orientation horizontal<br />
<br />
# Layout for new containers<br />
# Can be set <default|stacking|tabbed><br />
workspace_layout default<br />
<br />
# Use Mouse+$mod to drag floating windows to their wanted position<br />
floating_modifier $mod<br />
<br />
########################################################<br />
######## Keybindings ########<br />
########################################################<br />
<br />
# start a terminal<br />
bindsym $mod+Return exec i3-sensible-terminal<br />
<br />
# kill focused window<br />
bindsym $mod+Shift+Q kill<br />
<br />
# start dmenu (a program launcher)<br />
bindsym $mod+d exec dmenu_run<br />
<br />
# change focus<br />
bindsym $mod+j focus left<br />
bindsym $mod+k focus down<br />
bindsym $mod+l focus up<br />
bindsym $mod+semicolon focus right<br />
<br />
# alternatively, you can use the cursor keys:<br />
bindsym $mod+Left focus left<br />
bindsym $mod+Down focus down<br />
bindsym $mod+Up focus up<br />
bindsym $mod+Right focus right<br />
<br />
# move focused window<br />
bindsym $mod+Shift+J move left<br />
bindsym $mod+Shift+K move down<br />
bindsym $mod+Shift+L move up<br />
bindsym $mod+Shift+colon move right<br />
<br />
# alternatively, you can use the cursor keys:<br />
bindsym $mod+Shift+Left move left<br />
bindsym $mod+Shift+Down move down<br />
bindsym $mod+Shift+Up move up<br />
bindsym $mod+Shift+Right move right<br />
<br />
# split in horizontal orientation<br />
bindsym $mod+h split h<br />
<br />
# split in vertical orientation<br />
bindsym $mod+v split v<br />
<br />
# enter fullscreen mode for the focused container<br />
bindsym $mod+f fullscreen<br />
<br />
# change container layout (stacked, tabbed, default)<br />
bindsym $mod+s layout stacking<br />
bindsym $mod+w layout tabbed<br />
bindsym $mod+e layout default<br />
<br />
# toggle tiling / floating<br />
bindsym $mod+Shift+space floating toggle<br />
<br />
# change focus between tiling / floating windows<br />
bindsym $mod+space focus mode_toggle<br />
<br />
# focus the parent container<br />
bindsym $mod+a focus parent<br />
<br />
# focus the child container<br />
#bindcode $mod+d focus child<br />
<br />
# reload the configuration file<br />
bindsym $mod+Shift+C reload<br />
# restart i3 inplace (preserves your layout/session, can be used to upgrade i3)<br />
bindsym $mod+Shift+R restart<br />
# exit i3 (logs you out of your X session)<br />
bindsym $mod+Shift+E exit<br />
<br />
# resize window (you can also use the mouse for that)<br />
mode "resize" {<br />
# These bindings trigger as soon as you enter the resize mode<br />
# They resize the border in the direction you pressed, e.g.<br />
# when pressing left, the window is resized so that it has<br />
# more space on its left<br />
<br />
bindsym j resize shrink left 10 px or 10 ppt<br />
bindsym Shift+J resize grow left 10 px or 10 ppt<br />
<br />
bindsym k resize shrink down 10 px or 10 ppt<br />
bindsym Shift+K resize grow down 10 px or 10 ppt<br />
<br />
bindsym l resize shrink up 10 px or 10 ppt<br />
bindsym Shift+L resize grow up 10 px or 10 ppt<br />
<br />
bindsym semicolon resize shrink right 10 px or 10 ppt<br />
bindsym Shift+colon resize grow right 10 px or 10 ppt<br />
<br />
# same bindings, but for the arrow keys<br />
bindsym Left resize shrink left 10 px or 10 ppt<br />
bindsym Shift+Left resize grow left 10 px or 10 ppt<br />
<br />
bindsym Down resize shrink down 10 px or 10 ppt<br />
bindsym Shift+Down resize grow down 10 px or 10 ppt<br />
<br />
bindsym Up resize shrink up 10 px or 10 ppt<br />
bindsym Shift+Up resize grow up 10 px or 10 ppt<br />
<br />
bindsym Right resize shrink right 10 px or 10 ppt<br />
bindsym Shift+Right resize grow right 10 px or 10 ppt<br />
<br />
# back to normal: Enter or Escape<br />
bindsym Return mode "default"<br />
bindsym Escape mode "default"<br />
}<br />
<br />
bindsym $mod+r mode "resize"<br />
<br />
########################################################<br />
######## i3bar ########<br />
########################################################<br />
<br />
# Start i3bar to display a workspace bar (plus the system information i3status<br />
# finds out, if available)<br />
bar {<br />
output DFP3<br />
output DFP4<br />
status_command i3status -c ~/.i3status.conf<br />
position top<br />
mode dock<br />
workspace_buttons yes<br />
tray_output DFP3<br />
<br />
font -misc-fixed-medium-r-normal--13-120-75-75-C-70-iso10646-1<br />
<br />
colors {<br />
background #000000<br />
statusline #FFFFFF<br />
<br />
focused_workspace #ffffff #9932CC<br />
active_workspace #ffffff #DA70D6<br />
inactive_workspace #888888 #242424<br />
urgent_workspace #ffffff #32CD32<br />
}<br />
} </pre></div><br />
<br />
These scripts can be found in /usr/bin/<br />
<br />
=== i3nagbar ===<br />
<br />
The i3nagbar is the error bar that pops up on top of the screen when there is an error in the i3 configuration.<br />
<br />
=== i3-sensible-editor ===<br />
<br />
i3-sensible-editor is callen when the user presses the edit button on the i3nagbar. If $EDITOR is set, that editor will be used, else i3-sensible-editor will open the first editor that is installed according to the order in i3-sensible-editor. If the user has a preference, he will set $EDITOR.<br />
<br />
=== i3-sensible-terminal ===<br />
<br />
i3-sensible-terminal is called when the user opens a terminal. If $TERMINAL is set, that terminal will be used, else i3-sensible-terminal will open the first terminal that is installed according to the order in i3-sensible-terminal. If the user has a preference, he will set $TERMINAL.<br />
<br />
=== i3-sensible-pager ===<br />
<br />
i3-sensible-pager is called when the user presses the view button on the i3nagbar. If $PAGER is set, that pager will be used, else i3-sensible-pager will open the first pager that is installed accordding to the order in i3-sensible-pager. If the user has a preference, he will set $PAGER.<br />
<br />
=== i3status ===<br />
<br />
i3status generates a status bar similar to conky in i3. i3status replaces dzen2, xmobar, and other similar applications used in older versions of i3. It is suggested to create an <tt>~/.i3status.conf</tt> file to configure the i3status bar locally. <br />
A sample <tt>~/.i3status.conf</tt>:<br />
<br />
<pre><br />
general {<br />
colors = true<br />
interval = 5<br />
}<br />
<br />
order = "disk /"<br />
order += "disk /home"<br />
order += "ethernet eth0"<br />
order += "cpu_temperature 0"<br />
order += "cpu_temperature 1"<br />
order += "cpu_temperature 2"<br />
order += "cpu_temperature 3"<br />
order += "load"<br />
order += "time"<br />
<br />
ethernet eth0 {<br />
# if you use %speed, i3status requires the cap_net_admin capability<br />
format_up = "Eth0: %ip (%speed)"<br />
format_down = "Eth0: down"<br />
}<br />
<br />
time {<br />
format = "%a:%d-%b-%Y %I:%M:%S %p"<br />
}<br />
<br />
load {<br />
format = "Load: %5min"<br />
}<br />
<br />
cpu_temperature 0 {<br />
format = "T1: %degrees °C"<br />
path = "/sys/devices/platform/coretemp.0/temp2_input"<br />
}<br />
<br />
cpu_temperature 1 {<br />
format = "T2: %degrees °C"<br />
path = "/sys/devices/platform/coretemp.0/temp3_input"<br />
}<br />
<br />
cpu_temperature 2 {<br />
format = "T3: %degrees °C"<br />
path = "/sys/devices/platform/coretemp.0/temp4_input"<br />
}<br />
<br />
cpu_temperature 3 {<br />
format = "T4: %degrees °C"<br />
path = "/sys/devices/platform/coretemp.0/temp5_input"<br />
}<br />
<br />
disk "/" {<br />
format = "/: %free"<br />
}<br />
<br />
disk "/home" {<br />
format = "/home: %free"<br />
} <br />
</pre><br />
<br />
== dmenu ==<br />
<br />
i3 uses {{Package|x11-misc/dmenu}} as the application launcher. To install it, run the following: <br />
<br />
<console><br />
###i## emerge dmenu<br />
</console><br />
<br />
{{fancynote| The default key-binding for dmenu is Mod1+d.}}<br />
<br />
== Default Keybindings ==<br />
<br />
{| class="wikitable" border="2" style="text-align:center;"<br />
|Alt + Enter<br />
|Open terminal<br />
|-<br />
|Alt + A<br />
|Focus Parent<br />
|-<br />
|Alt + S<br />
|Stacked Layout<br />
|-Advanced SearchSearch…<br />
|Alt + W<br />
|Tabbed Layout<br />
|-<br />
|Alt + E<br />
|Default Layout<br />
|-<br />
|Alt + SpaceBar<br />
|Focus tiling/floating<br />
|-<br />
|Alt + D<br />
|dmenu<br />
|-<br />
|Alt + H<br />
|Split Horizontal<br />
|-<br />
|Alt + V<br />
|Split Vertically<br />
|-<br />
|Alt + J<br />
|Left<br />
|-<br />
|Alt + K<br />
|Down<br />
|-<br />
|Alt + J<br />
|Up<br />
|-<br />
|Alt + ;<br />
|Right<br />
|-<br />
|Alt + Shift + Q<br />
|Kill window<br />
|-<br />
|Alt + Shift + E<br />
|Exit i3<br />
|-<br />
|Alt + Shift + C<br />
|Reload i3config without restarting<br />
|-<br />
|Alt + Shift + R<br />
|Restart i3 (reloads i3config without exiting i3)<br />
|-<br />
|Alt + Shift + J<br />
|Move left<br />
|-<br />
|Alt + Shift + K<br />
|Move down<br />
|-<br />
|Alt + Shift + L<br />
|Move up<br />
|-<br />
|Alt + Shift + :<br />
|Move right<br />
|-<br />
|Alt + Shift + SpaceBar<br />
|Toggle tiling/floating<br />
|}<br />
<br />
== Troubleshooting ==<br />
<br />
=== i3status ===<br />
<br />
{{fancynote| i3status may not work out of box}} The permissions may be set to: <tt>-r-xr-x---</tt>: when run as non-root, sh would return with "permission denied". <br />
If i3status does not work for you, this can be easily corrected by changing the permissions.<br />
<console><br />
###i## sudo chmod 755 /usr/bin/i3status<br />
</console><br />
<br />
=== Documentation ===<br />
<br />
==== Websites ====<br />
<br />
[http://i3wm.org/ i3]<br />
<br />
[http://i3wm.org/docs/userguide.html User Guide]<br />
<br />
[http://i3wm.org/docs/ More Documentation]<br />
<br />
==== Man pages ====<br />
<br />
* i3<br />
* i3-config-wizard<br />
* i3-input<br />
* i3-migrate-config-to-v4<br />
* i3-msg<br />
* i3-nagbar<br />
* i3-sensible-editor<br />
* i3-sensible-pager<br />
* i3-sensible-terminal<br />
* i3-wsbar<br />
* i3bar<br />
* i3lock<br />
* i3status<br />
<br />
[[Category:Desktop]]</div>Edelwinhttps://www.funtoo.org/index.php?title=User:Edelwin&diff=4396User:Edelwin2014-06-22T20:40:11Z<p>Edelwin: </p>
<hr />
<div>{{Person<br />
|Geoloc=<br />
|Location name=<br />
|Blogs=<br />
}}<br />
I'm a Queer sysadmin fond of UNIX-like systems, trombonist since childhood and member of the Queertoo community.<br />
I also have a [http://asphodelium.eu/ blog]</div>Edelwinhttps://www.funtoo.org/index.php?title=User:Edelwin&diff=4395User:Edelwin2014-06-22T20:33:52Z<p>Edelwin: Created page with "{{Person |Geoloc= |Location name= |Blogs= }} I'm Edelwin Khaelos and because you didn't kill my father, I won't kill you."</p>
<hr />
<div>{{Person<br />
|Geoloc=<br />
|Location name=<br />
|Blogs=<br />
}}<br />
I'm Edelwin Khaelos and because you didn't kill my father, I won't kill you.</div>Edelwinhttps://www.funtoo.org/index.php?title=Funtoo_Linux_Installation&diff=4390Funtoo Linux Installation2014-06-22T18:01:56Z<p>Edelwin: /* Using wpa_supplicant */</p>
<hr />
<div>== Introduction == <br />
__TOC__<br />
This document was written to help you install Funtoo Linux as concisely as possible, with a minimum number of distracting options regarding system configuration. <br />
<br />
These docs assume you have a "PC compatible" computer system with a standard PC BIOS. Many new computers support UEFI for booting, which is a new firmware interface that frequently replaces the older MBR-based BIOS. If you have a system with UEFI, you will want to use this documentation along with the [[UEFI Install Guide]], which will augment these instructions and explain how to get your system to boot. You may need to change your PC BIOS settings to enable or disable UEFI booting. The [[UEFI Install Guide]] has more information on this, and steps on how to determine if your system supports UEFI.<br />
<br />
We also offer a [[ZFS Install Guide]], which augment the instructions on this page for those who want to install Funtoo Linux on ZFS. If you are installing Funtoo Linux on [[Funtoo Linux Installation on ARM|ARM]] architecture, please see [[Funtoo Linux Installation on ARM]] for notable differences regarding ARM support. An experimental Funtoo Linux build also exists for [[Funtoo Linux Installation on SPARC|SPARC]] platforms. See [[Funtoo Linux Installation on SPARC]].<br />
<br />
If you've had previous experience installing Gentoo Linux then a lot of steps will be familiar, but you should still read through as there are a few differences.<br />
<br />
== Installation Overview ==<br />
<br />
This is a basic overview of the Funtoo installation process:<br />
<br />
# [[#Live CD|Download and boot the live CD of your choice]].<br />
# [[#Prepare Hard Disk|Prepare your disk]].<br />
# [[#Creating filesystems|Create]] and [[#Mounting filesystems|mount]] filesystems.<br />
# [[#Installing the Stage 3 tarball|Install the Funtoo stage tarball]] of your choice.<br />
# [[#Chroot into Funtoo|Chroot into your new system]].<br />
# [[#Downloading the Portage tree|Download the Portage tree]].<br />
# [[#Configuring your system|Configure your system]] and [[#Configuring your network|network]].<br />
# [[#Configuring and installing the Linux kernel|Install a kernel]].<br />
# [[#Installing a Bootloader|Install a bootloader]].<br />
# [[#Finishing Steps|Complete final steps]].<br />
# [[#Restart your system|Reboot and enjoy]].<br />
<br />
=== Live CD ===<br />
<br />
Funtoo doesn't provide an "official" Funtoo Live CD, but there are plenty of good ones out there to choose from. A great choice is the Gentoo-based [http://www.sysresccd.org/ System Rescue CD] as it contains lots of tools and utilities and supports both 32-bit and 64-bit systems.<br />
<br />
It is also possible to install Funtoo Linux using many other Linux-based live CDs. Generally, any modern bootable Linux live CD or live USB media will work. See [[Requirements|requirements]] for an overview of what the Live Media must provide to allow a problem-free install of Funtoo Linux.<br />
<br />
To begin a Funtoo Linux installation, download System Rescue CD from:<br />
<br />
* Main US mirror: [http://ftp.osuosl.org/pub/funtoo/distfiles/sysresccd/ The Oregon State University Open Source Lab]<br />
* Main EU mirror: [http://ftp.heanet.ie/mirrors/funtoo/distfiles/sysresccd/ HEAnet] or use your preferred live media. Insert it into your disc drive, and boot from it. If using an older version of System Rescue CD, '''be sure to select the <tt>rescue64</tt> kernel at the boot menu if you are installing a 64-bit system'''. By default, System Rescue CD used to boot in 32-bit mode though the latest version attempts to automatically detect 64-bit processors.<br />
<br />
=== Prepare Hard Disk ===<br />
==== Partitions ====<br />
<br />
Funtoo Linux fully supports traditional MBR partitions, as well as newer GPT/GUID partition formats. Funtoo Linux recommends the use of the GPT partitioning scheme, since it is newer and more flexible. Here are the various trade-offs between each partitioning scheme:<br />
<br />
===== GPT Partitions =====<br />
<br />
* Newer, preferred format for Linux systems<br />
* Supports 2 TB+ hard drives for booting<br />
* Supports hundreds of partitions per disk of any size<br />
* Requires legacy BIOS boot partition (~32 MB) to be created if system does not use EFI<br />
* Requires bootloader with support for GPT such as GRUB 2, EXTLINUX, or a patched version of GRUB Legacy<br />
<br />
===== MBR Partitions =====<br />
<br />
* Legacy, DOS partitioning scheme<br />
* Only 4 primary partitions per disk; after that, you must use "logical" partitions<br />
* Does not support 2 TB+ disks for booting<br />
* Compatible with certain problematic systems (such as the HP ProBook 4520)<br />
* Dual-boot with Windows for BIOS systems (Windows handle GPT only on true EFI systems, whatever version it is)<br />
* Multiple boot loader options, e.g. GRUB 2, GRUB Legacy, lilo<br />
<br />
{{fancyimportant|If you plan to use partitions of 2 TB or greater, you ''must'' partition using the GPT/GUID format. Also note that there are small percentage of PCs that will not boot properly with GPT. For these systems, using MBR partitions or a primary drive with an MBR partition may be required in order to boot.}}<br />
<br />
==== Partitioning Using gdisk ====<br />
<br />
===== Notes Before We Begin =====<br />
<br />
These install instructions assume you are installing Funtoo Linux to an empty hard disk using GUID partition tables (GPT). If you are installing Funtoo Linux on a machine where another OS is installed, or there is an existing Linux distribution on your system that you want to keep, then you will need to adapt these instructions to suit your needs.<br />
<br />
If you are going to create a legacy MBR partition table instead of GUID/GPT, you will use the <tt>fdisk</tt> command instead of <tt>gdisk</tt>, and you will not need to create the GRUB boot loader partition. See the table under [[#Partitioning Recommendations|Partitioning Recommendations]], in particular the <br />
'''MBR Block Device (<tt>fdisk</tt>)''' and '''MBR Code''' columns. <tt>fdisk</tt> works just like <tt>gdisk</tt>, but creates legacy MBR partition tables instead of the newer GPT/GUID partition tables.<br />
<br />
Advanced users may be interested in the following topics:<br />
<br />
* [[GUID Booting Guide]]<br />
* [[Rootfs over encrypted lvm]]<br />
* [[Rootfs over encrypted lvm over raid-1 on GPT]]<br />
* '''NEW!''' '''[[ZFS Install Guide]] (Also contains instructions for Rootfs over Encrypted ZFS!)'''<br />
<br />
===== Using gdisk =====<br />
<br />
The first step after booting SystemRescueCd is to use <tt>gdisk</tt> to create GPT (also known as GUID) partitions, specifying the disk you want to use, which is typically <tt>/dev/sda</tt>, the first disk in the system:<br />
<br />
<console># ##i##gdisk /dev/sda</console><br />
You should find <tt>gdisk</tt> very similar to <tt>fdisk</tt>. Here is the partition table we want to end up with:<br />
<br />
<console>Command (? for help): ##i##p<br />
Disk /dev/sda: 234441648 sectors, 111.8 GiB<br />
Logical sector size: 512 bytes<br />
Disk identifier (GUID): A4E5208A-CED3-4263-BB25-7147DC426931<br />
Partition table holds up to 128 entries<br />
First usable sector is 34, last usable sector is 234441614<br />
Partitions will be aligned on 2048-sector boundaries<br />
Total free space is 2014 sectors (1007.0 KiB)<br />
<br />
Number Start (sector) End (sector) Size Code Name<br />
1 2048 206847 500.0 MiB 8300 Linux filesystem<br />
2 206848 272383 32.0 MiB EF02 BIOS boot partition<br />
3 272384 8660991 4.0 GiB 8200 Linux swap<br />
4 8660992 234441614 107.7 GiB 8300 Linux filesystem<br />
<br />
Command (? for help): </console><br />
<br />
Above, you'll see that we have a 500 MiB boot partition, a 32 MiB "BIOS boot partition" (also known as the GRUB boot loader partition), 4 GiB of swap, and the remaining disk used by a 107.7 GiB root partition.<br />
<br />
===== For new <tt>gdisk</tt> users =====<br />
<br />
These partitions were created using the "<tt>n</tt>" command from within <tt>gdisk</tt>. The <tt>gdisk</tt> commands to create the partition table above are as follows. Adapt sizes as necessary, although these defaults will work for most users. The partition codes entered below can be found in the [[#Partitioning Recommendations|Partitioning Recommendations]] table below, in the GPT Code column.<br />
<br />
Within <tt>gdisk</tt>, follow these steps:<br />
<br />
'''Create a new empty partition table''' (This ''will'' erase all data on the disk when saved):<br />
<br />
<console><br />
Command: ##i##o ↵<br />
This option deletes all partitions and creates a new protective MBR.<br />
Proceed? (Y/N): ##i##y ↵<br />
</console><br />
<br />
'''Create Partition 1''' (boot):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##1 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+500M ↵<br />
Hex Code: ##i##↵<br />
</console><br />
<br />
'''Create Partition 2''' (GRUB):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##2 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+32M ↵<br />
Hex Code: ##i##EF02 ↵<br />
</console><br />
<br />
'''Create Partition 3''' (swap):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##3 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+4G ↵<br />
Hex Code: ##i##8200 ↵<br />
</console><br />
<br />
'''Create Partition 4''' (root):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##4 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##↵##!i## (for rest of disk)<br />
Hex Code: ##i##↵<br />
</console><br />
<br />
Along the way, you can type "<tt>p</tt>" and hit Enter to view your current partition table. If you make a mistake, you can type "<tt>d</tt>" to delete an existing partition that you created. When you are satisfied with your partition setup, type "<tt>w</tt>" to write your configuration to disk:<br />
<br />
'''Write Partition Table To Disk''':<br />
<br />
<console><br />
Command: ##i##w ↵<br />
Do you want to proceed? (Y/N): ##i##Y ↵<br />
</console><br />
<br />
The partition table will now be written to disk and <tt>gdisk</tt> will close.<br />
<br />
Now, your GPT/GUID partitions have been created, and will show up as the following ''block devices'' under Linux:<br />
<br />
* <tt>/dev/sda1</tt>, which will be used to hold the <tt>/boot</tt> filesystem, <br />
* <tt>/dev/sda2</tt>, which will be used directly by the new GRUB,<br />
* <tt>/dev/sda3</tt>, which will be used for swap space, and <br />
* <tt>/dev/sda4</tt>, which will hold your root filesystem.<br />
<br />
===== For Previous fdisk users =====<br />
<br />
If you have installed Gentoo Linux before, the one thing that is likely new to you here is the GRUB boot loader partition, which is listed as "BIOS boot partition" within <tt>gdisk</tt>. This partition is required for GRUB 2 to boot GPT/GUID boot disks. What is it? In GRUB-speak, this partition is essentially the location of the meat of GRUB's boot loading code. If you've used GRUB Legacy in the past, this partition is where the new GRUB stores the equivalent of the <tt>stage1_5</tt> and <tt>stage2</tt> files in legacy GRUB. Since GPT-based partition tables have less dead space at the beginning of the disk than their MBR equivalents, an explicitly defined partition of code <tt>EF02</tt> is required to hold the guts of the boot loader.<br />
<br />
In all other respects, the partition table is similar to that which you might create for an MBR-based disk during a Gentoo Linux installation. We have a boot and a root partition with code <tt>0700</tt>, and a Linux swap partition with code <tt>8200</tt>.<br />
<br />
===== Partitioning Recommendations =====<br />
<br />
Below are our partitioning recommendations in table form. For GPT-based partitions, use the GPT Block Device and GPT Code columns with <tt>gdisk</tt>. For legacy MBR-based partitions, use the MBR Block Device and MBR code columns with <tt>fdisk</tt>:<br />
<br />
{| {{table}} <br />
!Partition<br />
!Size<br />
!MBR Block Device (<tt>fdisk</tt>)<br />
!GPT Block Device (<tt>gdisk</tt>)<br />
!Filesystem<br />
!MBR Code<br />
!GPT Code<br />
|-<br />
|<tt>/boot</tt><br />
|500 MB<br />
|<tt>/dev/sda1</tt><br />
|<tt>/dev/sda1</tt><br />
|ext2<br />
|83<br />
|8300<br />
|-<br />
|GRUB boot loader partition<br />
|32 MB<br />
| ''not required for MBR''<br />
|<tt>/dev/sda2</tt><br />
|For GPT/GUID only, skip for MBR - no filesystem.<br />
|''N/A''<br />
|EF02<br />
|-<br />
|swap<br />
|2x RAM for low-memory systems and production servers; otherwise 2GB.<br />
|<tt>/dev/sda2</tt><br />
|<tt>/dev/sda3</tt><br />
|swap (default)<br />
|82<br />
|8200<br />
|-<br />
|<tt>/</tt> (root)<br />
|Rest of the disk, minimum of 10GB.<br />
|<tt>/dev/sda3</tt><br />
|<tt>/dev/sda4</tt><br />
|XFS recommended, alternatively ext4<br />
|83<br />
|8300<br />
|-<br />
|<tt>/home</tt> (optional) <br />
|User storage and media. Typically most of the disk.<br />
|<tt>/dev/sda4</tt> (if created)<br />
|<tt>/dev/sda5</tt> (if created)<br />
|XFS recommended, alternatively ext4<br />
|83<br />
|8300<br />
|-<br />
| LVM (optional)<br />
| If you want to create an LVM volume.<br />
| <tt>/dev/sda4</tt> (PV, if created)<br />
| <tt>/dev/sda5</tt> (PV, if created)<br />
| LVM PV<br />
| 8E<br />
| 8E00<br />
|}<br />
<br />
==== Creating filesystems ====<br />
<br />
Before your newly-created partitions can be used, the block devices need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.<br />
<br />
You will not create a filesystem on your swap partition, but will initialize it using the <tt>mkswap</tt> command so that it can be used as disk-based virtual memory. Then we'll run the <tt>swapon</tt> command to make your newly-initialized swap space active within the live CD environment, in case it is needed during the rest of the install process.<br />
<br />
Note that we will not create a filesystem on the GRUB boot loader partition, as GRUB writes binary data directly to that partition when the boot loader is installed, which we'll do later.<br />
<br />
You can see the commands you will need to type below. Like the rest of this document, it assumes that you are using a GPT partitioning scheme. If you are using MBR, your root filesystem will likely be created on <tt>/dev/sda3</tt> instead and you will need to adjust the target block devices. If you are following our recommendations, then simply do this:<br />
<br />
'''We generally recommend XFS for root filesystems, although ext4 is also a good choice.''' This tutorial assumes the use of XFS. If you want to use ext4, then be sure that your <tt>/etc/fstab</tt> file reflects this.<br />
<br />
{{fancywarning|1=<br />
Please use ext4 exclusively when deploying an OpenVZ host. The Parallels development team tests extensively with ext4, and modern versions of <tt>openvz-rhel6-stable</tt> are '''not''' compatible with XFS, and you may experience kernel bugs.<br />
}}<br />
<br />
'''To use XFS as your root filesystem:'''<br />
<br />
<console><br />
# ##i##mke2fs -t ext2 /dev/sda1 <br />
# ##i##mkfs.xfs /dev/sda4<br />
# ##i##mkswap /dev/sda3<br />
# ##i##swapon /dev/sda3<br />
</console><br />
<br />
'''To use ext4 as your root filesystem:'''<br />
<br />
<console><br />
# ##i##mke2fs -t ext2 /dev/sda1 <br />
# ##i##mkfs.ext4 /dev/sda4<br />
# ##i##mkswap /dev/sda3<br />
# ##i##swapon /dev/sda3<br />
</console><br />
<br />
==== Mounting filesystems ====<br />
<br />
Mount the newly-created filesystems as follows, creating <tt>/mnt/funtoo</tt> as the installation mount point:<br />
<br />
<console><br />
# ##i##mkdir /mnt/funtoo<br />
# ##i##mount /dev/sda4 /mnt/funtoo<br />
# ##i##mkdir /mnt/funtoo/boot<br />
# ##i##mount /dev/sda1 /mnt/funtoo/boot<br />
</console><br />
<br />
Optionally, if you have a separate filesystem for <tt>/home</tt> or anything else:<br />
<br />
<console><br />
# ##i##mkdir /mnt/funtoo/home<br />
# ##i##mount /dev/sda5 /mnt/funtoo/home<br />
</console><br />
<br />
If you have <tt>/tmp</tt> or <tt>/var/tmp</tt> on a separate filesystem, be sure to change the permissions of the mount point to be globally-writeable after mounting, as follows:<br />
<br />
<console><br />
# ##i##chmod 1777 /mnt/funtoo/tmp<br />
</console><br />
<br />
=== Installing the Stage 3 tarball ===<br />
After creating filesystems, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux. Load one of the following URLs in another browser window:<br />
* http://ftp.osuosl.org/pub/funtoo - main Funtoo Linux Mirror<br />
* http://ftp.heanet.ie/mirrors/funtoo -European Funtoo Linux mirror<br />
Now, let's navigate the directories on the mirrors to find the appropriate build of Funtoo Linux for you.<br />
<br />
==== Stable or Current? ====<br />
Funtoo Linux has a "stable" build and a "current" build. Most people use the "current" build of Funtoo Linux, and it's generally recommended that you do too. You will find "current' builds in the main <code>/funtoo-current</code> directory on our mirrors, and "stable" builds in <code>/funtoo-stable</code>.<br />
<br />
==== 32 or 64-bit? ====<br />
There are three different types of Funtoo Linux that you can install. If you are installing on an older 32-bit system (if you don't know, then you probably are not) then you want to grab a stage3 tarball from the <code>x86-32bit</code> sub-directory. Most likely, you'll want to grab a 64-bit build from the <code>x86-64bit</code> sub-directory.<br />
<br />
==== Your SubArch ====<br />
Inside <code>/funtoo-current/x86-64bit/</code> on one of our mirrors, you'll see a bunch of directories for various ''subarches'' of Funtoo Linux.<br />
<br />
Subarches are builds of Funtoo Linux that are designed to run on a particular type of CPU, to offer the best possible performance. They take advantage of the instruction sets available for each CPU. <br />
<br />
For example, the <code>corei7</code> and <code>corei7-pure64</code> sub-arches require an Intel Core i7 processor to run (this includes Xeon x3400+ series, or other Nehalem-based CPUs such as Xeon x5500/x5600 series.)<br />
<br />
If you are using an AMD-based CPU, download a stage3 from <code>generic_64</code>, <code>amd64-k8</code> or <code>amd64-k10</code>. <br />
<br />
If you are using an Intel-based CPU, download a stage3 from <code>generic_64</code>, <code>atom_64</code>, <code>core2_64</code> or <code>corei7</code>.<br />
<br />
===== Pure64 Builds =====<br />
Inside <code>x86-64bit</code>, you may notice a sub-directory named <code>pure64</code>. These builds are recommended for server systems, and they do not offer any 32-bit compatibility, which is generally not needed on server systems. If you are setting up a desktop or workstation system, it's recommended that you avoid these builds as you will need 32-bit compatibility to run several binary desktop-oriented applications such as Skype. But for servers, pure64 is recommended.<br />
<br />
==== Setting the Date ====<br />
<br />
{{fancyimportant|If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date.}}<br />
<br />
Now is a good time to verify the date and time are correctly set to UTC. Use the <tt>date</tt> command to verify the date and time:<br />
<br />
<console><br />
# ##i##date<br />
Fri Jul 15 19:47:18 UTC 2011<br />
</console><br />
<br />
If the date and/or time need to be corrected, do so using <tt>date MMDDhhmmYYYY</tt>, keeping in mind <tt>hhmm</tt> are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:<br />
<br />
<console><br />
# ##i##date 071620002011<br />
Fri Jul 16 20:00:00 UTC 2011<br />
</console><br />
<br />
==== Download the Stage3 ====<br />
Once you are in your Funtoo Linux root filesystem, use <tt>wget</tt> to download the Stage 3 tarball you have chosen to use as the basis for your new Funtoo Linux system. It should be saved to the <tt>/mnt/funtoo</tt> directory as follows:<br />
<br />
<console># ##i##cd /mnt/funtoo<br />
# ##i##wget http://ftp.osuosl.org/pub/funtoo/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz<br />
</console><br />
<br />
<br />
Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the <tt>generic_64</tt> or <tt>generic_32</tt> stage. Consult the [[Download]] page for more information.<br />
<br />
Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:<br />
<console><br />
# ##i##tar xpf stage3-latest.tar.xz<br />
</console><br />
<br />
{{fancyimportant|It is very important to use <tt>tar</tt>'s "<tt>p</tt>" option when extracting the Stage 3 tarball - it tells <tt>tar</tt> to ''preserve'' any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.}}<br />
<br />
=== Chroot into Funtoo ===<br />
Before chrooting into your new system, there's a few things that need to be done first. You will need to mount /proc and /dev inside your new system. Use the following commands:<br />
<console><br />
# ##i##cd /mnt/funtoo<br />
# ##i##mount -t proc none proc<br />
# ##i##mount --rbind /sys sys<br />
# ##i##mount --rbind /dev dev<br />
</console><br />
<br />
You'll also want to copy over <tt>resolv.conf</tt> in order to have proper DNS name resolution from inside the chroot:<br />
<console><br />
# ##i##cp /etc/resolv.conf etc<br />
</console><br />
<br />
Now you can chroot into your new system. Use <tt>env</tt> before <tt>chroot</tt> to ensure that no environment variables from the installation media are used by your new system:<br />
<br />
<console><br />
# ##i##env -i HOME=/root TERM=$TERM chroot . bash -l<br />
</console><br />
<br />
{{fancynote|Users of live CDs with 64-bit kernels: Some software may use <tt>uname -r</tt> to check whether the system is 32 or 64-bit. You may want append linux32 to the chroot command as a workaround, but it's generally not needed.}}<br />
{{fancyimportant|If you receive the error "<tt>chroot: failed to run command `/bin/bash': Exec format error</tt>", it is probably because you are running a 32-bit kernel and trying to execute 64-bit code. SystemRescueCd boots with a 32-bit kernel by default.}}<br />
<br />
It's also a good idea to change the default command prompt while inside the chroot. This will avoid confusion if you have to change terminals. Use this command:<br />
<console><br />
# ##i##export PS1="(chroot) $PS1"<br />
</console><br />
<br />
Congratulations! You are now chrooted inside a Funtoo Linux system. Now it's time to get Funtoo Linux properly configured so that Funtoo Linux will boot successfully when your system is restarted.<br />
<br />
=== Downloading the Portage tree ===<br />
<br />
{{fancynote|For an alternative way to do this, see [[Installing Portage From Snapshot]].}}<br />
Now it's time to install a copy of the Portage repository, which contains package scripts (ebuilds) that tell portage how to build and install thousands of different software packages. To create the Portage repository, simply run <tt>emerge --sync</tt> from within the chroot. This will automatically clone the portage tree from [http://github.com/ GitHub]:<br />
<br />
<console><br />
(chroot) # ##i##emerge --sync<br />
</console><br />
<br />
{{fancyimportant|If you receive the error with initial <tt>emerge --sync</tt> due to git protocol restrictions, change <tt>SYNC</tt> variable in <tt>/etc/make.conf</tt>}}<br />
<pre><br />
SYNC="https://github.com/funtoo/ports-2012.git"<br />
</pre><br />
<br />
=== Configuring your system ===<br />
As is expected from a Linux distribution, Funtoo Linux has its share of configuration files. The one file you are absolutely required to edit in order to ensure that Funtoo Linux boots successfully is <tt>/etc/fstab</tt>. The others are optional. Here are a list of files that you should consider editing:<br />
<br />
{| {{table}}<br />
!File<br />
!Do I need to change it?<br />
!Description<br />
|-<br />
|<tt>/etc/fstab</tt><br />
|'''YES - required'''<br />
|Mount points for all filesystems to be used at boot time. This file must reflect your disk partition setup. We'll guide you through modifying this file below.<br />
|-<br />
|<tt>/etc/localtime</tt><br />
|''Maybe - recommended''<br />
|Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal) <br />
|-<br />
|<tt>/etc/make.conf</tt> (symlink) - also known as:<br/><tt>/etc/portage/make.conf</tt><br />
|''Maybe - recommended''<br />
|Parameters used by gcc (compiler), portage, and make. It's a good idea to set MAKEOPTS. This is covered later in this document.<br />
|-<br />
|<tt>/etc/conf.d/hostname</tt><br />
|''Maybe - recommended''<br />
|Used to set system hostname. Set the <tt>hostname</tt> variable to the fully-qualified (with dots, ie. <tt>foo.funtoo.org</tt>) name if you have one. Otherwise, set to the local system hostname (without dots, ie. <tt>foo</tt>). Defaults to <tt>localhost</tt> if not set.<br />
|-<br />
|<tt>/etc/hosts</tt><br />
|''No''<br />
| You no longer need to manually set the hostname in this file. This file is automatically generated by <tt>/etc/init.d/hostname</tt>.<br />
|-<br />
|<tt>/etc/conf.d/keymaps</tt><br />
|Optional<br />
|Keyboard mapping configuration file (for console pseudo-terminals). Set if you have a non-US keyboard. See [[Funtoo Linux Localization]].<br />
|-<br />
|<tt>/etc/conf.d/hwclock</tt><br />
|Optional<br />
|How the time of the battery-backed hardware clock of the system is interpreted (UTC or local time). Linux uses the battery-backed hardware clock to initialize the system clock when the system is booted.<br />
|-<br />
|<tt>/etc/conf.d/modules</tt><br />
|Optional<br />
|Kernel modules to load automatically at system startup. Typically not required. See [[Additional Kernel Resources]] for more info.<br />
|-<br />
|<tt>profiles</tt><br />
|Optional<br />
|Some useful portage settings that may help speed up intial configuration.<br />
|}<br />
<br />
If you're installing an English version of Funtoo Linux, you're in luck as most of the configuration files can be used as-is. If you're installing for another locale, don't worry. We will walk you through the necessary configuration steps on the [[Funtoo Linux Localization]] page, and if needed, there's always plenty of friendly, helpful support. (See [[#Community portal|Community]])<br />
<br />
Let's go ahead and see what we have to do. Use <tt>nano -w <name_of_file></tt> to edit files -- the "<tt>-w</tt>" disables word-wrapping, which is handy when editing configuration files. You can copy and paste from the examples.<br />
<br />
{{fancywarning|It's important to edit your <tt>/etc/fstab</tt> file before you reboot! You will need to modify both the "fs" and "type" columns to match the settings for your partitions and filesystems that you created with <tt>gdisk</tt> or <tt>fdisk</tt>. Skipping this step may prevent Funtoo Linux from booting successfully.}}<br />
<br />
==== /etc/fstab ====<br />
<br />
<tt>/etc/fstab</tt> is used by the <tt>mount</tt> command which is ran when your system boots. Statements of this file inform <tt>mount</tt> about partitions to be mounted and how they are mounted. In order for the system to boot properly, you must edit <tt>/etc/fstab</tt> and ensure that it reflects the partition configuration you used earlier:<br />
<br />
<console><br />
(chroot) # ##i##nano -w /etc/fstab<br />
</console><br />
<br />
You can use arrow keys to move around and hit Control-X to exit. If you want to save your changes, type "<tt>Y</tt>" when asked if you want to save the modified buffer, or hit Control-O before closing <tt>nano</tt>. Otherwise your changes will be discarded.<br />
<br />
<pre><br />
# The root filesystem should have a pass number of either 0 or 1.<br />
# All other filesystems should have a pass number of 0 or greater than 1.<br />
#<br />
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.<br />
#<br />
# See the manpage fstab(5) for more information.<br />
#<br />
# <fs> <mountpoint> <type> <opts> <dump/pass><br />
<br />
/dev/sda1 /boot ext2 noatime 1 2<br />
/dev/sda3 none swap sw 0 0<br />
/dev/sda4 / ext4 noatime 0 1<br />
#/dev/cdrom /mnt/cdrom auto noauto,ro 0 0<br />
</pre><br />
<br />
==== /etc/localtime ====<br />
<br />
<tt>/etc/localtime</tt> is used to specify the timezone that your machine is in, and defaults to UTC. If you would like your Funtoo Linux system to use local time, you should replace <tt>/etc/localtime</tt> with a symbolic link to the timezone that you wish to use. <br />
<br />
<console><br />
(chroot) # ##i##ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime<br />
</console><br />
<br />
The above sets the timezone to Mountain Standard Time (with daylight savings). Type <tt>ls /usr/share/zoneinfo</tt> to see what timezones are available. There are also sub-directories containing timezones described by location.<br />
<br />
==== /etc/make.conf ====<br />
<br />
MAKEOPTS can be used to define how many parallel compilations should occur when you compile a package, which can speed up compilation significantly. A rule of thumb is the number of CPUs (or CPU threads) in your system plus one. If for example you have a dual core processor without [[wikipedia:Hyper-threading|hyper-threading]], then you would set MAKEOPTS to 3:<br />
<br />
<pre><br />
MAKEOPTS="-j3" <br />
</pre><br />
<br />
If you are unsure about how many processors/threads you have then use /proc/cpuinfo to help you.<br />
<console><br />
(chroot) # ##i##grep "processor" /proc/cpuinfo | wc -l<br />
16<br />
</console><br />
<br />
Set MAKEOPTS to this number plus one:<br />
<br />
<pre><br />
MAKEOPTS="-j17"<br />
</pre><br />
<br />
USE flags define what functionality is enabled when packages are built. It is not recommended to add a lot of them during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("<tt>-</tt>") sign tells Portage not to use the flag when compiling. A Funtoo guide to USE flags will be available in the future. For now, you can find out more information about USE flags in the [http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=2&chap=2 Gentoo Handbook].<br />
<br />
LINGUAS tells Portage which local language to compile the system and applications in (those who use LINGUAS variable like OpenOffice). It is not usually necessary to set this if you use English. If you want another language such as French (fr) or German (de), set LINGUAS appropriately:<br />
<br />
<pre><br />
LINGUAS="fr"<br />
</pre><br />
<br />
==== /etc/conf.d/hwclock ====<br />
If you dual-boot with Windows, you'll need to edit this file and change '''clock''' to '''local''', because Windows will set your hardware clock to local time every time you boot Windows. Otherwise you normally wouldn't need to edit this file.<br />
<console><br />
(chroot) # ##i##nano -w /etc/conf.d/hwclock<br />
</console><br />
<br />
==== Localization ====<br />
<br />
By default, Funtoo Linux is configured with Unicode (UTF-8) enabled, and for the US English locale and keyboard. If you would like to configure your system to use a non-English locale or keyboard, see [[Funtoo Linux Localization]].<br />
<br />
==== Profiles ====<br />
<br />
[[Funtoo 1.0 Profile|Funtoo profiles]] are used to define defaults for Portage specific to your needs. There are 4 basic profile types: arch, build, [[Flavors and Mix-ins|flavor, and mix-ins]]:<br />
<br />
;arch: typically <tt>x86-32bit</tt> or <tt>x86-64bit</tt>, this defines the processor type and support of your system. This is defined when your stage was built and should not be changed.<br />
;build: defines whether your system is a <tt>current</tt>, <tt>stable</tt> or <tt>experimental</tt> build. <tt>current</tt> systems will have newer packages unmasked than <tt>stable</tt> systems.<br />
;flavor: defines the general type of system, such as <tt>server</tt> or <tt>desktop</tt>, and will set default USE flags appropriate for your needs.<br />
;mix-ins: define various optional settings that you may be interested in enabling.<br />
<br />
One arch, build and flavor must be set for each Funtoo Linux system, while mix-ins are optional and you can enable more than one if desired.<br />
<br />
Remember that profiles can often be inherited. For example, the <tt>desktop</tt> flavor inherits the <tt>workstation</tt> flavor settings, which in turn inherits the <tt>X</tt> and <tt>audio</tt> mix-ins. You can view this by using eselect:<br />
<br />
<console><br />
(chroot) # ##i##eselect profile show<br />
Currently set profiles:<br />
arch: gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit<br />
build: gentoo:funtoo/1.0/linux-gnu/build/current<br />
flavor: gentoo:funtoo/1.0/linux-gnu/flavor/desktop<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/kde<br />
<br />
Automatically enabled profiles:<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/print<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/X<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/audio<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/dvd<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/media<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/console-extras<br />
<br />
<br />
</console><br />
<br />
To view installed profiles:<br />
<console><br />
(chroot) # ##i##eselect profile list<br />
</console><br />
<br />
To change the profile flavor:<br />
<console><br />
(chroot) # ##i##eselect profile set-flavor 7<br />
</console><br />
<br />
To add a mix-in:<br />
<br />
<console><br />
(chroot) # ##i##eselect profile add 10<br />
</console><br />
<br />
=== Configuring and installing the Linux kernel ===<br />
<br />
Now it's time to build and install a Linux kernel, which is the heart of any Funtoo Linux system. The kernel is loaded by the boot loader, and interfaces directly with your system's hardware, and allows regular (userspace) programs to run.<br />
<br />
A kernel must be configured properly for your system's hardware, so that it supports your hard drives, file systems, network cards, and so on. More experienced Linux users can choose to install kernel sources and configure and install their own kernel. If you don't know how to do this, we provide ebuilds that will automatically build a "univeral" kernel, modules and initramfs for booting your system that supports all hardware. This is an extremely simple way of building a kernel that will get your system booted.<br />
<br />
What is our goal? To build a kernel that will recognize all the hardware in your system necessary for booting, so that you will be greeted by a friendly login prompt after installation is complete. These instructions will guide you through the process of installing a kernel the "easy" way -- without requiring user configuration, by using a "universal" kernel.<br />
<br />
==== Package Sets ====<br />
<br />
Before we install a kernel, we're going to cover something about Portage, the Funtoo Linux package manager which will help us in our kernel installation efforts. Portage has a command called <tt>emerge</tt> which is used to build and install packages from source, and it takes care of installing all of the package's dependencies. You call emerge like this:<br />
<br />
<console><br />
(chroot) # ##i##emerge packagename<br />
</console><br />
<br />
All of the package's dependencies will be built from source, and installed, as well as the package itself.<br />
<br />
When you install a package by specifying its name on the command-line, Portage records its name in the <tt>/var/lib/portage/world</tt> file. It does this because it figures that because you've installed it by name, you want to consider it part of your system, and will want to keep the package updated in the future. This is a handy feature -- when packages are added to the ''world set'', we can update our entire system by typing:<br />
<br />
<console><br />
(chroot) # ##i##emerge --sync<br />
(chroot) # ##i##emerge -auDN @world<br />
</console><br />
<br />
This is the "official" way to update your Funtoo Linux system. Above, we first update our Portage tree using git to grab the latest ebuilds (scripts), and then run an emerge command to update the "world" set of packages. The options specified tell <tt>emerge</tt> to:<br />
<br />
* '''<tt>a</tt>''' - show us what will be emerged, and '''ask''' us if we want to proceed<br />
* '''<tt>u</tt>''' - ''update'' the packages we specify -- don't emerge them again if they are already emerged.<br />
* '''<tt>D</tt>''' - Consider the entire dependency tree of packages when looking for updates. In other words, do a '''deep''' update.<br />
* '''<tt>N</tt>''' - Update any packages who have changed ('''new''') USE settings.<br />
<br />
While this is a handy feature, most people don't want to be forced to update their kernel whenever they update all their system's packages. So we're going to create a new package set, called <tt>kernel</tt>, which contains our Linux kernel. When we want to update it, we'll type:<br />
<br />
<console><br />
(chroot) # ##i##emerge -u @kernel<br />
</console><br />
<br />
When we just want to update our system's packages, we'll type <tt>emerge -auDN @world</tt>, and it will update our world set, leaving out the kernel. Let's look at how to do this:<br />
<br />
==== Kernel Package Set ====<br />
<br />
To create the kernel package set, perform the following steps:<br />
<br />
<console><br />
(chroot) # ##i##mkdir /etc/portage/sets<br />
(chroot) # ##i##echo sys-kernel/debian-sources > /etc/portage/sets/kernel<br />
</console><br />
<br />
Now, we'll want to set a USE variable to tell <tt>debian-sources</tt> to build a "universal" kernel and initramfs for us, to take the guess-work out of getting Funtoo Linux booted. To do this, we're going to set the <tt>binary</tt> USE variable for <tt>debian-sources</tt>, as follows:<br />
<br />
<console><br />
(chroot) # ##i##echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use<br />
</console><br />
<br />
{{Fancynote|1=<br />
See [[Funtoo Linux Kernels]] for a full list of kernels supported in Funtoo Linux. We recommend <tt>debian-sources</tt> for new users.}}<br />
<br />
If USE variables are new to you, you'll be getting a lot more familiar with them as you use Funtoo Linux. At their essence, they are "switches" that you can set to configure options that can be built in to various packages. They're used to customize your Funtoo Linux system to meet your exact needs. We added support for a <tt>binary</tt> USE flag to the <tt>debian-sources</tt> ebuilds, as well as a few other of our kernel ebuilds, to make it easier for new users to get Funtoo Linux up and running.<br />
<br />
==== Building the Kernel ====<br />
<br />
Now, let's emerge our kernel:<br />
<br />
<console><br />
(chroot) # ##i##emerge @kernel<br />
</console><br />
<br />
Note that while use of the <tt>binary</tt> USE flag makes installing a working kernel extremely simple, it is one part of Funtoo Linux that takes a ''very'' long time to build from source, because it is building a kernel that supports ''all'' hardware that Linux supports! So, get the build started, and then let your machine compile. Slower machines can take up to several hours to build the kernel, and you'll want to make sure that you've set <tt>MAKEOPTS</tt> in <tt>/etc/make.conf</tt> to the number of processing cores/threads (plus one) in your system before starting to build it as quickly as possible -- see the [[#/etc/make.conf|/etc/make.conf section]] if you forgot to do this.<br />
<br />
{{fancyimportant|1=<br />
<tt>debian-sources</tt> with <tt>binary</tt> USE flag requires at least 12GB free in <tt>/var/tmp</tt>.}}<br />
<br />
{{fancynote|NVIDIA card users: the <tt>binary</tt> USE flag installs the Nouveau drivers which cannot be loaded at the same time as the proprietary drivers, and cannot be unloaded at runtime because of KMS. You need to blacklist it under <tt>/etc/modprobe.d/</tt>.}}<br />
<br />
{{fancynote|For an overview of other kernel options for Funtoo Linux, see [[Funtoo Linux Kernels]]. There may be modules that the Debian kernel doesn't include, a situation where [http://www.funtoo.org/wiki/Funtoo_Linux_Kernels#Using_Debian-Sources_with_Genkernel genkernel] would be useful. Also be sure to see [[:Category:Hardware Compatibility|hardware compatibility]] information.}}<br />
<br />
Once <tt>emerge</tt> completes, you'll have a brand new kernel and initramfs installed to <tt>/boot</tt>, plus kernel headers installed in <tt>/usr/src/linux</tt>, and you'll be ready to configure the boot loader to load these to boot your Funtoo Linux system.<br />
<br />
=== Installing a Bootloader ===<br />
<br />
==== Installing Grub ====<br />
<br />
The boot loader is responsible for loading the kernel from disk when your computer boots. For new installations, GRUB 2 and Funtoo's boot-update tool should be used as a boot loader. GRUB supports both GPT/GUID and legacy MBR partitioning schemes.<br />
<br />
To use this recommended boot method, first emerge <tt>boot-update</tt>. This will also cause <tt>grub-2</tt> to be merged, since it is a dependency of <tt>boot-update</tt>.<br />
<br />
<console><br />
(chroot) # ##i##emerge boot-update<br />
</console><br />
<br />
Then, edit <tt>/etc/boot.conf</tt> and specify "<tt>Funtoo Linux genkernel</tt>" as the <tt>default</tt> setting at the top of the file, replacing <tt>"Funtoo Linux"</tt>. <br />
<br />
<tt>/etc/boot.conf</tt> should now look like this:<br />
<br />
<pre><br />
boot {<br />
generate grub<br />
default "Funtoo Linux genkernel"<br />
timeout 3 <br />
}<br />
<br />
"Funtoo Linux" {<br />
kernel bzImage[-v]<br />
# params += nomodeset<br />
}<br />
<br />
"Funtoo Linux genkernel" {<br />
# if you use bliss-kernel package<br />
# you should change string<br />
# kernel kernel[-v]<br />
# to<br />
# kernel kernel/[-v]/kernel[-v]<br />
kernel kernel[-v]<br />
initrd initramfs[-v]<br />
params += real_root=auto <br />
# params += nomodeset<br />
} <br />
</pre><br />
<br />
If you use bliss-kernel, your <tt>/etc/boot.conf</tt> should look like:<br />
<br />
<pre><br />
boot {<br />
generate grub<br />
default "Funtoo Linux genkernel"<br />
timeout 3 <br />
}<br />
<br />
"Funtoo Linux" {<br />
kernel bzImage[-v]<br />
# params += nomodeset<br />
}<br />
<br />
"Funtoo Linux genkernel" {<br />
kernel kernels/[-v]/kernel[-v]<br />
initrd initramfs[-v]<br />
params += real_root=auto <br />
# params += nomodeset<br />
} <br />
</pre><br />
<br />
Please read <tt>man boot.conf</tt> for further details.<br />
<br />
===== Running grub-install and boot-update =====<br />
<br />
Finally, we will need to actually install the GRUB boot loader to your disk, and also run <tt>boot-update</tt> which will generate your boot loader configuration file:<br />
<br />
<console><br />
(chroot) # ##i##grub-install --no-floppy /dev/sda<br />
(chroot) # ##i##boot-update<br />
</console><br />
<br />
You only need to run <tt>grub-install</tt> when you first install Funtoo Linux, but you need to re-run <tt>boot-update</tt> every time you modify your <tt>/etc/boot.conf</tt> file, so your changes are applied on next boot.<br />
<br />
OK - your system should be ready to boot! Well, there are a few more loose ends...<br />
<br />
==== Installing Syslinux/Extlinux ====<br />
<br />
An alternate boot loader called extlinux can be used instead of GRUB if you desire. See the [[Extlinux|extlinux Guide]] for information on how to do this.<br />
<br />
=== Configuring your network ===<br />
<br />
It's important to ensure that you will be able to connect to your local-area network after you reboot into Funtoo Linux. There are three approaches you can use for configuring your network: NetworkManager, dhcpcd, and the [[Funtoo Linux Networking]] scripts. Here's how to choose which one to use based on the type of network you want to set up.<br />
<br />
==== Wi-Fi ====<br />
===== Using NetworkManager =====<br />
For laptop/mobile systems where you will be using Wi-Fi and connecting to various networks, NetworkManager is strongly recommended. The Funtoo version of NetworkManager is fully functional even from the command-line, so you can use it even without X or without the Network Manager applet. Here are the steps involved in setting up NetworkManager:<br />
<br />
<console><br />
# ##i##emerge linux-firmware<br />
# ##i##emerge networkmanager<br />
# ##i##rc-update add NetworkManager default<br />
</console><br />
<br />
Above, we installed linux-firmware which contains a complete collection of available firmware for many hardware devices including Wi-Fi adapters, plus NetworkManager to manage our network connection. Then we added NetworkManager to the <tt>default</tt> runlevel so it will start when Funtoo Linux boots.<br />
<br />
After you reboot into Funtoo Linux, you will be able to add a Wi-Fi connection this way:<br />
<br />
<console><br />
# ##i##addwifi -S wpa -K 'wifipassword' mywifinetwork<br />
</console><br />
<br />
The <tt>addwifi</tt> command is used to configure and connect to a WPA/WPA2 Wi-Fi network named <tt>mywifinetwork</tt> with the password <tt>wifipassword</tt>. This network configuration entry is stored in <tt>/etc/NetworkManager/system-connections</tt> so that it will be remembered in the future. You should only need to enter this command once for each Wi-Fi network you connect to.<br />
<br />
===== Using wpa_supplicant =====<br />
If for some reasons, you don't want to use a tool such as NetworkManager or wicd, you can edit the wpa_supplicant configuration file, located at /etc/wpa_supplicant.conf.<br />
The syntax is very easy :<br />
<pre><br />
network={<br />
ssid="MyWifiName"<br />
psk="lol42-wifi"<br />
}<br />
<br />
network={<br />
ssid="Other Network"<br />
psk="6d96270004515a0486bb7f76196a72b40c55a47f"<br />
}<br />
</pre><br />
You can now start wpa_supplicant with<br />
<console><br />
# ##i##wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf<br />
</console><br />
wpa_supplicant will automatically connect to the first avaible network.<br />
You can of course set an alias for the command :<br />
<console><br />
# ##i## echo "wifi='wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf'" >> ~/.${SHELL}rc<br />
</console><br />
Of course, this will only connect you to the network. For an IP address, unless it's configured in /etc/network/interfaces, you will have to run<br />
<console><br />
# ##i##wifi & dhcpcd wlan0 # Assuming this is your wireless interface.<br />
</console><br />
This will run our alias, which will go in the background, and run the DHCP client on the specified interface.<br />
<br />
==== Desktop (Wired Ethernet) ====<br />
<br />
For a home desktop or workstation with wired Ethernet that will use DHCP, the simplest and most effective option to enable network connectivity is to simply add <tt>dhcpcd</tt> to the default runlevel:<br />
<br />
<console><br />
# ##i##rc-update add dhcpcd default<br />
</console><br />
<br />
When you reboot, <tt>dhcpcd</tt> will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.<br />
<br />
==== Server (Static IP) ====<br />
<br />
For servers, the [[Funtoo Linux Networking]] scripts are recommended. They are optimized for static configurations and things like virtual ethernet bridging for virtualization setups. See [[Funtoo Linux Networking]] for information on how to use Funtoo Linux's template-based network configuration system.<br />
<br />
=== Finishing Steps ===<br />
<br />
==== Set your root password ====<br />
It's imperative that you set your root password before rebooting so that you can log in.<br />
<console><br />
(chroot) # ##i##passwd<br />
</console><br />
<br />
===Restart your system ===<br />
<br />
Now is the time to leave chroot, to unmount Funtoo Linux partitions and files and to restart your computer. When you restart, the GRUB boot loader will start, load the Linux kernel and initramfs, and your system will begin booting.<br />
<br />
Leave the chroot, change directory to /mnt, unmount your Funtoo partitions, and reboot.<br />
<console><br />
(chroot) # ##i##exit<br />
# ##i##cd /mnt<br />
# ##i##umount -l funtoo<br />
# ##i##reboot<br />
</console><br />
<br />
You should now see your system reboot, the GRUB boot loader appear for a few seconds, and then see the Linux kernel and initramfs loading. After this, you should see Funtoo Linux itself start to boot, and you should be greeted with a <tt>login:</tt> prompt. Funtoo Linux has been successfully installed!<br />
<br />
===Next Steps===<br />
<br />
If you are brand new to Funtoo Linux and Gentoo Linux, please check out [[Funtoo Linux First Steps]], which will help get you acquainted with your new system. We also have a category for our [[:Category:Official Documentation|official documentation]], which includes all docs that we officially maintain for installation and operation of Funtoo Linux.<br />
<br />
We also have a number of pages dedicated to setting up your system, which you can find below. If you are interested in adding a page to this list, add it to the "First Steps" MediaWiki category.<br />
<br />
{{#ask: [[Category:First Steps]] | format=category }}<br />
<br />
If your system did not boot correctly, see [[Installation Troubleshooting]] for steps you can take to resolve the problem.<br />
<br />
[[Category:HOWTO]]<br />
[[Category:Install]]<br />
[[Category:Official Documentation]]</div>Edelwinhttps://www.funtoo.org/index.php?title=Package:Vim&diff=4335Package:Vim2014-06-20T08:34:50Z<p>Edelwin: s/do/d0/</p>
<hr />
<div>==More on Vim==<br />
<br />
So you thought you could get by with gedit? Not when you must configure an application on your server in a data center two states away! When it comes to remote system administration, all roads lead back to Vim. Not a Vim expert? No problem, you just need a handful of commands to do everything you need to do.<br />
<br />
Entire books have been written about Vim, and they still fail to capture all of its functionality. But the core command set is all you really need if you're just making a few changes to a few files over SSH. You might not do it as efficiently as a Vim expert, but it's good enough to get the job done. In fact, if you're working with Vim (the pre-eminent vi-clone) on a server, there's a good chance it's "vim-tiny," a stripped-down Vim that offers the traditional vi functionality but not the full set of Vim features.<br />
<br />
==Insert Mode==<br />
The first thing you must grok is that Vim has several modes -- command mode, insert mode, and last-line mode (also known as ex mode). When you start Vim, you'll be in command mode. Here, all of the keys are used to perform commands, not input text. To switch to input mode, hit <span style="color:green">i</span>, and you're able start editing the file, adding text, using Backspace, etc.<br />
To return to command mode, hit <span style="color:green">Esc</span>. To enter last-line or Ex mode, use :, and then input the command you wish to enter.<br />
<br />
==Vim Command Mode==<br />
I could go on for days about the commands needed in command mode, but we're just here for the basics, so let's look at movement. Movement is based on the standard alphabetic keys:<br />
<br />
* '''h''' Move the cursor to the left one character.<br />
* '''l''' Move the cursor to the right one character.<br />
* '''j''' Move the cursor down one line.<br />
* '''k''' Move the cursor up one line.<br />
<br />
You can move faster by using <span style="color:green">b</span> and <span style="color:green">w</span> to move backward and forward by one "word" at a time, respectively. Vim looks at "words" as a string of alphanumeric characters. So "eix" is a word, but "eix-sync" is multi-word because it's broken up by a non-alphanumeric character.<br />
<br />
Deleting is done with <span style="color:green">d</span> or <span style="color:green">x</span>. To delete a single character, move the cursor over that character and use <span style="color:green">x</span>. Using <span style="color:green">dw</span> will delete the word the cursor is over, and <span style="color:green">db</span> will delete the previous word.<br />
<br />
To delete an entire line, use <span style="color:green">dd</span>. To delete from the cursor to the end of the line, use <span style="color:green">d$</span>. To delete from the cursor to the beginning of the line, use <span style="color:green">d0</span>. The $ is shorthand for "end of the line," and 0 is shorthand for beginning of the line. You can also use ^.<br />
<br />
==Copying and Pasting in Vim==<br />
Let's look at copying and pasting real quick. To highlight text to copy, use the <span style="color:green">v</span>, <span style="color:green">V</span> and <span style="color:green">Ctrl-V</span> commands. You might have guessed by now that Vim commands are case-sensitive, So v and V are different things.<br />
<br />
The <span style="color:green">v</span> command simply allows you to highlight changes character by character using the movement (hljk and others) or arrow keys. The <span style="color:green">v</span> command highlights entire lines. And the <span style="color:green">Ctrl-v</span> command highlights blocks of text -- very useful for highlighting and copying columns of text.<br />
<br />
Once you've highlighted the text you want to copy, hit <span style="color:green">y</span> to "yank" the text into the buffer.<br />
<br />
To paste the text, use <span style="color:green">p</span> or <span style="color:green">P</span> to paste. The p command will paste after the cursor, and P pastes before the cursor.<br />
==Search and Replace==<br />
To search through the document, use the / key to initiate a forward search, or ? to initiate a backward search.<br />
<br />
To search and replace, use <span style="color:green">:s</span> with the range of lines and search terms. Like so:<br />
<pre><br />
:%s/old/new/<br />
</pre><br />
<br />
The % means "global," but you can replace that with a range of lines, like this:<br />
<br />
<pre><br />
:1,15s/old/new/<br />
</pre><br />
Another example of search/replace functions<br />
<pre>Command Outcome<br />
:s/xxx/yyy/ Replace xxx with yyy at the first occurence<br />
:s/xxx/yyy/g Replace xxx with yyy first occurrence, global (whole sentence)<br />
:s/xxx/yyy/gc Replace xxx with yyy global with confirm<br />
:%s/xxx/yyy/g Replace xxx with yyy global in the whole file</pre><br />
<br />
I prefer to use the <span style="color:green">c</span> (confirm) and <span style="color:green">g</span> (global) options too, so when searching it will search the entire line and not just the first occurrence of a string.<br />
<br />
A usual search would look something like :%s/old/new/gc, and when you hit Enter you'll be prompted before you make changes. I recommend using confirm; otherwise you can wind up with unexpected results.<br />
<br />
==Undo==<br />
What if you've made an edit you didn't want to make? Easy, use the undo <span style="color:green">u</span> command. If you didn't mean to undo what you did -- and it's easy to accidentally hit u -- use <span style="color:green">Ctrl-r</span> to redo the last change.<br />
Quick note: If Vim is in vi-compatibility mode, it will have only one "level" of undo. In normal Vim mode, you can undo many, many changes. But vi undoes only the most recent change.<br />
<br />
==Saving, Quitting and More ...==<br />
One of the things that's severely non-obvious while working with Vim the first time is how do I get the heck out of here? You can quit Vim in a number of ways, but I'll show the most usual ones.<br />
<br />
First, if you want to save your changes before exiting Vim, use <span style="color:green">:w</span> or save and exit in one action with <span style="color:green">:wq</span>.<br />
Don't want to save your changes? It happens. No problem, just use <span style="color:green">:q!</span> if you realize that you've made some edits that you don't want to save, and they are too complex to easily undo before exiting. Note that you can also write changes to a different filename by using :w newfile.<br />
<br />
This is just a short and sweet intro to Vim for emergencies or minimal usage. You could do much, much more with Vim if you wanted. Be sure to read through the Vim tutorial by running vimtutor, and look through Vim's documentation by running :help. But in a pinch, this list of commands should get you through</div>Edelwinhttps://www.funtoo.org/index.php?title=Funtoo_Linux_Installation&diff=4086Funtoo Linux Installation2014-06-12T18:37:22Z<p>Edelwin: /* Using wpa_supplicant */</p>
<hr />
<div>== Introduction == <br />
<br />
This document was written to help you install Funtoo Linux as concisely as possible, with a minimum number of distracting options regarding system configuration. <br />
<br />
These docs assume you have a "PC compatible" computer system with a standard PC BIOS. Many new computers support UEFI for booting, which is a new firmware interface that frequently replaces the older MBR-based BIOS. If you have a system with UEFI, you will want to use this documentation along with the [[UEFI Install Guide]], which will augment these instructions and explain how to get your system to boot. You may need to change your PC BIOS settings to enable or disable UEFI booting. The [[UEFI Install Guide]] has more information on this, and steps on how to determine if your system supports UEFI.<br />
<br />
We also offer a [[ZFS Install Guide]], which augment the instructions on this page for those who want to install Funtoo Linux on ZFS. If you are installing Funtoo Linux on [[Funtoo Linux Installation on ARM|ARM]] architecture, please see [[Funtoo Linux Installation on ARM]] for notable differences regarding ARM support. An experimental Funtoo Linux build also exists for [[Funtoo Linux Installation on SPARC|SPARC]] platforms. See [[Funtoo Linux Installation on SPARC]].<br />
<br />
If you've had previous experience installing Gentoo Linux then a lot of steps will be familiar, but you should still read through as there are a few differences.<br />
<br />
== Installation Overview ==<br />
<br />
This is a basic overview of the Funtoo installation process:<br />
<br />
# [[#Live CD|Download and boot the live CD of your choice]].<br />
# [[#Prepare Hard Disk|Prepare your disk]].<br />
# [[#Creating filesystems|Create]] and [[#Mounting filesystems|mount]] filesystems.<br />
# [[#Installing the Stage 3 tarball|Install the Funtoo stage tarball]] of your choice.<br />
# [[#Chroot into Funtoo|Chroot into your new system]].<br />
# [[#Downloading the Portage tree|Download the Portage tree]].<br />
# [[#Configuring your system|Configure your system]] and [[#Configuring your network|network]].<br />
# [[#Configuring and installing the Linux kernel|Install a kernel]].<br />
# [[#Installing a Bootloader|Install a bootloader]].<br />
# [[#Finishing Steps|Complete final steps]].<br />
# [[#Restart your system|Reboot and enjoy]].<br />
<br />
=== Live CD ===<br />
<br />
Funtoo doesn't provide an "official" Funtoo Live CD, but there are plenty of good ones out there to choose from. A great choice is the Gentoo-based [http://www.sysresccd.org/ System Rescue CD] as it contains lots of tools and utilities and supports both 32-bit and 64-bit systems.<br />
<br />
It is also possible to install Funtoo Linux using many other Linux-based live CDs. Generally, any modern bootable Linux live CD or live USB media will work. See [[Requirements|requirements]] for an overview of what the Live Media must provide to allow a problem-free install of Funtoo Linux.<br />
<br />
To begin a Funtoo Linux installation, download System Rescue CD from:<br />
<br />
* Main US mirror: [http://ftp.osuosl.org/pub/funtoo/distfiles/sysresccd/ The Oregon State University Open Source Lab]<br />
* Main EU mirror: [http://ftp.heanet.ie/mirrors/funtoo/distfiles/sysresccd/ HEAnet] or use your preferred live media. Insert it into your disc drive, and boot from it. If using an older version of System Rescue CD, '''be sure to select the <tt>rescue64</tt> kernel at the boot menu if you are installing a 64-bit system'''. By default, System Rescue CD used to boot in 32-bit mode though the latest version attempts to automatically detect 64-bit processors.<br />
<br />
=== Prepare Hard Disk ===<br />
==== Partitions ====<br />
<br />
Funtoo Linux fully supports traditional MBR partitions, as well as newer GPT/GUID partition formats. Funtoo Linux recommends the use of the GPT partitioning scheme, since it is newer and more flexible. Here are the various trade-offs between each partitioning scheme:<br />
<br />
===== GPT Partitions =====<br />
<br />
* Newer, preferred format for Linux systems<br />
* Supports 2 TB+ hard drives for booting<br />
* Supports hundreds of partitions per disk of any size<br />
* Requires legacy BIOS boot partition (~32 MB) to be created if system does not use EFI<br />
* Requires bootloader with support for GPT such as GRUB 2, EXTLINUX, or a patched version of GRUB Legacy<br />
<br />
===== MBR Partitions =====<br />
<br />
* Legacy, DOS partitioning scheme<br />
* Only 4 primary partitions per disk; after that, you must use "logical" partitions<br />
* Does not support 2 TB+ disks for booting<br />
* Compatible with certain problematic systems (such as the HP ProBook 4520)<br />
* Dual-boot with Windows for BIOS systems (Windows handle GPT only on true EFI systems, whatever version it is)<br />
* Multiple boot loader options, e.g. GRUB 2, GRUB Legacy, lilo<br />
<br />
{{fancyimportant|If you plan to use partitions of 2 TB or greater, you ''must'' partition using the GPT/GUID format. Also note that there are small percentage of PCs that will not boot properly with GPT. For these systems, using MBR partitions or a primary drive with an MBR partition may be required in order to boot.}}<br />
<br />
==== Partitioning Using gdisk ====<br />
<br />
===== Notes Before We Begin =====<br />
<br />
These install instructions assume you are installing Funtoo Linux to an empty hard disk using GUID partition tables (GPT). If you are installing Funtoo Linux on a machine where another OS is installed, or there is an existing Linux distribution on your system that you want to keep, then you will need to adapt these instructions to suit your needs.<br />
<br />
If you are going to create a legacy MBR partition table instead of GUID/GPT, you will use the <tt>fdisk</tt> command instead of <tt>gdisk</tt>, and you will not need to create the GRUB boot loader partition. See the table under [[#Partitioning Recommendations|Partitioning Recommendations]], in particular the <br />
'''MBR Block Device (<tt>fdisk</tt>)''' and '''MBR Code''' columns. <tt>fdisk</tt> works just like <tt>gdisk</tt>, but creates legacy MBR partition tables instead of the newer GPT/GUID partition tables.<br />
<br />
Advanced users may be interested in the following topics:<br />
<br />
* [[GUID Booting Guide]]<br />
* [[Rootfs over encrypted lvm]]<br />
* [[Rootfs over encrypted lvm over raid-1 on GPT]]<br />
* '''NEW!''' '''[[ZFS Install Guide]] (Also contains instructions for Rootfs over Encrypted ZFS!)'''<br />
<br />
===== Using gdisk =====<br />
<br />
The first step after booting SystemRescueCd is to use <tt>gdisk</tt> to create GPT (also known as GUID) partitions, specifying the disk you want to use, which is typically <tt>/dev/sda</tt>, the first disk in the system:<br />
<br />
<console># ##i##gdisk /dev/sda</console><br />
You should find <tt>gdisk</tt> very similar to <tt>fdisk</tt>. Here is the partition table we want to end up with:<br />
<br />
<console>Command (? for help): ##i##p<br />
Disk /dev/sda: 234441648 sectors, 111.8 GiB<br />
Logical sector size: 512 bytes<br />
Disk identifier (GUID): A4E5208A-CED3-4263-BB25-7147DC426931<br />
Partition table holds up to 128 entries<br />
First usable sector is 34, last usable sector is 234441614<br />
Partitions will be aligned on 2048-sector boundaries<br />
Total free space is 2014 sectors (1007.0 KiB)<br />
<br />
Number Start (sector) End (sector) Size Code Name<br />
1 2048 206847 500.0 MiB 8300 Linux filesystem<br />
2 206848 272383 32.0 MiB EF02 BIOS boot partition<br />
3 272384 8660991 4.0 GiB 8200 Linux swap<br />
4 8660992 234441614 107.7 GiB 8300 Linux filesystem<br />
<br />
Command (? for help): </console><br />
<br />
Above, you'll see that we have a 500 MiB boot partition, a 32 MiB "BIOS boot partition" (also known as the GRUB boot loader partition), 4 GiB of swap, and the remaining disk used by a 107.7 GiB root partition.<br />
<br />
===== For new <tt>gdisk</tt> users =====<br />
<br />
These partitions were created using the "<tt>n</tt>" command from within <tt>gdisk</tt>. The <tt>gdisk</tt> commands to create the partition table above are as follows. Adapt sizes as necessary, although these defaults will work for most users. The partition codes entered below can be found in the [[#Partitioning Recommendations|Partitioning Recommendations]] table below, in the GPT Code column.<br />
<br />
Within <tt>gdisk</tt>, follow these steps:<br />
<br />
'''Create a new empty partition table''' (This ''will'' erase all data on the disk when saved):<br />
<br />
<console><br />
Command: ##i##o ↵<br />
This option deletes all partitions and creates a new protective MBR.<br />
Proceed? (Y/N): ##i##y ↵<br />
</console><br />
<br />
'''Create Partition 1''' (boot):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##1 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+500M ↵<br />
Hex Code: ##i##↵<br />
</console><br />
<br />
'''Create Partition 2''' (GRUB):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##2 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+32M ↵<br />
Hex Code: ##i##EF02 ↵<br />
</console><br />
<br />
'''Create Partition 3''' (swap):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##3 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+4G ↵<br />
Hex Code: ##i##8200 ↵<br />
</console><br />
<br />
'''Create Partition 4''' (root):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##4 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##↵##!i## (for rest of disk)<br />
Hex Code: ##i##↵<br />
</console><br />
<br />
Along the way, you can type "<tt>p</tt>" and hit Enter to view your current partition table. If you make a mistake, you can type "<tt>d</tt>" to delete an existing partition that you created. When you are satisfied with your partition setup, type "<tt>w</tt>" to write your configuration to disk:<br />
<br />
'''Write Partition Table To Disk''':<br />
<br />
<console><br />
Command: ##i##w ↵<br />
Do you want to proceed? (Y/N): ##i##Y ↵<br />
</console><br />
<br />
The partition table will now be written to disk and <tt>gdisk</tt> will close.<br />
<br />
Now, your GPT/GUID partitions have been created, and will show up as the following ''block devices'' under Linux:<br />
<br />
* <tt>/dev/sda1</tt>, which will be used to hold the <tt>/boot</tt> filesystem, <br />
* <tt>/dev/sda2</tt>, which will be used directly by the new GRUB,<br />
* <tt>/dev/sda3</tt>, which will be used for swap space, and <br />
* <tt>/dev/sda4</tt>, which will hold your root filesystem.<br />
<br />
===== For Previous fdisk users =====<br />
<br />
If you have installed Gentoo Linux before, the one thing that is likely new to you here is the GRUB boot loader partition, which is listed as "BIOS boot partition" within <tt>gdisk</tt>. This partition is required for GRUB 2 to boot GPT/GUID boot disks. What is it? In GRUB-speak, this partition is essentially the location of the meat of GRUB's boot loading code. If you've used GRUB Legacy in the past, this partition is where the new GRUB stores the equivalent of the <tt>stage1_5</tt> and <tt>stage2</tt> files in legacy GRUB. Since GPT-based partition tables have less dead space at the beginning of the disk than their MBR equivalents, an explicitly defined partition of code <tt>EF02</tt> is required to hold the guts of the boot loader.<br />
<br />
In all other respects, the partition table is similar to that which you might create for an MBR-based disk during a Gentoo Linux installation. We have a boot and a root partition with code <tt>0700</tt>, and a Linux swap partition with code <tt>8200</tt>.<br />
<br />
===== Partitioning Recommendations =====<br />
<br />
Below are our partitioning recommendations in table form. For GPT-based partitions, use the GPT Block Device and GPT Code columns with <tt>gdisk</tt>. For legacy MBR-based partitions, use the MBR Block Device and MBR code columns with <tt>fdisk</tt>:<br />
<br />
{| {{table}} <br />
!Partition<br />
!Size<br />
!MBR Block Device (<tt>fdisk</tt>)<br />
!GPT Block Device (<tt>gdisk</tt>)<br />
!Filesystem<br />
!MBR Code<br />
!GPT Code<br />
|-<br />
|<tt>/boot</tt><br />
|500 MB<br />
|<tt>/dev/sda1</tt><br />
|<tt>/dev/sda1</tt><br />
|ext2<br />
|83<br />
|8300<br />
|-<br />
|GRUB boot loader partition<br />
|32 MB<br />
| ''not required for MBR''<br />
|<tt>/dev/sda2</tt><br />
|For GPT/GUID only, skip for MBR - no filesystem.<br />
|''N/A''<br />
|EF02<br />
|-<br />
|swap<br />
|2x RAM for low-memory systems and production servers; otherwise 2GB.<br />
|<tt>/dev/sda2</tt><br />
|<tt>/dev/sda3</tt><br />
|swap (default)<br />
|82<br />
|8200<br />
|-<br />
|<tt>/</tt> (root)<br />
|Rest of the disk, minimum of 10GB.<br />
|<tt>/dev/sda3</tt><br />
|<tt>/dev/sda4</tt><br />
|XFS recommended, alternatively ext4<br />
|83<br />
|8300<br />
|-<br />
|<tt>/home</tt> (optional) <br />
|User storage and media. Typically most of the disk.<br />
|<tt>/dev/sda4</tt> (if created)<br />
|<tt>/dev/sda5</tt> (if created)<br />
|XFS recommended, alternatively ext4<br />
|83<br />
|8300<br />
|-<br />
| LVM (optional)<br />
| If you want to create an LVM volume.<br />
| <tt>/dev/sda4</tt> (PV, if created)<br />
| <tt>/dev/sda5</tt> (PV, if created)<br />
| LVM PV<br />
| 8E<br />
| 8E00<br />
|}<br />
<br />
==== Creating filesystems ====<br />
<br />
Before your newly-created partitions can be used, the block devices need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.<br />
<br />
You will not create a filesystem on your swap partition, but will initialize it using the <tt>mkswap</tt> command so that it can be used as disk-based virtual memory. Then we'll run the <tt>swapon</tt> command to make your newly-initialized swap space active within the live CD environment, in case it is needed during the rest of the install process.<br />
<br />
Note that we will not create a filesystem on the GRUB boot loader partition, as GRUB writes binary data directly to that partition when the boot loader is installed, which we'll do later.<br />
<br />
You can see the commands you will need to type below. Like the rest of this document, it assumes that you are using a GPT partitioning scheme. If you are using MBR, your root filesystem will likely be created on <tt>/dev/sda3</tt> instead and you will need to adjust the target block devices. If you are following our recommendations, then simply do this:<br />
<br />
'''We generally recommend XFS for root filesystems, although ext4 is also a good choice.''' This tutorial assumes the use of XFS. If you want to use ext4, then be sure that your <tt>/etc/fstab</tt> file reflects this.<br />
<br />
{{fancywarning|1=<br />
Please use ext4 exclusively when deploying an OpenVZ host. The Parallels development team tests extensively with ext4, and modern versions of <tt>openvz-rhel6-stable</tt> are '''not''' compatible with XFS, and you may experience kernel bugs.<br />
}}<br />
<br />
'''To use XFS as your root filesystem:'''<br />
<br />
<console><br />
# ##i##mke2fs -t ext2 /dev/sda1 <br />
# ##i##mkfs.xfs /dev/sda4<br />
# ##i##mkswap /dev/sda3<br />
# ##i##swapon /dev/sda3<br />
</console><br />
<br />
'''To use ext4 as your root filesystem:'''<br />
<br />
<console><br />
# ##i##mke2fs -t ext2 /dev/sda1 <br />
# ##i##mkfs.ext4 /dev/sda4<br />
# ##i##mkswap /dev/sda3<br />
# ##i##swapon /dev/sda3<br />
</console><br />
<br />
==== Mounting filesystems ====<br />
<br />
Mount the newly-created filesystems as follows, creating <tt>/mnt/funtoo</tt> as the installation mount point:<br />
<br />
<console><br />
# ##i##mkdir /mnt/funtoo<br />
# ##i##mount /dev/sda4 /mnt/funtoo<br />
# ##i##mkdir /mnt/funtoo/boot<br />
# ##i##mount /dev/sda1 /mnt/funtoo/boot<br />
</console><br />
<br />
Optionally, if you have a separate filesystem for <tt>/home</tt> or anything else:<br />
<br />
<console><br />
# ##i##mkdir /mnt/funtoo/home<br />
# ##i##mount /dev/sda5 /mnt/funtoo/home<br />
</console><br />
<br />
If you have <tt>/tmp</tt> or <tt>/var/tmp</tt> on a separate filesystem, be sure to change the permissions of the mount point to be globally-writeable after mounting, as follows:<br />
<br />
<console><br />
# ##i##chmod 1777 /mnt/funtoo/tmp<br />
</console><br />
<br />
=== Installing the Stage 3 tarball ===<br />
==== Stage 3 tarball ====<br />
<br />
After creating filesystems, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux. Visit the [[Download]] page and copy the URL to the Stage 3 tarball you want to use. We will download it soon.<br />
<br />
{{fancyimportant|If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date.}}<br />
<br />
Now is a good time to verify the date and time are correctly set to UTC. Use the <tt>date</tt> command to verify the date and time:<br />
<br />
<console><br />
# ##i##date<br />
Fri Jul 15 19:47:18 UTC 2011<br />
</console><br />
<br />
If the date and/or time need to be corrected, do so using <tt>date MMDDhhmmYYYY</tt>, keeping in mind <tt>hhmm</tt> are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:<br />
<br />
<console><br />
# ##i##date 071620002011<br />
Fri Jul 16 20:00:00 UTC 2011<br />
</console><br />
<br />
Once you are in your Funtoo Linux root filesystem, use <tt>wget</tt> to download the Stage 3 tarball you have chosen from the [[Download]] page to use as the basis for your new Funtoo Linux system. It should be saved to the <tt>/mnt/funtoo</tt> directory as follows:<br />
<br />
<console># ##i##cd /mnt/funtoo<br />
# ##i##wget http://ftp.osuosl.org/pub/funtoo/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz<br />
</console><br />
<br />
<br />
Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the <tt>generic_64</tt> or <tt>generic_32</tt> stage. Consult the [[Download]] page for more information.<br />
<br />
Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:<br />
<console><br />
# ##i##tar xpf stage3-latest.tar.xz<br />
</console><br />
<br />
{{fancyimportant|It is very important to use <tt>tar</tt>'s "<tt>p</tt>" option when extracting the Stage 3 tarball - it tells <tt>tar</tt> to ''preserve'' any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.}}<br />
<br />
=== Chroot into Funtoo ===<br />
Before chrooting into your new system, there's a few things that need to be done first. You will need to mount /proc and /dev inside your new system. Use the following commands:<br />
<console><br />
# ##i##cd /mnt/funtoo<br />
# ##i##mount -t proc none proc<br />
# ##i##mount --rbind /sys sys<br />
# ##i##mount --rbind /dev dev<br />
</console><br />
<br />
You'll also want to copy over <tt>resolv.conf</tt> in order to have proper DNS name resolution from inside the chroot:<br />
<console><br />
# ##i##cp /etc/resolv.conf etc<br />
</console><br />
<br />
Now you can chroot into your new system. Use <tt>env</tt> before <tt>chroot</tt> to ensure that no environment variables from the installation media are used by your new system:<br />
<br />
<console><br />
# ##i##env -i HOME=/root TERM=$TERM chroot . bash -l<br />
</console><br />
<br />
{{fancynote|Users of live CDs with 64-bit kernels: Some software may use <tt>uname -r</tt> to check whether the system is 32 or 64-bit. You may want append linux32 to the chroot command as a workaround, but it's generally not needed.}}<br />
{{fancyimportant|If you receive the error "<tt>chroot: failed to run command `/bin/bash': Exec format error</tt>", it is probably because you are running a 32-bit kernel and trying to execute 64-bit code. SystemRescueCd boots with a 32-bit kernel by default.}}<br />
<br />
It's also a good idea to change the default command prompt while inside the chroot. This will avoid confusion if you have to change terminals. Use this command:<br />
<console><br />
# ##i##export PS1="(chroot) $PS1"<br />
</console><br />
<br />
Congratulations! You are now chrooted inside a Funtoo Linux system. Now it's time to get Funtoo Linux properly configured so that Funtoo Linux will boot successfully when your system is restarted.<br />
<br />
=== Downloading the Portage tree ===<br />
<br />
{{fancynote|For an alternative way to do this, see [[Installing Portage From Snapshot]].}}<br />
Now it's time to install a copy of the Portage repository, which contains package scripts (ebuilds) that tell portage how to build and install thousands of different software packages. To create the Portage repository, simply run <tt>emerge --sync</tt> from within the chroot. This will automatically clone the portage tree from [http://github.com/ GitHub]:<br />
<br />
<console><br />
(chroot) # ##i##emerge --sync<br />
</console><br />
<br />
{{fancyimportant|If you receive the error with initial <tt>emerge --sync</tt> due to git protocol restrictions, change <tt>SYNC</tt> variable in <tt>/etc/portage/make.conf</tt>}}<br />
<pre><br />
SYNC="https://github.com/funtoo/ports-2012.git"<br />
</pre><br />
<br />
<br />
=== Configuring your system ===<br />
As is expected from a Linux distribution, Funtoo Linux has its share of configuration files. The one file you are absolutely required to edit in order to ensure that Funtoo Linux boots successfully is <tt>/etc/fstab</tt>. The others are optional. Here are a list of files that you should consider editing:<br />
<br />
{| {{table}}<br />
!File<br />
!Do I need to change it?<br />
!Description<br />
|-<br />
|<tt>/etc/fstab</tt><br />
|'''YES - required'''<br />
|Mount points for all filesystems to be used at boot time. This file must reflect your disk partition setup. We'll guide you through modifying this file below.<br />
|-<br />
|<tt>/etc/localtime</tt><br />
|''Maybe - recommended''<br />
|Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal) <br />
|-<br />
|<tt>/etc/make.conf<br/>/etc/portage/make.conf&nbsp;(new&nbsp;location)</tt><br />
|''Maybe - recommended''<br />
|Parameters used by gcc (compiler), portage, and make. It's a good idea to set MAKEOPTS. This is covered later in this document.<br />
|-<br />
|<tt>/etc/conf.d/hostname</tt><br />
|''Maybe - recommended''<br />
|Used to set system hostname. Set to the fully-qualified (with dots) name. Defaults to <tt>localhost</tt> if not set.<br />
|-<br />
|<tt>/etc/hosts</tt><br />
|''No''<br />
| You no longer need to manually set the hostname in this file. This file is automatically generated by <tt>/etc/init.d/hostname</tt>.<br />
|-<br />
|<tt>/etc/conf.d/keymaps</tt><br />
|Optional<br />
|Keyboard mapping configuration file (for console pseudo-terminals). Set if you have a non-US keyboard. See [[Funtoo Linux Localization]].<br />
|-<br />
|<tt>/etc/conf.d/hwclock</tt><br />
|Optional<br />
|How the time of the battery-backed hardware clock of the system is interpreted (UTC or local time). Linux uses the battery-backed hardware clock to initialize the system clock when the system is booted.<br />
|-<br />
|<tt>/etc/conf.d/modules</tt><br />
|Optional<br />
|Kernel modules to load automatically at system startup. Typically not required. See [[Additional Kernel Resources]] for more info.<br />
|-<br />
|<tt>profiles</tt><br />
|Optional<br />
|Some useful portage settings that may help speed up intial configuration.<br />
|}<br />
<br />
If you're installing an English version of Funtoo Linux, you're in luck as most of the configuration files can be used as-is. If you're installing for another locale, don't worry. We will walk you through the necessary configuration steps on the [[Funtoo Linux Localization]] page, and if needed, there's always plenty of friendly, helpful support. (See [[#Community portal|Community]])<br />
<br />
Let's go ahead and see what we have to do. Use <tt>nano -w <name_of_file></tt> to edit files -- the "<tt>-w</tt>" disables word-wrapping, which is handy when editing configuration files. You can copy and paste from the examples.<br />
<br />
{{fancywarning|It's important to edit your <tt>/etc/fstab</tt> file before you reboot! You will need to modify both the "fs" and "type" columns to match the settings for your partitions and filesystems that you created with <tt>gdisk</tt> or <tt>fdisk</tt>. Skipping this step may prevent Funtoo Linux from booting successfully.}}<br />
<br />
==== /etc/fstab ====<br />
<br />
<tt>/etc/fstab</tt> is used by the <tt>mount</tt> command which is ran when your system boots. Statements of this file inform <tt>mount</tt> about partitions to be mounted and how they are mounted. In order for the system to boot properly, you must edit <tt>/etc/fstab</tt> and ensure that it reflects the partition configuration you used earlier:<br />
<br />
<console><br />
(chroot) # ##i##nano -w /etc/fstab<br />
</console><br />
<br />
You can use arrow keys to move around and hit Control-X to exit. If you want to save your changes, type "<tt>Y</tt>" when asked if you want to save the modified buffer, or hit Control-O before closing <tt>nano</tt>. Otherwise your changes will be discarded.<br />
<br />
<pre><br />
# The root filesystem should have a pass number of either 0 or 1.<br />
# All other filesystems should have a pass number of 0 or greater than 1.<br />
#<br />
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.<br />
#<br />
# See the manpage fstab(5) for more information.<br />
#<br />
# <fs> <mountpoint> <type> <opts> <dump/pass><br />
<br />
/dev/sda1 /boot ext2 noatime 1 2<br />
/dev/sda3 none swap sw 0 0<br />
/dev/sda4 / ext4 noatime 0 1<br />
#/dev/cdrom /mnt/cdrom auto noauto,ro 0 0<br />
</pre><br />
<br />
==== /etc/localtime ====<br />
<br />
<tt>/etc/localtime</tt> is used to specify the timezone that your machine is in, and defaults to UTC. If you would like your Funtoo Linux system to use local time, you should replace <tt>/etc/localtime</tt> with a symbolic link to the timezone that you wish to use. <br />
<br />
<console><br />
(chroot) # ##i##ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime<br />
</console><br />
<br />
The above sets the timezone to Mountain Standard Time (with daylight savings). Type <tt>ls /usr/share/zoneinfo</tt> to see what timezones are available. There are also sub-directories containing timezones described by location.<br />
<br />
==== /etc/make.conf ====<br />
<br />
{{fancynote|This file is the symlink to /etc/portage/make.conf, new default location, edit /etc/portage/make.conf.}}<br />
<br />
MAKEOPTS can be used to define how many parallel compilations should occur when you compile a package, which can speed up compilation significantly. A rule of thumb is the number of CPUs (or CPU threads) in your system plus one. If for example you have a dual core processor without [[wikipedia:Hyper-threading|hyper-threading]], then you would set MAKEOPTS to 3:<br />
<br />
<pre><br />
MAKEOPTS="-j3" <br />
</pre><br />
<br />
If you are unsure about how many processors/threads you have then use /proc/cpuinfo to help you.<br />
<console><br />
(chroot) # ##i##grep "processor" /proc/cpuinfo | wc -l<br />
16<br />
</console><br />
<br />
Set MAKEOPTS to this number plus one:<br />
<br />
<pre><br />
MAKEOPTS="-j17"<br />
</pre><br />
<br />
USE flags define what functionality is enabled when packages are built. It is not recommended to add a lot of them during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("<tt>-</tt>") sign tells Portage not to use the flag when compiling. A Funtoo guide to USE flags will be available in the future. For now, you can find out more information about USE flags in the [http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=2&chap=2 Gentoo Handbook].<br />
<br />
LINGUAS tells Portage which local language to compile the system and applications in (those who use LINGUAS variable like OpenOffice). It is not usually necessary to set this if you use English. If you want another language such as French (fr) or German (de), set LINGUAS appropriately:<br />
<br />
<pre><br />
LINGUAS="fr"<br />
</pre><br />
<br />
==== /etc/conf.d/hwclock ====<br />
If you dual-boot with Windows, you'll need to edit this file and change '''clock''' to '''local''', because Windows will set your hardware clock to local time every time you boot Windows. Otherwise you normally wouldn't need to edit this file.<br />
<console><br />
(chroot) # ##i##nano -w /etc/conf.d/hwclock<br />
</console><br />
<br />
==== Localization ====<br />
<br />
By default, Funtoo Linux is configured with Unicode (UTF-8) enabled, and for the US English locale and keyboard. If you would like to configure your system to use a non-English locale or keyboard, see [[Funtoo Linux Localization]].<br />
<br />
==== Profiles ====<br />
<br />
[[Funtoo 1.0 Profile|Funtoo profiles]] are used to define defaults for Portage specific to your needs. There are 4 basic profile types: arch, build, [[Flavors and Mix-ins|flavor, and mix-ins]]:<br />
<br />
;arch: typically <tt>x86-32bit</tt> or <tt>x86-64bit</tt>, this defines the processor type and support of your system. This is defined when your stage was built and should not be changed.<br />
;build: defines whether your system is a <tt>current</tt>, <tt>stable</tt> or <tt>experimental</tt> build. <tt>current</tt> systems will have newer packages unmasked than <tt>stable</tt> systems.<br />
;flavor: defines the general type of system, such as <tt>server</tt> or <tt>desktop</tt>, and will set default USE flags appropriate for your needs.<br />
;mix-ins: define various optional settings that you may be interested in enabling.<br />
<br />
One arch, build and flavor must be set for each Funtoo Linux system, while mix-ins are optional and you can enable more than one if desired.<br />
<br />
Remember that profiles can often be inherited. For example, the <tt>desktop</tt> flavor inherits the <tt>workstation</tt> flavor settings, which in turn inherits the <tt>X</tt> and <tt>audio</tt> mix-ins. You can view this by using eselect:<br />
<br />
<console><br />
(chroot) # ##i##eselect profile show<br />
Currently set profiles:<br />
arch: gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit<br />
build: gentoo:funtoo/1.0/linux-gnu/build/current<br />
flavor: gentoo:funtoo/1.0/linux-gnu/flavor/desktop<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/kde<br />
<br />
Automatically enabled profiles:<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/print<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/X<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/audio<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/dvd<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/media<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/console-extras<br />
<br />
<br />
</console><br />
<br />
To view installed profiles:<br />
<console><br />
(chroot) # ##i##eselect profile list<br />
</console><br />
<br />
To change the profile flavor:<br />
<console><br />
(chroot) # ##i##eselect profile set-flavor 7<br />
</console><br />
<br />
To add a mix-in:<br />
<br />
<console><br />
(chroot) # ##i##eselect profile add 10<br />
</console><br />
<br />
=== Configuring and installing the Linux kernel ===<br />
<br />
Now it's time to build and install a Linux kernel, which is the heart of any Funtoo Linux system. In the past, the process of creating a kernel that actually booted your system could be time-consuming and require a great deal of trial and error. Fortunately, Funtoo Linux offers an option to automatically build a kernel for you that will boot nearly all systems.<br />
<br />
If you are unfamiliar with how to manually configure your own kernel, or you simply want to get your system up and running quickly, you can emerge <tt>debian-sources</tt> with the <tt>binary</tt> USE flag set, which will automatically build the kernel and an initrd that will boot nearly all Funtoo Linux systems. This kernel is based on a linux-3.2 LTS official debian kernel package and is an easy way to get your system up and running relatively quickly.<br />
<br />
Click [http://wiki.debian.org/DebianKernel here] for a list of all architectures the Debian kernel supports. <br />
<br />
{{fancyimportant|<tt>debian-sources</tt> with <tt>binary</tt> USE flag requires at least 12GB in /var/tmp}}<br />
<br />
<console><br />
(chroot) # ##i##echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use<br />
(chroot) # ##i##emerge debian-sources</console><br />
<br />
All done!<br />
<br />
{{fancynote|NVIDIA card users: the <tt>binary</tt> USE flag installs the Nouveau drivers which cannot be loaded at the same time as the proprietary drivers, and cannot be unloaded at runtime because of KMS. You need to blacklist it under <tt>/etc/modprobe.d/</tt>.}}<br />
{{fancynote|For an overview of other kernel options for Funtoo Linux, see [[Funtoo Linux Kernels]]. There maybe modules that the Debian kernel doesn't include, a situation where [http://www.funtoo.org/wiki/Funtoo_Linux_Kernels#Using_Debian-Sources_with_Genkernel genkernel] would be useful. Also be sure to see [[:Category:Hardware Compatibility|hardware compatibility]] information. We have compiled a very good reference for [[Dell PowerEdge 11G Servers]] that includes kernel compatibility information as well..}}<br />
<br />
<br />
The next step is to configure your boot loader so that your new kernel loads when the system boots.<br />
<br />
=== Installing a Bootloader ===<br />
<br />
==== Installing Grub ====<br />
<br />
The boot loader is responsible for loading the kernel from disk when your computer boots. For new installations, GRUB 2 and Funtoo's boot-update tool should be used as a boot loader. GRUB supports both GPT/GUID and legacy MBR partitioning schemes.<br />
<br />
To use this recommended boot method, first emerge <tt>boot-update</tt>. This will also cause <tt>grub-2</tt> to be merged, since it is a dependency of <tt>boot-update</tt>.<br />
<br />
<console><br />
(chroot) # ##i##emerge boot-update<br />
</console><br />
<br />
Then, edit <tt>/etc/boot.conf</tt> and specify "<tt>Funtoo Linux genkernel</tt>" as the <tt>default</tt> setting at the top of the file, replacing <tt>"Funtoo Linux"</tt>. <br />
<br />
<tt>/etc/boot.conf</tt> should now look like this:<br />
<br />
<pre><br />
boot {<br />
generate grub<br />
default "Funtoo Linux genkernel"<br />
timeout 3 <br />
}<br />
<br />
"Funtoo Linux" {<br />
kernel bzImage[-v]<br />
# params += nomodeset<br />
}<br />
<br />
"Funtoo Linux genkernel" {<br />
# if you use bliss-kernel package<br />
# you should change string<br />
# kernel kernel[-v]<br />
# to<br />
# kernel kernel/[-v]/kernel[-v]<br />
kernel kernel[-v]<br />
initrd initramfs[-v]<br />
params += real_root=auto <br />
# params += nomodeset<br />
} <br />
</pre><br />
<br />
If you use bliss-kernel, your <tt>/etc/boot.conf</tt> should look like:<br />
<br />
<pre><br />
boot {<br />
generate grub<br />
default "Funtoo Linux genkernel"<br />
timeout 3 <br />
}<br />
<br />
"Funtoo Linux" {<br />
kernel bzImage[-v]<br />
# params += nomodeset<br />
}<br />
<br />
"Funtoo Linux genkernel" {<br />
kernel kernels/[-v]/kernel[-v]<br />
initrd initramfs[-v]<br />
params += real_root=auto <br />
# params += nomodeset<br />
} <br />
</pre><br />
<br />
Please read <tt>man boot.conf</tt> for further details.<br />
<br />
===== Running grub-install and boot-update =====<br />
<br />
Finally, we will need to actually install the GRUB boot loader to your disk, and also run <tt>boot-update</tt> which will generate your boot loader configuration file:<br />
<br />
<console><br />
(chroot) # ##i##grub-install --no-floppy /dev/sda<br />
(chroot) # ##i##boot-update<br />
</console><br />
<br />
You only need to run <tt>grub-install</tt> when you first install Funtoo Linux, but you need to re-run <tt>boot-update</tt> every time you modify your <tt>/etc/boot.conf</tt> file, so your changes are applied on next boot.<br />
<br />
OK - your system should be ready to boot! Well, there are a few more loose ends...<br />
<br />
==== Installing Syslinux/Extlinux ====<br />
<br />
An alternate boot loader called extlinux can be used instead of GRUB if you desire. See the [[Extlinux|extlinux Guide]] for information on how to do this.<br />
<br />
=== Configuring your network ===<br />
<br />
It's important to ensure that you will be able to connect to your local-area network after you reboot into Funtoo Linux. There are three approaches you can use for configuring your network: NetworkManager, dhcpcd, and the [[Funtoo Linux Networking]] scripts. Here's how to choose which one to use based on the type of network you want to set up.<br />
<br />
==== Wi-Fi ====<br />
===== Using NetworkManager =====<br />
For laptop/mobile systems where you will be using Wi-Fi and connecting to various networks, NetworkManager is strongly recommended. The Funtoo version of NetworkManager is fully functional even from the command-line, so you can use it even without X or without the Network Manager applet. Here are the steps involved in setting up NetworkManager:<br />
<br />
<console><br />
# ##i##emerge linux-firmware<br />
# ##i##emerge networkmanager<br />
# ##i##rc-update add NetworkManager default<br />
</console><br />
<br />
Above, we installed linux-firmware which contains a complete collection of available firmware for many hardware devices including Wi-Fi adapters, plus NetworkManager to manage our network connection. Then we added NetworkManager to the <tt>default</tt> runlevel so it will start when Funtoo Linux boots.<br />
<br />
After you reboot into Funtoo Linux, you will be able to add a Wi-Fi connection this way:<br />
<br />
<console><br />
# ##i##addwifi -S wpa -K 'wifipassword' mywifinetwork<br />
</console><br />
<br />
The <tt>addwifi</tt> command is used to configure and connect to a WPA/WPA2 Wi-Fi network named <tt>mywifinetwork</tt> with the password <tt>wifipassword</tt>. This network configuration entry is stored in <tt>/etc/NetworkManager/system-connections</tt> so that it will be remembered in the future. You should only need to enter this command once for each Wi-Fi network you connect to.<br />
<br />
===== Using wpa_supplicant =====<br />
If for some reasons, you don't want to use a tool such as NetworkManager of wicd, you can edit the wpa_supplicant configuration file, located at /etc/wpa_supplicant.conf.<br />
The syntax is very easy :<br />
<pre><br />
network={<br />
ssid="MyWifiName"<br />
psk="lol42-wifi"<br />
}<br />
<br />
network={<br />
ssid="Other Network"<br />
psk="6d96270004515a0486bb7f76196a72b40c55a47f"<br />
}<br />
</pre><br />
You can now start wpa_supplicant with<br />
<console><br />
# ##i##wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf<br />
</console><br />
wpa_supplicant will automatically connect to the first avaible network.<br />
You can of course set an alias for the command :<br />
<console><br />
# ##i## echo "wifi='wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf'" >> ~/.${SHELL}rc<br />
</console><br />
Of course, this will only connect you to the network. For an IP adress, unless it's configured in /etc/network/interfaces, you will have to run<br />
<console><br />
# ##i##wifi & dhcpcd wlan0 # Assuming this is your wireless interface.<br />
</console><br />
This will run our alias, which will go in the background, and run the DHCP client on the specified interface.<br />
<br />
==== Desktop (Wired Ethernet) ====<br />
<br />
For a home desktop or workstation with wired Ethernet that will use DHCP, the simplest and most effective option to enable network connectivity is to simply add <tt>dhcpcd</tt> to the default runlevel:<br />
<br />
<console><br />
# ##i##rc-update add dhcpcd default<br />
</console><br />
<br />
When you reboot, <tt>dhcpcd</tt> will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.<br />
<br />
==== Server (Static IP) ====<br />
<br />
For servers, the [[Funtoo Linux Networking]] scripts are recommended. They are optimized for static configurations and things like virtual ethernet bridging for virtualization setups. See [[Funtoo Linux Networking]] for information on how to use Funtoo Linux's template-based network configuration system.<br />
<br />
=== Finishing Steps ===<br />
<br />
==== Set your root password ====<br />
It's imperative that you set your root password before rebooting so that you can log in.<br />
<console><br />
(chroot) # ##i##passwd<br />
</console><br />
<br />
===Restart your system ===<br />
<br />
Now is the time to leave chroot, to unmount Funtoo Linux partitions and files and to restart your computer. When you restart, the GRUB boot loader will start, load the Linux kernel and initramfs, and your system will begin booting.<br />
<br />
Leave the chroot, change directory to /mnt, unmount your Funtoo partitions, and reboot.<br />
<console><br />
(chroot) # ##i##exit<br />
# ##i##cd /mnt<br />
# ##i##umount -l funtoo<br />
# ##i##reboot<br />
</console><br />
<br />
You should now see your system reboot, the GRUB boot loader appear for a few seconds, and then see the Linux kernel and initramfs loading. After this, you should see Funtoo Linux itself start to boot, and you should be greeted with a <tt>login:</tt> prompt. Funtoo Linux has been successfully installed!<br />
<br />
===Next Steps===<br />
<br />
If you are brand new to Funtoo Linux and Gentoo Linux, please check out [[Funtoo Linux First Steps]], which will help get you acquainted with your new system. We also have a category for our [[:Category:Official Documentation|official documentation]], which includes all docs that we officially maintain for installation and operation of Funtoo Linux.<br />
<br />
We also have a number of pages dedicated to setting up your system, which you can find below. If you are interested in adding a page to this list, add it to the "First Steps" MediaWiki category.<br />
<br />
{{#ask: [[Category:First Steps]] | format=category }}<br />
<br />
If your system did not boot correctly, see [[Installation Troubleshooting]] for steps you can take to resolve the problem.<br />
<br />
[[Category:HOWTO]]<br />
[[Category:Install]]<br />
[[Category:Official Documentation]]</div>Edelwinhttps://www.funtoo.org/index.php?title=Funtoo_Linux_Installation&diff=3922Funtoo Linux Installation2014-05-18T02:32:28Z<p>Edelwin: fixed some details, added an absolute path</p>
<hr />
<div>== Introduction == <br />
<br />
This document was written to help you install Funtoo Linux as concisely as possible, with a minimum number of distracting options regarding system configuration. <br />
<br />
These docs assume you have a "PC compatible" computer system with a standard PC BIOS. Many new computers support UEFI for booting, which is a new firmware interface that frequently replaces the older MBR-based BIOS. If you have a system with UEFI, you will want to use this documentation along with the [[UEFI Install Guide]], which will augment these instructions and explain how to get your system to boot. You may need to change your PC BIOS settings to enable or disable UEFI booting. The [[UEFI Install Guide]] has more information on this, and steps on how to determine if your system supports UEFI.<br />
<br />
We also offer a [[ZFS Install Guide]], which augment the instructions on this page for those who want to install Funtoo Linux on ZFS. If you are installing Funtoo Linux on [[Funtoo Linux Installation on ARM|ARM]] architecture, please see [[Funtoo Linux Installation on ARM]] for notable differences regarding ARM support. An experimental Funtoo Linux build also exists for [[Funtoo Linux Installation on SPARC|SPARC]] platforms. See [[Funtoo Linux Installation on SPARC]].<br />
<br />
If you've had previous experience installing Gentoo Linux then a lot of steps will be familiar, but you should still read through as there are a few differences.<br />
<br />
== Installation Overview ==<br />
<br />
This is a basic overview of the Funtoo installation process:<br />
<br />
# [[#Live CD|Download and boot the live CD of your choice]].<br />
# [[#Prepare Hard Disk|Prepare your disk]].<br />
# [[#Creating filesystems|Create]] and [[#Mounting filesystems|mount]] filesystems.<br />
# [[#Installing the Stage 3 tarball|Install the Funtoo stage tarball]] of your choice.<br />
# [[#Chroot into Funtoo|Chroot into your new system]].<br />
# [[#Downloading the Portage tree|Download the Portage tree]].<br />
# [[#Configuring your system|Configure your system]] and [[#Configuring your network|network]].<br />
# [[#Configuring and installing the Linux kernel|Install a kernel]].<br />
# [[#Installing a Bootloader|Install a bootloader]].<br />
# [[#Finishing Steps|Complete final steps]].<br />
# [[#Restart your system|Reboot and enjoy]].<br />
<br />
=== Live CD ===<br />
<br />
Funtoo doesn't provide an "official" Funtoo Live CD, but there are plenty of good ones out there to choose from. A great choice is the Gentoo-based [http://www.sysresccd.org/ System Rescue CD] as it contains lots of tools and utilities and supports both 32-bit and 64-bit systems.<br />
<br />
It is also possible to install Funtoo Linux using many other Linux-based live CDs. Generally, any modern bootable Linux live CD or live USB media will work. See [[Requirements|requirements]] for an overview of what the Live Media must provide to allow a problem-free install of Funtoo Linux.<br />
<br />
To begin a Funtoo Linux installation, download System Rescue CD from:<br />
<br />
* Main US mirror: [http://ftp.osuosl.org/pub/funtoo/distfiles/sysresccd/ The Oregon State University Open Source Lab]<br />
* Main EU mirror: [http://ftp.heanet.ie/mirrors/funtoo/distfiles/sysresccd/ HEAnet] or use your preferred live media. Insert it into your disc drive, and boot from it. If using an older version of System Rescue CD, '''be sure to select the <tt>rescue64</tt> kernel at the boot menu if you are installing a 64-bit system'''. By default, System Rescue CD used to boot in 32-bit mode though the latest version attempts to automatically detect 64-bit processors.<br />
<br />
=== Prepare Hard Disk ===<br />
==== Partitions ====<br />
<br />
Funtoo Linux fully supports traditional MBR partitions, as well as newer GPT/GUID partition formats. Funtoo Linux recommends the use of the GPT partitioning scheme, since it is newer and more flexible. Here are the various trade-offs between each partitioning scheme:<br />
<br />
===== GPT Partitions =====<br />
<br />
* Newer, preferred format for Linux systems<br />
* Supports 2 TB+ hard drives for booting<br />
* Supports hundreds of partitions per disk of any size<br />
* Requires legacy BIOS boot partition (~32 MB) to be created if system does not use EFI<br />
* Requires bootloader with support for GPT such as GRUB 2, EXTLINUX, or a patched version of GRUB Legacy<br />
<br />
===== MBR Partitions =====<br />
<br />
* Legacy, DOS partitioning scheme<br />
* Only 4 primary partitions per disk; after that, you must use "logical" partitions<br />
* Does not support 2 TB+ disks for booting<br />
* Compatible with certain problematic systems (such as the HP ProBook 4520)<br />
* Dual-boot with Windows for BIOS systems (Windows handle GPT only on true EFI systems, whatever version it is)<br />
* Multiple boot loader options, e.g. GRUB 2, GRUB Legacy, lilo<br />
<br />
{{fancyimportant|If you plan to use partitions of 2 TB or greater, you ''must'' partition using the GPT/GUID format. Also note that there are small percentage of PCs that will not boot properly with GPT. For these systems, using MBR partitions or a primary drive with an MBR partition may be required in order to boot.}}<br />
<br />
==== Partitioning Using gdisk ====<br />
<br />
===== Notes Before We Begin =====<br />
<br />
These install instructions assume you are installing Funtoo Linux to an empty hard disk using GUID partition tables (GPT). If you are installing Funtoo Linux on a machine where another OS is installed, or there is an existing Linux distribution on your system that you want to keep, then you will need to adapt these instructions to suit your needs.<br />
<br />
If you are going to create a legacy MBR partition table instead of GUID/GPT, you will use the <tt>fdisk</tt> command instead of <tt>gdisk</tt>, and you will not need to create the GRUB boot loader partition. See the table under [[#Partitioning Recommendations|Partitioning Recommendations]], in particular the <br />
'''MBR Block Device (<tt>fdisk</tt>)''' and '''MBR Code''' columns. <tt>fdisk</tt> works just like <tt>gdisk</tt>, but creates legacy MBR partition tables instead of the newer GPT/GUID partition tables.<br />
<br />
Advanced users may be interested in the following topics:<br />
<br />
* [[GUID Booting Guide]]<br />
* [[Rootfs over encrypted lvm]]<br />
* [[Rootfs over encrypted lvm over raid-1 on GPT]]<br />
* '''NEW!''' '''[[ZFS Install Guide]] (Also contains instructions for Rootfs over Encrypted ZFS!)'''<br />
<br />
===== Using gdisk =====<br />
<br />
The first step after booting SystemRescueCd is to use <tt>gdisk</tt> to create GPT (also known as GUID) partitions, specifying the disk you want to use, which is typically <tt>/dev/sda</tt>, the first disk in the system:<br />
<br />
<console># ##i##gdisk /dev/sda</console><br />
You should find <tt>gdisk</tt> very similar to <tt>fdisk</tt>. Here is the partition table we want to end up with:<br />
<br />
<console>Command (? for help): ##i##p<br />
Disk /dev/sda: 234441648 sectors, 111.8 GiB<br />
Logical sector size: 512 bytes<br />
Disk identifier (GUID): A4E5208A-CED3-4263-BB25-7147DC426931<br />
Partition table holds up to 128 entries<br />
First usable sector is 34, last usable sector is 234441614<br />
Partitions will be aligned on 2048-sector boundaries<br />
Total free space is 2014 sectors (1007.0 KiB)<br />
<br />
Number Start (sector) End (sector) Size Code Name<br />
1 2048 206847 500.0 MiB 8300 Linux filesystem<br />
2 206848 272383 32.0 MiB EF02 BIOS boot partition<br />
3 272384 8660991 4.0 GiB 8200 Linux swap<br />
4 8660992 234441614 107.7 GiB 8300 Linux filesystem<br />
<br />
Command (? for help): </console><br />
<br />
Above, you'll see that we have a 500 MiB boot partition, a 32 MiB "BIOS boot partition" (also known as the GRUB boot loader partition), 4 GiB of swap, and the remaining disk used by a 107.7 GiB root partition.<br />
<br />
===== For new <tt>gdisk</tt> users =====<br />
<br />
These partitions were created using the "<tt>n</tt>" command from within <tt>gdisk</tt>. The <tt>gdisk</tt> commands to create the partition table above are as follows. Adapt sizes as necessary, although these defaults will work for most users. The partition codes entered below can be found in the [[#Partitioning Recommendations|Partitioning Recommendations]] table below, in the GPT Code column.<br />
<br />
Within <tt>gdisk</tt>, follow these steps:<br />
<br />
'''Create a new empty partition table''' (This ''will'' erase all data on the disk when saved):<br />
<br />
<console><br />
Command: ##i##o ↵<br />
This option deletes all partitions and creates a new protective MBR.<br />
Proceed? (Y/N): ##i##y ↵<br />
</console><br />
<br />
'''Create Partition 1''' (boot):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##1 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+500M ↵<br />
Hex Code: ##i##↵<br />
</console><br />
<br />
'''Create Partition 2''' (GRUB):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##2 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+32M ↵<br />
Hex Code: ##i##EF02 ↵<br />
</console><br />
<br />
'''Create Partition 3''' (swap):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##3 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+4G ↵<br />
Hex Code: ##i##8200 ↵<br />
</console><br />
<br />
'''Create Partition 4''' (root):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##4 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##↵##!i## (for rest of disk)<br />
Hex Code: ##i##↵<br />
</console><br />
<br />
Along the way, you can type "<tt>p</tt>" and hit Enter to view your current partition table. If you make a mistake, you can type "<tt>d</tt>" to delete an existing partition that you created. When you are satisfied with your partition setup, type "<tt>w</tt>" to write your configuration to disk:<br />
<br />
'''Write Partition Table To Disk''':<br />
<br />
<console><br />
Command: ##i##w ↵<br />
Do you want to proceed? (Y/N): ##i##Y ↵<br />
</console><br />
<br />
The partition table will now be written to disk and <tt>gdisk</tt> will close.<br />
<br />
Now, your GPT/GUID partitions have been created, and will show up as the following ''block devices'' under Linux:<br />
<br />
* <tt>/dev/sda1</tt>, which will be used to hold the <tt>/boot</tt> filesystem, <br />
* <tt>/dev/sda2</tt>, which will be used directly by the new GRUB,<br />
* <tt>/dev/sda3</tt>, which will be used for swap space, and <br />
* <tt>/dev/sda4</tt>, which will hold your root filesystem.<br />
<br />
===== For Previous fdisk users =====<br />
<br />
If you have installed Gentoo Linux before, the one thing that is likely new to you here is the GRUB boot loader partition, which is listed as "BIOS boot partition" within <tt>gdisk</tt>. This partition is required for GRUB 2 to boot GPT/GUID boot disks. What is it? In GRUB-speak, this partition is essentially the location of the meat of GRUB's boot loading code. If you've used GRUB Legacy in the past, this partition is where the new GRUB stores the equivalent of the <tt>stage1_5</tt> and <tt>stage2</tt> files in legacy GRUB. Since GPT-based partition tables have less dead space at the beginning of the disk than their MBR equivalents, an explicitly defined partition of code <tt>EF02</tt> is required to hold the guts of the boot loader.<br />
<br />
In all other respects, the partition table is similar to that which you might create for an MBR-based disk during a Gentoo Linux installation. We have a boot and a root partition with code <tt>0700</tt>, and a Linux swap partition with code <tt>8200</tt>.<br />
<br />
===== Partitioning Recommendations =====<br />
<br />
Below are our partitioning recommendations in table form. For GPT-based partitions, use the GPT Block Device and GPT Code columns with <tt>gdisk</tt>. For legacy MBR-based partitions, use the MBR Block Device and MBR code columns with <tt>fdisk</tt>:<br />
<br />
{| {{table}} <br />
!Partition<br />
!Size<br />
!MBR Block Device (<tt>fdisk</tt>)<br />
!GPT Block Device (<tt>gdisk</tt>)<br />
!Filesystem<br />
!MBR Code<br />
!GPT Code<br />
|-<br />
|<tt>/boot</tt><br />
|500 MB<br />
|<tt>/dev/sda1</tt><br />
|<tt>/dev/sda1</tt><br />
|ext2<br />
|83<br />
|8300<br />
|-<br />
|GRUB boot loader partition<br />
|32 MB<br />
| ''not required for MBR''<br />
|<tt>/dev/sda2</tt><br />
|For GPT/GUID only, skip for MBR - no filesystem.<br />
|''N/A''<br />
|EF02<br />
|-<br />
|swap<br />
|2x RAM for low-memory systems and production servers; otherwise 2GB.<br />
|<tt>/dev/sda2</tt><br />
|<tt>/dev/sda3</tt><br />
|swap (default)<br />
|82<br />
|8200<br />
|-<br />
|<tt>/</tt> (root)<br />
|Rest of the disk, minimum of 10GB.<br />
|<tt>/dev/sda3</tt><br />
|<tt>/dev/sda4</tt><br />
|XFS recommended, alternatively ext4<br />
|83<br />
|8300<br />
|-<br />
|<tt>/home</tt> (optional) <br />
|User storage and media. Typically most of the disk.<br />
|<tt>/dev/sda4</tt> (if created)<br />
|<tt>/dev/sda5</tt> (if created)<br />
|XFS recommended, alternatively ext4<br />
|83<br />
|8300<br />
|-<br />
| LVM (optional)<br />
| If you want to create an LVM volume.<br />
| <tt>/dev/sda4</tt> (PV, if created)<br />
| <tt>/dev/sda5</tt> (PV, if created)<br />
| LVM PV<br />
| 8E<br />
| 8E00<br />
|}<br />
<br />
==== Creating filesystems ====<br />
<br />
Before your newly-created partitions can be used, the block devices need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.<br />
<br />
You will not create a filesystem on your swap partition, but will initialize it using the <tt>mkswap</tt> command so that it can be used as disk-based virtual memory. Then we'll run the <tt>swapon</tt> command to make your newly-initialized swap space active within the live CD environment, in case it is needed during the rest of the install process.<br />
<br />
Note that we will not create a filesystem on the GRUB boot loader partition, as GRUB writes binary data directly to that partition when the boot loader is installed, which we'll do later.<br />
<br />
You can see the commands you will need to type below. Like the rest of this document, it assumes that you are using a GPT partitioning scheme. If you are using MBR, your root filesystem will likely be created on <tt>/dev/sda3</tt> instead and you will need to adjust the target block devices. If you are following our recommendations, then simply do this:<br />
<br />
'''We generally recommend XFS for root filesystems, although ext4 is also a good choice.''' This tutorial assumes the use of XFS. If you want to use ext4, then be sure that your <tt>/etc/fstab</tt> file reflects this.<br />
<br />
{{fancywarning|1=<br />
Please use ext4 exclusively when deploying an OpenVZ host. The Parallels development team tests extensively with ext4, and modern versions of <tt>openvz-rhel6-stable</tt> are '''not''' compatible with XFS, and you may experience kernel bugs.<br />
}}<br />
<br />
'''To use XFS as your root filesystem:'''<br />
<br />
<console><br />
# ##i##mke2fs -t ext2 /dev/sda1 <br />
# ##i##mkfs.xfs /dev/sda4<br />
# ##i##mkswap /dev/sda3<br />
# ##i##swapon /dev/sda3<br />
</console><br />
<br />
'''To use ext4 as your root filesystem:'''<br />
<br />
<console><br />
# ##i##mke2fs -t ext2 /dev/sda1 <br />
# ##i##mkfs.ext4 /dev/sda4<br />
# ##i##mkswap /dev/sda3<br />
# ##i##swapon /dev/sda3<br />
</console><br />
<br />
==== Mounting filesystems ====<br />
<br />
Mount the newly-created filesystems as follows, creating <tt>/mnt/funtoo</tt> as the installation mount point:<br />
<br />
<console><br />
# ##i##mkdir /mnt/funtoo<br />
# ##i##mount /dev/sda4 /mnt/funtoo<br />
# ##i##mkdir /mnt/funtoo/boot<br />
# ##i##mount /dev/sda1 /mnt/funtoo/boot<br />
</console><br />
<br />
Optionally, if you have a separate filesystem for <tt>/home</tt> or anything else:<br />
<br />
<console><br />
# ##i##mkdir /mnt/funtoo/home<br />
# ##i##mount /dev/sda5 /mnt/funtoo/home<br />
</console><br />
<br />
If you have <tt>/tmp</tt> or <tt>/var/tmp</tt> on a separate filesystem, be sure to change the permissions of the mount point to be globally-writeable after mounting, as follows:<br />
<br />
<console><br />
# ##i##chmod 1777 /mnt/funtoo/tmp<br />
</console><br />
<br />
=== Installing the Stage 3 tarball ===<br />
==== Stage 3 tarball ====<br />
<br />
After creating filesystems, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux. Visit the [[Download]] page and copy the URL to the Stage 3 tarball you want to use. We will download it soon.<br />
<br />
{{fancyimportant|If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date.}}<br />
<br />
Now is a good time to verify the date and time are correctly set to UTC. Use the <tt>date</tt> command to verify the date and time:<br />
<br />
<console><br />
# ##i##date<br />
Fri Jul 15 19:47:18 UTC 2011<br />
</console><br />
<br />
If the date and/or time need to be corrected, do so using <tt>date MMDDhhmmYYYY</tt>, keeping in mind <tt>hhmm</tt> are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:<br />
<br />
<console><br />
# ##i##date 071620002011<br />
Fri Jul 16 20:00:00 UTC 2011<br />
</console><br />
<br />
Once you are in your Funtoo Linux root filesystem, use <tt>wget</tt> to download the Stage 3 tarball you have chosen from the [[Download]] page to use as the basis for your new Funtoo Linux system. It should be saved to the <tt>/mnt/funtoo</tt> directory as follows:<br />
<br />
<console># ##i##cd /mnt/funtoo<br />
# ##i##wget http://ftp.osuosl.org/pub/funtoo/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz<br />
</console><br />
<br />
<br />
Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the <tt>generic_64</tt> or <tt>generic_32</tt> stage. Consult the [[Download]] page for more information.<br />
<br />
Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:<br />
<console><br />
# ##i##tar xpf stage3-latest.tar.xz<br />
</console><br />
<br />
{{fancyimportant|It is very important to use <tt>tar</tt>'s "<tt>p</tt>" option when extracting the Stage 3 tarball - it tells <tt>tar</tt> to ''preserve'' any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.}}<br />
<br />
=== Chroot into Funtoo ===<br />
Before chrooting into your new system, there's a few things that need to be done first. You will need to mount /proc and /dev inside your new system. Use the following commands:<br />
<console><br />
# ##i##cd /mnt/funtoo<br />
# ##i##mount -t proc none proc<br />
# ##i##mount --rbind /sys sys<br />
# ##i##mount --rbind /dev dev<br />
</console><br />
<br />
You'll also want to copy over <tt>resolv.conf</tt> in order to have proper DNS name resolution from inside the chroot:<br />
<console><br />
# ##i##cp /etc/resolv.conf etc<br />
</console><br />
<br />
Now you can chroot into your new system. Use <tt>env</tt> before <tt>chroot</tt> to ensure that no environment variables from the installation media are used by your new system:<br />
<br />
<console><br />
# ##i##env -i HOME=/root TERM=$TERM chroot . bash -l<br />
</console><br />
<br />
{{fancynote|Users of live CDs with 64-bit kernels: Some software may use <tt>uname -r</tt> to check whether the system is 32 or 64-bit. You may want append linux32 to the chroot command as a workaround, but it's generally not needed.}}<br />
{{fancyimportant|If you receive the error "<tt>chroot: failed to run command `/bin/bash': Exec format error</tt>", it is probably because you are running a 32-bit kernel and trying to execute 64-bit code. SystemRescueCd boots with a 32-bit kernel by default.}}<br />
<br />
It's also a good idea to change the default command prompt while inside the chroot. This will avoid confusion if you have to change terminals. Use this command:<br />
<console><br />
# ##i##export PS1="(chroot) $PS1"<br />
</console><br />
<br />
Congratulations! You are now chrooted inside a Funtoo Linux system. Now it's time to get Funtoo Linux properly configured so that Funtoo Linux will boot successfully when your system is restarted.<br />
<br />
=== Downloading the Portage tree ===<br />
<br />
{{fancynote|For an alternative way to do this, see [[Installing Portage From Snapshot]].}}<br />
Now it's time to install a copy of the Portage repository, which contains package scripts (ebuilds) that tell portage how to build and install thousands of different software packages. To create the Portage repository, simply run <tt>emerge --sync</tt> from within the chroot. This will automatically clone the portage tree from [http://github.com/ GitHub]:<br />
<br />
<console><br />
(chroot) # ##i##emerge --sync<br />
</console><br />
<br />
{{fancyimportant|If you receive the error with initial <tt>emerge --sync</tt> due to git protocol restrictions, change <tt>SYNC</tt> variable in <tt>/etc/portage/make.conf</tt>}}<br />
<pre><br />
SYNC="https://github.com/funtoo/ports-2012.git"<br />
</pre><br />
<br />
<br />
=== Configuring your system ===<br />
As is expected from a Linux distribution, Funtoo Linux has its share of configuration files. The one file you are absolutely required to edit in order to ensure that Funtoo Linux boots successfully is <tt>/etc/fstab</tt>. The others are optional. Here are a list of files that you should consider editing:<br />
<br />
{| {{table}}<br />
!File<br />
!Do I need to change it?<br />
!Description<br />
|-<br />
|<tt>/etc/fstab</tt><br />
|'''YES - required'''<br />
|Mount points for all filesystems to be used at boot time. This file must reflect your disk partition setup. We'll guide you through modifying this file below.<br />
|-<br />
|<tt>/etc/localtime</tt><br />
|''Maybe - recommended''<br />
|Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal) <br />
|-<br />
|<tt>/etc/make.conf<br/>/etc/portage/make.conf&nbsp;(new&nbsp;location)</tt><br />
|''Maybe - recommended''<br />
|Parameters used by gcc (compiler), portage, and make. It's a good idea to set MAKEOPTS. This is covered later in this document.<br />
|-<br />
|<tt>/etc/conf.d/hostname</tt><br />
|''Maybe - recommended''<br />
|Used to set system hostname. Set to the fully-qualified (with dots) name. Defaults to <tt>localhost</tt> if not set.<br />
|-<br />
|<tt>/etc/hosts</tt><br />
|''No''<br />
| You no longer need to manually set the hostname in this file. This file is automatically generated by <tt>/etc/init.d/hostname</tt>.<br />
|-<br />
|<tt>/etc/conf.d/keymaps</tt><br />
|Optional<br />
|Keyboard mapping configuration file (for console pseudo-terminals). Set if you have a non-US keyboard. See [[Funtoo Linux Localization]].<br />
|-<br />
|<tt>/etc/conf.d/hwclock</tt><br />
|Optional<br />
|How the time of the battery-backed hardware clock of the system is interpreted (UTC or local time). Linux uses the battery-backed hardware clock to initialize the system clock when the system is booted.<br />
|-<br />
|<tt>/etc/conf.d/modules</tt><br />
|Optional<br />
|Kernel modules to load automatically at system startup. Typically not required. See [[Additional Kernel Resources]] for more info.<br />
|-<br />
|<tt>profiles</tt><br />
|Optional<br />
|Some useful portage settings that may help speed up intial configuration.<br />
|}<br />
<br />
If you're installing an English version of Funtoo Linux, you're in luck as most of the configuration files can be used as-is. If you're installing for another locale, don't worry. We will walk you through the necessary configuration steps on the [[Funtoo Linux Localization]] page, and if needed, there's always plenty of friendly, helpful support. (See [[#Community portal|Community]])<br />
<br />
Let's go ahead and see what we have to do. Use <tt>nano -w <name_of_file></tt> to edit files -- the "<tt>-w</tt>" disables word-wrapping, which is handy when editing configuration files. You can copy and paste from the examples.<br />
<br />
{{fancywarning|It's important to edit your <tt>/etc/fstab</tt> file before you reboot! You will need to modify both the "fs" and "type" columns to match the settings for your partitions and filesystems that you created with <tt>gdisk</tt> or <tt>fdisk</tt>. Skipping this step may prevent Funtoo Linux from booting successfully.}}<br />
<br />
==== /etc/fstab ====<br />
<br />
<tt>/etc/fstab</tt> is used by the <tt>mount</tt> command which is ran when your system boots. Statements of this file inform <tt>mount</tt> about partitions to be mounted and how they are mounted. In order for the system to boot properly, you must edit <tt>/etc/fstab</tt> and ensure that it reflects the partition configuration you used earlier:<br />
<br />
<console><br />
(chroot) # ##i##nano -w /etc/fstab<br />
</console><br />
<br />
You can use arrow keys to move around and hit Control-X to exit. If you want to save your changes, type "<tt>Y</tt>" when asked if you want to save the modified buffer, or hit Control-O before closing <tt>nano</tt>. Otherwise your changes will be discarded.<br />
<br />
<pre><br />
# The root filesystem should have a pass number of either 0 or 1.<br />
# All other filesystems should have a pass number of 0 or greater than 1.<br />
#<br />
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.<br />
#<br />
# See the manpage fstab(5) for more information.<br />
#<br />
# <fs> <mountpoint> <type> <opts> <dump/pass><br />
<br />
/dev/sda1 /boot ext2 noatime 1 2<br />
/dev/sda3 none swap sw 0 0<br />
/dev/sda4 / ext4 noatime 0 1<br />
#/dev/cdrom /mnt/cdrom auto noauto,ro 0 0<br />
</pre><br />
<br />
==== /etc/localtime ====<br />
<br />
<tt>/etc/localtime</tt> is used to specify the timezone that your machine is in, and defaults to UTC. If you would like your Funtoo Linux system to use local time, you should replace <tt>/etc/localtime</tt> with a symbolic link to the timezone that you wish to use. <br />
<br />
<console><br />
(chroot) # ##i##ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime<br />
</console><br />
<br />
The above sets the timezone to Mountain Standard Time (with daylight savings). Type <tt>ls /usr/share/zoneinfo</tt> to see what timezones are available. There are also sub-directories containing timezones described by location.<br />
<br />
==== /etc/make.conf ====<br />
<br />
{{fancynote|This file is the symlink to /etc/portage/make.conf, new default location, edit /etc/portage/make.conf.}}<br />
<br />
MAKEOPTS can be used to define how many parallel compilations should occur when you compile a package, which can speed up compilation significantly. A rule of thumb is the number of CPUs (or CPU threads) in your system plus one. If for example you have a dual core processor without [[wikipedia:Hyper-threading|hyper-threading]], then you would set MAKEOPTS to 3:<br />
<br />
<pre><br />
MAKEOPTS="-j3" <br />
</pre><br />
<br />
If you are unsure about how many processors/threads you have then use /proc/cpuinfo to help you.<br />
<console><br />
(chroot) # ##i##grep "processor" /proc/cpuinfo | wc -l<br />
16<br />
</console><br />
<br />
Set MAKEOPTS to this number plus one:<br />
<br />
<pre><br />
MAKEOPTS="-j17"<br />
</pre><br />
<br />
USE flags define what functionality is enabled when packages are built. It is not recommended to add a lot of them during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("<tt>-</tt>") sign tells Portage not to use the flag when compiling. A Funtoo guide to USE flags will be available in the future. For now, you can find out more information about USE flags in the [http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=2&chap=2 Gentoo Handbook].<br />
<br />
LINGUAS tells Portage which local language to compile the system and applications in (those who use LINGUAS variable like OpenOffice). It is not usually necessary to set this if you use English. If you want another language such as French (fr) or German (de), set LINGUAS appropriately:<br />
<br />
<pre><br />
LINGUAS="fr"<br />
</pre><br />
<br />
==== /etc/conf.d/hwclock ====<br />
If you dual-boot with Windows, you'll need to edit this file and change '''clock''' to '''local''', because Windows will set your hardware clock to local time every time you boot Windows. Otherwise you normally wouldn't need to edit this file.<br />
<console><br />
(chroot) # ##i##nano -w /etc/conf.d/hwclock<br />
</console><br />
<br />
==== Localization ====<br />
<br />
By default, Funtoo Linux is configured with Unicode (UTF-8) enabled, and for the US English locale and keyboard. If you would like to configure your system to use a non-English locale or keyboard, see [[Funtoo Linux Localization]].<br />
<br />
==== Profiles ====<br />
<br />
[[Funtoo 1.0 Profile|Funtoo profiles]] are used to define defaults for Portage specific to your needs. There are 4 basic profile types: arch, build, [[Flavors and Mix-ins|flavor, and mix-ins]]:<br />
<br />
;arch: typically <tt>x86-32bit</tt> or <tt>x86-64bit</tt>, this defines the processor type and support of your system. This is defined when your stage was built and should not be changed.<br />
;build: defines whether your system is a <tt>current</tt>, <tt>stable</tt> or <tt>experimental</tt> build. <tt>current</tt> systems will have newer packages unmasked than <tt>stable</tt> systems.<br />
;flavor: defines the general type of system, such as <tt>server</tt> or <tt>desktop</tt>, and will set default USE flags appropriate for your needs.<br />
;mix-ins: define various optional settings that you may be interested in enabling.<br />
<br />
One arch, build and flavor must be set for each Funtoo Linux system, while mix-ins are optional and you can enable more than one if desired.<br />
<br />
Remember that profiles can often be inherited. For example, the <tt>desktop</tt> flavor inherits the <tt>workstation</tt> flavor settings, which in turn inherits the <tt>X</tt> and <tt>audio</tt> mix-ins. You can view this by using eselect:<br />
<br />
<console><br />
(chroot) # ##i##eselect profile show<br />
Currently set profiles:<br />
arch: gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit<br />
build: gentoo:funtoo/1.0/linux-gnu/build/current<br />
flavor: gentoo:funtoo/1.0/linux-gnu/flavor/desktop<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/kde<br />
<br />
Automatically enabled profiles:<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/print<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/X<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/audio<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/dvd<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/media<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/console-extras<br />
<br />
<br />
</console><br />
<br />
To view installed profiles:<br />
<console><br />
(chroot) # ##i##eselect profile list<br />
</console><br />
<br />
To change the profile flavor:<br />
<console><br />
(chroot) # ##i##eselect profile set-flavor 7<br />
</console><br />
<br />
To add a mix-in:<br />
<br />
<console><br />
(chroot) # ##i##eselect profile add 10<br />
</console><br />
<br />
=== Configuring and installing the Linux kernel ===<br />
<br />
Now it's time to build and install a Linux kernel, which is the heart of any Funtoo Linux system. In the past, the process of creating a kernel that actually booted your system could be time-consuming and require a great deal of trial and error. Fortunately, Funtoo Linux offers an option to automatically build a kernel for you that will boot nearly all systems.<br />
<br />
If you are unfamiliar with how to manually configure your own kernel, or you simply want to get your system up and running quickly, you can emerge <tt>debian-sources</tt> with the <tt>binary</tt> USE flag set, which will automatically build the kernel and an initrd that will boot nearly all Funtoo Linux systems. This kernel is based on a linux-3.2 LTS official debian kernel package and is an easy way to get your system up and running relatively quickly.<br />
<br />
Click [http://wiki.debian.org/DebianKernel here] for a list of all architectures the Debian kernel supports. <br />
<br />
{{fancyimportant|<tt>debian-sources</tt> with <tt>binary</tt> USE flag requires at least 12GB in /var/tmp}}<br />
<br />
<console><br />
(chroot) # ##i##echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use<br />
(chroot) # ##i##emerge debian-sources</console><br />
<br />
All done!<br />
<br />
{{fancynote|NVIDIA card users: the <tt>binary</tt> USE flag installs the Nouveau drivers which cannot be loaded at the same time as the proprietary drivers, and cannot be unloaded at runtime because of KMS. You need to blacklist it under <tt>/etc/modprobe.d/</tt>.}}<br />
{{fancynote|For an overview of other kernel options for Funtoo Linux, see [[Funtoo Linux Kernels]]. There maybe modules that the Debian kernel doesn't include, a situation where [http://www.funtoo.org/wiki/Funtoo_Linux_Kernels#Using_Debian-Sources_with_Genkernel genkernel] would be useful. Also be sure to see [[:Category:Hardware Compatibility|hardware compatibility]] information. We have compiled a very good reference for [[Dell PowerEdge 11G Servers]] that includes kernel compatibility information as well..}}<br />
<br />
<br />
The next step is to configure your boot loader so that your new kernel loads when the system boots.<br />
<br />
=== Installing a Bootloader ===<br />
<br />
==== Installing Grub ====<br />
<br />
The boot loader is responsible for loading the kernel from disk when your computer boots. For new installations, GRUB 2 and Funtoo's boot-update tool should be used as a boot loader. GRUB supports both GPT/GUID and legacy MBR partitioning schemes.<br />
<br />
To use this recommended boot method, first emerge <tt>boot-update</tt>. This will also cause <tt>grub-2</tt> to be merged, since it is a dependency of <tt>boot-update</tt>.<br />
<br />
<console><br />
(chroot) # ##i##emerge boot-update<br />
</console><br />
<br />
Then, edit <tt>/etc/boot.conf</tt> and specify "<tt>Funtoo Linux genkernel</tt>" as the <tt>default</tt> setting at the top of the file, replacing <tt>"Funtoo Linux"</tt>. <br />
<br />
<tt>/etc/boot.conf</tt> should now look like this:<br />
<br />
<pre><br />
boot {<br />
generate grub<br />
default "Funtoo Linux genkernel"<br />
timeout 3 <br />
}<br />
<br />
"Funtoo Linux" {<br />
kernel bzImage[-v]<br />
# params += nomodeset<br />
}<br />
<br />
"Funtoo Linux genkernel" {<br />
# if you use bliss-kernel package<br />
# you should change string<br />
# kernel kernel[-v]<br />
# to<br />
# kernel kernel/[-v]/kernel[-v]<br />
kernel kernel[-v]<br />
initrd initramfs[-v]<br />
params += real_root=auto <br />
# params += nomodeset<br />
} <br />
</pre><br />
<br />
If you use bliss-kernel, your <tt>/etc/boot.conf</tt> should look like:<br />
<br />
<pre><br />
boot {<br />
generate grub<br />
default "Funtoo Linux genkernel"<br />
timeout 3 <br />
}<br />
<br />
"Funtoo Linux" {<br />
kernel bzImage[-v]<br />
# params += nomodeset<br />
}<br />
<br />
"Funtoo Linux genkernel" {<br />
kernel kernels/[-v]/kernel[-v]<br />
initrd initramfs[-v]<br />
params += real_root=auto <br />
# params += nomodeset<br />
} <br />
</pre><br />
<br />
Please read <tt>man boot.conf</tt> for further details.<br />
<br />
===== Running grub-install and boot-update =====<br />
<br />
Finally, we will need to actually install the GRUB boot loader to your disk, and also run <tt>boot-update</tt> which will generate your boot loader configuration file:<br />
<br />
<console><br />
(chroot) # ##i##grub-install --no-floppy /dev/sda<br />
(chroot) # ##i##boot-update<br />
</console><br />
<br />
You only need to run <tt>grub-install</tt> when you first install Funtoo Linux, but you need to re-run <tt>boot-update</tt> every time you modify your <tt>/etc/boot.conf</tt> file, so your changes are applied on next boot.<br />
<br />
OK - your system should be ready to boot! Well, there are a few more loose ends...<br />
<br />
==== Installing Syslinux/Extlinux ====<br />
<br />
An alternate boot loader called extlinux can be used instead of GRUB if you desire. See the [[Extlinux|extlinux Guide]] for information on how to do this.<br />
<br />
=== Configuring your network ===<br />
<br />
It's important to ensure that you will be able to connect to your local-area network after you reboot into Funtoo Linux. There are three approaches you can use for configuring your network: NetworkManager, dhcpcd, and the [[Funtoo Linux Networking]] scripts. Here's how to choose which one to use based on the type of network you want to set up.<br />
<br />
==== Wi-Fi ====<br />
===== Using NetworkManager =====<br />
For laptop/mobile systems where you will be using Wi-Fi and connecting to various networks, NetworkManager is strongly recommended. The Funtoo version of NetworkManager is fully functional even from the command-line, so you can use it even without X or without the Network Manager applet. Here are the steps involved in setting up NetworkManager:<br />
<br />
<console><br />
# ##i##emerge linux-firmware<br />
# ##i##emerge networkmanager<br />
# ##i##rc-update add NetworkManager default<br />
</console><br />
<br />
Above, we installed linux-firmware which contains a complete collection of available firmware for many hardware devices including Wi-Fi adapters, plus NetworkManager to manage our network connection. Then we added NetworkManager to the <tt>default</tt> runlevel so it will start when Funtoo Linux boots.<br />
<br />
After you reboot into Funtoo Linux, you will be able to add a Wi-Fi connection this way:<br />
<br />
<console><br />
# ##i##addwifi -S wpa -K 'wifipassword' mywifinetwork<br />
</console><br />
<br />
The <tt>addwifi</tt> command is used to configure and connect to a WPA/WPA2 Wi-Fi network named <tt>mywifinetwork</tt> with the password <tt>wifipassword</tt>. This network configuration entry is stored in <tt>/etc/NetworkManager/system-connections</tt> so that it will be remembered in the future. You should only need to enter this command once for each Wi-Fi network you connect to.<br />
<br />
===== Using wpa_supplicant =====<br />
If for some reasons, you don't want to use a tool such as NetworkManager of wicd, you can edit the wpa_supplicant configuration file, located at /etc/wpa_supplicant.conf.<br />
The syntax is very easy :<br />
<console><br />
##i##network={<br />
##i##ssid="MyWifiName"<br />
##i##psk="lol42-wifi"<br />
##i##}<br />
<br />
##i##network={<br />
##i##ssid="Other Network"<br />
##i##psk="6d96270004515a0486bb7f76196a72b40c55a47f"<br />
##i##}<br />
</console><br />
You can now start wpa_supplicant with<br />
<console><br />
# ##i##wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf<br />
</console><br />
wpa_supplicant will automatically connect to the first avaible network.<br />
You can of course set an alias for the command :<br />
<console><br />
# ##i## echo "wifi='wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf'" >> ~/.${SHELL}rc<br />
</console><br />
<br />
==== Desktop (Wired Ethernet) ====<br />
<br />
For a home desktop or workstation with wired Ethernet that will use DHCP, the simplest and most effective option to enable network connectivity is to simply add <tt>dhcpcd</tt> to the default runlevel:<br />
<br />
<console><br />
# ##i##rc-update add dhcpcd default<br />
</console><br />
<br />
When you reboot, <tt>dhcpcd</tt> will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.<br />
<br />
==== Server (Static IP) ====<br />
<br />
For servers, the [[Funtoo Linux Networking]] scripts are recommended. They are optimized for static configurations and things like virtual ethernet bridging for virtualization setups. See [[Funtoo Linux Networking]] for information on how to use Funtoo Linux's template-based network configuration system.<br />
<br />
=== Finishing Steps ===<br />
<br />
==== Set your root password ====<br />
It's imperative that you set your root password before rebooting so that you can log in.<br />
<console><br />
(chroot) # ##i##passwd<br />
</console><br />
<br />
===Restart your system ===<br />
<br />
Now is the time to leave chroot, to unmount Funtoo Linux partitions and files and to restart your computer. When you restart, the GRUB boot loader will start, load the Linux kernel and initramfs, and your system will begin booting.<br />
<br />
Leave the chroot, change directory to /mnt, unmount your Funtoo partitions, and reboot.<br />
<console><br />
(chroot) # ##i##exit<br />
# ##i##cd /mnt<br />
# ##i##umount -l funtoo<br />
# ##i##reboot<br />
</console><br />
<br />
You should now see your system reboot, the GRUB boot loader appear for a few seconds, and then see the Linux kernel and initramfs loading. After this, you should see Funtoo Linux itself start to boot, and you should be greeted with a <tt>login:</tt> prompt. Funtoo Linux has been successfully installed!<br />
<br />
===Next Steps===<br />
<br />
If you are brand new to Funtoo Linux and Gentoo Linux, please check out [[Funtoo Linux First Steps]], which will help get you acquainted with your new system. We also have a category for our [[:Category:Official Documentation|official documentation]], which includes all docs that we officially maintain for installation and operation of Funtoo Linux.<br />
<br />
We also have a number of pages dedicated to setting up your system, which you can find below. If you are interested in adding a page to this list, add it to the "First Steps" MediaWiki category.<br />
<br />
{{#ask: [[Category:First Steps]] | format=category }}<br />
<br />
If your system did not boot correctly, see [[Installation Troubleshooting]] for steps you can take to resolve the problem.<br />
<br />
[[Category:HOWTO]]<br />
[[Category:Install]]<br />
[[Category:Official Documentation]]</div>Edelwinhttps://www.funtoo.org/index.php?title=Funtoo_Linux_Installation&diff=3920Funtoo Linux Installation2014-05-17T16:52:53Z<p>Edelwin: added a simple way to use the wireless interface</p>
<hr />
<div>== Introduction == <br />
<br />
This document was written to help you install Funtoo Linux as concisely as possible, with a minimum number of distracting options regarding system configuration. <br />
<br />
These docs assume you have a "PC compatible" computer system with a standard PC BIOS. Many new computers support UEFI for booting, which is a new firmware interface that frequently replaces the older MBR-based BIOS. If you have a system with UEFI, you will want to use this documentation along with the [[UEFI Install Guide]], which will augment these instructions and explain how to get your system to boot. You may need to change your PC BIOS settings to enable or disable UEFI booting. The [[UEFI Install Guide]] has more information on this, and steps on how to determine if your system supports UEFI.<br />
<br />
We also offer a [[ZFS Install Guide]], which augment the instructions on this page for those who want to install Funtoo Linux on ZFS. If you are installing Funtoo Linux on [[Funtoo Linux Installation on ARM|ARM]] architecture, please see [[Funtoo Linux Installation on ARM]] for notable differences regarding ARM support. An experimental Funtoo Linux build also exists for [[Funtoo Linux Installation on SPARC|SPARC]] platforms. See [[Funtoo Linux Installation on SPARC]].<br />
<br />
If you've had previous experience installing Gentoo Linux then a lot of steps will be familiar, but you should still read through as there are a few differences.<br />
<br />
== Installation Overview ==<br />
<br />
This is a basic overview of the Funtoo installation process:<br />
<br />
# [[#Live CD|Download and boot the live CD of your choice]].<br />
# [[#Prepare Hard Disk|Prepare your disk]].<br />
# [[#Creating filesystems|Create]] and [[#Mounting filesystems|mount]] filesystems.<br />
# [[#Installing the Stage 3 tarball|Install the Funtoo stage tarball]] of your choice.<br />
# [[#Chroot into Funtoo|Chroot into your new system]].<br />
# [[#Downloading the Portage tree|Download the Portage tree]].<br />
# [[#Configuring your system|Configure your system]] and [[#Configuring your network|network]].<br />
# [[#Configuring and installing the Linux kernel|Install a kernel]].<br />
# [[#Installing a Bootloader|Install a bootloader]].<br />
# [[#Finishing Steps|Complete final steps]].<br />
# [[#Restart your system|Reboot and enjoy]].<br />
<br />
=== Live CD ===<br />
<br />
Funtoo doesn't provide an "official" Funtoo Live CD, but there are plenty of good ones out there to choose from. A great choice is the Gentoo-based [http://www.sysresccd.org/ System Rescue CD] as it contains lots of tools and utilities and supports both 32-bit and 64-bit systems.<br />
<br />
It is also possible to install Funtoo Linux using many other Linux-based live CDs. Generally, any modern bootable Linux live CD or live USB media will work. See [[Requirements|requirements]] for an overview of what the Live Media must provide to allow a problem-free install of Funtoo Linux.<br />
<br />
To begin a Funtoo Linux installation, download System Rescue CD from:<br />
<br />
* Main US mirror: [http://ftp.osuosl.org/pub/funtoo/distfiles/sysresccd/ The Oregon State University Open Source Lab]<br />
* Main EU mirror: [http://ftp.heanet.ie/mirrors/funtoo/distfiles/sysresccd/ HEAnet] or use your preferred live media. Insert it into your disc drive, and boot from it. If using an older version of System Rescue CD, '''be sure to select the <tt>rescue64</tt> kernel at the boot menu if you are installing a 64-bit system'''. By default, System Rescue CD used to boot in 32-bit mode though the latest version attempts to automatically detect 64-bit processors.<br />
<br />
=== Prepare Hard Disk ===<br />
==== Partitions ====<br />
<br />
Funtoo Linux fully supports traditional MBR partitions, as well as newer GPT/GUID partition formats. Funtoo Linux recommends the use of the GPT partitioning scheme, since it is newer and more flexible. Here are the various trade-offs between each partitioning scheme:<br />
<br />
===== GPT Partitions =====<br />
<br />
* Newer, preferred format for Linux systems<br />
* Supports 2 TB+ hard drives for booting<br />
* Supports hundreds of partitions per disk of any size<br />
* Requires legacy BIOS boot partition (~32 MB) to be created if system does not use EFI<br />
* Requires bootloader with support for GPT such as GRUB 2, EXTLINUX, or a patched version of GRUB Legacy<br />
<br />
===== MBR Partitions =====<br />
<br />
* Legacy, DOS partitioning scheme<br />
* Only 4 primary partitions per disk; after that, you must use "logical" partitions<br />
* Does not support 2 TB+ disks for booting<br />
* Compatible with certain problematic systems (such as the HP ProBook 4520)<br />
* Dual-boot with Windows for BIOS systems (Windows handle GPT only on true EFI systems, whatever version it is)<br />
* Multiple boot loader options, e.g. GRUB 2, GRUB Legacy, lilo<br />
<br />
{{fancyimportant|If you plan to use partitions of 2 TB or greater, you ''must'' partition using the GPT/GUID format. Also note that there are small percentage of PCs that will not boot properly with GPT. For these systems, using MBR partitions or a primary drive with an MBR partition may be required in order to boot.}}<br />
<br />
==== Partitioning Using gdisk ====<br />
<br />
===== Notes Before We Begin =====<br />
<br />
These install instructions assume you are installing Funtoo Linux to an empty hard disk using GUID partition tables (GPT). If you are installing Funtoo Linux on a machine where another OS is installed, or there is an existing Linux distribution on your system that you want to keep, then you will need to adapt these instructions to suit your needs.<br />
<br />
If you are going to create a legacy MBR partition table instead of GUID/GPT, you will use the <tt>fdisk</tt> command instead of <tt>gdisk</tt>, and you will not need to create the GRUB boot loader partition. See the table under [[#Partitioning Recommendations|Partitioning Recommendations]], in particular the <br />
'''MBR Block Device (<tt>fdisk</tt>)''' and '''MBR Code''' columns. <tt>fdisk</tt> works just like <tt>gdisk</tt>, but creates legacy MBR partition tables instead of the newer GPT/GUID partition tables.<br />
<br />
Advanced users may be interested in the following topics:<br />
<br />
* [[GUID Booting Guide]]<br />
* [[Rootfs over encrypted lvm]]<br />
* [[Rootfs over encrypted lvm over raid-1 on GPT]]<br />
* '''NEW!''' '''[[ZFS Install Guide]] (Also contains instructions for Rootfs over Encrypted ZFS!)'''<br />
<br />
===== Using gdisk =====<br />
<br />
The first step after booting SystemRescueCd is to use <tt>gdisk</tt> to create GPT (also known as GUID) partitions, specifying the disk you want to use, which is typically <tt>/dev/sda</tt>, the first disk in the system:<br />
<br />
<console># ##i##gdisk /dev/sda</console><br />
You should find <tt>gdisk</tt> very similar to <tt>fdisk</tt>. Here is the partition table we want to end up with:<br />
<br />
<console>Command (? for help): ##i##p<br />
Disk /dev/sda: 234441648 sectors, 111.8 GiB<br />
Logical sector size: 512 bytes<br />
Disk identifier (GUID): A4E5208A-CED3-4263-BB25-7147DC426931<br />
Partition table holds up to 128 entries<br />
First usable sector is 34, last usable sector is 234441614<br />
Partitions will be aligned on 2048-sector boundaries<br />
Total free space is 2014 sectors (1007.0 KiB)<br />
<br />
Number Start (sector) End (sector) Size Code Name<br />
1 2048 206847 500.0 MiB 8300 Linux filesystem<br />
2 206848 272383 32.0 MiB EF02 BIOS boot partition<br />
3 272384 8660991 4.0 GiB 8200 Linux swap<br />
4 8660992 234441614 107.7 GiB 8300 Linux filesystem<br />
<br />
Command (? for help): </console><br />
<br />
Above, you'll see that we have a 500 MiB boot partition, a 32 MiB "BIOS boot partition" (also known as the GRUB boot loader partition), 4 GiB of swap, and the remaining disk used by a 107.7 GiB root partition.<br />
<br />
===== For new <tt>gdisk</tt> users =====<br />
<br />
These partitions were created using the "<tt>n</tt>" command from within <tt>gdisk</tt>. The <tt>gdisk</tt> commands to create the partition table above are as follows. Adapt sizes as necessary, although these defaults will work for most users. The partition codes entered below can be found in the [[#Partitioning Recommendations|Partitioning Recommendations]] table below, in the GPT Code column.<br />
<br />
Within <tt>gdisk</tt>, follow these steps:<br />
<br />
'''Create a new empty partition table''' (This ''will'' erase all data on the disk when saved):<br />
<br />
<console><br />
Command: ##i##o ↵<br />
This option deletes all partitions and creates a new protective MBR.<br />
Proceed? (Y/N): ##i##y ↵<br />
</console><br />
<br />
'''Create Partition 1''' (boot):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##1 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+500M ↵<br />
Hex Code: ##i##↵<br />
</console><br />
<br />
'''Create Partition 2''' (GRUB):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##2 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+32M ↵<br />
Hex Code: ##i##EF02 ↵<br />
</console><br />
<br />
'''Create Partition 3''' (swap):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##3 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##+4G ↵<br />
Hex Code: ##i##8200 ↵<br />
</console><br />
<br />
'''Create Partition 4''' (root):<br />
<br />
<console><br />
Command: ##i##n ↵<br />
Partition Number: ##i##4 ↵<br />
First sector: ##i##↵<br />
Last sector: ##i##↵##!i## (for rest of disk)<br />
Hex Code: ##i##↵<br />
</console><br />
<br />
Along the way, you can type "<tt>p</tt>" and hit Enter to view your current partition table. If you make a mistake, you can type "<tt>d</tt>" to delete an existing partition that you created. When you are satisfied with your partition setup, type "<tt>w</tt>" to write your configuration to disk:<br />
<br />
'''Write Partition Table To Disk''':<br />
<br />
<console><br />
Command: ##i##w ↵<br />
Do you want to proceed? (Y/N): ##i##Y ↵<br />
</console><br />
<br />
The partition table will now be written to disk and <tt>gdisk</tt> will close.<br />
<br />
Now, your GPT/GUID partitions have been created, and will show up as the following ''block devices'' under Linux:<br />
<br />
* <tt>/dev/sda1</tt>, which will be used to hold the <tt>/boot</tt> filesystem, <br />
* <tt>/dev/sda2</tt>, which will be used directly by the new GRUB,<br />
* <tt>/dev/sda3</tt>, which will be used for swap space, and <br />
* <tt>/dev/sda4</tt>, which will hold your root filesystem.<br />
<br />
===== For Previous fdisk users =====<br />
<br />
If you have installed Gentoo Linux before, the one thing that is likely new to you here is the GRUB boot loader partition, which is listed as "BIOS boot partition" within <tt>gdisk</tt>. This partition is required for GRUB 2 to boot GPT/GUID boot disks. What is it? In GRUB-speak, this partition is essentially the location of the meat of GRUB's boot loading code. If you've used GRUB Legacy in the past, this partition is where the new GRUB stores the equivalent of the <tt>stage1_5</tt> and <tt>stage2</tt> files in legacy GRUB. Since GPT-based partition tables have less dead space at the beginning of the disk than their MBR equivalents, an explicitly defined partition of code <tt>EF02</tt> is required to hold the guts of the boot loader.<br />
<br />
In all other respects, the partition table is similar to that which you might create for an MBR-based disk during a Gentoo Linux installation. We have a boot and a root partition with code <tt>0700</tt>, and a Linux swap partition with code <tt>8200</tt>.<br />
<br />
===== Partitioning Recommendations =====<br />
<br />
Below are our partitioning recommendations in table form. For GPT-based partitions, use the GPT Block Device and GPT Code columns with <tt>gdisk</tt>. For legacy MBR-based partitions, use the MBR Block Device and MBR code columns with <tt>fdisk</tt>:<br />
<br />
{| {{table}} <br />
!Partition<br />
!Size<br />
!MBR Block Device (<tt>fdisk</tt>)<br />
!GPT Block Device (<tt>gdisk</tt>)<br />
!Filesystem<br />
!MBR Code<br />
!GPT Code<br />
|-<br />
|<tt>/boot</tt><br />
|500 MB<br />
|<tt>/dev/sda1</tt><br />
|<tt>/dev/sda1</tt><br />
|ext2<br />
|83<br />
|8300<br />
|-<br />
|GRUB boot loader partition<br />
|32 MB<br />
| ''not required for MBR''<br />
|<tt>/dev/sda2</tt><br />
|For GPT/GUID only, skip for MBR - no filesystem.<br />
|''N/A''<br />
|EF02<br />
|-<br />
|swap<br />
|2x RAM for low-memory systems and production servers; otherwise 2GB.<br />
|<tt>/dev/sda2</tt><br />
|<tt>/dev/sda3</tt><br />
|swap (default)<br />
|82<br />
|8200<br />
|-<br />
|<tt>/</tt> (root)<br />
|Rest of the disk, minimum of 10GB.<br />
|<tt>/dev/sda3</tt><br />
|<tt>/dev/sda4</tt><br />
|XFS recommended, alternatively ext4<br />
|83<br />
|8300<br />
|-<br />
|<tt>/home</tt> (optional) <br />
|User storage and media. Typically most of the disk.<br />
|<tt>/dev/sda4</tt> (if created)<br />
|<tt>/dev/sda5</tt> (if created)<br />
|XFS recommended, alternatively ext4<br />
|83<br />
|8300<br />
|-<br />
| LVM (optional)<br />
| If you want to create an LVM volume.<br />
| <tt>/dev/sda4</tt> (PV, if created)<br />
| <tt>/dev/sda5</tt> (PV, if created)<br />
| LVM PV<br />
| 8E<br />
| 8E00<br />
|}<br />
<br />
==== Creating filesystems ====<br />
<br />
Before your newly-created partitions can be used, the block devices need to be initialized with filesystem ''metadata''. This process is known as ''creating a filesystem'' on the block devices. After filesystems are created on the block devices, they can be mounted and used to store files.<br />
<br />
You will not create a filesystem on your swap partition, but will initialize it using the <tt>mkswap</tt> command so that it can be used as disk-based virtual memory. Then we'll run the <tt>swapon</tt> command to make your newly-initialized swap space active within the live CD environment, in case it is needed during the rest of the install process.<br />
<br />
Note that we will not create a filesystem on the GRUB boot loader partition, as GRUB writes binary data directly to that partition when the boot loader is installed, which we'll do later.<br />
<br />
You can see the commands you will need to type below. Like the rest of this document, it assumes that you are using a GPT partitioning scheme. If you are using MBR, your root filesystem will likely be created on <tt>/dev/sda3</tt> instead and you will need to adjust the target block devices. If you are following our recommendations, then simply do this:<br />
<br />
'''We generally recommend XFS for root filesystems, although ext4 is also a good choice.''' This tutorial assumes the use of XFS. If you want to use ext4, then be sure that your <tt>/etc/fstab</tt> file reflects this.<br />
<br />
{{fancywarning|1=<br />
Please use ext4 exclusively when deploying an OpenVZ host. The Parallels development team tests extensively with ext4, and modern versions of <tt>openvz-rhel6-stable</tt> are '''not''' compatible with XFS, and you may experience kernel bugs.<br />
}}<br />
<br />
'''To use XFS as your root filesystem:'''<br />
<br />
<console><br />
# ##i##mke2fs -t ext2 /dev/sda1 <br />
# ##i##mkfs.xfs /dev/sda4<br />
# ##i##mkswap /dev/sda3<br />
# ##i##swapon /dev/sda3<br />
</console><br />
<br />
'''To use ext4 as your root filesystem:'''<br />
<br />
<console><br />
# ##i##mke2fs -t ext2 /dev/sda1 <br />
# ##i##mkfs.ext4 /dev/sda4<br />
# ##i##mkswap /dev/sda3<br />
# ##i##swapon /dev/sda3<br />
</console><br />
<br />
==== Mounting filesystems ====<br />
<br />
Mount the newly-created filesystems as follows, creating <tt>/mnt/funtoo</tt> as the installation mount point:<br />
<br />
<console><br />
# ##i##mkdir /mnt/funtoo<br />
# ##i##mount /dev/sda4 /mnt/funtoo<br />
# ##i##mkdir /mnt/funtoo/boot<br />
# ##i##mount /dev/sda1 /mnt/funtoo/boot<br />
</console><br />
<br />
Optionally, if you have a separate filesystem for <tt>/home</tt> or anything else:<br />
<br />
<console><br />
# ##i##mkdir /mnt/funtoo/home<br />
# ##i##mount /dev/sda5 /mnt/funtoo/home<br />
</console><br />
<br />
If you have <tt>/tmp</tt> or <tt>/var/tmp</tt> on a separate filesystem, be sure to change the permissions of the mount point to be globally-writeable after mounting, as follows:<br />
<br />
<console><br />
# ##i##chmod 1777 /mnt/funtoo/tmp<br />
</console><br />
<br />
=== Installing the Stage 3 tarball ===<br />
==== Stage 3 tarball ====<br />
<br />
After creating filesystems, the next step is downloading the initial Stage 3 tarball. The Stage 3 is a pre-compiled system used as a starting point to install Funtoo Linux. Visit the [[Download]] page and copy the URL to the Stage 3 tarball you want to use. We will download it soon.<br />
<br />
{{fancyimportant|If your system's date and time are too far off (typically by months or years,) then it may prevent Portage from properly downloading source tarballs. This is because some of our sources are downloaded via HTTPS, which use SSL certificates and are marked with an activation and expiration date.}}<br />
<br />
Now is a good time to verify the date and time are correctly set to UTC. Use the <tt>date</tt> command to verify the date and time:<br />
<br />
<console><br />
# ##i##date<br />
Fri Jul 15 19:47:18 UTC 2011<br />
</console><br />
<br />
If the date and/or time need to be corrected, do so using <tt>date MMDDhhmmYYYY</tt>, keeping in mind <tt>hhmm</tt> are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:<br />
<br />
<console><br />
# ##i##date 071620002011<br />
Fri Jul 16 20:00:00 UTC 2011<br />
</console><br />
<br />
Once you are in your Funtoo Linux root filesystem, use <tt>wget</tt> to download the Stage 3 tarball you have chosen from the [[Download]] page to use as the basis for your new Funtoo Linux system. It should be saved to the <tt>/mnt/funtoo</tt> directory as follows:<br />
<br />
<console># ##i##cd /mnt/funtoo<br />
# ##i##wget http://ftp.osuosl.org/pub/funtoo/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz<br />
</console><br />
<br />
<br />
Note that 64-bit systems can run 32-bit or 64-bit stages, but 32-bit systems can only run 32-bit stages. Make sure that you select a Stage 3 build that is appropriate for your CPU. If you are not certain, it is a safe bet to choose the <tt>generic_64</tt> or <tt>generic_32</tt> stage. Consult the [[Download]] page for more information.<br />
<br />
Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your stage 3 tarball:<br />
<console><br />
# ##i##tar xpf stage3-latest.tar.xz<br />
</console><br />
<br />
{{fancyimportant|It is very important to use <tt>tar</tt>'s "<tt>p</tt>" option when extracting the Stage 3 tarball - it tells <tt>tar</tt> to ''preserve'' any permissions and ownership that exist within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.}}<br />
<br />
=== Chroot into Funtoo ===<br />
Before chrooting into your new system, there's a few things that need to be done first. You will need to mount /proc and /dev inside your new system. Use the following commands:<br />
<console><br />
# ##i##cd /mnt/funtoo<br />
# ##i##mount -t proc none proc<br />
# ##i##mount --rbind /sys sys<br />
# ##i##mount --rbind /dev dev<br />
</console><br />
<br />
You'll also want to copy over <tt>resolv.conf</tt> in order to have proper DNS name resolution from inside the chroot:<br />
<console><br />
# ##i##cp /etc/resolv.conf etc<br />
</console><br />
<br />
Now you can chroot into your new system. Use <tt>env</tt> before <tt>chroot</tt> to ensure that no environment variables from the installation media are used by your new system:<br />
<br />
<console><br />
# ##i##env -i HOME=/root TERM=$TERM chroot . bash -l<br />
</console><br />
<br />
{{fancynote|Users of live CDs with 64-bit kernels: Some software may use <tt>uname -r</tt> to check whether the system is 32 or 64-bit. You may want append linux32 to the chroot command as a workaround, but it's generally not needed.}}<br />
{{fancyimportant|If you receive the error "<tt>chroot: failed to run command `/bin/bash': Exec format error</tt>", it is probably because you are running a 32-bit kernel and trying to execute 64-bit code. SystemRescueCd boots with a 32-bit kernel by default.}}<br />
<br />
It's also a good idea to change the default command prompt while inside the chroot. This will avoid confusion if you have to change terminals. Use this command:<br />
<console><br />
# ##i##export PS1="(chroot) $PS1"<br />
</console><br />
<br />
Congratulations! You are now chrooted inside a Funtoo Linux system. Now it's time to get Funtoo Linux properly configured so that Funtoo Linux will boot successfully when your system is restarted.<br />
<br />
=== Downloading the Portage tree ===<br />
<br />
{{fancynote|For an alternative way to do this, see [[Installing Portage From Snapshot]].}}<br />
Now it's time to install a copy of the Portage repository, which contains package scripts (ebuilds) that tell portage how to build and install thousands of different software packages. To create the Portage repository, simply run <tt>emerge --sync</tt> from within the chroot. This will automatically clone the portage tree from [http://github.com/ GitHub]:<br />
<br />
<console><br />
(chroot) # ##i##emerge --sync<br />
</console><br />
<br />
{{fancyimportant|If you receive the error with initial <tt>emerge --sync</tt> due to git protocol restrictions, change <tt>SYNC</tt> variable in <tt>/etc/portage/make.conf</tt>}}<br />
<pre><br />
SYNC="https://github.com/funtoo/ports-2012.git"<br />
</pre><br />
<br />
<br />
=== Configuring your system ===<br />
As is expected from a Linux distribution, Funtoo Linux has its share of configuration files. The one file you are absolutely required to edit in order to ensure that Funtoo Linux boots successfully is <tt>/etc/fstab</tt>. The others are optional. Here are a list of files that you should consider editing:<br />
<br />
{| {{table}}<br />
!File<br />
!Do I need to change it?<br />
!Description<br />
|-<br />
|<tt>/etc/fstab</tt><br />
|'''YES - required'''<br />
|Mount points for all filesystems to be used at boot time. This file must reflect your disk partition setup. We'll guide you through modifying this file below.<br />
|-<br />
|<tt>/etc/localtime</tt><br />
|''Maybe - recommended''<br />
|Your timezone, which will default to UTC if not set. This should be a symbolic link to something located under /usr/share/zoneinfo (e.g. /usr/share/zoneinfo/America/Montreal) <br />
|-<br />
|<tt>/etc/make.conf<br/>/etc/portage/make.conf&nbsp;(new&nbsp;location)</tt><br />
|''Maybe - recommended''<br />
|Parameters used by gcc (compiler), portage, and make. It's a good idea to set MAKEOPTS. This is covered later in this document.<br />
|-<br />
|<tt>/etc/conf.d/hostname</tt><br />
|''Maybe - recommended''<br />
|Used to set system hostname. Set to the fully-qualified (with dots) name. Defaults to <tt>localhost</tt> if not set.<br />
|-<br />
|<tt>/etc/hosts</tt><br />
|''No''<br />
| You no longer need to manually set the hostname in this file. This file is automatically generated by <tt>/etc/init.d/hostname</tt>.<br />
|-<br />
|<tt>/etc/conf.d/keymaps</tt><br />
|Optional<br />
|Keyboard mapping configuration file (for console pseudo-terminals). Set if you have a non-US keyboard. See [[Funtoo Linux Localization]].<br />
|-<br />
|<tt>/etc/conf.d/hwclock</tt><br />
|Optional<br />
|How the time of the battery-backed hardware clock of the system is interpreted (UTC or local time). Linux uses the battery-backed hardware clock to initialize the system clock when the system is booted.<br />
|-<br />
|<tt>/etc/conf.d/modules</tt><br />
|Optional<br />
|Kernel modules to load automatically at system startup. Typically not required. See [[Additional Kernel Resources]] for more info.<br />
|-<br />
|<tt>profiles</tt><br />
|Optional<br />
|Some useful portage settings that may help speed up intial configuration.<br />
|}<br />
<br />
If you're installing an English version of Funtoo Linux, you're in luck as most of the configuration files can be used as-is. If you're installing for another locale, don't worry. We will walk you through the necessary configuration steps on the [[Funtoo Linux Localization]] page, and if needed, there's always plenty of friendly, helpful support. (See [[#Community portal|Community]])<br />
<br />
Let's go ahead and see what we have to do. Use <tt>nano -w <name_of_file></tt> to edit files -- the "<tt>-w</tt>" disables word-wrapping, which is handy when editing configuration files. You can copy and paste from the examples.<br />
<br />
{{fancywarning|It's important to edit your <tt>/etc/fstab</tt> file before you reboot! You will need to modify both the "fs" and "type" columns to match the settings for your partitions and filesystems that you created with <tt>gdisk</tt> or <tt>fdisk</tt>. Skipping this step may prevent Funtoo Linux from booting successfully.}}<br />
<br />
==== /etc/fstab ====<br />
<br />
<tt>/etc/fstab</tt> is used by the <tt>mount</tt> command which is ran when your system boots. Statements of this file inform <tt>mount</tt> about partitions to be mounted and how they are mounted. In order for the system to boot properly, you must edit <tt>/etc/fstab</tt> and ensure that it reflects the partition configuration you used earlier:<br />
<br />
<console><br />
(chroot) # ##i##nano -w /etc/fstab<br />
</console><br />
<br />
You can use arrow keys to move around and hit Control-X to exit. If you want to save your changes, type "<tt>Y</tt>" when asked if you want to save the modified buffer, or hit Control-O before closing <tt>nano</tt>. Otherwise your changes will be discarded.<br />
<br />
<pre><br />
# The root filesystem should have a pass number of either 0 or 1.<br />
# All other filesystems should have a pass number of 0 or greater than 1.<br />
#<br />
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.<br />
#<br />
# See the manpage fstab(5) for more information.<br />
#<br />
# <fs> <mountpoint> <type> <opts> <dump/pass><br />
<br />
/dev/sda1 /boot ext2 noatime 1 2<br />
/dev/sda3 none swap sw 0 0<br />
/dev/sda4 / ext4 noatime 0 1<br />
#/dev/cdrom /mnt/cdrom auto noauto,ro 0 0<br />
</pre><br />
<br />
==== /etc/localtime ====<br />
<br />
<tt>/etc/localtime</tt> is used to specify the timezone that your machine is in, and defaults to UTC. If you would like your Funtoo Linux system to use local time, you should replace <tt>/etc/localtime</tt> with a symbolic link to the timezone that you wish to use. <br />
<br />
<console><br />
(chroot) # ##i##ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime<br />
</console><br />
<br />
The above sets the timezone to Mountain Standard Time (with daylight savings). Type <tt>ls /usr/share/zoneinfo</tt> to see what timezones are available. There are also sub-directories containing timezones described by location.<br />
<br />
==== /etc/make.conf ====<br />
<br />
{{fancynote|This file is the symlink to /etc/portage/make.conf, new default location, edit /etc/portage/make.conf.}}<br />
<br />
MAKEOPTS can be used to define how many parallel compilations should occur when you compile a package, which can speed up compilation significantly. A rule of thumb is the number of CPUs (or CPU threads) in your system plus one. If for example you have a dual core processor without [[wikipedia:Hyper-threading|hyper-threading]], then you would set MAKEOPTS to 3:<br />
<br />
<pre><br />
MAKEOPTS="-j3" <br />
</pre><br />
<br />
If you are unsure about how many processors/threads you have then use /proc/cpuinfo to help you.<br />
<console><br />
(chroot) # ##i##grep "processor" /proc/cpuinfo | wc -l<br />
16<br />
</console><br />
<br />
Set MAKEOPTS to this number plus one:<br />
<br />
<pre><br />
MAKEOPTS="-j17"<br />
</pre><br />
<br />
USE flags define what functionality is enabled when packages are built. It is not recommended to add a lot of them during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("<tt>-</tt>") sign tells Portage not to use the flag when compiling. A Funtoo guide to USE flags will be available in the future. For now, you can find out more information about USE flags in the [http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=2&chap=2 Gentoo Handbook].<br />
<br />
LINGUAS tells Portage which local language to compile the system and applications in (those who use LINGUAS variable like OpenOffice). It is not usually necessary to set this if you use English. If you want another language such as French (fr) or German (de), set LINGUAS appropriately:<br />
<br />
<pre><br />
LINGUAS="fr"<br />
</pre><br />
<br />
==== /etc/conf.d/hwclock ====<br />
If you dual-boot with Windows, you'll need to edit this file and change '''clock''' to '''local''', because Windows will set your hardware clock to local time every time you boot Windows. Otherwise you normally wouldn't need to edit this file.<br />
<console><br />
(chroot) # ##i##nano -w /etc/conf.d/hwclock<br />
</console><br />
<br />
==== Localization ====<br />
<br />
By default, Funtoo Linux is configured with Unicode (UTF-8) enabled, and for the US English locale and keyboard. If you would like to configure your system to use a non-English locale or keyboard, see [[Funtoo Linux Localization]].<br />
<br />
==== Profiles ====<br />
<br />
[[Funtoo 1.0 Profile|Funtoo profiles]] are used to define defaults for Portage specific to your needs. There are 4 basic profile types: arch, build, [[Flavors and Mix-ins|flavor, and mix-ins]]:<br />
<br />
;arch: typically <tt>x86-32bit</tt> or <tt>x86-64bit</tt>, this defines the processor type and support of your system. This is defined when your stage was built and should not be changed.<br />
;build: defines whether your system is a <tt>current</tt>, <tt>stable</tt> or <tt>experimental</tt> build. <tt>current</tt> systems will have newer packages unmasked than <tt>stable</tt> systems.<br />
;flavor: defines the general type of system, such as <tt>server</tt> or <tt>desktop</tt>, and will set default USE flags appropriate for your needs.<br />
;mix-ins: define various optional settings that you may be interested in enabling.<br />
<br />
One arch, build and flavor must be set for each Funtoo Linux system, while mix-ins are optional and you can enable more than one if desired.<br />
<br />
Remember that profiles can often be inherited. For example, the <tt>desktop</tt> flavor inherits the <tt>workstation</tt> flavor settings, which in turn inherits the <tt>X</tt> and <tt>audio</tt> mix-ins. You can view this by using eselect:<br />
<br />
<console><br />
(chroot) # ##i##eselect profile show<br />
Currently set profiles:<br />
arch: gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit<br />
build: gentoo:funtoo/1.0/linux-gnu/build/current<br />
flavor: gentoo:funtoo/1.0/linux-gnu/flavor/desktop<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/kde<br />
<br />
Automatically enabled profiles:<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/print<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/X<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/audio<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/dvd<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/media<br />
mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/console-extras<br />
<br />
<br />
</console><br />
<br />
To view installed profiles:<br />
<console><br />
(chroot) # ##i##eselect profile list<br />
</console><br />
<br />
To change the profile flavor:<br />
<console><br />
(chroot) # ##i##eselect profile set-flavor 7<br />
</console><br />
<br />
To add a mix-in:<br />
<br />
<console><br />
(chroot) # ##i##eselect profile add 10<br />
</console><br />
<br />
=== Configuring and installing the Linux kernel ===<br />
<br />
Now it's time to build and install a Linux kernel, which is the heart of any Funtoo Linux system. In the past, the process of creating a kernel that actually booted your system could be time-consuming and require a great deal of trial and error. Fortunately, Funtoo Linux offers an option to automatically build a kernel for you that will boot nearly all systems.<br />
<br />
If you are unfamiliar with how to manually configure your own kernel, or you simply want to get your system up and running quickly, you can emerge <tt>debian-sources</tt> with the <tt>binary</tt> USE flag set, which will automatically build the kernel and an initrd that will boot nearly all Funtoo Linux systems. This kernel is based on a linux-3.2 LTS official debian kernel package and is an easy way to get your system up and running relatively quickly.<br />
<br />
Click [http://wiki.debian.org/DebianKernel here] for a list of all architectures the Debian kernel supports. <br />
<br />
{{fancyimportant|<tt>debian-sources</tt> with <tt>binary</tt> USE flag requires at least 12GB in /var/tmp}}<br />
<br />
<console><br />
(chroot) # ##i##echo "sys-kernel/debian-sources binary" >> /etc/portage/package.use<br />
(chroot) # ##i##emerge debian-sources</console><br />
<br />
All done!<br />
<br />
{{fancynote|NVIDIA card users: the <tt>binary</tt> USE flag installs the Nouveau drivers which cannot be loaded at the same time as the proprietary drivers, and cannot be unloaded at runtime because of KMS. You need to blacklist it under <tt>/etc/modprobe.d/</tt>.}}<br />
{{fancynote|For an overview of other kernel options for Funtoo Linux, see [[Funtoo Linux Kernels]]. There maybe modules that the Debian kernel doesn't include, a situation where [http://www.funtoo.org/wiki/Funtoo_Linux_Kernels#Using_Debian-Sources_with_Genkernel genkernel] would be useful. Also be sure to see [[:Category:Hardware Compatibility|hardware compatibility]] information. We have compiled a very good reference for [[Dell PowerEdge 11G Servers]] that includes kernel compatibility information as well..}}<br />
<br />
<br />
The next step is to configure your boot loader so that your new kernel loads when the system boots.<br />
<br />
=== Installing a Bootloader ===<br />
<br />
==== Installing Grub ====<br />
<br />
The boot loader is responsible for loading the kernel from disk when your computer boots. For new installations, GRUB 2 and Funtoo's boot-update tool should be used as a boot loader. GRUB supports both GPT/GUID and legacy MBR partitioning schemes.<br />
<br />
To use this recommended boot method, first emerge <tt>boot-update</tt>. This will also cause <tt>grub-2</tt> to be merged, since it is a dependency of <tt>boot-update</tt>.<br />
<br />
<console><br />
(chroot) # ##i##emerge boot-update<br />
</console><br />
<br />
Then, edit <tt>/etc/boot.conf</tt> and specify "<tt>Funtoo Linux genkernel</tt>" as the <tt>default</tt> setting at the top of the file, replacing <tt>"Funtoo Linux"</tt>. <br />
<br />
<tt>/etc/boot.conf</tt> should now look like this:<br />
<br />
<pre><br />
boot {<br />
generate grub<br />
default "Funtoo Linux genkernel"<br />
timeout 3 <br />
}<br />
<br />
"Funtoo Linux" {<br />
kernel bzImage[-v]<br />
# params += nomodeset<br />
}<br />
<br />
"Funtoo Linux genkernel" {<br />
# if you use bliss-kernel package<br />
# you should change string<br />
# kernel kernel[-v]<br />
# to<br />
# kernel kernel/[-v]/kernel[-v]<br />
kernel kernel[-v]<br />
initrd initramfs[-v]<br />
params += real_root=auto <br />
# params += nomodeset<br />
} <br />
</pre><br />
<br />
If you use bliss-kernel, your <tt>/etc/boot.conf</tt> should look like:<br />
<br />
<pre><br />
boot {<br />
generate grub<br />
default "Funtoo Linux genkernel"<br />
timeout 3 <br />
}<br />
<br />
"Funtoo Linux" {<br />
kernel bzImage[-v]<br />
# params += nomodeset<br />
}<br />
<br />
"Funtoo Linux genkernel" {<br />
kernel kernels/[-v]/kernel[-v]<br />
initrd initramfs[-v]<br />
params += real_root=auto <br />
# params += nomodeset<br />
} <br />
</pre><br />
<br />
Please read <tt>man boot.conf</tt> for further details.<br />
<br />
===== Running grub-install and boot-update =====<br />
<br />
Finally, we will need to actually install the GRUB boot loader to your disk, and also run <tt>boot-update</tt> which will generate your boot loader configuration file:<br />
<br />
<console><br />
(chroot) # ##i##grub-install --no-floppy /dev/sda<br />
(chroot) # ##i##boot-update<br />
</console><br />
<br />
You only need to run <tt>grub-install</tt> when you first install Funtoo Linux, but you need to re-run <tt>boot-update</tt> every time you modify your <tt>/etc/boot.conf</tt> file, so your changes are applied on next boot.<br />
<br />
OK - your system should be ready to boot! Well, there are a few more loose ends...<br />
<br />
==== Installing Syslinux/Extlinux ====<br />
<br />
An alternate boot loader called extlinux can be used instead of GRUB if you desire. See the [[Extlinux|extlinux Guide]] for information on how to do this.<br />
<br />
=== Configuring your network ===<br />
<br />
It's important to ensure that you will be able to connect to your local-area network after you reboot into Funtoo Linux. There are three approaches you can use for configuring your network: NetworkManager, dhcpcd, and the [[Funtoo Linux Networking]] scripts. Here's how to choose which one to use based on the type of network you want to set up.<br />
<br />
==== Wi-Fi ====<br />
===== Using NetworkManager =====<br />
For laptop/mobile systems where you will be using Wi-Fi and connecting to various networks, NetworkManager is strongly recommended. The Funtoo version of NetworkManager is fully functional even from the command-line, so you can use it even without X or without the Network Manager applet. Here are the steps involved in setting up NetworkManager:<br />
<br />
<console><br />
# ##i##emerge linux-firmware<br />
# ##i##emerge networkmanager<br />
# ##i##rc-update add NetworkManager default<br />
</console><br />
<br />
Above, we installed linux-firmware which contains a complete collection of available firmware for many hardware devices including Wi-Fi adapters, plus NetworkManager to manage our network connection. Then we added NetworkManager to the <tt>default</tt> runlevel so it will start when Funtoo Linux boots.<br />
<br />
After you reboot into Funtoo Linux, you will be able to add a Wi-Fi connection this way:<br />
<br />
<console><br />
# ##i##addwifi -S wpa -K 'wifipassword' mywifinetwork<br />
</console><br />
<br />
The <tt>addwifi</tt> command is used to configure and connect to a WPA/WPA2 Wi-Fi network named <tt>mywifinetwork</tt> with the password <tt>wifipassword</tt>. This network configuration entry is stored in <tt>/etc/NetworkManager/system-connections</tt> so that it will be remembered in the future. You should only need to enter this command once for each Wi-Fi network you connect to.<br />
<br />
===== Using wpa_supplicant =====<br />
If for some reasons, you don't want to use a tool such as NetworkManager of wicd, you can edit the wpa_supplicant configuration file, located at /etc/wpa_supplicant.conf.<br />
The syntax is very easy :<br />
<console><br />
# ##i##network={<br />
# ##i##ssid="MyWifiName"<br />
# ##i##psk="lol42-wifi"<br />
# ##i##}<br />
<br />
# ##i##network={<br />
# ##i##ssid="Other Network"<br />
# ##i##psk="6d96270004515a0486bb7f76196a72b40c55a47f"<br />
# ##i##}<br />
</console><br />
You can now start wpa_supplicant with<br />
<console><br />
# ##i##wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf<br />
</console><br />
wpa_supplicant will automatically connect to the first avaible network.<br />
You can of course set an alias for the command :<br />
<console><br />
# ##i## echo "wifi='wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf'" >> .${SHELL}rc<br />
</console><br />
==== Desktop (Wired Ethernet) ====<br />
<br />
For a home desktop or workstation with wired Ethernet that will use DHCP, the simplest and most effective option to enable network connectivity is to simply add <tt>dhcpcd</tt> to the default runlevel:<br />
<br />
<console><br />
# ##i##rc-update add dhcpcd default<br />
</console><br />
<br />
When you reboot, <tt>dhcpcd</tt> will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.<br />
<br />
==== Server (Static IP) ====<br />
<br />
For servers, the [[Funtoo Linux Networking]] scripts are recommended. They are optimized for static configurations and things like virtual ethernet bridging for virtualization setups. See [[Funtoo Linux Networking]] for information on how to use Funtoo Linux's template-based network configuration system.<br />
<br />
=== Finishing Steps ===<br />
<br />
==== Set your root password ====<br />
It's imperative that you set your root password before rebooting so that you can log in.<br />
<console><br />
(chroot) # ##i##passwd<br />
</console><br />
<br />
===Restart your system ===<br />
<br />
Now is the time to leave chroot, to unmount Funtoo Linux partitions and files and to restart your computer. When you restart, the GRUB boot loader will start, load the Linux kernel and initramfs, and your system will begin booting.<br />
<br />
Leave the chroot, change directory to /mnt, unmount your Funtoo partitions, and reboot.<br />
<console><br />
(chroot) # ##i##exit<br />
# ##i##cd /mnt<br />
# ##i##umount -l funtoo<br />
# ##i##reboot<br />
</console><br />
<br />
You should now see your system reboot, the GRUB boot loader appear for a few seconds, and then see the Linux kernel and initramfs loading. After this, you should see Funtoo Linux itself start to boot, and you should be greeted with a <tt>login:</tt> prompt. Funtoo Linux has been successfully installed!<br />
<br />
===Next Steps===<br />
<br />
If you are brand new to Funtoo Linux and Gentoo Linux, please check out [[Funtoo Linux First Steps]], which will help get you acquainted with your new system. We also have a category for our [[:Category:Official Documentation|official documentation]], which includes all docs that we officially maintain for installation and operation of Funtoo Linux.<br />
<br />
We also have a number of pages dedicated to setting up your system, which you can find below. If you are interested in adding a page to this list, add it to the "First Steps" MediaWiki category.<br />
<br />
{{#ask: [[Category:First Steps]] | format=category }}<br />
<br />
If your system did not boot correctly, see [[Installation Troubleshooting]] for steps you can take to resolve the problem.<br />
<br />
[[Category:HOWTO]]<br />
[[Category:Install]]<br />
[[Category:Official Documentation]]</div>Edelwin