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
 
(33 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}}
 
{{/Download and Extract Stage3}}
 
{{/Chroot}}
 
{{/Download Portage Tree}}
 
{{/Configuration Files}}
 
{{/Introducing Portage}}
 
=== 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