Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Are there any errors in my Gentoo installation command list?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
ArtificialAmateur
n00b
n00b


Joined: 05 Feb 2016
Posts: 2

PostPosted: Mon May 02, 2016 11:49 pm    Post subject: Are there any errors in my Gentoo installation command list? Reply with quote

Hello gentoomen, I am transitioning from Arch to Gentoo on my new rig and with the combination of systemd and LVM, and being my first time, I knew this would get confusing so I spent some time trying to plan it out.

Now I ask of you to peer review it and help me ascend on my glorious journey, if you see any errors/mistakes and any suggestions or recommendations are welcome. Thank you.
_____________
This is for: UEFI, Ethernet, LVM, and systemd.

PCI & USB devices:

Code:
    # lsusb

    Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

    Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

    Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

    Bus 001 Device 004: ID 1b1c:1b05 Corsair

    Bus 001 Device 003: ID 0d8c:1319 C-Media Electronics, Inc.

    Bus 001 Device 002: ID 8564:1000 Transcend Information, Inc. JetFlash

    Bus 001 Device 006: ID 04d9:0112 Holtek Semiconductor, Inc.

    Bus 001 Device 005: ID 04d9:a0b9 Holtek Semiconductor, Inc.

    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
   
    # lspci

    00:00.0 Host bridge: Intel Corporation Sky Lake Host Bridge/DRAM Registers (rev 07)

    00:01.0 PCI bridge: Intel Corporation Sky Lake PCIe Controller (x16) (rev 07)

    00:14.0 USB controller: Intel Corporation Sunrise Point-H USB 3.0 xHCI Controller (rev 31)

    00:16.0 Communication controller: Intel Corporation Sunrise Point-H CSME HECI #1 (rev 31)

    00:17.0 SATA controller: Intel Corporation Device a102 (rev 31)

    00:1b.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Root Port #17 (rev f1)

    00:1c.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #1 (rev f1)

    00:1c.2 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #3 (rev f1)

    00:1d.0 PCI bridge: Intel Corporation Sunrise Point-H PCI Express Root Port #9 (rev f1)

    00:1f.0 ISA bridge: Intel Corporation Sunrise Point-H LPC Controller (rev 31)

    00:1f.2 Memory controller: Intel Corporation Sunrise Point-H PMC (rev 31)

    00:1f.3 Audio device: Intel Corporation Sunrise Point-H HD Audio (rev 31)

    00:1f.4 SMBus: Intel Corporation Sunrise Point-H SMBus (rev 31)

    00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-V (rev 31)

    01:00.0 VGA compatible controller: NVIDIA Corporation GM200 [GeForce GTX 980 Ti] (rev a1)

    01:00.1 Audio device: NVIDIA Corporation Device 0fb0 (rev a1)

    03:00.0 USB controller: ASMedia Technology Inc. ASM1142 USB 3.1 Host Controller

    04:00.0 PCI bridge: ASMedia Technology Inc. ASM1083/1085 PCIe to PCI Bridge (rev 04)

    # lscpu

    Architecture:          x86_64

    CPU op-mode(s):        32-bit, 64-bit

    Byte Order:            Little Endian

    CPU(s):                8

    On-line CPU(s) list:   0-7

    Thread(s) per core:    2

    Core(s) per socket:    4

    Socket(s):             1

    NUMA node(s):          1

    Vendor ID:             GenuineIntel

    CPU family:            6

    Model:                 94

    Model name:            Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz

    Stepping:              3

    CPU MHz:               1206.718

    CPU max MHz:           4200.0000

    CPU min MHz:           800.0000

    BogoMIPS:              8015.85

    Virtualization:        VT-x

    L1d cache:             32K

    L1i cache:             32K

    L2 cache:              256K

    L3 cache:              8192K

    NUMA node0 CPU(s):     0-7

    Flags:                 fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc aperfmperf eagerfpu pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch ida arat epb pln pts dtherm hwp hwp_notify hwp_act_window hwp_epp intel_pt tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm mpx rdseed adx smap clflushopt xsaveopt xsavec xgetbv1



Main hardware devices:

* Intel i7-6700k
* Nvidia GTX 980TI
* 16Gb DDR4 RAM
* ASUS X99‑A Motherboard
* Samsung 500Gb SSD
* Western Digital 2Tb HDD

____________
Here is my game plan:

[Device Graph](http://i.imgur.com/1neMLsH.png)

[Mount Graph](http://i.imgur.com/8g2vF6W.png)

*Slightly different from pics (eg. /boot/efi)

* SSH (or VNC)
* Decrease boot time
* Mail Server
* Gaming Rig
* Create snapshots to revert to when I fuck up
* WM ricing

__________________
Parts that I know are wrong and I need guidance for:

* Installing systemd instead of OpenRC.
* What to configure in the kernel

**Please note the comments I placed in different sections where I question what i've done.**

__________________
Check Connection:

Code:
# ping -c 3 gentoo.com


Check UEFI:

Code:
    # ls /sys/firmware/efi/efivars

Partitioning:

Code:
 # parted /dev/sda

    # (parted) mklabel gpt

    # (parted) mkpart ESP fat32 1MiB 513MiB

    # (parted) set 1 boot on

    # (parted) mkpart primary ext4 513MiB 100%

    # parted /dev/sdb

    # (parted) mkpart primary ext4 1MiB 100%


LVM:

Code:
# pvcreate /dev/sda2

    # pvcreate /dev/sdb1

    # vgcreate ssd /dev/sda2

    # vgcreate hdd /dev/sdb1

    # lvcreate -n virtualmachines -L 240G ssd

    # lvcreate -n games -l 100%FREE ssd

    # lvcreate -n root -L 5G hdd

    # lvcreate -n usr -L 15G hdd

    # lvcreate -n var -L 20G hdd 

    # lvcreate -n swap -L 8G hdd

    # lvcreate -n home -l 100%FREE hdd


Format:

Code:
    # dd if=/dev/zero of=/dev/sda1 bs=1M

    # mkfs.fat -F32 /dev/sda1

    # mkfs.btrfs /dev/mapper/hdd-{root,usr,var}

    # mkfs.xfs /dev/mapper/{ssd-games,hdd-home,ssd-virtualmachines}

    # mkswap /dev/mapper/hdd-swap

    # swapon /dev/mapper/hdd-swap


// Not sure at what point /tmp should come in and be formatted as /tmpfs

Mount:

Code:
    # mount /dev/mapper/hdd-root /mnt/gentoo

    # mkdir -p /mnt/gentoo/boot; mount /dev/sda1 /mnt/gentoo/boot

    # mkdir -p /mnt/gentoo/usr; mount /dev/mapper/hdd-usr /mnt/gentoo/usr

    # mkdir -p /mnt/gentoo/var; mount /dev/mapper/hdd-var /mnt/gentoo/var

    # mkdir -p /mnt/gentoo/home/; mount /dev/mapper/hdd-home /mnt/gentoo/home

    # mkdir -p /mnt/gentoo/home/artificial/{virtualmachines,games}

    # mount /dev/mapper/ssd-virtualmachines /mnt/gentoo/home/artificial/VMs

    # mount /dev/mapper/ssd-games /mnt/gentoo/home/artific/Games

Setting time and date:

Code:
    # date

Downloading the stage tarball:

Code:
    # cd /mnt/gentoo

    # links https://www.gentoo.org/downloads/mirrors/

    // http, releases/amd64/autobuilds/current-stage3-amd64/

    // ‘D’ to download tarball, ‘Q’ to quit

Unpacking the stage tarball:

Code:
    # tar xvjpf stage3*.tar.bz2 --xattrs

Configure compile options:

Code:

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

    // Any suggestions for options here would be great.

>     CFLAGS=”-march=skylake -O2 -pipe”

>     CXXFLAGS=”${CFLAGS}”

>     CPU_FLAGS_X86.="${USE}"

>    ACCEPT_LICENSE="*"

>     MAKEOPTS="-j9"

>     VIDEO_CARDS="intel nvidia"

    #Selecting mirrors:

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

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

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

    # cat /mnt/gentoo/etc/portage/repos.conf/gentoo.conf

>     [gentoo]

>     location = /usr/portage

>     sync-type = rsync

>     sync-uri = rsync://rsync.gentoo.org/gentoo-portage

>     auto-sync = yes

Copy DNS info:

Code:
    # cp -L /etc/resolv.conf /mnt/gentoo/etc

Mounting the necessary filesystems:

Code:
    # mount -t proc proc /mnt/gentoo/proc

    # mount --rbind /sys /mnt/gentoo/sys

    # mount --make-rslave /mnt/gentoo/sys

    # mount --rbind /dev /mnt/gentoo/dev

    # mount --make-rslave /mnt/gentoo/dev

Entering the new environment:

Code:
    # chroot /mnt/gentoo /bin/bash

    # source /etc/profile

    # export PS1=”(chroot) $PS1”


Installing a portage snapshot:

Code:
    # emerge-webrsync

    # emerge --sync

Reading news items:

Code:
    # eselect news list

    # eselect news read

    # eselect news purge

Choosing the right profile:

Code:
    # eselect profile list

    # eselect profile set <insert # here>

    // At this point it tells me to look at the systemd page, but its not a continuation of this guide so it confuses me somewhat.


Time:

Code:
    # echo “America/Los_Angeles” > /etc/timezone

    # emerge --config sys-libs/timezone-data


Locale:

Code:
    # nano -w /etc/locale.gen

    # locale-gen

    # locale -a

    # eselect locale list

    # eselect locale set <insert # here>

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


Installing the sources:

Code:
    # emerge --ask sys-kernel/gentoo-sources

    # ls -l /usr/src/linux

    // I decided against the hardened kernel as it causes too many problems with Steam.

Intro to manual kernal configuration:

Code:
    # emerge --ask sys-apps/pciutils

    # cd /usr/src/linux

    # make menuconfig


Kernel options:

Code:
    Gentoo Linux --->
            Support for init systems, system and service managers --->
                    [*] systemd

    General setup  --->
       [*] Control Group support
       [*] open by fhandle syscalls
       [ ] Enable deprecated sysfs features to support old userspace tools
       [*] Configure standard kernel features (expert users)  --->
          [*] Enable eventpoll support
          [*] Enable signalfd() system call
          [*] Enable timerfd() system call
           [*] Namespaces support  --->
          [*] Network namespace

    [*] Enable the block layer  --->
       [*] Block layer SG support v4
           Partition Types  --->
          [*] Advanced partition selection
          [*]   EFI GUID Partition support

    Networking support --->
        Networking options --->
           <*> The IPv6 protocol

    Device Drivers --->
       Generic Driver Options  --->
      [*] Maintain a devtmpfs filesystem to mount at /dev
                -*- Userspace firmware loading support
                [*] Include in-kernel firmware blobs in kernel binary
                ( )  path to uevent helper
      [ ] Fallback user-helper invocation for firmware loading
       Graphics support --->
                <*> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->
                < > Nouveau (nVidia) cards
                Frame buffer Devices --->
                    <*> Support for frame buffer devices --->
                    ## (Disable all drivers, including VGA, Intel, nVidia, and ATI, except EFI-based Framebuffer Support, only if you are using UEFI)
       <*> Sound card support
                <*> Advanced Linux Sound Architecture --->
                     [*] PCI sound devices  --->
                        <*> Intel HD Audio  ---> (snd-hda-intel)
                             [*] Build Realtek HD-audio codec support
                             [*] ...
                             [*] Build Silicon Labs 3054 HD-modem codec support
                             [*] Enable generic HD-audio codec parser
       SCSI device support  --->
                <*> SCSI device support
                <*> SCSI disk support
                < > SCSI CDROM support
                [ ] SCSI low-level drivers  --->
       <*> Serial ATA and Parallel ATA drivers (libata)  --->
       [*] HID Devices  --->
                <*>   USB Human Interface Device (full HID) support
       USB support  --->
                <*> Support for Host-side USB
           ---   USB Host Controller Drivers
                 <*>   xHCI HCD (USB 3.0) support
                 <*>   EHCI HCD (USB 2.0) support
                 < >   OHCI HCD  (USB 1.1) support
                 < >   UHCI HCD (most Intel and VIA) support
               <*> USB Mass Storage support
       Multiple devices driver support (RAID and LVM) ---> 
                <*> Device mapper support
                    <*> Snapshot target
                    <*> Crypt target support
                    <*> Snapshot target
                <*> Mirror target
                <*> Multipath target
                    <*> I/O Path Selector based on the number of in-flight I/Os
                    <*> I/O Path Selector based on the service time

    Firmware Drivers  --->
       [*] Export DMI identification via sysfs to userspace
            EFI (Extensible Firmware Interface) Support -->
               <*> EFI Variable Support via sysfs

    File systems --->
      <*> Second extended fs support
      <*> The Extended 4 (ext4) filesystem
      <*> BtrFS filesystem support
      <*> XFS filesystem support
      <*> Kernel automounter version 4 support (also supports v3)
       [*] Inotify support for userspace
      ...
      Pseudo Filesystems --->
        [*] /proc file system support
        [*] sysfs file system support
        [*] Virtual memory file system support (former shm fs)
        [*] Tmpfs virtual memory file system support (former shm fs)
        [*]   Tmpfs POSIX Access Control Lists
        [*]   Tmpfs extended attributes

    // Reference Intel's i7-6700k feature list to add them to the kernel.

    Processor type and features  --->
       [*] Symmetric multi-processing support
       [*]   SMT (Hyperthreading) scheduler support
       [*]   Multi-core scheduler support (NEW)
       [*] Enable seccomp to safely compute untrusted bytecode
       [*] EFI runtime service support
       [*]   EFI stub support
       [*] Machine Check / overheating reporting
       [*]   Intel MCE Features
       [ ]   AMD MCE Features
       [*] MTRR (Memory Type Range Register) support
      Processor family (AMD-Opteron/Athlon64)  --->
        ( ) Opteron/Athlon64/Hammer/K8
        ( ) Intel P4 / older Netburst based Xeon
        ( ) Core 2/newer Xeon
        ( ) Intel Atom
        ( ) Generic-x86-64

    Executable file formats / Emulations  --->
       [*] IA32 Emulation

    Power management and ACPI options  --->
     [*] ACPI (Advanced Configuration and Power Interface) Support

    [*] Enable loadable module support --->

    // Not sure what to do with the requirements in the upstream README file as it doesn't look to be in makeconfig format:  http://cgit.freedesktop.org/systemd/systemd/tree/README#n38


Compiling and installing:

Code:
    # make -j9 && make modules_install -j9

    # make install

    # mkdir -p /boot/efi/boot

    # cp /boot/vmlinuz-* /boot/efi/bootx64.efi


The /etc/mtab:

Code:
    # ln -sf /proc/self/mounts /etc/mtab

Initramfs:

Code:
    # emerge --ask sys-kernel/genkernel-next

    # nano /etc/genkernel.conf

>     UDEV="yes"

    # genkernel --install initramfs

    # genkernel --install all

    # genkernel --udev --lvm --disklabel initramfs

    // systemd page says 'genkernel --install all', but is that necessary?


Configuring the modules:

Code:
    // Replace <kernel version> w/ version.

    # find /lib/modules/<kernel version>/ -type f -iname ‘*.o’ -or -iname ‘*.ko’ | less

    # nano -w /etc/conf.d/modules

    *modules=”<insert necessary module here>”*

    # emerge –ask sys-kernel/linux-firmware


Starting lvmetad daemon:

Code:
    # nano /etc/lvm/lvm.conf

>     use_lvmetad = 1

Systemd installation:

Code:
    # emerge --ask sys-apps/systemd   

    # emerge --deselect sys-fs/udev

Fstab:

Code:
    # blkid

    // Any reccomended options?

    # nano -w /etc/fstab

<file system> | <dir> | <type> | <options> | <dump> | <pass>
---|---|----|----|----|----
PARTUUID= | /boot | vfat | default,noatime | 0 | 2
PARTUUID= | / | btrfs | default,noatime,discard | 0 | 1
PARTUUID= | none | swap | sw | 0 | 0
PARTUUID= | /home | xfs | default,noatime | 0 | 2
PARTUUID= | /home/artificial/games | xfs | default,noatime | 0 | 2
PARTUUID= | /home/artificial/VMs | xfs | default,noatime | 0 | 2
PARTUUID= | /usr | btrfs | default,noatime,discard | 0 | 2
PARTUUID= | /var | btrfs | default,noatime,discard | 0 | 2

    //Again not sure about /tmp, doesnt have partuuid what do I do?

Host and domain info:

Code:
    # nano -w /etc/conf.d/hostname

>     hostname=”tundra”


The hosts file:

Code:
    # nano -w /etc/hosts

>     127.0.0.1    tundra.localhost    tundra    localhost

Systemd-networkd:

Code:
    # nano /etc/systemd/network/50-dhcp.network

>     [Match]
>     Name=enp0s31f6
>     
>     [Network]
>     DHCP=yes

    # ln -snf /run/systemd/resolve/resolve.conf /etc/resolv.conf

    # systemctl enable systemd-resolved.service

    # systemctl start systemd-resolved.service

Homenamectl:

Code:
    # hostnamectl set-hostname tundra

Root password:

Code:
    # passwd

File indexing:

Code:
    # emerge --ask sys-apps/mlocate

Filesystem tools:

Code:
    # emerge --ask sys-fs/e2fsprogs sys-fs/xfsprogs sys-fs/dosfstools

Installing GRUB2:

Code:
    # echo GRUB_PLATFORMS=”efi-64” >> /etc/portage/make.conf

    # emerge --ask sys-boot/grub

Configuring GRUB2:

Code:
    # grub2-install --target=x86_64-efi –efi-directory=/boot

    # grub2-mkconfig -o /boot/grub/grub.cfg

    // Output must say that at least one Linux image is found.

    # nano /etc/default/grub

>     GRUB_CMDLINE_LINUX="init=/usr/lib/systemd/systemd"

Activating lvm

Code:
    # systemctl enable lvm2-monitor.service

Install zsh

Code:
# emerge --ask zsh zsh-completions gentoo-zsh-completions

Rebooting the system:

Code:
    # exit

    # cd

    # umount -l /mnt/gentoo/dev{/shm,/pts,}

    # umount /mnt/gentoo{/boot,/sys,/proc,}

    # reboot

    # pray


User administration:

Code:
    # useradd -m -G users,wheel,audio,games,portage,usb,video,wheel -s /bin/zsh artificial

    # passwd artificial

Disk cleanup:

Code:
    # rm /stage3-*.tar.bz2

_________________________

Edits (realtime):

+ Added tmp to fstab;

+ Added systemd kernel config;

~ Changed initramfs;

+ Added LVM daemon;

+ Added systemd to GRUB2 config;

+ Added root & user passwd;

+ Added hostnamectl commands;

+ Added systemd installation;

+ Added systemd-networkd;

- Removed /tmp as systemd automatically sets it;

- Removed extra root passwd command;

+ Added Activating lvm;

+ Added updated systemd requirements;

+ Added VIDEO_CARDS variable to make.conf;

- Removed init & boot configuration, system logger, and cron daemon sections;

~ Switched networking and hostname commands for systemd counterparts;

+ Added timezone data configuration command;

- Removed Networking tools, because im pretty sure systemd comes with a DHCP client;

+ Added pvcreate commands;

+ Added kernel options;

+ Added lscpu info;

- Removed luks stuff

+ Added lsusb and lspci info;

+ Added more kernel options;

+ Added volume groups to missing places in Mounting section.

+ Added CPU_FLAGS_X86

+ Added 'emerge --ask sys-apps/systemd';

+ Added lscpu info;

- Removed more luks stuff;

~ Changed '-march=native' to 'skylake';

+ Added snapshot kernel options.

~ Changed to zsh shell

_________________________

Edit: I want to use rEFInd instead of Grub2.
Back to top
View user's profile Send private message
DONAHUE
Watchman
Watchman


Joined: 09 Dec 2006
Posts: 7553
Location: Goose Creek SC

PostPosted: Tue May 03, 2016 2:10 pm    Post subject: Reply with quote

Quote:
I want to use rEFInd instead of Grub2

Grub2 is a boot manager and a bootloader.
rEFInd is a boot manager only.
running rEFInd to run grub2 is a feasible redundancy.
IMHO using rEFInd to select an efi stub kernel bootloader is preferable as a lower maintenance option.
_________________
Defund the FCC.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 43221
Location: 56N 3W

PostPosted: Tue May 03, 2016 4:49 pm    Post subject: Reply with quote

ArtificialAmateur,

Follow the handbook until your own Gentoo will boot.
Now switch to systemd. Do check it still boots and that systemd is in use.

From there, the world is your oyster but adopt the approch of building on what you know works, so that when, not if, if breaks. you know what broke it.
Narrowing the problem field makes it much simpler to help you fix it.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum