Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Configuring the network
- =====================================================
- (...)
- Preparing the disks
- =====================================================
- livecd ~ # parted -a optimal /dev/sda
- --(parted) unit mib
- (parted) mklabel gpt
- (parted) mkpart primary 1 3
- (parted) name 1 grub
- (parted) set 1 bios_grub on
- (parted) mkpart primary 3 -1
- (parted) name 2 lvmpv
- (parted) set 2 lvm on
- livecd ~ # pvcreate /dev/sda2
- livecd ~ # vgcreate vg /dev/sda2
- livecd ~ # lvcreate -L 8G -n swap vg
- livecd ~ # lvcreate -L 120G -n home vg
- livecd ~ # lvcreate -l 100%VG -n rootfs vg
- livecd ~ # mkfs.ext4 /dev/vg/home
- livecd ~ # mkfs.ext4 /dev/vg/rootfs
- --livecd ~ # mkswap /dev/vg/swap
- --livecd ~ # swapon /dev/vg/swap
- livecd ~ # cryptsetup -s 512 luksFormat /dev/vg/swap
- livecd ~ # cryptsetup luksOpen /dev/vg/swap swap
- livecd ~ # mkswap /dev/mapper/swap
- livecd ~ # swapon /dev/mapper/swap
- livecd ~ # mount /dev/vg/rootfs /mnt/gentoo
- Installing Stage3
- =====================================================
- livecd ~ # cd /mnt/gentoo
- livecd /mnt/gentoo # wget http://distfiles.gentoo.org/releases/amd64/autobuilds/20180123/systemd/stage3-amd64-systemd-20180123.tar.bz2
- livecd /mnt/gentoo # sha512sum stage3-amd64-systemd-20180123.tar.bz2
- 95e4d6d6f65c6ecc4e5052c70c99c13793a81440d0d236faa83e6e929e1759bac153b90551909f7e7a49a9725b82b524c8363bacb2f46d4ad0051198ea033c4b
- livecd /mnt/gentoo # tar xpf stage3-*.tar.{bz2,xz} --xattrs-include='*.*' --numeric-owner
- /mnt/gentoo/etc/portage/make.conf:
- CFLAGS="-O2 -pipe -march=native"
- MAKEOPTS="-j2"
- Installing base system
- =====================================================
- livecd /mnt/gentoo # mirrorselect -i -o >> /mnt/gentoo/etc/portage/make.conf
- livecd /mnt/gentoo # mkdir /mnt/gentoo/etc/portage/repos.conf
- livecd /mnt/gentoo # cp /mnt/gentoo/usr/share/portage/config/repos.conf /mnt/gentoo/etc/portage/repos.conf/gentoo.conf
- livecd /mnt/gentoo # cp --dereference /etc/resolv.conf /mnt/gentoo/etc
- /mnt/gentoo/chroot-mounts.sh:
- mount --types 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
- livecd /mnt/gentoo # chmod +x chroot-mounts.sh
- livecd /mnt/gentoo # ./chroot-mounts.sh
- livecd /mnt/gentoo # chroot /mnt/gentoo /bin/bash
- livecd / # . /etc/profile
- livecd / # export PS1="(chroot) $PS1"
- (chroot) livecd / # mount /dev/vg/home /home
- (chroot) livecd / # emerge-webrsync
- (chroot) livecd / # emerge --sync
- (chroot) livecd / # eselect news read
- (chroot) livecd / # eselect profile list
- (chroot) livecd / # eselect profile set 18
- /etc/portage/make.conf:
- USE="bash-completion bindist git gnome ios mmx sse sse2 systemd vim-syntax wayland wifi"
- (chroot) livecd / # emerge --ask --update --deep --newuse @world
- Configuring the kernel
- =====================================================
- (chroot) livecd / # emerge --ask sys/kernel/gentoo-sources
- (chroot) livecd / # cd /usr/src/linux
- (chroot) livecd /usr/src/linux # make menuconfig
- [*] Device Drivers -> Generic Driver Options -> Maintain a devtmpfs filesystem to mount at /dev
- [ ] Device Drivers -> Generic Driver Options -> Automount devtmpfs at /dev, after the kernel mounted the rootfs
- <*> Device Drivers -> SCSI device support -> SCSI disk support
- <*> File systems -> Second extended fs support
- [*] File systems -> Ext2 extended attributes
- <*> File systems -> The Extended 3 (ext3) filesystem
- <*> File systems -> The Extended 4 (ext4) filesystem
- <*> File systems -> DOS/FAT/NT Filesystems -> MSDOS fs support
- <*> File systems -> DOS/FAT/NT Filesystems -> VFAT (Windows-95) fs support
- [*] Processor type and features -> Symmetric multi-processing support
- -*- Device Drivers -> HID support -> HID bus support
- [*] Device Drivers -> HID support -> Battery level reporting for HID devices
- <*> Device Drivers -> HID support -> Generic HID driver
- <*> Device Drivers -> HID support -> USB HID transport layer
- [*] Device Drivers -> USB support
- <*> Device Drivers -> USB support -> xHCI HCD (USB 3.0) support
- <*> Device Drivers -> USB support -> EHCI HCD (USB 2.0) support
- <*> Device Drivers -> USB support -> OHCI HCD (USB 1.1) support
- (Core 2/newer Xeon) Processor type and features -> Processor family
- [*] Executable file formats / Emulations -> IA32 Emulation
- [*] Enable the block layer -> Partition types -> Advanced patition selection
- [*] Enable the block layer -> Partition types -> EFI GUID Partition support
- -- [*] Processor type and features -> EFI runtime service support
- -- [*] Processor type and features -> EFI stub support
- -- [*] Processor type and features -> EFI mixed-mode support
- -- [*] Firmware drivers -> EFI (Extensible Firmware Interface) Support -> EFI variable support via sysfs
- === systemd ===
- [ ] Gentoo Linux -> Support for init systems, system and service managers -> OpenRC, runit and other script based systems and managers
- [*] Gentoo Linux -> Support for init systems, system and service managers -> systemd
- [*] General setup -> open by fhandle syscalls
- [*] General setup -> Control Group support
- [ ] General setup -> Enable deprecated sysfs features to support old userspace tools
- [*] General setup -> Configure standard kernel features (expert users)
- -*- General setup -> Configure standard kernel features (expert users) -> Enable eventpoll support
- -*- General setup -> Configure standard kernel features (expert users) -> Enable signalfd() system call
- -*- General setup -> Configure standard kernel features (expert users) -> Enable timerfd() system call
- -*- Networking support
- -*- Device Drivers -> Generic Driver Options -> Mantain a devtmpfs filesystem to mount at /dev
- -*- File systems -> Inotify support for userspace
- -*- File systems -> Pseudo filesystems -> /proc file system support
- -*- File systems -> Pseudo filesystems -> sysfs file system support
- -*- General setup -> Checkpoint/restore support
- -*- General setup -> Namespaces support
- -*- General setup -> Namespaces support -> Network namespace
- -*- Enable the block layer -> Block layer SG support v4
- -*- Processor type and features -> Enable seccomp to safely compute untrusted bytecode
- -*- Networking support -> Networking options -> The IPv6 protocol
- ( ) Device Drivers -> Generic Driver Options -> path to uevent helper
- [ ] Device Drivers -> Fallback user-helper invocation for firmware loading
- -*- Firmware Drivers -> Export DMI identification via sysfs to userspace
- -*- File systems -> Kernel automounter version 4 support (also supports v3)
- -*- File systems -> Pseudo filesystems -> Tmpfs virtual memory file system support (former shm fs)
- -*- File systems -> Pseudo filesystems -> Tmpfs POSIX Acess Control Lists
- -*- File systems -> Pseudo filesystems -> Tmpfs extended attributes
- === LVM ===
- <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> Device mapper support
- <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> Crypt target support
- <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> Snapshot target
- <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> Mirror target
- <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> Multipath target
- <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> I/O Path Selector based on the number of in-flight I/Os
- <*> Device drivers -> Multiple devices driver support (RAID and LVM)-> I/O Path Selector based on the service time
- === dm-crypt ===
- -*- Cryptographic API
- <*> Cryptographic API -> XTS support
- -*- Cryptographic API -> SHA224 and SHA256 digest algorithm
- -*- Cryptographic API -> AES cipher algorithms
- <*> Cryptographic API -> AES cipher algorithms (for x86_64)
- -*- Cryptographic API -> User-space interface for hash algorithms
- <*> Cryptographic API -> User-space interface for symmetric key cipher algorithms
- [*] General setup -> Initial RAM filesystem and RAM dist (initramfs/initrd) support
- (chroot) livecd /usr/src/linux # make -j2
- (chroot) livecd /usr/src/linux # make modules_install
- (chroot) livecd /usr/src/linux # make install
- (chroot) livecd /usr/src/linux # emerge --ask sys-fs/lvm2
- (chroot) livecd /usr/src/linux # emerge --ask sys-fs/cryptsetup
- (chroot) livecd /usr/src/linux # emerge --ask sys-kernel/genkernel-next
- (chroot) livecd /usr/src/linux # genkernel --udev --lvm --luks --install initramfs
- (chroot) livecd /usr/src/linux # emerge --ask sys-kernel/linux-firmware
- Configuring the system
- =====================================================
- /etc/crypttab:
- crypt-swap UUID=<UUID in LVM> -
- /etc/fstab:
- /dev/vg/rootfs / ext4 noatime 0 1
- /dev/vg/home /home ext4 noatime 0 1
- UUID="<UUID in dm-crypt>" none swap sw 0 0
- (chroot) livecd /usr/src/linux # emerge --ask networkmanager
- (chroot) livecd /usr/src/linux # emerge --ask systemd # (check the installation)
- (chroot) livecd /usr/src/linux # passwd
- Installing tools
- =====================================================
- (chroot) livecd /usr/src/linux # emerge --ask mlocate
- (chroot) livecd /usr/src/linux # emerge --ask e2fsprogs
- (chroot) livecd /usr/src/linux # emerge --ask dosfstools
- Configuring the bootloader
- =====================================================
- (chroot) livecd /usr/src/linux # mkdir /etc/portage/package.use
- /etc/portage/package.use/grub:
- sys-boot/grub:2 device-mapper
- (chroot) livecd /usr/src/linux # emerge --ask --verbose sys-boot/grub:2
- /etc/default/grub:
- GRUB_CMDLINE_LINUX_DEFAULT="dolvm init=/lib/systemd/systemd"
- (chroot) livecd /usr/src/linux # grub-install --recheck /dev/sda
- (chroot) livecd /usr/src/linux # grub-mkconfig -o /boot/grub/grub.cfg
- (chroot) livecd /usr/src/linux # exit
- livecd /mnt/gentoo # umount -l /mnt/gentoo/dev
- livecd /mnt/gentoo # cd
- livecd ~ # umount -R /mnt/gentoo
- livecd ~ # reboot
- e8fe6728-cd11-4982-8ed2-7085b0a753cb
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement