Skip to content

Latest commit

 

History

History
293 lines (226 loc) · 7.81 KB

README.md

File metadata and controls

293 lines (226 loc) · 7.81 KB

Gentoo Configuration

Initial (temporary) configuration

The first step of the configuration is having a working system. We need to perform some basic configurations, just to be able to fully configure the system later on.

To have a working system, you need to do some temporary configuration: follow the Temporary configuration tutorial.

System configuration

It's time to fully configure your system.

Here it's not our focus to configure specific end-user software, but the base system, including:

  1. Kernel.
  2. Main daemons.
  3. Portage.
  4. Layman.
  5. Display manager
  6. Window manager
  7. etc... (as much as you can)

Follow the Configurations install tutorial.

Additional hardware support

For every additional hardware (not supported by default), follow the corresponding guide. The available ones are listed here.

Build the kernel

Now the kernel is configured (i.e. the .config file has been copied to /usr/src/linux). We need to rebuild it to use the new configurations.

Mount the EFI partition under /boot and run the following:

# _dst_kernel_image="/boot/EFI/gentoo/kernel-hardened-latest.efi"
# cd "/usr/src/linux"
# make && make modules_install
# cp "arch/x86_64/boot/bzImage" "${_dst_kernel_image}"

Start and enable Systemd-Networkd

# systemctl enable "systemd-networkd"
# systemctl start "systemd-networkd"

Start and enable Systemd-Resolved

# systemctl enable "systemd-resolved"
# systemctl start "systemd-resolved"
# ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf

Start and enable Avahi

# systemctl enable "avahi-daemon"
# systemctl start "avahi-daemon"

Local portage overlay

Create it running:

# mkdir -p /usr/local/portage/{metadata,profiles}
# echo 'local' > /usr/local/portage/profiles/repo_name
# echo 'masters = gentoo' > /usr/local/portage/metadata/layout.conf
# chown -R portage:portage /usr/local/portage

Next, tell portage about the overlay.

Update packages

Now you should have new use flags, compiling options, etc.., so it's better to recompile the entire system.

# emerge -e "system"
# emerge -e "world"

Install daemons

# emerge "wpa_supplicant"

Install portage software

See here

Install some basic packages

# emerge pciutils usbutils # To work with `PCI `& `USB` devices.
# emerge parted # To manage partitions.
# emerge "sys-apps/gentoo-functions"
# emerge "dev-util/debugedit"
# emerge "sys-fs/ntfs3g"

Install X stack

# emerge "x11-apps/xrandr" "x11-apps/xdpyinfo"
# emerge "setxkbmap" "xmodmap" "x11-apps/xinput" "xbacklight"
# emerge "xorg-server"
# emerge "x11-misc/lightdm"
# systemctl enable lightdm

Install window manager

# emerge "x11-wm/awesome"

Install other software

# emerge "app-admin/sudo"
# emerge "app-shells/zsh"
# emerge "media-gfx/feh"
# emerge "media-sound/pavucontrol"
# emerge "x11-misc/xclip" "x11-misc/xsel"
# emerge "x11-terms/rxvt-unicode" "x11-misc/urxvt-perls" "x11-misc/urxvt-font-size"

Install fonts

# emerge "media-fonts/powerline-fonts"

Install chips

Install all of the following chips:

  • GNU/Linux: General purpose scripts for GNU/Linux scripts.
  • Gentoo: Scripts specific for Gentoo systems.

Setup device-specific software

Sometimes you need to install (and configure) software specific to a particular device.

The main example is installing drivers..

Here is a list of device-specific software setup tutorials.

Create your personal user

# _comment="Personal user for Alessandro Molari" # Replace with yours.
# _username="alem0lars" # Replace with yours.
# useradd -d "/home/${_username}" -s /bin/zsh -c "${_comment}" -m "${_username}"

Create the administrators group:

# groupadd admin

Add your user to groups:

# _username="alem0lars" # Replace with yours.
# gpasswd -a ${_username} admin
# gpasswd -a ${_username} portage
# gpasswd -a ${_username} systemd-journal
# gpasswd -a ${_username} games

Allow admin to user sudo:

# echo "%admin ALL=(ALL) ALL" > "/etc/sudoers.d/group-admin"
# chmod 600 "/etc/sudoers.d/group-admin"

Finally, add the ssh keys for the created user.

User-level configuration

If you are using Fizzy, that's simple:

$ _username="alem0lars" # Replace with yours.
$ _vars_name="julia_hck_gentoo" # Replace with yours.
$ _meta_name="meta-user.yml" # Replace with yours.
$ fizzy cfg instantiate --vars-name=${_vars_name} --inst-name="user_${_username}"
$ fizzy sys install --vars-name=${vars_name} --inst-name="user-${_username}" --meta-name="${_meta_name}"

You may want to run the snippet above for every user you want to be configured in your system. I personally run this for alem0lars and root.

(Optional) Configure data

See here.

Install additional software

Fonts setup

See here.