## [[Date(2004-12-06T16:24:40)]] = 까나리's Gentoo Install Guide = [[TableOfContents]] * 글쓴이 : 김동섭 (까나리) * 작성일 : 2004년 12월 04일 (토) CodeFest 3rd * 수정일 : 2005년 01월 26일 (수) * 최신버전 : http://kkanari.org/wiki/wiki.php/GentooInstallGuide * 인쇄용 : http://kkanari.org/wiki/wiki.php/GentooInstallGuide?action=print == get! gentoo =={{{ http://www.gentoo.org/main/en/mirrors.xml ex) http://mirror.gentoo.gr.jp/releases/x86/2004.3/livecd/install-x86-minimal-2004.3-r1.iso}}} 미러는 한국 or 일본쪽에서 받는게 속도나 정신건강상 좋다. LiveCD 를 다운받으면 되는데, 들어가는 순서는 release -> x86 (or 자신에 맞는 architecture 를 선택) -> 2004.3 (2004년 12월 현재 최신) -> LiveCD -> Pentium4 (자신의 CPU에 맞게 선택) -> CD Download (minimal or universal) minimal 은 시스템 부팅할 수 있는 최소의 용량만 갖고있다. (stageX.tar.bz2 필요함) – 2004.3 약 50MB universal 은 아키텍쳐에 맞는 stage 들이 들어있다. - 2004.3 약 650MB == Booting the LiveCD(s) =={{{ boot: gentoo(gentoo-nofb) or smp (smp-nofb)}}} 자신의 CPU 가 single일 경우 [Enter] 또는 gentoo 라고 입력하고 들어가며 되고, smp(펜티엄4 계열 하이퍼쓰레딩도 포함됨) 으로 부팅하면 된다. 그 밖에 다른 모드 옵션을 보려면 F2 키를 누르면 자세하게 설명이 나온다. === NIC Detect === {{{ # modprobe 8139too or e100 (network modules)}}} 가끔 랜카드 모듈이 안 올라올 경우가 있는데, 그럴때는 자신의 NIC 에 맞는 모듈을 올려주면 된다. === Network Setup === {{{ # net-setup eth0 (네트워크 설정) # ifconfig eth0 (네트워크 설정확인) # ping -c 3 kr.yahoo.com}}} net-setup eth0 이라고 입력을 하면, 스크립트에 따라서 순서대로 자신의 네트워크 셋업을 해주면 되는데, dhcp 또는 static 상황에 맞게 값을 넣어주면 된다. (ADSL 은 사용해보지 않아서 skip) === DMA on === {{{ # hdparm -d 1 /dev/hda}}} IDE 하드웨어를 갖고있는 사람은 특별하지 않는 이상 DMA 를 꼭 켜주기 바란다. (대부분 해당) * 알고 있겠지만 SCSI HDD 는 이 옵션이 먹지 않는다. 더 자세한 사항은 DMA 대해서 알아보며 좋다. === ROOT passwd change === {{{ # passwd}}} sshd 데몬을 띄우고 설치할 사람은 root passwd 를 설정해야 한다 === Option === {{{ # /etc/init.d/sshd start # ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:01:02:82:DB:58 inet addr:192.168.0.100 Bcast:192.168.0.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:158606 errors:0 dropped:0 overruns:0 frame:0 TX packets:123666 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:96163883 (91.7 Mb) TX bytes:20863289 (19.8 Mb) Interrupt:11 Base address:0xc000}}} sshd 데몬을 띄우고 다른 터미널에서 작업을 할 수 있다. === FDISK === {{{ Partition Fileststem Size Description /dev/hda1 ext3 100M Boot Partition /dev/hda2 swap 2G Swap Partition /dev/hda3 xfs remaining Root Partition}}} FDISK 항목을 설정한다 위의 예는 /dev/hda 디스크 1개를 hda1~3 번으로 나누었다. /dev/hda1 은 /boot 파티션으로 사용할 부분이며 파일시스템은 ext3 로 정하였다. /dev/hda2 부분은 swap 영역인데 메모리의 1 ~ 1.5배 정도 입력하면 될 것이다. /dev/hda3 영역은 남은 하드디스크를 모두 할당하고 파일시스템은 xfs 로 정하였다. 더 자세한 사항은 젠투 메뉴얼 또는 man fdisk 를 참고하기 바란다. ||Filesystem||Creation Command|| ||ext2||mke2fs|| ||ext3||mke2fs -j|| ||reiserfs||mkreiserfs|| ||xfs||mkfs.xfs|| ||jfs||mkfs.jfs|| == Creating Filesystems == {{{ # mke2fs -j /dev/hda1 (ext3 로 만들기) # mkfs.xfs /dev/hda3 (xfs 로 만들기) # mkswap /dev/hda2 (스왑만들기) # swapon /dev/hda2}}} == Mounting == {{{ # mount /dev/hda3 /mnt/gentoo # mkdir /mnt/gentoo/boot # mount -t ext3 /dev/hda1 /mnt/gentoo/boot}}} chroot 하기위한 준비작업 == Install a Stage Tarball == {{{ # date 120416102004 (2004년 12월 04일 16:10)}}} 현재 컴퓨터의 시간을 지정해주기 === Internet 으로부터 stage 얻기 === {{{ # cd /mnt/gentoo # links2 http://www.gentoo.org/main/en/mirrors.xml}}} 이동키 : 방향키, 다운로드키 "d" stage 파일과 스냅샷 파일을 다운로드 한다, 물론 확인을 위해 md5도 받으면 좋다{{{ # md5sum -c stage?-*.tar.bz2.md5 (stage 2, 3) # md5sum -c portage-*.tar.bz2.md5 (snapshot)}}} 다운로드 받은 파일의 이상유무 검사{{{ # tar -xvjpf stage?-*.tar.bz2 # tar -xvjf /mnt/gentoo/portage-20041202.tar.bz2 -C /mnt/gentoo/usr}}} tarball 풀기 === LiveCD 로부터 stage 얻기 === {{{ # cd /mnt/gentoo # ls /mnt/cdrom/stages # tar -xvjpf /mnt/cdrom/stages/stage?-*.tar.bz2 # tar -xvjpf /mnt/cdrom/snapshot/portage-*.tar.bz2}}} tarball 풀기 === USE Flag 와 mirror 조정 === {{{ # nano -w /mnt/gentoo/etc/make.conf USE="x86 alsa acpi -arts avi berkdb crypt cups encode foomaticdb gdbm gif gpm gtk gtk2 imlib jpeg -kde gnome libg++ libwww mad mikmod motif mpeg ncurses nls nptl oggvorbis mp3 opengl pam pdflib png python -qt quicktime readline sdl slang spell ssl svga tcpd truetype X xml2 xv zlib cjk multichar sse sse2 mmx" GENTOO_MIRRORS="http://ftp.gentoo.or.kr/ http://mirror.gentoo.or.kr/"}}} 미러는 한국과 일본미러 == Chrooting == {{{ # cp -L /etc/resolv.conf /mnt/gentoo/etc/resolv.conf}}} chroot 하기전에 DNS 정보파일인 resolv.conf 파일을 chroot 될 etc 디렉토리 밑에 복사 {{{# mount -t proc none /mnt/gentoo/proc # chroot /mnt/gentoo /bin/bash}}} root directory change !{{{ # env-update}}} /etc/env.d/ 디렉토리에 있는 환경값을 업데이트 해줌{{{ # source /etc/profile}}} /etc/profile 적용{{{ # emerge --sync}}} portage sync === glibc locale 사용자 설정하기 (옵션) === {{{ # mkdir /etc/portage # echo "sys-libs/glibc userlocales" >> /etc/portage/package.use # nano -w /etc/locales.build en_US/ISO-8859-1 en_US.UTF-8/UTF-8 ko_KR.EUC-KR/EUC-KR ko_KR.UTF-8/UTF-8 ko_KR/EUC-KR}}} === Stage 1 to Stage 2 === {{{ # cd /usr/portage # scripts/bootstrap.sh}}} 부트스트랩 과정 (상당히 오래 걸린다 !!!) === Stage 2 to Stage 3 === {{{ # emerge system}}} 시스템 패키지를 모두 업데이트 해준다 (조금 오래걸림) == Timezone == {{{ # ls /usr/share/zoneinfo # ln -sf /usr/share/zoneinfo/Asia/Seoul /etc/localtime}}} 현재 컴터의 타임존을 아시아/서울로 심볼릭 링크를 걸어줌 (-f 는 강제) == Kernel Compile == {{{ # cd /usr/portage/sys-kernel/gentoo-dev-source # emerge gentoo-dev-sources-2.6.9-r9.ebuild (gentoo-dev-source 사용) # cd /usr/src/linux # make menuconfig}}} 커널설정은 본인의 PC 와 환경에 맞게 세팅해주되, 아래 사항들은 젠투리눅스 사용시 꼭 필요한 옵션들이니 넣어주기 바람 {{{Activating Required Options Code Listing 6: Selecting experimental code/drivers Code maturity level options ---> [*] Prompt for development and/or incomplete code/drivers}}} {{{Code Listing 7: Selecting correct processor family Processor type and features ---> (Change according to your system) (Athlon/Duron/K7) Processor family}}} {{{Code Listing 8: Selecting necessary file systems (With a 2.6.x kernel) File systems ---> Pseudo Filesystems ---> [*] /proc file system support [*] /dev file system support (OBSOLETE) [*] Automatically mount at boot [*] Virtual memory file system support (former shm fs) (Select one or more of the following options as needed by your system) <*> Reiserfs support <*> Ext3 journalling file system support <*> JFS filesystem support <*> Second extended fs support <*> XFS filesystem support}}} {{{Code Listing 11: Activating SMP support Processor type and features ---> [*] Symmetric multi-processing support}}} {{{Code Listing 12: Activating USB Support for Input Devices USB Support ---> <*> USB Human Interface Device (full HID) support}}} For 2.6 kernel{{{ # make && make modules_install}}} 본격적인 커널컴파일 (시간이 오래걸림) {{{# cp arch/i386/boot/bzImage /boot/gentoo-2.6.9-r9 # cp System.map /boot/System.map-gentoo-2.6.9-r9 # cp .config /boot/config-2.6.9-r9}}} 커널컴파일후 산출된 파일들을 /boot 디렉토리로 복사 {{{# emerge coldplug # rc-update add coldplug boot}}} coldplug 데몬 설치 & 서비스 등록 {{{# emerge hotplug # rc-update add hotplug default}}} hotplug 데몬 설치 & 서비스 등록 {{{# nano -w /etc/modules.autoload.d/kernel-2.X # modules-update}}} 커널 컴파일시 모듈로 넣었던 부분을 넣어주면 된다 (kernel-2.4 or kernel-2.6) == fstab == {{{ /dev/hda1 /boot ext3 noatime 1 1 /dev/hda3 / xfs noatime 0 0 /dev/hda2 none swap sw 0 0}}} 위의 FDISK 할때 잡아준 파일시스템과 마운트위치를 맞춰준다 == Network Information == {{{ # echo ns > /etc/hostname (호스트네임 등록) # echo kkanari.info > /etc/dnsdomainname # echo kkanari.info > /etc/nisdomainname # rc-update add domainname default}}} 도메인 입력 & 서비스 등록 {{{# nano -w /etc/conf.d/net (네트워크 설정) === static === iface_eth1=”192.168.6.17 broadcast 192.168.6.255 netmask 255.255.255.0” gateway=”eth1/192.168.6.1” === dhcp === iface_eth1=”dhcp”}}} === Centrino Wireless LAN 잡기 === {{{ # emerge ipw2100 # modprobe ipw2100 # iwlist scanning (essid 찾기) # iwconfig eth1 essid “3com” key 1234 (암호값이 문자일경우 key s:abcd 라고 입력해줌)}}} === Wireless LAN eth1 === {{{ # cd /etc/init.d # ln -s net.eth0 net.eth1 # nano -w /etc/hosts 127.0.0.1 localhost 192.168.6.17 x31.kkanari.org x31}}} == System Information == {{{ # passwd # nano -w /etc/rc.conf (해당항목에 필요한 사항이 있으면 수정해 준다, 아래는 내가 수정한 내역) CLOCK="local" EDITOR="/usr/bin/vim" DISPLAYMANAGER="gdm" XSESSION="Gnome"}}} {{{# emerge metalog # rc-update add metalog default}}} metalog 설치 & 서비스 등록 {{{# emerge vixie-cron # rc-update add vixie-cron default}}} vixie-cron 설치 & 서비스 등록 {{{# emerge slocate (filesystem indexing) # emerge xfsprogs (xfs filesystem needs)}}} === 각자 시스템에 맞는 파일시스템 패키지를 설치해 준다. === ||File System||Tool||Install Command|| ||XFS||xfsprogs||emerge xfsprogs|| ||ReiserFS||reiserfsprogs||emerge reiserfsprogs|| ||JFS||jfsutils||emerge jfsutils}} {{{ # emerge dhcpcd}}} DHCP 를 받기 위해서 설치해 준다 == Boot Loader == {{{ # emerge grub # nano -w /boot/grub/grub.conf default 1 timeout 5 splashimage=(hd0,0)/boot/grub/splash.xpm.gz title=Gentoo Linux (2.6.9-gentoo-r6) root (hd0,0) kernel /boot/kernel-2.6.9-r6 root=/dev/hda3 (옵션으로 아래는 윈도우와 멀티부팅을 위한 설정이다. 필요한 사람만 적으면 된다) title=Microsoft Windows XP Professional sp2 rootnoverify (hd0,0) chainloader +1 * 주의 : kernel 뒤에 root=/dev/hdx 에서 root 는 "/" 파티션을 넣어줘야 한다 !!! # grub grub> root (hd0,0) grub> setup (hd0) grub> quit}}} {{{# useradd -m -G users,wheel,audio,tty -s /bin/bash tongseob # passwd tongseob}}} == Rebooting the System == {{{ # exit cdimage ~# cd cdimage ~# umount /mnt/gentoo/boot /mnt/gentoo/proc /mnt/gentoo cdimage ~# reboot}}} == Neccesary programs == {{{ # emerge openssh # rc-update add sshd default # emerge vim}}} == NPTL == === NPTL 적용시키기 (The Native POSIX Thread Library) === {{{# emerge gcc # emerge -C linux-headers # ACCEPT_KEYWORDS="~x86" emerge linux26-headers # USE=”nptl” emerge glibc}}} === NPTL 확인하기 === {{{ # /lib/libc.so.6 또는 # getconf GNU_LIBPTHREAD_VERSION}}} == X-Windows == {{{ # emerge xorg-x11 gnome # rc-update add xdm default # Xorg -scanpci # Xorg -configure # Xorg -probeonly # cp /root/xorg.conf.new /etc/X11/xorg.conf }}} === TTF font setting === {{{ # mkdir /usr/share/fonts/ttf/korean/ms # mv gulim.ttc batang.ttc ngulim.ttf Monaco.ttf /usr/share/fonts/ttf/korean/ms # cd /usr/share/fonts/ttf/korean/ms # mkfontscale # ttmkfdir # mkfontdir # fc-cache # vi /etc/X11/xorg.conf Load "freetype" Load "xtt" }}} 둘중 아무거나 설치한다 (xtt 추천) FontPath 를 추가해 줄 차례이다. Section "Files" 에 다음과 같이 글꼴 디렉토리를 등록해준다.{{{ FontPath "/usr/share/fonts/ttf/korean/ms/" }}} === 한글입력기 설치 === {{{ # emerge nabi imhangul # vi /etc/env.d/00basic (한글관련 세팅값 추가) LC_ALL=ko_KR.UTF-8 LC_LANG=ko_KR.UTF-8 LC_MESSAGE=ko_KR.UTF-8 LANG=ko_KR.UTF-8 GDM_LANG=ko_KR.UTF-8 XMODIFIERS="@im=nabi" XIM_PROGRAM="/usr/bin/nabi" GTK_IM_MODULE=hangul2 # env-update}}} === 모니터 dpms 정보가 잘못 되었을시 수동으로 입력하는 방법 === (참고로 내 모니터는 SAMTRON 97BDF 인데, 윈도우에서 1280x960@75Hz 밖에 나오지 않는데, 하지만 dpms 를 끄고 수동으로 입력하면 윈도우던, 리눅스던 85Hz 까지 끌어올릴 수 있다.){{{ tongseob@gentoo tongseob $ gtf 1280 960 85 # 1280x960 @ 85.00 Hz (GTF) hsync: 85.68 kHz; pclk: 149.43 MHz Modeline "1280x960_85.00" 149.43 1280 1376 1512 1744 960 961 964 1008 -HSync +Vsync}}} /etc/X11/xorg.conf 파일에 추가해주면 해상도별 Refresh Rate 를 정해줄 수 있다 예){{{ Section "Monitor" #DisplaySize 360 270 # mm Identifier "Monitor0" VendorName "STN" ModelName "S/T 97/96BDF" ### Uncomment if you don't want to default to DDC: HorizSync 30.0 - 150 VertRefresh 50.0 - 150 #Option "DPMS" Modeline "1280x960_85.00" 149.43 1280 1376 1512 1744 960 961 964 1008 -HSync +Vsync EndSection ... Section "Screen" Identifier "Screen0" Device "Card0" Monitor "Monitor0" DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 24 Modes "1280x960" "1152x864" "1024x768" "800x600" "640x480" EndSubSection EndSection}}}