Gentoo 설치 정리
1. Live CD 다운로드
2. Boot
3. Configuring Network
4. Partition a Disk
5. Create Filesystems
6. Mount
7. Installing a Stage Tarball
8. Inatal Portage
9. Configuring the Compile Options
10. Chrooting
11. Configuring the Kernel
12. Configuring your System
13. Configuring the Bootloader
0. 참고 자료
http://wiki.kldp.org/wiki.php/GentooInstall KLDP Gentoo 설치 문서
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml Gentoo Handbook
1.Live CD 다운로드
2. Boot
boot 옵션을 사용하기 위해서는 아래 문서를 참고하며 엔터를 치면 default gentoo 커널을 사용한다. boot: 상태에서 F1을 누르면 선택 가능한 커널을 알려주며 F2를 누르면 사용 가능한 옵션을 알려준다.
ㄱ. default 설치
boot: gentoo
ㄴ. scsi, ataraid, smp 인 경우
boot: smp doscsi doataraid
부팅후 리모트 설치를 위해 root 계정의 암호를 설정하고 sshd 데몬을 시작한다.
# passwd
# /etc/init.d/sshd start
3. Configure Network
net-setup 명령어를 이용해 네트워크를 구성하며 자세한 내용은 다음 문서를 참고한다.
net-setup eth0
4. Partition a Disk
fdisk 명령어를 이용해 디스크의 파티션을 구성한다.
# fdisk /dev/hda
또는
# fdisk /dev/discs/discs0
fdisk 명령어
m 도움말
n 파티션 생성
p 파티션 정보
t 시스템 아이디 변경
/ 4G(/usr, /var 포함)
/boot 100M
/tmp 1G
swap 512M
/var/log 1~3G
/usr/local 4G
home 나머지
5. Create Filesystems
Filesystem Creation Command
ext2 mke2fs
ext3 mke2fs -j
reiserfs mkreiserfs
xfs mkfs.xfs
jfs mkfs.jfs
파일 시스템 생성
# mkreiserfs /dev/hde1
# mkreiserfs /dev/hde3
# mkswap /dev/hde2
스왑 파티션 활성화
# swapon /dev/hde2
6. Mount
/mnt/gentoo 마운트
# mount /dev/hda3 /mnt/gentoo
/mnt/gentoo/boot 마운트
# mkdir /mnt/gentoo/boot
# mount /dev/hda1 /mnt/gentoo/boot
/mnt/gentoo/proc 마운트
# mount -t proc none /mnt/gentoo/proc
7. Installing a Stage Tarball
ㄱ. 시간 설정
# date //시간 확인
# date MMDDhhmmYYYY //시간설정
ㄴ. tarball 설치
# cd /mnt/gentoo
# tar -xvjpf /mnt/cdrom/stages/stage3-20031011.tar.bz2
8. Inatal Portage
# tar -xvjf /mnt/cdrom/snapshots/portage-20031011.tar.bz2 -C /mnt/gentoo/usr
9. Configuring the Compile Options
nano명령어를 이용해 컴파일 옵션을 수정한다. GHOST 값만 변경하고 CFLAGS값은 잘 몰라서 변경 못했음.
# nano -w /mnt/gentoo/etc/make.conf
10. Chrooting
Selecting Mirrors
# mirrorselect -a -s4 -o >> /mnt/gentoo/etc/make.conf
mirroselect 옵션에 추가(예정)
Copy DNS Info
# cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf
Entering the new Environment
# chroot /mnt/gentoo /bin/bash
# env-update
# source /etc/profile
Updating Portage
# emerge sync
# emerge-webrsync (emerge sync가 안되면 실행)
Optional: Preparing for GRP 항목은 선택사항이어서 이 단계는 수행하지 않고 다음 단계로 진행함
ALT+F2 : 새로운 터미날 오픈
ALT+F1 : 이전 터미날 돌아가기
11. Configuring the Kernel
Timezone 설정 Asia/Seoul로 Timezone을 설정한다.
# ls /usr/share/zoneinfo/Asia
# ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime
Source 설치 vanilla-sources the default kernel source
gentoo-sources kernel source patched with performance-enhancing features
gentoo-dev-sources kernel v2.6 source
설치하고 싶은 소스를 선택하고 emerge를 이용해 설치한다.
# emerge vanilla-sources
# ls -l /usr/src/linux
linux에 심볼릭 링크가 다른 커널 소스에 연결 되있는 경우 삭제하고 설치하고 싶은 커널 소스에 링크를 만든다.
# rm /usr/src/linux && ln -s /usr/src/linux-2.4.25 /usr/src/linux
# cd /usr/src/linux
# make menuconfig
커널 구성은 아래 문서를 보고 따라 한다.
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=7#doc_chap3
Installing Separate Kernel Modules
이해 부족... 요번 설치에서는 안했음.
12. Configuring your System
/etc/fstab 수정 nano나 vi를 이용해서 실제 사용될 파티션 정보에 맞게 수정을 하며 filesystem이 reiserfs인경우에 opt에 notail을 추가한다.
네트워크
hostname 설정
# echo tux > /etc/hostname
domainname 설정
# echo homenetwork > /etc/dnsdomainname
nisdomainame 설정
# echo nis.homenetwork > /etc/nisdomainname
domainname스크립트를 default run level에 추가
# rc-update add domainname default
네트워크 설정
네트워크 설정 수정(dhcp,ip,netmask,broadcast...)
# nano -w /etc/conf.d/net
부팅시에 네트워크 시작하기위해 net.eth0을 defalut run level에 추가한다.
# rc-update add net.eth0 default
시스템 정보
# nano -w /etc/rc.conf
13. Configuring the Bootloader
GRUB 설치
# emerge --usepkg grub
GRUB shell 실행
# grub
MBR에 GRUB 인스톨
grub> root (hd0,0) (Specify where your /boot partition resides)
grub> setup (hd0) (Install GRUB in the MBR)
grub> quit (Exit the GRUB shell)
grub.conf 수정
nano를 이용해 grub.conf 파일을 연다
nano -w /boot/grub/grub.conf
아래 내용을 참고해서 grub.conf를 작성한다.
# Which listing to boot as default. 0 is the first, 1 the second etc.
default 0
# How many seconds to wait before the default listing is booted.
timeout 30
# Nice, fat splash-image to spice things up :)
splashimage=(hd0,0)/grub/splash.xpm.gz
title=Gentoo Linux 2.4.24
# Partition where the kernel image (or operating system) is located
root (hd0,0)
kernel (hd0,0)/kernel-2.4.24 root=/dev/hda3
# The next three lines are only if you dualboot with a Windows system.
# In this case, Windows is hosted on /dev/hda6.
title=Windows XP
root (hd0,5)
chainloader +1
grub설치에 관한 자세한 내용은 아래 문서를 참고한다.
http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=9#doc_chap2