Funtoo Linux Installation

From Funtoo
Revision as of 05:37, November 12, 2014 by Drobbins (talk | contribs)
Jump to navigation Jump to search

Introduction

This document was written to help you install Funtoo Linux as concisely as possible, with a minimum number of distracting options regarding system configuration.

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.

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 ARM architecture, please see Funtoo Linux Installation on ARM for notable differences regarding ARM support. An experimental Funtoo Linux build also exists for SPARC platforms. See Funtoo Linux Installation on SPARC.

New F2FS Install Guide is in progress which will augment the instructions on this page for those who want to install Funtoo Linux on F2FS.

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.

Installation Overview

This is a basic overview of the Funtoo installation process:

  1. Download and boot the live CD of your choice.
  2. Prepare your disk.
  3. Create and mount filesystems.
  4. Install the Funtoo stage tarball of your choice.
  5. Chroot into your new system.
  6. Download the Portage tree.
  7. Configure your system and network.
  8. Install a kernel.
  9. Install a bootloader.
  10. Complete final steps.
  11. Reboot and enjoy.

Live CD

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 System Rescue CD as it contains lots of tools and utilities and supports both 32-bit and 64-bit systems. For a generation 2 Hyper-V system, the Ubuntu desktop install DVD as of version 14.04.1 works well enough. Gentoo CDs don't support EFI boot, and the System Rescue CD lacks appropriate graphics support for Hyper-V as of version 4.4.0.

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 for an overview of what the Live Media must provide to allow a problem-free install of Funtoo Linux.

To begin a Funtoo Linux installation, download System Rescue CD from:

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 rescue64 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.

Install/Partitioning Install/Stage3 <translate>

Chroot into Funtoo

To set up your Funtoo Linux system, we need to "enter into" it before we boot. If you are using the Funtoo Linux LiveCD, this can be easily done with the fchroot command:

root # fchroot /mnt/funtoo
fchroot #

The fchroot command will take care of all necessary steps to enter into your new Funtoo Linux system, as well as clean up things when you exit the fchroot by typing exit or ctrl-D.

If you are using another LiveCD or USB media to install Funtoo, you can manually chroot by using the following set of commands:

root # cd /mnt/funtoo
root # mount --rbind /proc proc
root # mount --rbind /sys sys
root # mount --rbind /dev dev
root # cp /etc/resolv.conf /mnt/funtoo/etc/
root # chroot . /bin/su --login
chroot #
   Note

For users of live CDs with 64-bit kernels installing 32-bit systems: Some software may use 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 "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 your live CD.

Test internet name resolution from within the chroot:

chroot # ping -c 5 google.com

If you can't ping, make sure that /etc/resolv.conf specifies a valid IP address for a reachable nameserver in its nameserver setting.

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. </translate>

Install/PortageTree Install/Configuring Install/Portage <translate>

Prepare Disk

Funtoo Linux stage3's include a pre-built debian-sources kernel to make installation faster and easier. To see what kernel version is pre-installed, type:

chroot # emerge -s debian-sources
Searching...    
[ Results for search key : debian-sources ]
[ Applications found : 1 ]

*  sys-kernel/debian-sources
      Latest version available: 5.9.6_p1
      Latest version installed: 5.9.6_p1
      Size of files: 118,723 kB
      Homepage:      https://packages.debian.org/unstable/kernel/
      Description:   Debian Sources (and optional binary kernel)
      License:       GPL-2

Firmware

At this point it is wise to emerge the latest 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 is not available. If using the stage3 image, perform the following to install it. linux-firmware will be already installed if using the gnome or other desktop images:

chroot # emerge -av linux-firmware

</translate>

Installing a Bootloader

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.

First, emerge boot-update. This will also cause grub-2 and efibootmgr to be merged, since they are dependencies:

(chroot) # emerge boot-update

Then, edit /etc/boot.conf using nano and specify "Funtoo Linux genkernel" as the default setting at the top of the file, replacing "Funtoo Linux".

/etc/boot.conf should now look like this:

   /etc/boot.conf
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
}

If you are booting a custom or non-default kernel, please read man boot.conf for information on the various options available to you.

Old School (BIOS) MBR

When using "old school" BIOS booting, run the following command to install GRUB to your MBR, and generate the /boot/grub/grub.cfg configuration file that GRUB will use for booting:

(chroot) # grub-install --target=i386-pc --no-floppy /dev/sda
(chroot) # boot-update

New School (UEFI) Boot Entry

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.

For x86-64bit systems:

(chroot) # grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
(chroot) # boot-update

For x86-32bit systems:

(chroot) # grub-install --target=i386-efi --efi-directory=/boot --bootloader-id="Funtoo Linux [GRUB]" --recheck /dev/sda
(chroot) # boot-update

First Boot, and in the future...

OK -- you are ready to boot!

You only need to run grub-install when you first install Funtoo Linux, but you need to re-run boot-update every time you modify your /etc/boot.conf file or add new kernels to your system. This will regenerate /boot/grub/grub.cfg so that you will have new kernels available in your GRUB boot menu, the next time you reboot. <translate>

Network

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

   Note

If using the gnome or other desktop install image, linux-firmware and NetworkManager are already installed and available. You can use nmtui to get Wi-Fi going if you need network connectivity prior to getting X and GNOME fully up and running. In addition, desktop stage3's have ZeroConf/Bonjour multicast DNS lookups enabled by default. Both these things will not be set up yet if you are using the basic stage3 image.

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 if you have not done so already:

chroot # emerge linux-firmware networkmanager
chroot # 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 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:

chroot # nmtui

For more information about NetworkManager, see the NetworkManager package page.

Desktop (Wired DHCP)

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 dhcpcd to the default runlevel:

chroot # rc-update add dhcpcd default

When you reboot, dhcpcd will run in the background and manage all network interfaces and use DHCP to acquire network addresses from a DHCP server.

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)

For servers, the Funtoo Linux Networking scripts are the supported option for network configuration, and they have their own documentation. 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

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

chroot # nano /etc/conf.d/hostname

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.

   Warning

Hostnames can be up to 63 characters long and may use the following characters: a-z, 0-9 and hyphens (-). However, the hyphen may not be the first or last character.

</translate>


Finishing Steps

Set your root password

It's imperative that you set your root password before rebooting so that you can log in.

(chroot) # passwd

Restart your system

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.

Leave the chroot, change directory to /mnt, unmount your Funtoo partitions, and reboot.

(chroot) # exit
root # cd /mnt
root # umount -l funtoo
root # reboot
   Note

System Rescue CD will gracefully unmount your new Funtoo filesystems as part of its normal shutdown sequence.

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 login: prompt. Funtoo Linux has been successfully installed!

Profiles

Once you have rebooted into Funtoo Linux, you can further customize your system to your needs by using Funtoo Profiles.

Funtoo profiles are used to define defaults for Portage specific to your needs. There are 4 basic profile types: arch, build, flavor, and mix-ins:

arch
typically x86-32bit or 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.
build
defines whether your system is a current, stable or experimental build. current systems will have newer packages unmasked than stable systems.
flavor
defines the general type of system, such as server or desktop, and will set default USE flags appropriate for your needs.
mix-ins
define various optional settings that you may be interested in enabling.

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.

Remember that profiles can often be inherited. For example, the desktop flavor inherits the workstation flavor settings, which in turn inherits the X and audio mix-ins. You can view this by using eselect:

(chroot) # eselect profile show
Currently set profiles:
    arch: gentoo:funtoo/1.0/linux-gnu/arch/x86-64bit
   build: gentoo:funtoo/1.0/linux-gnu/build/current
  flavor: gentoo:funtoo/1.0/linux-gnu/flavor/desktop
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/kde

Automatically enabled profiles:
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/print
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/X
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/audio
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/dvd
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/media
 mix-ins: gentoo:funtoo/1.0/linux-gnu/mix-ins/console-extras

To view installed profiles:

(chroot) # eselect profile list

To change the profile flavor:

(chroot) # eselect profile set-flavor 7

To add a mix-in:

(chroot) # eselect profile add 10

Next Steps

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 official documentation, which includes all docs that we officially maintain for installation and operation of Funtoo Linux.

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.

{{#ask: | format=ul }}

If your system did not boot correctly, see Installation Troubleshooting for steps you can take to resolve the problem.