Skip to content

젠투 리눅스 설치 가이드

Preface

젠투 리눅스 설치 가이드는 문서 방향성을 전면 수정합니다.

설치에 익숙한 분들이 핸드북을 참조하기 번거로울 때 활용할 수 있도록 수정합니다. 젠투 리눅스가 처음이신 분들이나 리눅스가 익숙하지 않으신 분들은 핸드북을 통해 천천히 진행하시는 것을 권장합니다.

Prerequisite

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

// Github
# wget https://github.com/YOUR_USER_ID/YOUR_REPOSITORY_NAME/raw/master/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

# ls /sys/firmware/efi

# wipefs --all /dev/sda
# parted /dev/sda
# cfdisk /dev/sda

Format

// /boot
# mkfs.vfat -F 32 /dev/sdaN

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

// /
# mkfs.ext4 -j /dev/sdaN

// xfs, 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 xvpf stage3-*.tar.xz --xattrs-include='*.*' --numeric-owner

Edit make.conf

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

// 본인 깃 에서 다운받기
// Github
# wget https://github.com/YOUR_USER_ID/YOUR_REPOSITORY_NAME/raw/master/YOUR_MAKE_CONF_DIRECTORY/make.conf
// Gitlab
# wget https://gitlab.com/YOUR_USER_ID/YOUR_REPOSITORY_NAME/-/raw/master/YOUR_MAKE_CONF_DIRECTORY/make.conf
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
### TEMPLATE
### You can download this via
### wget https://git.jeonwh.com/gentoo/plain/make.conf.temp

# These settings were set by the catalyst build script that automatically
# built this stage.
# Please consult /usr/share/portage/config/make.conf.example for a more
# detailed example.
COMMON_FLAGS="-march=native -O2 -pipe"
CFLAGS="${COMMON_FLAGS}"
CXXFLAGS="${COMMON_FLAGS}"
FCFLAGS="${COMMON_FLAGS}"
FFLAGS="${COMMON_FLAGS}"
MAKEOPTS="-j16"

# USE Flags
#USE="networkmanager xinerama jumbo-build ibus cjk"

# NOTE: This stage was built with the bindist Use flag enabled
PORTDIR="/var/db/repos/gentoo"
DISTDIR="/var/cache/distfiles"
PKGDIR="/var/cache/binpkgs"

# This sets the language of build output to English.
# Please keep this setting intact when reporting bugs.
LC_MESSAGES=C

# GRUB:2/UEFI
GRUB_PLATFORMS="efi-64"

# XORG
INPUT_DEVICES="libinput"    # You can add synaptics, if you're using laptop. 
#VIDEO_CARDS="nvidia"
#VIDEO_CARDS="amdgpu radeonsi"

# Language Support
L10N="ko"

# License
#ACCEPT_LICENSE="*"

# Accept Keywords
#ACCEPT_KEYWORDS="~amd64"

# Mirrors for South Korea
GENTOO_MIRRORS="http://ftp.daum.net/gentoo/ http://ftp.kaist.ac.kr/pub/gentoo/ ftp://ftp.kaist.ac.kr/gentoo/ http://ftp.lanet.kr/pub/gentoo/ https://ftp.lanet.kr/pub/gentoo/ ftp://ftp.lanet.kr/pub/gentoo/"

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

# emerge-webrsync
// 혹은
# emerge --sync

# 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) /etc/portage/package.use/package.use 
// >> sys-firmware/intel-microcode   initramfs

# emerge -av sys-firmware/intel-microcode

Edit fstab

# blkid >> /etc/fstab
# nano -w /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

// 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

// TIP: Enable 'logrotate' USE Flag
// ex) /etc/portage/package.use/package.use 
// >> app-admin/sysklogd     logrotate
# 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

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

# emerge --noreplace -av elogind udev dbus polkit udisks

# rc-update add dbus default
# rc-update add elogind boot

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

# emerge --noreplace -av sddm
# usermod -a -G video sddm
# emerge --renoplace -av gui-libs/display-manager-init
# vim /etc/conf.d/display-manager
> CHECKVT=7
> DISPLAYMANAGER="sddm"
# rc-update add display-manager default

Last update: October 25, 2021
Back to top