Note:

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Difference between revisions of "Install"

From Funtoo
Jump to navigation Jump to search
(Redirected page to Install/Introduction)
Tag: New redirect
 
(39 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#widget:AddThis}}
#REDIRECT [[Install/Introduction]]
= Install Funtoo Linux =
__NOTITLE__
<languages/>
{{Announce|To help us translate this documentation, {{CreateAccount}}, log in to the wiki. Then go to Actions -> Translate in the menu, or click the "Translate this page" link, above. You will be able to select small parts of the install docs and translate these parts to your native language.}}
<translate>
== Introduction == <!--T:2--> 
 
<!--T:3-->
This document was written to help you install Funtoo Linux on PC-compatible systems, while keeping distracting options regarding system configuration to a minimum.
 
<!--T:4-->
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. If you're new to installing a Gentoo-based Linux, or new to Linux entirely -- welcome! We have attempted to make these installation instructions understandable to new users as well.
 
<!--T:5-->
{{Note|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. }}
 
== Installation Overview == <!--T:6-->
 
<!--T:7-->
This is a basic overview of the Funtoo installation process:
 
<!--T:8-->
# [[#Live CD|Download and boot the live CD of your choice]].
# [[#Prepare Hard Disk|Prepare your disk]].
# [[#Creating filesystems|Create]] and [[#Mounting filesystems|mount]] filesystems.
# [[#Installing the Stage 3 tarball|Install the Funtoo stage tarball]] of your choice.
# [[#Chroot into Funtoo|Chroot into your new system]].
# [[#Downloading the Portage tree|Download the Portage tree]].
# [[#Configuring your system|Configure your system]] and [[#Configuring your network|network]].
# [[#Kernel|Install a kernel]].
# [[#Installing a Bootloader|Install a bootloader]].
# [[#Finishing Steps|Complete final steps]].
# [[#Restart your system|Reboot and enjoy]].
 
{{/Download LiveCD}}
 
=== Prepare Hard Disk === <!--T:25-->
 
<!--T:26-->
In this section, you will need to choose a disk format to use for booting and partitioning -- either MBR or UEFI/GPT. If you are not familiar with the differences between these options, please review our [[Install/Disk Formats|Disk Formats]] page for an overview of each option and the trade-offs. Generally, it's usually safe to pick the legacy MBR method for system disks under 2TB in size and most modern PC systems support MBR as well as UEFI booting.
 
==== But First... ====
 
Before doing anything to your disks, make sure you are partitioning the right one. Use the {{c|lsblk}} command to view a list of all block devices on your system, as well as partitions on these block devices:
 
{{console|body=
# ##i##lsblk
NAME          MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
sda            8:0    0  1.8T  0 disk
├─sda1          8:1    0  512M  0 part
├─sda2          8:2    0    8G  0 part [SWAP]
└─sda3          8:3    0  1.8T  0 part
  ├─main-root 254:0    0  500G  0 lvm  /
  └─main-data 254:1    0  1.3T  0 lvm  /home
}}
 
Make sure you will not be overwriting any important data and that you have chosen the correct {{c|/dev/sd?}} device. Above, you can see that {{c|sda}} contains three partitions, {{c|sda1}}, {{c|sda2}} and {{c|sda3}}, and that {{c|sda3}} contains LVM volumes.
 
Once you've double-checked your target block device and made sure you'll be partitioning the correct disk, proceed to the next step.
 
{{/MBR Partitioning}}
 
{{/GPT Partitioning}}
 
{{/Creating Filesystems}}
 
{{/Mounting Filesystems}}
 
==== Setting the Date ==== <!--T:90-->
 
<!--T:91-->
{{Important|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. However, if your system time is relatively close to correct, you can probably skip this step for now.}}
 
<!--T:92-->
Now is a good time to verify the date and time are correctly set to UTC. Use the {{c|date}} command to verify the date and time:
</translate>
{{console|body=
###i## date
Fri Jul 15 19:47:18 UTC 2011
}}
<translate><!--T:93-->
If the date and/or time need to be corrected, do so using {{c|date MMDDhhmmYYYY}}, keeping in mind {{c|hhmm}} are in 24-hour format. The example below changes the date and time to "July 16th, 2011 @ 8:00PM" UTC:</translate>
 
{{console|body=
###i## date 071620002011
Fri Jul 16 20:00:00 UTC 2011
}}
<translate><!--T:94-->
Once you have set the system clock, it's a very good idea to copy the time to the hardware clock, so it persists across reboots:</translate>
 
{{console|body=###i## hwclock --systohc}}
<translate>
 
=== Installing the Stage 3 tarball === <!--T:95-->
 
<!--T:96-->
Now that filesystems are created and your hardware and system clock are set, 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. 
 
<!--T:97-->
To download the correct build of Funtoo Linux for your system, head over to the [[Subarches]] page. Subarches are builds of Funtoo Linux that are designed to run on a particular type of CPU, to offer the best possible performance. They also take advantage of the instruction sets available for each CPU.
 
If you don't know which subarch to choose, issue this command:
<console>
###i## gcc -march=native -Q --help=target | grep march
</console>
 
<!--T:98-->
The [[Subarches]] page lists all CPU-optimized versions of Funtoo Linux. Find the one that is appropriate for the type of CPU that your system has, and then click on its name in the first column (such as {{c|corei7}}, for example.) You will then go to a page dedicated to that subarch, and the stage3s available for download will be listed. If you are using a virtualization technology to run Funtoo Linux, and your VM may migrate to different types of hardware, then it's recommended that you use a stage3 that is optimized for the oldest CPU instruction set that your VM will run on, or a generic image if it may run on both AMD and Intel processors.
 
<!--T:99-->
For most subarches, you will have several stage3s available to choose from. This next section will help you understand which one to pick.
 
==== Which Build? ==== <!--T:100-->
 
<!--T:101-->
''Pick {{c|funtoo-current}}.''
 
==== Which Variant? ==== <!--T:104-->
 
<!--T:105-->
If you're not sure, pick {{c|standard}}.
 
<!--T:106-->
Our "regular" stage3's are listed with a variant of {{c|standard}}. The following variant builds are available:
 
<!--T:107-->
{{TableStart}}
{{2ColHead|Variant|Description}}
<tr><td>{{c|standard}}</td><td>The "standard" version of Funtoo Linux</td></tr>
<tr><td>{{c|pure64}}</td><td>A 64-bit build that drops multilib (32-bit compatibility) support. ''Can be ideal for server systems.''</td></tr>
{{TableEnd}}
 
==== Download the Stage3 ==== <!--T:108-->
 
<!--T:109-->
Once you have found the stage3 that you would like to download, use {{c|wget}} 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 {{f|/mnt/funtoo}} directory as follows:
</translate>
{{console|body=
###i## cd /mnt/funtoo
###i## wget https://build.funtoo.org/funtoo-current/x86-64bit/generic_64/stage3-latest.tar.xz
}}
<translate><!--T:110-->
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 {{c|generic_64}} or {{c|generic_32}} stage. Consult the [[Subarches]] page for more information.
 
<!--T:111-->
Once the stage is downloaded, extract the contents with the following command, substituting in the actual name of your Stage 3 tarball:</translate>
{{console|body=
###i## tar xpf stage3-latest.tar.xz
}}<translate>
<!--T:112-->
{{Important|It is very important to use {{c|tar's}} "{{c|'''p'''}}" option when extracting the Stage 3 tarball - it tells {{c|tar}} to ''preserve'' any permissions and ownership that exists within the archive. Without this option, your Funtoo Linux filesystem permissions will be incorrect.}}
 
=== Chroot into Funtoo === <!--T:113-->
To install Funtoo Linux, the {{c|chroot}} command is first used. The chroot command will "switch into" the new Funtoo Linux system, so the commands you execute after running "chroot" will run within your newly-extracted Funtoo Linux system.
 
<!--T:114-->
Before chrooting, there are a few things that need to be done to set up the chroot environment. You will need to mount {{f|/proc}}, {{f|/sys}} and {{f|/dev}} inside your new system. Use the following commands to do so:</translate>
{{console|body=
# ##i##cd /mnt/funtoo
# ##i##mount -t proc none proc
# ##i##mount --rbind /sys sys
# ##i##mount --rbind /dev dev
}}<translate>
<!--T:115-->
You'll also want to copy over {{f|resolv.conf}} in order to have proper resolution of Internet hostnames from inside the chroot:</translate>
{{console|body=
# ##i##cp /etc/resolv.conf /mnt/funtoo/etc/
}}<translate>
<!--T:116-->
Now you can chroot into your new system. Use <code>env</code> before <code>chroot</code> to ensure that no environment settings from the installation media are pulled in to your new system:</translate>
 
{{console|body=###i## env -i HOME=/root TERM=$TERM /bin/chroot . bash -l}}
<translate><!--T:117-->
{{Note|For users of live CDs with 64-bit kernels installing 32-bit systems: Some software may use {{c|uname -r}} to check whether the system is 32 or 64-bit. You may want to append linux32 to the chroot command as a workaround, but it's generally not needed.}}
{{Important|If you receive the error "{{c|chroot: failed to run command `/bin/bash': Exec format error}}", it is most likely because you are running a 32-bit kernel and trying to execute 64-bit code. Make sure that you have selected the proper type of kernel when booting SystemRescueCD.}}
 
<!--T:118-->
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:
{{console|body=# ##i##export PS1="(chroot) $PS1"}}
Test internet name resolution from within the chroot:
{{console|body=###i## ping -c 5 google.com}}
If you can't ping, make sure {{f|/etc/resolv.conf}} doesn't contain things like {{c|127.0.x.x}} addresses, if it does, change the {{c|127.0.x.x}} entry to {{c|8.8.8.8}} -- Google's public dns address.  Make sure to replace this with your dns of choice once the system is installed.
 
 
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 start successfully, without any manual assistance, when your system is restarted.
 
=== Downloading the Portage tree === <!--T:120-->
 
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 {{c|ego sync}} from within the chroot. This will automatically clone the portage tree from [https://github.com/funtoo/meta-repo GitHub] and all kit submodules:
 
{{console|body=
(chroot) ###i## ego sync
}}
 
=== Configuring your system === <!--T:123-->
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 {{f|/etc/fstab}}. The others are optional.
 
==== Using Nano ==== <!--T:124-->
 
<!--T:125-->
The default editor included in the chroot environment is called {{c|nano}}. To edit one of the files below, run nano as follows:
 
<!--T:126-->
{{console|body=
(chroot) ###i## nano -w /etc/fstab
}}
When in the editor, you can use arrow keys to move the cursor, and common keys like backspace and delete will work as expected. To save the file, press Control-X, and answer {{c|y}} when prompted to save the modified buffer if you would like to save your changes.
 
==== Configuration Files ==== <!--T:127-->
 
<!--T:128-->
Here are a full list of files that you may want to edit, depending on your needs:
{{TableStart}}
{{3ColHead|File|Do I need to change it?|Description}}
<tr  class="danger">
<td>{{c|/etc/fstab}}</td>
<td>'''YES - required'''</td>
<td>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.</td>
</tr><tr>
<td>{{c|/etc/localtime}}</td>
<td>''Maybe - recommended''</td>
<td>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) </td>
</tr><tr>
<td>{{c|/etc/portage/make.conf}}</td>
<td>''Maybe - recommended''</td>
<td>Parameters used by gcc (compiler), portage, and make. ''Note that it is normal for this file to be empty in Funtoo Linux, as many settings have been migrated to our enhanced profile system.''</td>
</tr><tr>
<td>{{c|/etc/conf.d/hostname}}</td>
<td>''Maybe - recommended''</td>
<td>Used to set system hostname. Set the {{c|hostname}} variable to the fully-qualified (with dots, ie. {{c|foo.funtoo.org}}) name if you have one. Otherwise, set to the local system hostname (without dots, ie. {{c|foo}}). Defaults to {{c|localhost}} if not set.</td>
</tr><tr>
<td>{{c|/etc/hosts}}</td>
<td>''No''</td>
<td> You no longer need to manually set the hostname in this file. This file is automatically generated by {{c|/etc/init.d/hostname}}.</td>
</tr><tr>
<td>{{c|/etc/conf.d/keymaps}}</td>
<td>Optional</td>
<td>Keyboard mapping configuration file (for console pseudo-terminals). Set if you have a non-US keyboard. See [[Funtoo Linux Localization]].</td>
</tr><tr>
<td>{{c|/etc/conf.d/hwclock}}</td>
<td>Optional</td>
<td>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.</td>
</tr><tr>
<td>{{c|/etc/conf.d/modules}}</td>
<td>Optional</td>
<td>Kernel modules to load automatically at system startup. Typically not required. See [[Additional Kernel Resources]] for more info.</td>
</tr><tr>
<td>{{c|/etc/conf.d/consolefont}}</td>
<td>Optional</td>
<td>Allows you to specify the default console font. To apply this font, enable the consolefont service by running rc-update add consolefont.</td>
</tr><tr>
<td>{{c|profiles}}</td>
<td>Optional</td>
<td>Some useful portage settings that may help speed up intial configuration.</td>
</tr>
{{TableEnd}}
 
<!--T:129-->
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 available. (See [[Getting Help]])
 
<!--T:130-->
Let's go ahead and see what we have to do. Use {{c|nano -w <name_of_file>}} to edit files -- the "{{c|-w}}" argument disables word-wrapping, which is handy when editing configuration files. You can copy and paste from the examples.
 
<!--T:131-->
{{Warning|It's important to edit your {{c|/etc/fstab}} 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 {{c|gdisk}} or {{c|fdisk}}. Skipping this step may prevent Funtoo Linux from booting successfully.}}
 
==== /etc/fstab ==== <!--T:132-->
 
<!--T:133-->
{{f|/etc/fstab}} is used by the {{c|mount}} command which is run when your system boots. Lines in this file inform {{c|mount}} about filesystems to be mounted and how they should be mounted. In order for the system to boot properly, you must edit {{f|/etc/fstab}} and ensure that it reflects the partition configuration you used earlier in the install process. If you can't remember the partition configuration that you used earlier, the {{c|lsblk}} command may be of help to you:
</translate>
{{console|body=
(chroot) ###i## nano -w /etc/fstab
}}
{{file|name=/etc/fstab|desc=An example fstab file|body=
# The root filesystem should have a pass number of either 0 or 1.
# All other filesystems should have a pass number of 0 or greater than 1.
#
# NOTE: If your BOOT partition is ReiserFS, add the notail option to opts.
#
# See the manpage fstab(5) for more information.
#
# <fs>     <mountpoint>  <type>  <opts>        <dump/pass>
 
/dev/sda1    /boot        ext2    noauto,noatime 1 2
/dev/sda2    none          swap    sw            0 0
/dev/sda3    /            ext4    noatime        0 1
#/dev/cdrom  /mnt/cdrom    auto    noauto,ro      0 0
}}
<translate>
<!--T:135-->
{{Note|If you're using UEFI to boot, change the {{f|/dev/sda1}} line so that it says {{c|vfat}} instead of {{c|ext2}}. Similarly, make sure that the {{f|/dev/sda3}} line specifies either {{c|xfs}} or {{c|ext4}}, depending on which filesystem you chose earlier on in the installation process when you created filesystems.}}
 
==== /etc/localtime ==== <!--T:136-->
 
<!--T:137-->
{{f|/etc/localtime}} 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 {{f|/etc/localtime}} with a symbolic link to the timezone that you wish to use.
 
<!--T:138-->
{{console|body=
(chroot) ###i## ln -sf /usr/share/zoneinfo/MST7MDT /etc/localtime
}}
The above sets the timezone to Mountain Standard Time (with daylight savings). Type {{c|ls /usr/share/zoneinfo}} to list available timezones. There are also sub-directories containing timezones described by location.
 
==== /etc/portage/make.conf ==== <!--T:139-->
 
<!--T:140-->
{{c|USE}} flags define what functionality is enabled when packages are built. It is not recommended to add a lot of USE flags during installation; you should wait until you have a working, bootable system before changing your USE flags. A USE flag prefixed with a minus ("{{c|-}}") 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 [https://wiki.gentoo.org/wiki/Handbook:AMD64/Working/USE Gentoo Handbook].
 
==== /etc/conf.d/hwclock ==== <!--T:147-->
If you dual-boot with Windows, you'll need to edit this file and change the value of '''clock''' from '''UTC''' 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.
{{console|body=
(chroot) ###i## nano -w /etc/conf.d/hwclock
}}
==== Localization ====
 
<!--T:148-->
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]].
 
=== Introducing Portage === <!--T:149-->
 
<!--T:150-->
Portage, the Funtoo Linux package manager has a command called <code>emerge</code> which is used to build and install packages from source. It also takes care of installing all of the package's dependencies. You call emerge like this:
 
<!--T:151-->
<console>
(chroot) # ##i##emerge packagename
</console>
 
<!--T:152-->
When you install a package by specifying its name in the command-line, Portage records its name in the <code>/var/lib/portage/world</code> file. It does so because it assumes that, since you have installed it by name, you want to consider it part of your system and want to keep the package updated in the future. This is a handy feature, since when packages are being added to the <code>world</code> set, we can update our entire system by typing:
 
<!--T:153-->
<console>
(chroot) # ##i##ego sync
(chroot) # ##i##emerge -auDN @world
</console>
 
<!--T:154-->
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 <code>world</code> set of packages. The options specified tell <code>emerge</code> to:
 
<!--T:155-->
* '''<code>a</code>''' - show us what will be emerged, and '''ask''' us if we want to proceed
* '''<code>u</code>''' - '''update''' the packages we specify -- don't emerge them again if they are already emerged.
* '''<code>D</code>''' - Consider the entire dependency tree of packages when looking for updates. In other words, do a '''deep''' update.
* '''<code>N</code>''' - Update any packages that have changed ('''new''') USE settings.
 
<!--T:156-->
You should also consider passing <code>--with-bdeps=y</code> when emerging @world, at least once in a while. This will update build dependencies as well.
 
<!--T:157-->
Of course, sometimes we want to install a package but not add it to the <code>world</code> file. This is often done because you only want the package installed temporarily or because you know the package in question is a dependency of another package. If this behavior is desired, you call emerge like this:
 
<!--T:158-->
<console>
(chroot) # ##i##emerge -1 packagename
</console>
 
<!--T:159-->
Advanced users may be interested in the [[Emerge]] wiki page.
 
==== Updating World ==== <!--T:160-->
 
<!--T:161-->
Certain packages in the Funtoo stage3 tarball are compiled with the bindist USE flag enabled by default.  bindist flag controlling  enable or disable of options for proprietary and/or patented part of code which is disallowed to distribute in images due to licensing issues.). You may notice a dependency resolution problem with bindist USE during updating packages after initial system setup. To avoid potential problems, '''update the system before first boot or any other package installation''' as shown below:
 
<!--T:162-->
<console>
(chroot) # ##i##ego sync
(chroot) # ##i##emerge -auDN @world
</console>
 
<!--T:163-->
{{fancyimportant|1=
Make sure you read any post emerge messages and follow their instructions. This is especially true if you have upgraded perl or python.}}
 
=== Kernel === <!--T:164-->
 
<!--T:165-->
Starting mid-May 2015, Funtoo Linux stage3's include a pre-built {{c|debian-sources}} kernel to make installation faster and easier. To see if debian-sources is installed, type:
</translate>
{{console|body=
(chroot) # ##i##emerge -s debian-sources
Searching...   
[ Results for search key : ##b##debian-sources##!b## ]
[ Applications found : ##b##1##!b## ]
 
*  ##b##sys-kernel/debian-sources##!b##
      ##g##Latest version available:##!g## 3.19.3
      ##g##Latest version installed:##!g## 3.19.3
      ##g##Size of files:##!g## 81,292 kB
      ##g##Homepage:##!g##      http://www.debian.org
      ##g##Description:##!g##  Debian Sources (and optional binary kernel)
      ##g##License:##!g##      GPL-2
}}
<translate>
<!--T:166-->
If a version is listed under {{c|Latest version installed}}, then debian-sources is already pre-built for you and you can skip the rest of the Kernel section, and proceed to the [[#Installing a Bootloader|Installing a Bootloader section]].
 
{{fancyimportant|1=
At this point it is wise to emerge latest {{c|sys-kernel/linux-firmware}} package, because various drivers rely on firmware blobs and instructions. Hardware like wi-fi cards, graphic cards, network cards, and others will not work properly or at all if firmware not present.}}
 
==== Building the Kernel ==== <!--T:167-->
 
<!--T:168-->
If you need to build a kernel for Funtoo Linux, please follow these steps:
 
<!--T:169-->
{{Fancynote|1=
See [[Funtoo Linux Kernels]] for a full list of kernels supported in Funtoo Linux. We recommend <code>debian-sources</code> for new users.}}
 
<!--T:170-->
{{fancyimportant|1=
<code>debian-sources</code> with <code>binary</code> USE flag requires at least 20GB free in <code>/var/tmp</code> and takes around 1 hour to build on a Intel Core i7 Processor.}}
 
<!--T:171-->
Let's emerge our kernel:
 
<!--T:172-->
<console>
(chroot) # ##i##emerge debian-sources
</console>
 
<!--T:173-->
Once <code>emerge</code> completes, you'll have a brand new kernel and initramfs installed to <code>/boot</code>, plus kernel headers installed in <code>/usr/src/linux</code>, and you'll be ready to configure the boot loader to load these to boot your Funtoo Linux system.
 
<!--T:174-->
{{warning|If you have a RAID in your machine, the kernel installation will pull in the <code>mdadm</code> tool as a dependency. It is important to edit the <code>/etc/mdadm.conf</code> file prior to rebooting the machine so the RAID is properly recognised and set up before the kernel attempts to mount it in the tree. Failing to do so can result in an unusable or even unbootable system! For specific details, consult the mdadm man page <code>man mdadm</code> or the [[Package:Mdadm|mdadm]] ebuild page.}}
 
<!--T:175-->
{{fancynote|NVIDIA card users: the <code>binary</code> 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 <code>/etc/modprobe.d/</code>.}}
 
<!--T:176-->
{{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.}}
 
=== Installing a Bootloader === <!--T:177-->
 
<!--T:178-->
These install instructions show you how to use GRUB to boot using BIOS (old-school) or UEFI (new-school). As of boot-update-1.7.2, now in Portage, the steps are very similar.
 
<!--T:179-->
First, emerge <code>boot-update</code>. This will also cause <code>grub-2</code> and {{c|efibootmgr}} to be merged, since they are dependencies:
 
<!--T:180-->
<console>
(chroot) # ##i##emerge boot-update
</console>
 
<!--T:181-->
Then, edit <code>/etc/boot.conf</code> using {{c|nano}} and specify "<code>Funtoo Linux genkernel</code>" as the <code>default</code> setting at the top of the file, replacing <code>"Funtoo Linux"</code>. Also, if you're not using memtest86+ remove the entry in boot.conf to avoid errors.
 
<!--T:182-->
<code>/etc/boot.conf</code> should now look like this:
</translate>
{{file|name=/etc/boot.conf|body=
boot {
generate grub
default "Funtoo Linux genkernel"
timeout 3
}
 
"Funtoo Linux" {
kernel bzImage[-v]
}
 
"Funtoo Linux genkernel" {
kernel kernel[-v]
initrd initramfs[-v]
params += real_root=auto
}
 
"Funtoo Linux better-initramfs" {
kernel vmlinuz[-v]
initrd /initramfs.cpio.gz
}
}}
<translate>
<!--T:183-->
If you are booting a custom or non-default kernel, please read <code>man boot.conf</code> for information on the various options available to you.
 
==== Old School (BIOS) MBR ==== <!--T:184-->
 
<!--T:185-->
When using "old school" BIOS booting, run the following command to install GRUB to your MBR, and generate the {{c|/boot/grub/grub.cfg}} configuration file that GRUB will use for booting:
 
<!--T:186-->
<console>
(chroot) # ##i##grub-install --target=i386-pc --no-floppy /dev/sda
(chroot) # ##i##boot-update
</console>
 
==== New School (UEFI) Boot Entry ==== <!--T:187-->
 
<!--T:188-->
If you're using "new school" UEFI booting, run of the following sets of commands, depending on whether you are installing a 64-bit or 32-bit system. This will add GRUB as a UEFI boot entry.
 
<!--T:189-->
For x86-64bit systems:
 
<!--T:190-->
<console>
(chroot) # ##i##grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
(chroot) # ##i##boot-update
</console>
 
<!--T:191-->
For x86-32bit systems:
 
<!--T:192-->
<console>
(chroot) # ##i##grub-install --target=i386-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
(chroot) # ##i##boot-update
</console>
 
==== First Boot, and in the future... ==== <!--T:193-->
 
<!--T:194-->
OK -- you are almost ready to boot!
 
<!--T:195-->
You only need to run <code>grub-install</code> when you first install Funtoo Linux, but you need to re-run <code>boot-update</code> every time you modify your <code>/etc/boot.conf</code> file or add new kernels to your system. This will regenerate {{c|/boot/grub/grub.cfg}} so that you will have new kernels available in your GRUB boot menu, the next time you reboot.
 
=== Configuring your network === <!--T:196-->
 
<!--T:197-->
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.
 
==== Wi-Fi ==== <!--T:198-->
 
<!--T:232-->
For laptop/mobile systems where you will be using Wi-Fi, roaming, and connecting to various networks NetworkManager is strongly recommended. 
Since Wi-Fi cards require firmware to operate, it is also recommended that you emerge the linux-firmware ebuild:
 
<!--T:233-->
{{console|body=(chroot) # ##i##emerge linux-firmware networkmanager
}}
 
Depending on your architecture, you might now see a message similar to the following:
 
{{console|body=
The following USE changes are necessary to proceed
...
}}
This means that your USE flags need to be updated to allow this installation. For now, you can let portage handle this for you by adding the flag <code>--autounmask-write</code>:
{{console|body=(chroot) # ##i##emerge linux-firmware networkmanager --autounmask-write
}}
After this, update the config:
{{console|body=(chroot) # ##i##dispatch-conf
}}
Accept the new config by pressing <code>u</code>. Then, you can proceed to install NetworkManager:
 
{{console|body=(chroot) # ##i##emerge linux-firmware networkmanager
(chroot) ###i## rc-update add NetworkManager default
}}
The above command will ensure that NetworkManager starts after you boot into Funtoo Linux. Once you've completed these installation steps and have booted into Funtoo Linux, you can use the {{c|nmtui}} command (which has an easy-to-use console-based interface) to configure NetworkManager so that it will connect (and automatically reconnect, after reboot) to a Wi-Fi access point:
{{console|body=# ##i##nmtui}}
For more information about NetworkManager, see the [[Package:NetworkManager|NetworkManager package page]].
 
<!--T:234-->
{{Note|wpa_supplicant is also a good choice for wireless network connections. See the {{package|net-wireless/wpa_supplicant}} package for steps involved in setting up wpa_supplicant.}}
 
==== Desktop (Wired DHCP) ==== <!--T:200-->
 
<!--T:201-->
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 {{c|dhcpcd}} to the default runlevel:
 
<!--T:203-->
{{console|body=
(chroot) # ##i##rc-update add dhcpcd default}}
When you reboot, {{c|dhcpcd}} will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.
 
<!--T:204-->
If your upstream DHCP server is dnsmasq, it can be configured to assign addresses via mac address to make servers on DHCP feasible.
 
==== Server (Static IP) ==== <!--T:205-->
 
<!--T:235-->
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.
 
==== Hostname ==== <!--T:207-->
By default Funtoo uses "localhost" as hostname. Although the system will work perfectly fine using this name, some ebuilds refuse to install when detecting localhost as hostname. It also may create confusion if several systems use the same hostname. Therefore, it is advised to change it to a more meaningful name. The hostname itself is arbitrary, meaning you can choose almost any combination of characters, as long as it makes sense to the system administrator. To change the hostname, edit
 
<!--T:208-->
{{console|body=
(chroot) # ##i##nano /etc/conf.d/hostname
}}
 
<!--T:209-->
Look for the line starting with hostname and change the entry between the quotes. Save the file, on the next boot Funtoo will use the new hostname.
 
<!--T:210-->
{{warning|Do not use special characters in the hostname, as the shell may interpret these, leading to unpredictable results. Use the Latin alphabet: a-z, A-Z, 0-9}}
{{tip|Use short hostnames (up to 8 or 10 characters) to prevent the terminal screen being filled with the hostname, leaving little space for the command itself. This become particularly poignant when coding long command strings in various programming languages like Bash, Python, SQL and Perl}}
 
=== Finishing Steps === <!--T:211-->
==== Set your root password ====
It's imperative that you set your root password before rebooting so that you can log in.
<console>
(chroot) # ##i##passwd
</console>
 
===Restart your system === <!--T:212-->
 
<!--T:213-->
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.
 
<!--T:214-->
Leave the chroot, change directory to /mnt, unmount your Funtoo partitions, and reboot.
<console>
(chroot) # ##i##exit
# ##i##cd /mnt
# ##i##umount -lR funtoo
# ##i##reboot
</console>
 
<!--T:215-->
{{fancynote|System Rescue CD will gracefully unmount your new Funtoo filesystems as part of its normal shutdown sequence.}}
 
<!--T:216-->
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 <code>login:</code> prompt. Funtoo Linux has been successfully installed!
 
=== Profiles === <!--T:217-->
 
<!--T:218-->
Once you have rebooted into Funtoo Linux, you can further customize your system to your needs by using [[Funtoo Profiles]]. A quick introduction to profiles is included below -- consult the [[Funtoo Profiles]] page for more detailed information. There are five basic profile types: arch, build, subarch, flavors and mix-ins:
 
<!--T:220-->
{{TableStart}}
{{2ColHead|Sub-Profile Type|Description}}
{{2Col|{{c|arch}}|Typically {{c|x86-32bit}} or {{c|x86-64bit}}, this defines the processor type and support of your system. This is defined when your stage was built and should not be changed.}}
{{2Col|{{c|build}}|Defines whether your system is a {{c|current}}, {{c|stable}} or {{c|experimental}} build. {{c|current}} systems will have newer packages unmasked than {{c|stable}} systems. This is defined when your stage is built and is typically not changed.}}
{{2Col|{{c|subarch}}|Defines CPU optimizations for your system. The subarch is set at the time the stage3 is built, but can be changed later to better settings if necessary. Be sure to pick a setting that is compatible with your CPU.}}
{{2Col|{{c|flavor}}|Defines the general type of system, such as {{c|server}} or {{c|desktop}}, and will set default USE flags appropriate for your needs.}}
{{2Col|{{c|mix-ins}}|Defines various optional settings that you may be interested in enabling.}}
{{TableEnd}}
 
<!--T:221-->
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. Often, flavors and mix-ins inherit settings from other sub-profiles. Use {{c|epro show}} to view your current profile settings, in addition to any inheritance information:</translate>
{{console|body=
(chroot) # ##i## epro show
 
=== ##g##Enabled Profiles##!g##: ===
 
        arch: ##c## x86-64bit
      build: ##c## current
    subarch: ##c## intel64-haswell
      flavor: ##c## desktop
    mix-ins: ##c## gnome
 
 
=== ##g##All inherited flavors from desktop flavor##!g##: ===
 
                    ##c##workstation##!c## (from desktop flavor)
                            ##c##core##!c## (from workstation flavor)
                        ##c##minimal##!c## (from core flavor)
 
=== ##g##All inherited mix-ins from desktop flavor##!g##: ===
 
                              ##c##X##!c## (from workstation flavor)
                          ##c##audio##!c## (from workstation flavor)
                            ##c##dvd##!c## (from workstation flavor)
                          ##c##media##!c## (from workstation flavor)
      ##c##mediadevice-audio-consumer##!c## (from media mix-in)
                ##c##mediadevice-base##!c## (from mediadevice-audio-consumer mix-in)
      ##c##mediadevice-video-consumer##!c## (from media mix-in)
                ##c##mediadevice-base##!c## (from mediadevice-video-consumer mix-in)
        ##c##mediaformat-audio-common##!c## (from media mix-in)
          ##c##mediaformat-gfx-common##!c## (from media mix-in)
        ##c##mediaformat-video-common##!c## (from media mix-in)
                  ##c##console-extras##!c## (from workstation flavor)
                          ##c##print##!c## (from desktop flavor)
}}
<translate>
<!--T:223-->
Here are some basic examples of {{c|epro}} usage:
{{TableStart}}
{{2ColHead|Description|Command}}
{{2Col|View available profiles. Enabled profiles will be highlighted in cyan. Directly enabled profiles will be in bold and have a {{c|*}} appended.|{{c|epro list}}}}
{{2Col|Change the system flavor.|{{c|epro flavor desktop}}}}
{{2Col|Add a mix-in.|{{c|epro mix-in +gnome}}}}
{{TableEnd}}
 
===Kits=== <!--T:232-->
 
<!--T:233-->
Funtoo now provides sets of packages that are know to work in what we call kits.
 
===Next Steps=== <!--T:228-->
 
<!--T:229-->
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. You may also be interested in the following resources:
 
* [[ZFS]] - a quick and easy HOWTO on how to get ZFS set up under Funtoo Linux.
* [[:Category:Official Documentation|official documentation]], which includes all docs that we officially maintain for installation and operation of Funtoo Linux.
 
<!--T:230-->
We also have a number of pages dedicated to setting up your system. See [[:Category:First Steps|First Steps]] for a list of these pages.
 
<!--T:231-->
If your system did not boot correctly, see [[Installation Troubleshooting]] for steps you can take to resolve the problem.
 
[[Category:HOWTO]]
[[Category:Install]]
[[Category:Official Documentation]]
</translate>

Latest revision as of 04:12, November 21, 2021