Advertisement
Ikmik

gentoo_instalation.txt

Jan 26th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.71 KB | None | 0 0
  1. Configuring the network
  2. =====================================================
  3. (...)
  4.  
  5. Preparing the disks
  6. =====================================================
  7.  
  8. livecd ~ # parted -a optimal /dev/sda
  9. --(parted) unit mib
  10. (parted) mklabel gpt
  11. (parted) mkpart primary 1 3
  12. (parted) name 1 grub
  13. (parted) set 1 bios_grub on
  14. (parted) mkpart primary 3 -1
  15. (parted) name 2 lvmpv
  16. (parted) set 2 lvm on
  17. livecd ~ # pvcreate /dev/sda2
  18. livecd ~ # vgcreate vg /dev/sda2
  19. livecd ~ # lvcreate -L 8G -n swap vg
  20. livecd ~ # lvcreate -L 120G -n home vg
  21. livecd ~ # lvcreate -l 100%VG -n rootfs vg
  22. livecd ~ # mkfs.ext4 /dev/vg/home
  23. livecd ~ # mkfs.ext4 /dev/vg/rootfs
  24. --livecd ~ # mkswap /dev/vg/swap
  25. --livecd ~ # swapon /dev/vg/swap
  26. livecd ~ # cryptsetup -s 512 luksFormat /dev/vg/swap
  27. livecd ~ # cryptsetup luksOpen /dev/vg/swap swap
  28. livecd ~ # mkswap /dev/mapper/swap
  29. livecd ~ # swapon /dev/mapper/swap
  30. livecd ~ # mount /dev/vg/rootfs /mnt/gentoo
  31.  
  32. Installing Stage3
  33. =====================================================
  34. livecd ~ # cd /mnt/gentoo
  35. livecd /mnt/gentoo # wget http://distfiles.gentoo.org/releases/amd64/autobuilds/20180123/systemd/stage3-amd64-systemd-20180123.tar.bz2
  36. livecd /mnt/gentoo # sha512sum stage3-amd64-systemd-20180123.tar.bz2
  37. 95e4d6d6f65c6ecc4e5052c70c99c13793a81440d0d236faa83e6e929e1759bac153b90551909f7e7a49a9725b82b524c8363bacb2f46d4ad0051198ea033c4b
  38. livecd /mnt/gentoo # tar xpf stage3-*.tar.{bz2,xz} --xattrs-include='*.*' --numeric-owner
  39.  
  40. /mnt/gentoo/etc/portage/make.conf:
  41. CFLAGS="-O2 -pipe -march=native"
  42. MAKEOPTS="-j2"
  43.  
  44. Installing base system
  45. =====================================================
  46. livecd /mnt/gentoo # mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf
  47. livecd /mnt/gentoo # mkdir /mnt/gentoo/etc/portage/repos.conf
  48. livecd /mnt/gentoo # cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
  49. livecd /mnt/gentoo # cp --dereference /etc/resolv.conf /mnt/gentoo/etc
  50.  
  51. /mnt/gentoo/chroot-mounts.sh:
  52. mount --types proc /proc /mnt/gentoo/proc
  53. mount --rbind /sys /mnt/gentoo/sys
  54. mount --make-rslave /mnt/gentoo/sys
  55. mount --rbind /dev /mnt/gentoo/dev
  56. mount --make-rslave /mnt/gentoo/dev
  57.  
  58. livecd /mnt/gentoo # chmod +x chroot-mounts.sh
  59. livecd /mnt/gentoo # ./chroot-mounts.sh
  60. livecd /mnt/gentoo # chroot /mnt/gentoo /bin/bash
  61. livecd / # . /etc/profile
  62. livecd / # export PS1="(chroot) $PS1"
  63. (chroot) livecd / # mount /dev/vg/home /home
  64. (chroot) livecd / # emerge-webrsync
  65. (chroot) livecd / # emerge --sync
  66. (chroot) livecd / # eselect news read
  67. (chroot) livecd / # eselect profile list
  68. (chroot) livecd / # eselect profile set 18
  69.  
  70. /etc/portage/make.conf:
  71. USE="bash-completion bindist git gnome ios mmx sse sse2 systemd vim-syntax wayland wifi"
  72.  
  73. (chroot) livecd / # emerge --ask --update --deep --newuse @world
  74.  
  75. Configuring the kernel
  76. =====================================================
  77. (chroot) livecd / # emerge --ask sys/kernel/gentoo-sources
  78. (chroot) livecd / # cd /usr/src/linux
  79. (chroot) livecd /usr/src/linux # make menuconfig
  80.  
  81. [*] Device Drivers -> Generic Driver Options -> Maintain a devtmpfs filesystem to mount at /dev
  82. [ ] Device Drivers -> Generic Driver Options -> Automount devtmpfs at /dev, after the kernel mounted the rootfs
  83. <*> Device Drivers -> SCSI device support -> SCSI disk support
  84. <*> File systems -> Second extended fs support
  85. [*] File systems -> Ext2 extended attributes
  86. <*> File systems -> The Extended 3 (ext3) filesystem
  87. <*> File systems -> The Extended 4 (ext4) filesystem
  88. <*> File systems -> DOS/FAT/NT Filesystems -> MSDOS fs support
  89. <*> File systems -> DOS/FAT/NT Filesystems -> VFAT (Windows-95) fs support
  90. [*] Processor type and features -> Symmetric multi-processing support
  91. -*- Device Drivers -> HID support -> HID bus support
  92. [*] Device Drivers -> HID support -> Battery level reporting for HID devices
  93. <*> Device Drivers -> HID support -> Generic HID driver
  94. <*> Device Drivers -> HID support -> USB HID transport layer
  95. [*] Device Drivers -> USB support
  96. <*> Device Drivers -> USB support -> xHCI HCD (USB 3.0) support
  97. <*> Device Drivers -> USB support -> EHCI HCD (USB 2.0) support
  98. <*> Device Drivers -> USB support -> OHCI HCD (USB 1.1) support
  99. (Core 2/newer Xeon) Processor type and features -> Processor family
  100. [*] Executable file formats / Emulations -> IA32 Emulation
  101. [*] Enable the block layer -> Partition types -> Advanced patition selection
  102. [*] Enable the block layer -> Partition types -> EFI GUID Partition support
  103. -- [*] Processor type and features -> EFI runtime service support
  104. -- [*] Processor type and features -> EFI stub support
  105. -- [*] Processor type and features -> EFI mixed-mode support
  106. -- [*] Firmware drivers -> EFI (Extensible Firmware Interface) Support -> EFI variable support via sysfs
  107. === systemd ===
  108. [ ] Gentoo Linux -> Support for init systems, system and service managers -> OpenRC, runit and other script based systems and managers
  109. [*] Gentoo Linux -> Support for init systems, system and service managers -> systemd
  110. [*] General setup -> open by fhandle syscalls
  111. [*] General setup -> Control Group support
  112. [ ] General setup -> Enable deprecated sysfs features to support old userspace tools
  113. [*] General setup -> Configure standard kernel features (expert users)
  114. -*- General setup -> Configure standard kernel features (expert users) -> Enable eventpoll support
  115. -*- General setup -> Configure standard kernel features (expert users) -> Enable signalfd() system call
  116. -*- General setup -> Configure standard kernel features (expert users) -> Enable timerfd() system call
  117. -*- Networking support
  118. -*- Device Drivers -> Generic Driver Options -> Mantain a devtmpfs filesystem to mount at /dev
  119. -*- File systems -> Inotify support for userspace
  120. -*- File systems -> Pseudo filesystems -> /proc file system support
  121. -*- File systems -> Pseudo filesystems -> sysfs file system support
  122. -*- General setup -> Checkpoint/restore support
  123. -*- General setup -> Namespaces support
  124. -*- General setup -> Namespaces support -> Network namespace
  125. -*- Enable the block layer -> Block layer SG support v4
  126. -*- Processor type and features -> Enable seccomp to safely compute untrusted bytecode
  127. -*- Networking support -> Networking options -> The IPv6 protocol
  128. ( ) Device Drivers -> Generic Driver Options -> path to uevent helper
  129. [ ] Device Drivers -> Fallback user-helper invocation for firmware loading
  130. -*- Firmware Drivers -> Export DMI identification via sysfs to userspace
  131. -*- File systems -> Kernel automounter version 4 support (also supports v3)
  132. -*- File systems -> Pseudo filesystems -> Tmpfs virtual memory file system support (former shm fs)
  133. -*- File systems -> Pseudo filesystems -> Tmpfs POSIX Acess Control Lists
  134. -*- File systems -> Pseudo filesystems -> Tmpfs extended attributes
  135. === LVM ===
  136. <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> Device mapper support
  137. <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> Crypt target support
  138. <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> Snapshot target
  139. <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> Mirror target
  140. <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> Multipath target
  141. <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> I/O Path Selector based on the number of in-flight I/Os
  142. <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> I/O Path Selector based on the service time
  143. === dm-crypt ===
  144. -*- Cryptographic API
  145. <*> Cryptographic API -> XTS support
  146. -*- Cryptographic API -> SHA224 and SHA256 digest algorithm
  147. -*- Cryptographic API -> AES cipher algorithms
  148. <*> Cryptographic API -> AES cipher algorithms (for x86_64)
  149. -*- Cryptographic API -> User-space interface for hash algorithms
  150. <*> Cryptographic API -> User-space interface for symmetric key cipher algorithms
  151. [*] General setup -> Initial RAM filesystem and RAM dist (initramfs/initrd) support
  152.  
  153. (chroot) livecd /usr/src/linux # make -j2
  154. (chroot) livecd /usr/src/linux # make modules_install
  155. (chroot) livecd /usr/src/linux # make install
  156. (chroot) livecd /usr/src/linux # emerge --ask sys-fs/lvm2
  157. (chroot) livecd /usr/src/linux # emerge --ask sys-fs/cryptsetup
  158. (chroot) livecd /usr/src/linux # emerge --ask sys-kernel/genkernel-next
  159. (chroot) livecd /usr/src/linux # genkernel --udev --lvm --luks --install initramfs
  160. (chroot) livecd /usr/src/linux # emerge --ask sys-kernel/linux-firmware
  161.  
  162. Configuring the system
  163. =====================================================
  164. /etc/crypttab:
  165. crypt-swap UUID=<UUID in LVM> -
  166.  
  167. /etc/fstab:
  168. /dev/vg/rootfs / ext4 noatime 0 1
  169. /dev/vg/home /home ext4 noatime 0 1
  170. UUID="<UUID in dm-crypt>" none swap sw 0 0
  171.  
  172. (chroot) livecd /usr/src/linux # emerge --ask networkmanager
  173. (chroot) livecd /usr/src/linux # emerge --ask systemd # (check the installation)
  174. (chroot) livecd /usr/src/linux # passwd
  175.  
  176. Installing tools
  177. =====================================================
  178. (chroot) livecd /usr/src/linux # emerge --ask mlocate
  179. (chroot) livecd /usr/src/linux # emerge --ask e2fsprogs
  180. (chroot) livecd /usr/src/linux # emerge --ask dosfstools
  181.  
  182. Configuring the bootloader
  183. =====================================================
  184. (chroot) livecd /usr/src/linux # mkdir /etc/portage/package.use
  185.  
  186. /etc/portage/package.use/grub:
  187. sys-boot/grub:2 device-mapper
  188.  
  189. (chroot) livecd /usr/src/linux # emerge --ask --verbose sys-boot/grub:2
  190.  
  191. /etc/default/grub:
  192. GRUB_CMDLINE_LINUX_DEFAULT="dolvm init=/lib/systemd/systemd"
  193.  
  194. (chroot) livecd /usr/src/linux # grub-install --recheck /dev/sda
  195. (chroot) livecd /usr/src/linux # grub-mkconfig -o /boot/grub/grub.cfg
  196. (chroot) livecd /usr/src/linux # exit
  197. livecd /mnt/gentoo # umount -l /mnt/gentoo/dev
  198. livecd /mnt/gentoo # cd
  199. livecd ~ # umount -R /mnt/gentoo
  200. livecd ~ # reboot
  201.  
  202. e8fe6728-cd11-4982-8ed2-7085b0a753cb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement