Preface

젠투 리눅스 설치 가이드는 문서 방향성을 전면 수정합니다.
설치에 익숙한 분들이 핸드북을 참조하기 번거로울 때 활용할 수 있도록 수정합니다.
젠투 리눅스가 처음이신 분들이나 리눅스가 익숙하지 않으신 분들은 핸드북을 참고하시기 바랍니다.

23년 12월부로 젠투 측에서 바이너리 패키지를 공식 지원합니다.
바이너리 패키지 설치 방법을 위해 별도 포스트를 마련했습니다.

Prerequisite

본인 Git에서 필요한 파일을 다운받아야 할 때,

> Github
$ wget https://github.com/YOUR_USER_ID/YOUR_REPOSITORY_NAME/raw/main/FILE_DIRECTORY/SOME_FILE

> Gitlab
$ wget https://gitlab.com/YOUR_USER_ID/YOUR_REPOSITORY_NAME/-/raw/master/FILE_DIRECTORY/SOME_FILE

Live USB

젠투 위키의 미러

# wipefs --all /dev/sdb
# dd if=./Downloads/install-amd64-minimal-20211231T235901Z.iso of=/dev/sdb status=progress && sync

Base

Ping

# ping

Partition

UEFI 부팅 확인

# ls /sys/firmware/efi
# wipefs --all /dev/sda
# parted /dev/sda
# cfdisk /dev/sda

Format

/boot partition

# mkfs.vfat -F 32 /dev/sdaN

swap partition

# mkswap /dev/sdaN
# swapon /dev/sdaN

/ partition

# mkfs.ext4 -j /dev/sdaN

foramt as xfs or btrfs

# mkfs.xfs /dev/sdaN
# mkfs.btrfs /dev/sdaN

Mount

다른 배포판 환경에서 설치하는 경우, /mnt/gentoo 디렉터리가 없으므로,

# mkdir -pv /mnt/gentoo
# mount -v -t ext4 /dev/sda3 /mnt/gentoo

# mkdir -pv /mnt/gentoo/boot
# mount -v -t vfat /dev/sda1 /mnt/gentoo/boot

TIME

# ntpd -q -g
# hwclock --systohc --utc

Stage 3 Tarball

# cd /mnt/gentoo
# links https://www.gentoo.org/downloads/mirrors/
# tar xpf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner

Edit make.conf

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

Mirror

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

Copy repos.conf

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

Copy resolv.conf

# cp --dereference /etc/resolv.conf /mnt/gentoo/etc/

Mount /proc, /sys, /dev

아래 명령어중 --make-rslave옵션은 systemd 설치하실 분만 진행합니다

# 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 # <--
# mount --bind /run /mnt/gentoo/run

Chroot

# chroot /mnt/gentoo /bin/bash
# source /etc/profile
# export PS1="(chroot) $PS1"

Portage

# merge-webrsync

# emerge -avuDN @world
# emerge -av gentoolkit eix genlop

News

# eselect news list
# eselect news read N

Profile

# eselect profile list
# eselect profile set N

Timezone

# ls /usr/share/zoneinfo
# echo "Asia/Seoul" > /etc/timezone
# emerge --config sys-libs/timezone-data

Locale

# nano -w /etc/locale.gen
'en_US.UTF-8 UTF-8' 주석 제거
# locale-gen
# eselect locale list
# eselect locale set N

Update env

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

Kernel

// 정품
# emerge --ask sys-kernel/gentoo-sources pciutils sys-kernel/linux-firmware

// 진품
# git clone https://github.com/torvalds/linux.git
# wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.14.1.tar.xz

// 유사품 1 - 바이너리 [2020-09-15: Gentoo 업데이트]
# emerge -a sys-kernel/gentoo-sources-bin
# emerge -a sys-kernel/gentoo-kernel-bin

// 유사품 2 - 컴파일
# emerge -a sys-kernel/gentoo-kernel
# emerge -a sys-kernel/vanilla-sources
# emerge -a sys-kernel/git-sources
# cd /usr/src/linux

# make mrproper
# make defconfig
# make menuconfig

# make -jN
# make modules_install
# make install

When updating the kernel

# cp /usr/src/linux/.config /usr/src/linux/NEW_KERNEL
# make olddefconfig

If you need initramfs

# genkernel --install --kernel-config=/usr/src/linux/.config initramfs
Microcode (TIP: Enable 'initramfs' USE Flag)
ex) add 'sys-firmware/intel-microcode initramfs'
    inside '/etc/portage/package.use/package.use' file
# emerge -av sys-firmware/intel-microcode

Edit fstab

# blkid >> /etc/fstab
# nano -w /etc/fstab
# Inside file '/etc/fstab'
/dev/sda1    /boot    vfat    defaults,noatime    0 2
/dev/sda2    none     swap    sw                  0 0
/dev/sda3    /        ext4    noatime             0 1
/dev/sda4    /home    ext4    noatime    0 1

# UUID -> remove quotation(")
# PARTUUID -> remove quotation(")

Hostname

# nano -w /etc/conf.d/hostname
# nano -w /etc/conf.d/net
# nano -w /etc/hosts

Netifrc

# emerge --ask --noreplace net-misc/netifrc
# nano -w /etc/conf.d/net
config_enp3s0="dhcp"
# cd /etc/init.d
# ln -s net.lo net.enp3s0

아래엔 본인 드라이버의 이름을 넣어야 합니다.

# rc-update add net.enp3s0 default
TIP
emerge -av ifplugd

Passwd

passwd

Edit rc.conf

nano -w /etc/rc.conf
rc_logger="YES"
rc_log_path="/var/log/rc.log"
nano -w /etc/conf.d/keymaps
nano -w /etc/conf.d/hwclock

Install logroate, sysklogd, cronie

# emerge --ask app-admin/sysklogd cronie mlocate
# rc-update add sysklogd default
# rc-update add cronie default

# emerge --ask net-misc/dhcpcd

or

# emerge -av networkmanger
# rc-update add NetworkManager default

GRUB:2

# emerge --ask --verbose sys-boot/grub:2
# grub-install --target=x86_64-efi --efi-directory=/boot
# grub-mkconfig -o /boot/grub/grub.cfg

Reboot

# exit
# cd
# umount -lR /mnt/gentoo
# reboot

Useradd

# useradd -m -g users -G wheel,audio,video,portage -s /bin/bash USER_NAME
# passwd USER_NAME

Remove stage3*.tar.xz

# rm /stage3*.tar.xz

XORG

# eselect profile list
# eselect profile set N
# emerge -avuDN @world

# env-update && source /etc/profile

# emerge --ask x11-base/xorg-server
# env-update && source /etc/profile

PLASMA

Settings for Plasma

# eselect profile set N
# eselect profile list
# emerge -avuDN --with-bdeps=y @world

System Dependencies

# emerge --noreplace -av elogind udev dbus polkit udisks
# rc-update add dbus default
# rc-update add elogind boot

Install Packages

# emerge -av plasma-meta kde-aps-meta

SDDM

# emerge --noreplace -av sddm
# usermod -a -G video sddm
# emerge --renoplace -av gui-libs/display-manager-init

Enable SDDM

# vim /etc/conf.d/display-manager
CHECKVT=7
DISPLAYMANAGER="sddm"
# rc-update add display-manager default