Gentoo site와 각종 팁을 참고하여 나만의 가이드를 완성했다. (대략 어수선한 것 같음...)
오래전에 작성된 문서이므로 현재 버전과 차이가 있을 수 있다.



1. Make Live-cd
: get iso image from http://ftp.gentoo.or.kr

2. Booting
boot: enter

3. Load Kernel Modules
# ls /lib/modules/*/kernel/drivers/net/* (모듈 목록을 확인할 경우)
# modprobe 8139too (Realtek 8139*) (모듈이 로드되지 않은 경우)
# hdparm -d1 -A1 -m16 -u1 -a64 /dev/hdb

4. Configuring Networking
# ifconfig eth0 192.168.0.3 broadcast 192.168.0.255 netmask 255.255.255.0
# /sbin/route add -net default gw 192.168.0.1 netmask 0.0.0.0 metric 1 eth0
# vi /etc/resolv.conf (dns ip 수정)

버전 1.4부터는 net-setup eth0 활용 추천

5. Setting your system's date and time
# date
Thu Feb 27 09:04:42 CST 2003
(If your date is wrong, set your date with this next command)
# date 022709042003
(date MMDDhhmmCCYY)

6. Filesystems, partitions and block devices
# fdisk /dev/hdb

/*******************************************************
파티션을 나누지 않아도 되지만, 아래와 같이 나누었다.
각 파티션에 대한 크기는 절대적인 것이 아니며, 설치하는 사람의 성격(?)에 좌우된다.
fdisk 명령에 대해서는 별도로 다루지 않지만 몇 개의 옵션에 대한 설명은
아래 참고할 것.
p(print), d(delete), n(new), a(boot active) -- 실린더 번호에 +sizeM

fdisk (total 80G)

hdb1 - /boot (200M)
hdb2 - swap (512M) -> 생성 후 t -> 2 -> 82 수정
hdb3 - / (2G)
hdb4 - Extended
hdb5 - /usr (2G)
hdb6 - /var (512M)
hdb7 - /home (75G)~
*******************************************************/

# mkfs.ext3 /dev/hdb1 (swap, Extended 제외 모든 영역 포맷)
# mkswap /dev/hdb2 (swap 영역)

7. Mount Partitions
# swapon /dev/hdb2 (swap 마운트)

# mkdir /mnt/gentoo (/) (/를 제일 먼저 mount해야함. 순서대로 할것)
# mount -t ext3 /dev/hdb3 /mnt/gentoo

# mkdir /mnt/gentoo/boot (/boot)
# mount /dev/hdb1 /mnt/gentoo/boot

# mkdir /mnt/gentoo/usr (/usr)
# mount -t ext3 /dev/hdb5 /mnt/gentoo/usr

# mkdir /mnt/gentoo/var (/var)
# mount -t ext3 /dev/hdb6 /mnt/gentoo/var

# mkdir /mnt/gentoo/home (/home)
# mount -t ext3 /dev/hdb7 /mnt/gentoo/home

8. Mounting the CD-ROM (마운트가 안 된 경우)
# mount /dev/cdroms/cdrom0 /mnt/cdrom -o ro -t iso9660

9. Unpack the stage you want to use
# cd /mnt/gentoo
# tar xvjpf /mnt/cdrom/gentoo/stage2~ (stage1, 2, 3 중 원하는 것 선택. 1, 2, 3 마다 순서가 다름)

# mount -o bind /proc /mnt/gentoo/proc (old ver...)
아래것 추천
# mount -t proc proc /mnt/gentoo/proc
SELinux 커널 선택시... SELinux 커널을 설치하려고 닭질해봤지만... 실패했었음.
# mount -t selinuxfs none /mnt/gentoo/selinux

# cp /etc/resove.conf /mnt/gentoo/etc/
# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile

# nano -w /etc/make.conf 에 미러링 추가
아래것 추천
# nano -w /etc/make.globals 에 미러링 추가
GENTOO_MIRRORS="http://ftp.gentoo.or.kr http://ftp.devolus.org/gentoo"
SYNC="rsync://rsync.gentoo.gr.jp/gentoo-portage"

# emerge sync
# export CONFIG_PROTECT="" <- ??? 사용여부?? 일단 빼놓자...
# nano -w /etc/make.conf <- ACCEPT_KEYWORDS="~x86" 추가
# emerge -p system
# emerge system (여기서 모니터만 꺼놓고 1~2시간 정도 낮잠을 자던가 다른일을 한다.!)

# ln -sf /usr/share/zoneinfo/path/to/timezonefile /etc/localtime

SELinux 커널 선택시...
# emerge -k sys-kernel/selinux-sources
Or
# emerge -k sys-kernel/hardened-sources
Or
# emerge -k sys-kernel/devlopment-sources
Or
# emerge -k sys-kernel/mm-sources

normal gentoo 커널
# emerge sys-kernel/gentoo-sources

10. Kernel Compile
# emerge bootsplash (커널 옵션을 변경해야 적용될 것임)
# cd /usr/src/linux
# make mrproper
# make menuconfig (각자 원하는 옵션을 적용할 것)
# make dep && make clean bzImage modules modules_install
# cp arch/i386/boot/bzImage /boot/vmlinuz-2.4.20-r5
# cp System.map /boot/System-2.4.40-r5.map
# depmod -ae -F System.map 2.4.20-gentoo-r5

# emerge lilo
# emerge vim
# ln -s /usr/bin/vim /usr/bin/vi (Link가 안되어 있는 경우)
# vi /etc/lilo.conf (lilo.conf 옵션을 상황에 맞게 설정할 것!)

# lilo
# dd if=/boot/bzImage of=/dev/fd0 (부팅 디스크)

# emerge app-admin/sysklogd
# rc-update add sysklogd default
# emerge sys-apps/dcron
# crontab /etc/crontab
# rc-update add dcron default

# vi /etc/fstab
(BOOT, ROOT, SWAP 이라는 부분에 위에서 설정한 디스크의 파티션을 설정함)

# passwd (root password 설정)
# echo FTPsrv > /etc/hostname (원하는 hostname으로...)
# vi /etc/modules.autoload.d/kernel-2.4
8139too

# vi /etc/hosts

# vi /etc/conf.d/net
#iface_eth0="dhcp" (dhcp 사용시 주석 제거함)

# rc-update add net.eth0 default

------------------------------
* NIC를 새로 추가하고 싶은 경우
# vi /etc/conf.d/net (해당 NIC에 관한 설정 추가)
# cp /etc/init.d/net.eth0 /etc/init.d/net.eth1
# rc-update add net.eth1 default
------------------------------

SELinux 커널 선택했을 때...
# cd /etc/security/selinux/src/policy/
# make install
# make initrd
# make chroot_relabel

# etc-update
# exit
# cd /
# umount /mnt/gentoo/boot
# umount /mnt/gentoo/usr
# umount /mnt/gentoo/home
# umount /mnt/gentoo/var
# umount /mnt/gentoo/proc
# umount /mnt/gentoo
# reboot

*****************************************************************

---------- 설치 완료 후 처음 -----------
SELinux 커널 선택했을 때... 처음에 꼭 설정해야할 것!!!
# cd /etc/security/selinux/src/policy
# make relabel
# reboot

# vi /etc/make.conf <-- USE="-X -tcltk" 설정
# vi /usr/portage/dev-util/ctags/ctags-5.5-r1.ebuild (버전은 변경될 것임)
아래와 같이 파일 이름 수정
mv ${D}/usr/bin/ctags
mv ${D}/usr/share/man/man1/ctags.1
*****************************************************************

.bash_profile, .bashrc, .bash_logout, .vimrc 등 /etc/skel 에 복사
wheel group에 추가 ID 설정, 불필요 ID/group 삭제 (ID삭제 후 해당 ID가 속해있던 group 삭제)
/etc/lilo.conf 수정
ssh, screen, ctags 등과 같이 필요한 package 설치
각 주요 디렉토리 퍼미션 설정...
Posted by 피넛