Installation

13 Jan 2021 PLEASE DO NOT ATTEMPT ANY INSTALLS UNTIL FURTHER NOTICE. The install tarball is being worked on and what’s currently on the server will not be supported. I apologize for any inconvenience. It’s been a while since I worked on it and I guess it won’t be without a few bumps in the road. But I hope the end result will be an improvement, and hopefully this notice will be taken down soon.

Note for UEFI: Please make sure you understand how to boot your computer with UEFI and load a non-Windows OS if you have a UEFI machine. It is beyond the scope of this guide to assist with that. Once you have configured your machine’s EFI, the install script will automatically install for EFI.

Acquire a boot medium. The recommended boot medium is SystemRescueCd. You can use any boot medium that gives you access to your hard drive, allows you to chroot and supports bash. If using SystemRescueCd on a BIOS machine, select option C for standard 64-bit kernel, then option 1 for default options. If using SystemRescueCD on an EFI machine, select the first option from the boot menu. If you are using another boot medium, make sure you boot with a 64-bit kernel. You do not need to startx.

The automated and manual installs result in exactly the same system and use exactly the same commands. The manual install is provided for the DIY enthusiasts. In either case, installation is only intended for computers that will be running only Gentoo Studio and on which the primary hard drive contains no data you wish to keep. During the open beta, I will look into expanding dual-boot and alternate hard disk installations based on user feedback. The primary goal, though, is to make sure the installation process works for various hardware configurations.

Only the amd64 architecture is supported. There are no plans to include any other architectures.

Automated Install

  1. wget https://gentoostudio.org/src/builds/install.sh
  2. chmod +x install.sh
  3. ./install.sh
  4. Follow instructions and prompts. You will be asked to choose between a minimal or a complete install. See the Flavors page for details. The installer will automatically detect whether you have BIOS or UEFI and install the boot loader accordingly.
  5. On your first login, you will need to change the session to Xfce using the login manager menu in the upper right corner.

Manual Install

Manual install is for those who like doing things this way, and for those who want to dual-boot with an existing OS. For dual-boot users, you will need to handle the partitioning scheme on your own and adjust these instructions accordingly. Note that if you are dual-booting, you do not want to mklabel, you may or may not be able to apply partition names, and your boot label may or may not already be set. User takes all responsibility for the results of performing these steps.

DO NOT COPY AND PASTE. Type these instructions into your terminal and double-check for typos.

  1. Once you’ve booted with your boot medium, you need to prepare the hard drive using the following steps:
    1. parted -a optimal /dev/sda
    2. mklabel gpt
    3. unit mib
    4. mkpart primary 1 3
    5. name 1 grub
    6. set 1 bios_grub on
    7. mkpart primary 3 131
    8. name 2 boot
    9. mkpart primary 131 643
    10. name 3 swap
    11. mkpart primary 643 -1
    12. name 4 rootfs
    13. set 2 boot on
    14. print
      • You should see this:
        Number Start  End    Size   File system    Name  Flags
        
         1     1049kB 3146kB 2097kB                grub  bios_grub
        
         2     3146kB 137MB  134MB  ext2           boot  boot, esp
        
         3     137MB  2235MB 2097MB linux-swap(v1) swap
        
         4     2235MB 2000GB 1998GB ext4           rootfs
    15. quit
    1. If you have a BIOS system: > mkfs.ext4 /dev/sda2
    2. If you have a UEFI system: > mkfs.fat -F 32 /dev/sda2
  2. mkfs.ext4 /dev/sda4
  3. mkswap /dev/sda3
  4. swapon /dev/sda3

Now mount the hard drive and install the base system:

  1. mkdir /mnt/gentoo (if this dir does not exist)
  2. mount /dev/sda4 /mnt/gentoo (The mount point does not matter. Just substitute whatever you use here.)
  3. mkdir /mnt/gentoo/boot
  4. mount /dev/sda2 /mnt/gentoo/boot
  5. cd /mnt/gentoo
  6. wget https://gentoostudio.org/src/builds/complete/stage4-amd64-latest.tar.bz2
  7. tar xvjpf stage4-amd64-latest.tar.bz2 --xattrs --numeric-owner
  8. rm stage4-amd64-latest.tar.bz2

Chroot into the base system and configure:

  1. cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
  2. cp -L /etc/resolv.conf /mnt/gentoo/etc/, y to overwrite
  3. mount -t proc /proc /mnt/gentoo/proc
  4. mount --rbind /sys /mnt/gentoo/sys
  5. mount --rbind /dev /mnt/gentoo/dev
  6. chroot /mnt/gentoo /bin/bash
  7. source /etc/profile
  8. emerge-webrsync
  9. eix-sync
  10. ls /usr/share/zoneinfo
  11. echo "(selected timezone)" > /etc/timezone
  12. emerge --config timezone-data
  13. grub-install:
    1. If you have a BIOS system: > grub-install /dev/sda
    2. If you have a UEFI system: > grub-install --target=x86_64-efi --efi-directory=/boot --removable
  14. nano /etc/fstab
    1. If you have a BIOS system, make sure the line for /dev/sda2 has filesystem type ext4
    2. if you have an EFI system, make sure the line for /dev/sda2 has filesystem type vfat
  15. If you are dual-booting with Windows, emerge os-prober
  16. grub-mkconfig -o /boot/grub/grub.cfg
  17. passwd (Sets root password.)
  18. useradd -m -G users,wheel,audio,plugdev -s /bin/bash (username)
  19. passwd (username)
  20. cpuid2cpuflags >> /etc/portage/make.conf
  21. nano /etc/portage/make.conf and edit the CPU_FLAGS_X86 line so it looks similar to this: CPU_FLAGS_X86="mmx sse sse2"
  22. emerge -vuDN --keep-going --with-bdeps=y --backtrack=250 @system @world This recompiles any packages that use CPU-specific flags. Also note that while it’s tempting to skip this step and boot into your system, this world update helps make sure your system is updated and working correctly on first boot. If you encounter Portage errors such as conflicts and blocks and can’t scroll up, it’s fine to reboot into your new system and try it again there.
  23. reboot
  24. On your first login, you will need to change the session to Xfce using the login manager menu in the upper right corner.

You should now have a working Gentoo Studio workstation.

Notes:

  • Do NOT update /etc/security/limits.conf. Those settings are there for a reason.
  • If you dual-boot with Windows and need to re-install Windows, you will need to chroot into Gentoo Studio, re-install grub and run grub-mkconfig again. Windows installs its own bootloader and you will need to blow it away with Grub.