--- Gentoo pós instalação base --- Arch Linux BREVE ---
loadkeys br-abnt2
ip -s -c -h a
net-setup nomePlacaRede
ifconfig nomePlacaRede up
date MMDDHHMMAAAA
parted -a optimal /dev/sda ↵
(parted) mklabel gpt ↵
(parted) rm 2 ↵
(parted) unit mib ↵
(parted) mkpart primary 1 513 ↵
(parted) name 1 efi_grub ↵
(parted) set 1 boot on ↵
(parted) print ↵
(parted) mkpart primary 514 1026 ↵
(parted) name 2 boot ↵
(parted) mkpart primary 1027 13315 ↵
(parted) name 3 swap ↵
(parted) mkpart primary 13316 -1 ↵
(parted) name 4 rootfs ↵
(parted) quit ↵
mkfs.vfat -F32 /dev/sda1
mkfs.ext2 /dev/sda2
mkfs.ext4 /dev/sda4
Swap
mkswap /dev/sda3
swapon /dev/sda3
mkdir -p /mnt/gentoo
mount /dev/sda4 /mnt/gentoo
cd /mnt/gentoo
ping -c3 gentoo.org
links para navegar e achar o aquivo "stage3-amd64-*.tar.bz2"
links https://www.gentoo.org/downloads/mirrors/#BR
releases/ ↵
amd64/ ↵
autobuilds/ ↵
current-stage3-amd64/ ↵
stage3-amd64-*.tar.bz2
tar xpf stage3-*.tar.bz2 --xattrs-include='*.*' --numeric-owner
tar xpf stage3-amd64-*.tar.xz --xattrs-include='*.*' --numeric-owner
mkdir -p /mnt/gentoo/boot
mount /dev/sda2 /mnt/gentoo/boot
mkdir -p /mnt/gentoo/boot/efi
mount /dev/sda1 /mnt/gentoo/boot/efi
grep -c processor /proc/cpuinfo número de núcleos
grep -m1 -A3 "vendor_id" /proc/cpuinfo modelo do processador [flags](https://wiki.gentoo.org/wiki/Safe_CFLAGS)
nano -w /mnt/gentoo/etc/portage/make.conf
Então adicione ao make.conf.
CHOST="x86_64-pc-linux-gnu"
COMMON_FLAGS="-march=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
#USE="acpi bindist git dbus ffmpeg jpeg jpeg2k -modemmanager mp3 mp4 mpeg png sound opengl X"
EMERGE_DEFAULT_OPTS="--quiet-build=y --ask --load-average=2 --autounmask-write=y --with-bdeps=y"
FEATURES="preserve-libs collision-protect candy"
#INPUT_DEVICES="evdev keyboard synaptics mouse"
#VIDEO_CARDS="vesa intel amdgpu nvidia virtualbox"
LINGUAS="pt_BR.UTF-8 pt_BR.ISO-8859-1 pt_BR pt-BR"
MAKEOPTS="-j4"
ACCEPT_LICENSE="*"
L10N="pt-BR"
GRUB_PLATFORMS="efi-64"
Observação: Editar make.conf para funcionar com UEFI. Adicione a linha:
GRUB_PLATFORMS="efi-64"
mount --types proc /proc /mnt/gentoo/proc
mount --rbind /sys /mnt/gentoo/sys
mount --rbind /dev /mnt/gentoo/dev
test -L /dev/shm && rm /dev/shm && mkdir /dev/shm
mount --types tmpfs --options nosuid,nodev,noexec shm /dev/shm
chmod 1777 /dev/shm
cp -L /etc/resolv.conf /mnt/gentoo/etc/
chroot /mnt/gentoo /bin/bash
source /etc/profile && export PS1="(chroot) $PS1"
livecd ~ #
emerge-webrsync
emerge --sync --quiet
mkdir /etc/portage/repos.conf
cp /usr/share/portage/config/repos.conf /etc/portage/repos.conf/gentoo.conf
mirrorselect -i -o >> /etc/portage/repos.conf/gentoo.conf
eselect profile list
eselect profile set "X"
default/linux/amd64/17.0/desktop
eselect profile list
emerge --ask --update --deep --newuse @world
echo "America/Belem" > /etc/timezone
emerge --config sys-libs/timezone-data
nano -w /etc/locale.gen
pt_BR.UTF-8 UTF-8
locale-gen
locale -a
eselect locale list
eselect locale set [pt_br.utf8]
nano -w /etc/env.d/02locale
LANG="pt_BR.UTF-8"
LC_COLLATE="C"
env-update && source /etc/profile && export PS1="(chroot) $PS1"
emerge -auDN @world
emerge app-portage/cpuid2cpuflags
cpuid2cpuflags-x86
cpuid2cpuflags-x86 >> /etc/portage/make.conf
apague o primero CPU_FLAGS_X86 da linha do make.conf
modifique colocando entre aspas =""
nano -w /etc/portage/make.conf
env-update && source /etc/profile && export PS1="(chroot) $PS1"
gentoo kernel
emerge -aq gentoo-sources genkernel usbutils dosfstools pciutils gentoolkit ufed eix axel xfsprogs
nano -w /etc/genkernel.conf
MENUCONFIG="yes"
CLEAN="no"
MRPROPER="no"
descomente:
MAKEOPTS="$(portageq envvar MAKEOPTS)"
TMPDIR="/var/tmp/genkernel"
nano -w /etc/fstab
fs | mountpoint | type | opts | dump/pass |
---|---|---|---|---|
/dev/sda1 | /boot/efi | vfat | noauto,noatime | 0 2 |
/dev/sda2 | /boot | ext2 | defaults | 0 2 |
/dev/sda3 | none | swap | sw | 0 0 |
/dev/sda4 | / | ext4 | noatime | 0 1 |
/dev/cdrom | /mnt/cdrom | auto | noauto,ro | 0 0 |
tmpfs | /var/tmp | tmpfs | rw,nosuid,noatime,nodev,size=8G,mode=1777 | 0 0 |
tmpfs | /var/tmp/portage | tmpfs | rw,nosuid,noatime,nodev,size=7G,mode=775,uid=portage,gid=portage,x-mount.mkdir=775 | 0 0 |
nano -w /etc/portage/make.conf
genkernel all
--------------------------------------------------------------------------------------
video card nvidea
Pre-allocated buffer size for HD audio drive = 2048
Virtualization drivers
DOS/FAT/NT Filessystems ---> * NTFS write support
Device Drivers --->
Generic Driver Options --->
[*] Maintain a devtmpfs filesystem to mount at /dev
[ ] Automount devtmpfs at /dev, after the kernel mounted the rootfs
Verify SCSI disk support has been activated (CONFIG_BLK_DEV_SD):
KERNEL Enabling SCSI disk support
Device Drivers --->
SCSI device support --->
<*> SCSI disk support
File systems --->
<*> Second extended fs support
<*> The Extended 3 (ext3) filesystem
<*> The Extended 4 (ext4) filesystem
<*> Reiserfs support
<*> JFS filesystem support
<*> XFS filesystem support
<*> Btrfs filesystem support
DOS/FAT/NT Filesystems --->
<*> MSDOS fs support
<*> VFAT (Windows-95) fs support
Pseudo Filesystems --->
[*] /proc file system support
[*] Tmpfs virtual memory file system support (former shm fs)
Device Drivers --->
Network device support --->
<*> PPP (point-to-point protocol) support
<*> PPP support for async serial ports
<*> PPP support for sync tty ports
Processor type and features --->
[*] Symmetric multi-processing support
Device Drivers --->
HID support --->
-*- HID bus support
<*> Generic HID driver
[*] Battery level reporting for HID devices
USB HID support --->
<*> USB HID transport layer
[*] USB support --->
<*> xHCI HCD (USB 3.0) support
<*> EHCI HCD (USB 2.0) support
<*> OHCI HCD (USB 1.1) support
Architecture specific kernel configuration
Processor type and features --->
[ ] Machine Check / overheating reporting
[ ] Intel MCE Features
[ ] AMD MCE Features
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
Enable GPT partition
-*- Enable the block layer --->
Partition Types --->
[*] Advanced partition selection
[*] EFI GUID Partition support
Enable EFI stub support and EFI variables in the Linux kernel if UEFI is used to boot the system (CONFIG_EFI, CONFIG_EFI_STUB, CONFIG_EFI_MIXED, and CONFIG_EFI_VARS):
KERNEL Enable support for UEFI
Processor type and features --->
[*] EFI runtime service support
[*] EFI stub support
[*] EFI mixed-mode support
Firmware Drivers --->
EFI (Extensible Firmware Interface) Support --->
<*> EFI Variable Support via sysfs
------------------------------------------------------------------------------------
nano -w /etc/rc.conf
rc_parallel="YES"
nano -w /etc/profile.d/xdg_cache_home
export XDG_CACHE_HOME="/tmp/${USER}/.cache"
emerge --ask sys-kernel/linux-firmware
nano -w /etc/conf.d/hostname
hostname="gentoo"
Primeiro instale o pacote net-misc/netifrc
emerge --ask --noreplace net-misc/netifrc
Iniciando automaticamente a rede durante o boot precisam ser criados assim como fizemos com o net.eth0.
Se após a inicialização do sistema descobrirmos que o nome que usamos para a interface de rede (que está atualmente documentada como eth0) está errado, então execute os seguintes passos para corrigir isso:
1.Corrija o arquivo /etc/conf.d/net com o nome correto da interface de rede (tal como enp0s3 em vez de eth0).
2.Crie um novo link simbólico (como /etc/init.d/net.enp0s3).
3.Remova o link simbólico antigo (rm /etc/init.d/net.eth0).
4.Adicione o novo ao runlevel default.
5.Remova o antigo usando rc-update del net.eth0 default.
cd /etc/init.d
ln -s net.lo net.enp0s3
rc-update add net.enp0s3 default
cd /
Adicione um nome depois de localhost
nano -w /etc/hosts
127.0.0.1 gentoo.homenetwork localhost
passwd
nano -w /etc/conf.d/keymaps
keymap="br-abnt2"
nano -w /etc/conf.d/hwclock
clock="UTC"
emerge -aq sysklogd cronie mlocate logrotate dhcpcd
rc-update add sysklogd default
rc-update add sshd default
rc-update add cronie default
rc-update add dhcpcd default
Obs: Cuidado no "grub.cfg" pois ao aperta tab ele altomaticamente coloca "grub.conf".
Modo BIOS
emerge --ask sys-boot/grub
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
Modo UEFI
mkdir -p /boot/efi Verifique antes
mount /dev/sda1 /boot/efi Verifique antes
mount -o remount,rw /boot/efi
echo 'sys-boot/grub:2 mount truetype' >> /etc/portage/package.use/grub:2
emerge --ask --update --newuse --deep --verbose sys-boot/grub:2
mount -o remount,rw /sys/firmware/efi/efivars
grub-install --target=x86_64-efi --efi-directory=/boot/efi --removable
nano -w /etc/default/grub
GRUB_TIMEOUT=1
grub-mkconfig -o /boot/grub/grub.cfg
useradd -m -G users,wheel,audio,video,root,sys,disk,adm,bin,daemon,portage,console,usb,cron,input,lp,uucp -s /bin/bash nomeUsuario
passwd nomeUsuario
exit
cd
umount -l /mnt/gentoo/dev{/shm,/pts,}
umount -R /mnt/gentoo
shutdown -r now