In this how to we going to install Gentoo, a Linux based distribution built using the Portage package management system on a laptop, first one we need to get the  Minimal Installation CD from the Gentoo Download web page.

In this how to I not going to explain how to make partitions or network configuration in the live cd.

if u have any question or doubt feel free to leave a message/comment.

I have a Toshiba Portege Laptop with an Intel i3 processor, 640 HDD and 6 GB of RAM. The hard drive has a Windows 10, Kali & my partitions to install Gentoo.

when you are in the prompt of the live cd, change the root password with the command “passwd” and enable the sshd service with “service sshd start”.

If you feel insecure about how to make partitions with Parted or Fdisk u can make it with any other distro using some GUI like Disks on Ubuntu.


 

I going to use the number partition number 7 for boot <ext2>, number 8 for rootfs (including home <ext4>) and number 6 for swap.

Format boot with ext2.


 

Allocating group tables: doneWriting inode tables: doneWriting superblocks and filesystem accounting information: done

Format rootfs with ext4.

 


 

Making swap


 

Now we need to mount the Gentoo partitions.

 

Rootfs.


 

Clock

Before installing Gentoo, it is a good idea to be sure that the system date and time are set correctly. Bad clock settings can lead to strange results: system base files must be extracted with correct timestamps. In fact, because multiple websites and services use encrypted communications (SSL / TLS), it may not be possible to undo the installation files at all if the system clock is very desynchronized!

Automatic clock sync.


 

Download Stage

A Stage are all the basic files for an operating system but come compressed, so you can unpack it and configure it to your liking.

Move to /mnt/gentoo (my rootfs partition).


 

Now unpack the stage downloaded to the system. Use tar for this work:

tar xvjpf stage3-*.tar.bz2 --xattrs --numeric-owner

We edit the file /mnt/gentoo/etc/portage/make.conf.

nano -w /mnt/gentoo/etc/portage/make.conf

And we leave it similar except for the variable -jN, n are the number of cores + 1 and we include the variable “-march=native“.

Select replica servers.

In order to download the source code quickly it is recommended to select a fast replica server. Portage will check the GENTOO_MIRRORS variable in your make.conf file and will use the servers specified there. You can browse the list of Gentoo replica servers and look for a server (or servers) that are close to your location (as these are usually the fastest).

mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf

Gentoo ebuilds repository.

A second important step in selecting replicated servers is configuring the Gentoo ebuilds repository through the /etc/portage/repos.conf/gentoo.conf file. This file contains the synchronization information needed to update the package repository (the collection of ebuilds and related files that contain all the information Portage needs to download and install software packages).

The configuration of the repository can be done in a few simple steps. First, if it does not exist, create the repos.conf directory:

mkdir /mnt/gentoo/etc/portage/repos.conf

Copy the Gentoo repository configuration file provided by Portage to the (new) repos.conf directory:

cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf

Copy DNS information.

There is still one thing to do before entering the new environment, copy the DNS information in /etc/resolv.conf.

To copy this information, it is recommended to pass the -L option in the cp command. This ensures that if /etc/resolv.conf is a symbolic link you will copy the file to which the link is pointed and not the link.

cp -L /etc/resolv.conf /mnt/gentoo/etc/

Mount the necessary file systems.

 


 

Chroot (Change root).

  1. The root is changed from / (on the installation media) to / mnt / gentoo / (on the partitions) using chroot
  2. Some definitions (provided by / etc / profile) are loaded in memory using the source command.
  3. Redefines the primary prompt that reminds us that we are in a chrooted environment.

root #chroot /mnt/gentoo /bin/bash

root #source /etc/profile

root #export PS1=”(chroot) $PS1″

Configure Portage

Get a snapshot  of ebuilds repository from the web

This snapshot has a collection of files that tells to portage about the software titles, profiles to select, news, etc.

emerge-webrsync

Optional: Update the Gentoo ebuilds repository.

Assuming there was a need to have the latest updates of the packages (up to 1 hour ago) then use emerge –sync. This command will use the rsync protocol to update the Gentoo ebuilds repository (previously obtained by emerge – sync) to its most recent state.

emerge --sync
Choose the right profile
eselect profile list

 

We are going to choose number 6 or the option with plasma (no systemd) and your arch.

Timezone and Localization

View all zone list.

ls /usr/share/zoneinfo

Choose country and state from list.

ls /usr/share/zoneinfo/’ur country’

Save timezone info into /etc/timezone.

echo “America/Mexico_City” > /etc/timezone

Install timezone configuration.

emerge --config sys-libs/timezone-data

Edit locale.gen and set to ‘local’.

nano -w /etc/locale.gen

Generate locale.

locale-gen

Show local list.

eselect locale list

Set locale.

eselect locale set #

Update the environment.

env-update && source /etc/profile && export PS1=”(chroot) $PS1″

KERNEL and File system table (fstab)

This will install gentoo sources kernel

emerge --ask --verbose sys-kernel/gentoo-sources

Install required tool to detect pci and usb.

emerge -av pciutils usbutils

Get kernel.

emerge genkernel

Are few things need to be configure here to map your partitions.

nano -w /etc/fstab

This file and drive order/names are very important so the kernel and modules can load properly and Dbus can start its process.

sr0 are cd/dvd drive and iso9660 is its default kernel module. Adding ‘user’ will allow user to mount cd/dvd

When all done, save the configuration press ‘Ctrl + X’ to save press ‘Y’. And proceed to next step.

This will open a GUI (Generated User Interface) kernel for customization. In this part, you are practically alone because every laptop have different hardware if u want to know your hardware use the command “lspci” and don’t be afraid to ask a question as a comment

genkernel --menuconfig all

Add your hostname in General Setup. When you were done, save it to .config. Then exit. This will take a while to process.

Apply linux firmware

[/simterm]emerge -av sys-kernel/linux-firmware[/simterm]

no comments

Leave me comment