Документация по Gentoo Linux.pdf

772
Документация по Gentoo Linux сборник статей Handbook inside ! :) Linux не для идиотов inside ! :) Версия 1.1 от 15.07.2007 2007 г. 1

Transcript of Документация по Gentoo Linux.pdf

Gentoo Linux Handbook inside ! :) Linux inside ! :) 1.1 15.07.2007

2007 .

1

Gentoo Linux............................................................................................1 (changelog)......................................................................................12 : .....................................................................................................................13 : ....................................................................................................13 Gentoo Linux....................................................................................................................13 ?........................................................................................................14 Gentoo Linux.................................................................................................................. .14 . Gentoo..............................................................................................................15 .....................................................................................................................16 Gentoo ........................................................................................17 X.org.................................................................................................................. .19 . Portage..................................................................................................................19 Portage................................................................................20 ?...........................................................................20 ?.....................................................................................21 .................................................................................................21 ......................................................................................22 Gentoo Linux: ................................................................................22 ..............................................................................................23 - ...............................................................................................28 - ......................................................................30 - Gentoo.........................................................................................31 : ......................................................................................33 Gentoo Linux x86......................................................42 ........................................................................................................42 ...............................................................................................................42 .........................................................................................................43 ...........................................................................................................43 Gentoo.............................................................................43 ..............................................................................................................44 ........................................................................................................44 ........................................................................................45 ....................................................................................................46 grub.................................................................................................................... .............46 . # genkernel................................................................................46 # ( initrd)............................................................46 # ............................................................46 lilo............................................................................................................................. .......47 . # , genkernel................................................47 # genkernel................................................................................47 # .............................................................................................47 .....................................................................................................48 Gentoo Linux.......................................48 1. ....................................................................................................48 2. Smart BootManager........................48 3. Knoppix................................................................................49 4. Stage 1 .................................................................50 5. PXE.......................................................51 6. Gentoo Linux-..............................................55 Gentoo/x86.....................................................................58 2

1. .................................................................................................................58 2. ............................................................................................59 3. ................................................................................................61 4. /........................................................................................63 Gentoo................................................................................64 1. Gentoo .................................................................................................64 2. .....................................................................................65 3. ......................................................................66 Gentoo Linux x86..................................................................................70 1. Gentoo Linux........................................................................................73 1.a. .............................................................................................................73 2. .......................................................75 2.a. ....................................................................................75 2.b. - Gentoo...............................................................76 2.c. , Gentoo......................77 3. ...........................................................................................................81 3.a. ...............................................................81 3.b. ...............................................................83 3.c. .......................................................................................84 4. .....................................................................................................89 4.a. .........................................................89 4.b. .................................................................90 4.c. fdisk ...................................................92 4.d. ..............................................................................95 4.e. .....................................................................................................97 5. Gentoo................................................................97 5.a. ...................................................................................97 5.b. : .........................98 5.c. : ...........99 5.d. ............................................................................100 5.e. ...............................................................101 6. Gentoo......................................................................103 6.a. .......................................................................103 6.b. Portage............................................................................................105 USE...................................................................................107 7. ........................................................................................................109 7.a. .....................................................................................................109 7.b. .....................................................................109 7.c. : ...................................................................110 7.d. : genkernel.......................................................113 7.e. ......................................................................................................115 8. .............................................................................115 8.a. .........................................................................115 8.b. ................................................................................................116 8.c. .........................................................................................119 9. ..................................................................120 9.a. ........................................................................................120 9.b. .............................................................121 9.c. : cron.............................................................................121 9.d. : ..............................................................122 9.f. .............................................................................................122 10. ........................................................................123 10.a. ............................................................................................123 10.b. : GRUB..........................................................124 3

10.c. : LILO..............................................................128 10.d. ...................................................................................130 11. Gentoo.............................................................................131 11.a. ...................................................................131 12. ?..........................................................................................132 12.a. ..................................................................................................132 12.b. Gentoo ........................................................................................132 1. Portage..................................................................................................132 1.a. Portage...........................................................................133 1.b. ..............................................................................................133 1.c. ...................................................134 1.d. Portage ....................................................................................137 2. USE-................................................................................................................141 2.a. USE-?.....................................................................................141 2.b. USE-............................................................................142 2.c. USE- .......................................................................145 3. Portage...............................................................................................146 3.a. Portage.......................................................................................146 3.b. ..........................................................................146 3.c. ................................................................................147 3.d. .........................................................................148 4. .......................................................................................149 4.a. ..................................................................................................149 4.b. rc-update.................................................................................153 4.c. ...............................................................................................154 4.d. ...........................................................154 4.e. .........................................................157 5. ..................................................................................................158 5.a. ..........................................................................................158 5.b. ..........................................................160 5.c. ............................................................161 1. .....................................................................................................162 1.a. Portage...................................................................................................162 1.b. .............................................................................................164 1.c. ................................................................164 2. .......................................................................165 2.a. Portage............................................................................................165 2.b. ............................................................................................165 2.c. ...............................................................166 2.d. ....................................................................................166 2.e. Gentoo.............................................................................................168 2.f. Portage............................................................................................168 3. .....................................................168 3.a. ............................................................................168 3.b. .................169 3.c. .....................................................170 4. Portage........................................................................170 4.a. etc-update...........................................................................................................170 4.b. dispatch-conf......................................................................................................172 4.c. quickpkg......................................................................................................... ....172 . 5. ..................................................................173 5.a. Portage...............................................173 5.b. ebuild..............................173 5.c. , Portage......................................................174 4

6. ebuild..............................................................................................174 6.a. Emerge Ebuild.................................................................................................174 6.b. ............................................................................175 6.c. Ebuild.............................................................177 6.d. .........................................................................177 X- 6.X.....................................196 1. X Window Server?....................................................................................196 2. Xorg.........................................................................................................197 3. Xorg.........................................................................................................199 4. xorg.conf.................................................................................................200 5. ................................................................................................................... .202 . X- 7.X (.)............................203 Introduction....................................................................................................................203 nVidia Gentoo Linux.....................................................210 1. .................................................................................................................. 210 . 2. ......................................................................................................210 .........................................................................................210 ...............................................................................211 ........................................................................213 X-...............................................................................................213 video...........................................................214 ................................................................................................214 nvidia..................................................................................215 nVidia Settings.........................................................215 3. .................................................................................................................215 2D 4 ...................................................215 , no such device .............216 4. ..........................................................................................216 ...........................................................................................................216 .........................................................................................216 X-.......................................................................216 ATI Gentoo Linux......................................................217 1. ..............................................................................................217 2. .......................................................................................................... .......218 . 3. ................................................................................219 Hardware 3D Acceleration Guide (.)..........................................................................219 1. Introduction................................................................................................................219 2. Install Xorg and configure your kernel.......................................................................220 3. Install X11-DRM and configure direct rendering.......................................................221 4. Test 3D acceleration..................................................................................................222 5. Using the CVS sources..............................................................................................223 6. Tweak your performance...........................................................................................224 7. Troubleshooting.........................................................................................................225 8. Acknowledgments......................................................................................................226 9. References................................................................................................................ 226 . HOWTO KDE..............................................................................................226 1. K Desktop Environment?....................................................................226 2. KDE.........................................................................................................227 3. KDE.........................................................................................................229 UTF-8 Gentoo......................................................................................230 1. ...................................................230 2. .................................................................................................................231 3. UTF-8 Gentoo Linux...........................................................................233 4. ......................................................................................235 5

Gentoo Linux......................................................241 1. .................................................................................................................. 241 . 2. ..............................................................................242 3. locale.........................................................................................246 4. .......................................................................................248 5. X............................................................................249 Gentoo Linux ALSA.....................................................................................252 1. .................................................................................................................. 252 . 2. ALSA.......................................................................................................253 3. / ALSA...............................................................................257 4. ALSA......................................................................................263 Java Gentoo......................................................................265 1. JDK/JRE..................................................................................................265 2. JDK/JRE.......................................................................266 3. .......................................................................................268 4. ....................................................................................................268 Power Management Guide (.)....................................................................................268 1. Introduction................................................................................................................268 2. Prerequisites..............................................................................................................269 3. CPU Power Management..........................................................................................273 4. LCD Power Management..........................................................................................278 5. Disk Power Management..........................................................................................280 6. Power Management For Other Devices....................................................................282 7. Sleep States: sleep, standby, and suspend to disk...................................................284 8. Troubleshooting.........................................................................................................287 udev Gentoo........................................................................................289 1. udev?........................................................................................................289 2. udev Gentoo.............................................................................291 3. ..............................................................................................293 4. .....................................................................295 Gentoo Linux GCC...........................................................295 1. .................................................................................................................. 296 . 2. ............................................................................296 3. GCC-3.3 3.4 .........................................................297 4. GCC ...................................................................299 5. ......................................................................................................301 Gentoo LDAP-DNS Guide (.)....................................................................................302 1. Introduction................................................................................................................302 2. Configuring LDAP-DNS.............................................................................................302 3. Configuring OpenLDAP.............................................................................................303 4. Testing the Installation...............................................................................................304 ....................................................................304 1. .................................................................................................................. 304 . 2. postfix...................................................................................305 3. Courier-imap..............................................................................................................306 4. Cyrus-sasl..................................................................................................................307 5. SSL- Postfix Apache.................................................................308 6. SSL SASL Postfix.............................................................309 7. MySQL.......................................................................................................................310 8. Apache phpMyAdmin..............................................................................................311 9. Vmail-.................................................................................................313 10. MySQL ..................................313 11. Squirrelmail..............................................................................................................317 12. Mailman...................................................................................................................317 6

13. Anti-Virus.................................................................319 14. .......................................................................................................... ....319 . 15. Troubleshooting.......................................................................................................319 qmail/vpopmail...........................................321 1. .................................................................................................................. 321 . 2. qmail (" ")...............................................................................322 3. vpopmail................................................................................................................... .324 . 4. Courier POP/IMAP.....................................................................................................325 5. qmail ( ).................................................................................326 6. Horde / IMP............................................................................................327 7. .........................................................................................329 8. .................................................................................331 Mutt........................................331 1. E-Mail....................................................................................................331 2. Fetchmail...................................................................................................................332 3. Procmail.....................................................................................................................332 4. Mutt..............................................................................................334 5. SMTP.........................................................................................................................337 Gentoo Linux.................................338 1. .................................................................................................................. 338 . 2. ...................................................339 ................................................................................................339 .................................................................................................................340 3. ................................................................................341 4. .........................................................342 5. ..............................................................................................................344 .......................................................344 1. devfs?.......................................................................................................344 .................................................................................................................345 ...................................................................................................................346 2. .......................................................................346 3. .................................................................348 4. , .............................................................349 Gentoo (.).......................................................352 WIKI.....................................................................................................................418 H ...............................................................................418 IDE hdparm....................................................433 CD/DVD.........................................................................................................437 DVD..............................................................................................................442 Portage...........................................................................................................448 Portage NFS...................................................................................................448 Portage...................................................................................................452 Portage Overlay.........................................................................................................457 deltup....................................................................459 . 461 ....462 .................................................................................463 ...............................................................................467 ......................................................................................................................... .468 . MS Windows -............................................................................469 Internet..............................................................................................471 Udev..........................................................................................................................484 CFLAGS ......................487 Udev ....................................................................490 7

glibc...................................................................................................493 USB-flash..........................................................................................498 - NTFS ntfs-3g..................................501 .........................................................................................................503 Apache2..................................................................................................503 iptables ......................................................................508 iptables................................................................................513 .................................................................................535 vsftpd......................................................................................................543 Jabber Server...........................................................................................................547 Counter-Strike........................................................................548 Samba Win2k.....................................................................549 Samba PDC LDAP......554 ..................................................................................569 X..................................................................................................................592 X............................................................................592 X...........................................................................597 Xorg X11 .........................................................................................599 Xorg. ..............................................................................603 Xgl...........................................................................................................604 XGL........................................................................................................................ ...606 . GPRS Linux.........................................................................................631 nano..........................................................................................................636 ...........................................................636 Cedega 5.1................................................................................................................637 Windows-.............................................................................................638 .......................................................................................644 .........................................................................................647 ccache emerge..............................................................................655 Keymap............................................................................................................... ..........656 . XkbOptions....................................................................................................................657 ............................................................................................658 2. .................................................................................................................. 658 . Gentoo, ?.........................................658 Gentoo ?.............................................................................658 3. .......................................................................................................... .......659 . , "-O9 -ffast-math -fomit-frame-pointer". ? .................................................................659 root ( )?.........................659 ?.................................................................659 root su?..................659 devfs?...............................................................................................660 Gentoo ? .................................................660 (), ?...............................660 - , ?................................661 ISO -?.............................................................662 / ?............................662 . ? .....663 Windows GRUB LILO, . ? ....................................................................................................................663 Gentoo, Stage1 Stage2?.............................664 4. ..............................................................................................665 ?......................................................................665 ./configure . ?.........................665 8

emerge, ?..............................665 , rsync ?.............................................................665 . , ? ......................................666 /usr/portage/distfiles. ? ....666 /var/tmp/portage? /var/tmp/portage? .....................................................................................................666 5. .........................................................................................................666 ?....................................666 crontab?...........667 numlock ?......................................................................667 ?.......................................................667 X - root' ( su).............................668 6. ........................................................................................................668 ReiserFS - , ...................................668 7. ............................................................................................................. ..668 . ?................................................................668 ?............................................669 . ? .....669 8. .................................................................................................................. ..669 . Gentoo Linux?...............................................................669 CD Gentoo Linux?.....................................................................670 . ?........................................670 ............................................................................670 ...................................................................................................................670 ? ........................................................................................670 ? ..............................................................................................671 root ?..............................................................................672 ......................................................................................................673 man............................................................................................................673 cd...............................................................................................................673 ls................................................................................................................674 cp...............................................................................................................674 rm...............................................................................................................674 df................................................................................................................675 ?.............................................675 ?.................................................................................................................675 ?.....................................................................................676 ?......................................................676 .......................................................................................................... .................677 . (WiKi) ( : ) .....................................................................677 ALSA, Advanced Linux Sound Architecture .....................................................677 X ( ) - ................................................................................................677 ebuild- ...........................................................................................................................678 - .....................................................................................................................678 MAN ( )............................................................................................689 Emerge..........................................................................................................................689 Linux : ..................................................705 ................................................................................................................705 ..............................................................................................................705 ................................................................................708 ....................................................................................................709 System V shared memory.............................................................................................710 9

.......................................................................................................711 ..............................................................................................................714 .........................................................................715 .................................................................................715 .............................................................................716 ......................................................................................717 .......................................................................................717 sysctl..........................................................................................................718 ..................................................718 GNU libc................................................................................719 LD, Shared Library, SO .........................................................720 /proc................................................722 ....................................................................................................722 /dev.......................................................................................................... ......723 . /dev....................................................................724 DevFS...........................................................................................................725 UDEV........................................................................................................... 26 7 ....................................................................................................727 IDE ..................................................729 SCSI-........................................730 SATA IDE PATA..........................................................731 Logical Volume Manager...........................................................................................732 Sotware RAID............................................................................................................736 Device mapper..........................................................................................................739 Host-RAID, RAID- ....................................739 ....................................................................................................740 IP ...............................................................................742 ..........................................................................................................744 ...........................................................................744 .........................................745 ...........................................................................................746 ........................................................................................................746 iptables.............................................................................747 , NSS PAM................................................................749 X11 --.........................................................................................................751 - X11.......................................................................751 .........................................................................752 X11. .............................................................................752 X11. ............................................753 X11. FreeType XFT...................................................................................754 X11. ........................................................................................754 X11. .............................................................................755 X11. ...................................................................................755 .................................................................................................................755 ............................................................................757 1. make.conf...........................................................................................................757 2. xorg.conf NVIDIA Geforce........................................................................759 3. xorg.conf ATI radeon:..............................................................................764 Gentoo Linux.......................................................................................770 Gentoo Linux.....................................................................................771 ...............................................................................................771 ........................................................................772 IRC (freenode.net)...............................................................................................772

10

11

(changelog) 1.1 15.07.2007 1. Mati_maniak (linuxforum.ru): a) emerge --depclean world - emerge --depclean; b) --oneshot (-i) --oneshot. 2. . 3. : Linux , : (no-dashi, dalth & viking). 4. IRC . 5. .

12

:

.. a.k.a. JohnBat26 (ICQ(198710313)/Jabber.ru/Yahoo/AIM/Goog le) e-mail: [email protected], [email protected] occupation: JEE developer

.. a.k.a. BadEd (ICQ(757727756) BadEd) e-mail: [email protected] .. a.k.a. Kismih05 (ICQ(77833996 Mishel)/Yahoo/AIM) e-mail: [email protected]

: http://gentoo.ru http://gentoo.com http://ru.gentoo-wiki.com http://www.rugentoo.org http://myfotomx.com/dalth/linuxbook.odt : 1.1

: 15.07.2007 OpenOffice Writer 2.2.1.

: Linux Gentoo . . :) , 1. . 2. (. ).

Gentoo Linux : http://gentoo.ru/about Gentoo Pygoscelis papua ( : , , ). 98 (27/). Gentoo Linux , . , Gentoo. , Gentoo Linux , , 13

, , - , . - , Gentoo Linux "".

?Portage Gentoo Linux, . , portage Gentoo Linux. , , Gentoo Linux : emerge --sync (emerge; / (: emerge - , , )). Portage . , Gentoo. Portage 10000 , . Portage . , : emerge _, Portage , , , . Portage , . : emerge -u world , .

Gentoo Linux Gentoo Linux . Gentoo Gentoo Linux: , Gentoo Linux , : emerge --sync. , Gentoo Linux , . , Gentoo Linux -, . , Gentoo Linux:

x86, AMD64, PowerPC, UltraSparc, Alpha MIPS x86, AMD64, PowerPC, UltraSparc Alpha LiveCD KDE GNOME Linux GNU : ReiserFS, XFS, ext3, EVMS, LVM 14

: NVIDIA, Creative Labs Live! Audigy OpenGL ( ) , Gentoo 10000

, Gentoo Linux, . : !

Gentoo . , , ... Gentoo Linux. Debian Linux, , Linux , , Linux, , Stampede Linux. , Stampede, . , , . . , , . #enoch irc.freenode.net 10 , . , , , . Gentoo Linux. , Gentoo 1.0 , . , - Linux , - Gentoo . Gentoo... FreeBSD. . . Linux. , , Gentoo . Portage. Gentoo , . Gentoo , . Gentoo - , , Gentoo. ( ) . 15

, Gentoo , Gentoo. 2004 Gentoo. Gentoo, . Gentoo , : , , . , , Gentoo Gentoo!

: http://gentoo.ru/philosophy: Daniel Robbins - Gentoo :

Gentoo, , . Linux- , , , . Gentoo (.. Portages), , , . . , , ebuild. ebuild - (, emerge build file) . , USE. , ebuild . emerge - , . Linux- , Gentoo . " ", Gentoo "from source" ( ). , , , . , , . , Linux. ( ) ?

Gentoo - , . Gentoo , , 16

. . , , , Gentoo . , .. (, RPM - . ). Gentoo , , , . , "" . Gentoo :

. Gentoo . ,

Gentoo , Linux . , , , . - - , . , , . Gentoo.

, Gentoo . , , (, , Unix - . ). , , . Gentoo , - , . , , ? ? - .

Gentoo : http://ylsoftware.com/?action=news&na=viewfull&news=130 : MooSE 2006-11-22 16:35:01 Gentoo - . . , 17

Gentoo. . Gentoo Handbook ( Gentoo- . : ). Gentoo , . Gentoo "" , . Gentoo . Handbook Gentoo. ( X ALSA) Gentoo Wiki. (WiKi) ( : ) ( -) ( : , , (FAQ), -(HOWTO)). : . . - (), . . , . , , , . . ( ) . - . , , . . Wiki , ; - . ALSA, Advanced Linux Sound Architecture Linux, - MIDI- (Musical Instrument Digital Interface ) Linux. ALSA 2.6, OSS (Open Sound System - ), 2.4 X- ( )- . Gentoo ( Linux ), ? , , :-). Linux , . , : , . Linux - . , . 18

, , , , X Window System, X11 X. Unix, Linux Unix . , Linux X11, Xorg-X11, XFree86. XFree86 , , GPL, Xorg. XFree86 .

X.org X.org X11 . , X11. Xorg . , Xorg , , . , IRC.

Portage Gentoo - , Portage, . , ( , ). Portage USE- . KDE GNOME USE /etc/make.conf "kde -gnome". USE- Gentoo Handbook. Portage emerge. moo : emerge moo. Portage , , . , ebuild', . ebuild' /usr/portage.

19

Portage Gentoo - USE. Midnight Commander X.Org - X. KPDF KDE? - KDE pdf ( KGhostScript). emerge --ask --verbose ( emerge -av) USE- . gentoolkit (emerge gentoolkit) - euse, USE. euse -i flag "flag". man euse ( . :-)). USE- USE="some flags" emerge moo. , . USE- /etc/portage/package.use, echo "category/moo some flags" >> /etc/portage/package.use . ACCEPT_KEYWORDS /etc/portage/package.keywords. Portage 2.1 package.use package.keywords .

? - ebuild', () Portage

, Portage. , Portage. ebuild Portage CVS. , ebuild bugzilla. , ebuild. ebuild . - ebuild', () Portage.

ebuild' (/usr/portage), . , , /usr/portage. ebuild. PORTDIR_OVERLAY="/path/to/local/overlay" /etc/make.conf. - /usr/local/overlays. ebuild' /usr/local/overlays/local. /usr/local/overlays. , , , 20

ebuild', . xgl-coffee , XGL. /usr/local/overlays/xgl-coffee SVN. Gentoo Wiki. .

? . . packages.gentoo.org gentoo-portage.com ( RSS).

, emerge some-package, /var/lib/portage/world. emerge --update --deep world - . . . - world. , wxWidgets, world. - emerge --update (...) world, emerge --depclean. wxWidgets world - . , world . world --oneshot. - .

emerge /var/log/emerge.log. - tail /var/log/emerge.log. genlop (emerge genlop) . genlop -c .

21

- /var/tmp/portage. - . - /var/tmp/portage . /usr/portage/distfiles. eclean gentoolkit. . , . ( eclean-dist eclean-pkg ). man . Gentoo . . .

Gentoo Linux: ( ) : http://posix.ru/distro/gentoo_old/ Gentoo Linux

Gentoo Linux - .. Source Based . , , . Gentoo , , Red Hat Debian. Gentoo 2001 . , Linux Stampade, (Microsoft). , . http://www.gentoo.org.(: http://gentoo.ru) Gentoo Linux BSD- ( - FreeBSD). , BSD- Linux , Unix System V ( ). Gentoo FreeBSD. , , (.. Distribution) . .. . - 22

( - ) , , , . , FreeBSD (packages), . Gentoo ( - Portages) , FreeBSD. ( - ) , , , gcc glib. Gentoo : 1. , ( ) ; 2. ( , i86, Sparc, PowerPC Alpha), ; 3. ( packages FreeBSD), , host-; 4. (, ) . Gentoo . Gentoo Handbook , . ( "-") . - ( Pygoscelis papua), - (, , ). , - . Gentoo.

Gentoo . - http ftp, , . , CD-, . Gentoo , () . iso- CD- , Gentoo . , , - , , , , . , , - 23

. - , 200 ( ). Live CD - Linux-, -. , . . - (*.tar.bz2), ( ) . ( stage1-*, 10 ) (i86, PowerPC, Sparc ..). (stage2-* stage3-*, 50 80 , ), , PC- , : i486 Pentium-4 ( Athlon). , , . , - portage-200XXXXX.tar.bz2, ~/gentoo/snapshots ( ). , ( ), . , - . : Gentoo ~/gentoo/distfiles ( ~/gentoo/gentoo-sources, ). , , , . - , . "" : CD ( , , ) Zip ( - 250 , ). - ( ) . - stage2-*, stage3-* portage-* - , - . , Gentoo (, - , ). , , - . . , , - . , , src - , . Linux- . Gentoo - : , , Reset, Setup BIOS , 24

(, - dmesg. (login), root, - Enter. - . . Gentoo, - - , . ( ) . . -, - , , . - ( ), Gentoo - , Live CD. - Linux- ( ). - Linux, bash 6 ( , - root ). - CD Linux- , ( ). - . : - SCSI-, IDE-RAID, Zip- (atapi-floppy, Linux), , , ; : , FATxx - (native) Linux, XFS, ); - , , ; ppp - . , ( , ) , $ modprobe _ , $ insmod _ ( ) /lib/modules/2.6.XX.X/kernel/ - .

25

- ( ). IP-, DHCP- ( ), , $ dhcpcd eth0 . IP- , ( ). . /mnt , , $ mkdir /mnt/zip Zip-, $ mkdir /mnt/cd2 CD ( CD - /mnt/cdrom, - , ). . zip " " : $ mount /dev/hdd4 -t msdos /mnt/zip , , , - /dev/hdd4: zip- , , . : devfs Gentoo, zip- - . CD . , ( , , ). , - - , : $ lynx /mnt/mount_point/build.html - , , , , - Gentoo , - , . , ( , , FreeBSD) - , , , . wvdial, Live CD ( /usr/bin). ppp (, ppp_generic, , ppp_async), $ wvdialconf /etc/wvdial.conf

26

, , , , . , : [Dialer Defaults] Modem = /dev/ttyS0 Baud = 115200 Init1 = ATZ Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0 ISDN = 0 Modem Type = Analog Modem , . - , , , : Dial Command = ATDP - : Phone = Username = Password = , , /etc/hostname localhost /etc/resolv.conf: nameserver IP- DNS- . $ wvdial - . : ( , )? Gentoo nano - , . $ nano -w _ -w - , , . , :

27

$ alias nano='nano -w' , , bash.

- - , Live CD. - . , ( , #11, 2002) . - fdisk, cfdisk, parted, Live CD. : mkefs ext2fs, mkfs.xfs - XFS, mkswap - , . ( IDE-) . 1. 1. Gentoo

100 ext2fs ext3fs /dev/hda1 128 = setup (hd0) : grub> quit

36

, , /boot. - , . , , , /boot . GRUB . : $ nano -w /boot/grub/menu.lst . GRUB : default 0 timeout [__] splashimage=(hd0,0)/boot/grub/splash.xpm.gz , , . - . - ( ). - . Gentoo. title=My Love Gentoo Linux root (hd0,0) kernel /boot/_ root=/dev/hda3 - . , . GRUB, Linux: , GRUB , . Linux, Unix' (, FreeBSD OpenBSD). , , , . , /boot/bzImage, /boot . , kernel, , /boot/linux. Linux - , , /dev/hda?. , GRUB , ( ) /boot/grub/menu.lst . - . . , ( - ) DMA - . /etc/conf.d/local.start. 37

( ) hdparm -d 1 /dev/hda - . , , : gpm -t imps2 -m /dev/psaux . , Gentoo - ( ). , . . /etc/rc.conf. Linux. , Gentoo BSD ( Sysem V, Linux, Slackware ). , - . - : , , /etc/rc.conf. , . $ nano -w /etc/rc.conf KEYMAP="us" - , . - - $ ls /usr/share/keymaps/i386/qwerty/ru* : /usr/share/keymaps/i386/qwerty/ru1.map.gz /usr/share/keymaps/i386/qwerty/ru2.map.gz /usr/share/keymaps/i386/qwerty/ru3.map.gz /usr/share/keymaps/i386/qwerty/ru4.map.gz /usr/share/keymaps/i386/qwerty/ru-cp1251.map.gz /usr/share/keymaps/i386/qwerty/ru.map.gz /usr/share/keymaps/i386/qwerty/ru-ms.map.gz /usr/share/keymaps/i386/qwerty/ru_win.map.gz /usr/share/keymaps/i386/qwerty/ru-yawerty.map.gz , ( , Live CD, , ). , , ( , ), ru4: KOI8-R Windows- ( Windows - , , ) CapsLock. KEYMAP="ru4" 38

, CONSOLEFONT. , . - , , /usr/share/consolefonts. , alt-*.psf.gz cp866-*.psf.gz. , () - CP866 ( , DOS IBM). - KOI8-R , ( koi8r-*.gz), ? , : , . "" , , . console-tools-cyrillic - , - . , , CONSOLEFONT="cp866-8x16" : , KOI8, - CP866. , . - /usr/share/consoletrans koi2alt. CONSOLETRASLATION="koi2alt" . , , , ( - ) - . , /etc/rc.conf, , ( - ) - , - /etc/localtime. , CLOCK="UTC" , , (UTC=GMT). UTC localtime - /etc/rc.conf ( , ). . /etc/init.d/local: , ( ). ( ) ( ): for i in 1 2 3 4 5 6 do echo -ne '' > /dev/vc/$i done i ( ) 1 6 ( ), - , . - " " ESC-(K ( ) 39

, i, /dev/vc/1 /dev/vc6. - (devfs), ( tmpfs /etc/fstab) - /dev/tty0 - /dev/tty5. ( ) CP1251. . /etc/fstab (, , ) CP1251->CP866. ( - ) - Altlinux ASPLinux. - DOS. : VGA- ( VGA, GeForce ) . , , , , . , . Midnight Commander - ! . /etc/init.d/local ( , !): export LANG="ru_RU.KOI8-R" - ( , , , , , , ) , . , , export LC_NUMERIC="POSIX" , , , ( , ). , , - , , ( - ) - Altlinux ASPLinux. , . , "" , - . " " ( Gentoo) . , , etcupdate, (, ). - , , . - . , Gentoo exit, Live CD, , ( ) 40

. - . . - , unmount: $ umount /mnt/gentoo/boot $ umount /mnt/gentoo , - reboot ( halt, - ). ( - - ), : Live CD (, , , ): $ cp /cdroot/boot/linux /mnt/gentoo/boot/ , , . , CD: cp -R /cdroot/lib/modules /mnt/gentoo/lib/modules - , . , - , , - . . , , - - . , , : , , . . - , , , . - , - - . ( ) CD . , (, ). - , , . : - , - , , ( , ). Gentoo , , . - , , . . Gentoo , , - , , GIS CAD. , 41

. , , . Linux, , . , , - ...

Gentoo Linux x86 : http://www.gentoo.org/doc/ru/gentoo-x86-quickinstall.xml

- . ISO- : releases///-. ; . -, . F2, , . PCMCIA, pcmcia. sshd, , irssi ( -) lynx links2.

, net-setup. modprobe. ADSL, adsl-setup adsl-start. PPTP, /etc/ppp/chap-secrets /etc/ppp/options.pptp, pptp . iwconfig, net-setup, ifconfig, dhcpcd / route. -, 42

export http_proxy, ftp_proxy RSYNC_PROXY.

fdisk cfdisk. ( 82) Linux ( 83). Linux- mke2fs, mke2fs -j, mkreiserfs, mkfs.xfs mkfs.jfs. mkswap swapon. /mnt/gentoo. (, /mnt/gentoo/boot), .

, date MMDDhhmmYYYY. ( /mnt/cdrom/stages). /mnt/gentoo tar -xvjpf . : /mnt/gentoo/usr tar -xvjf /mnt/cdrom/snapshots/. . , /mnt/cdrom/distfiles/ /mnt/gentoo/usr/portage/distfiles/. /mnt/gentoo/etc/make.conf ( USE, CFLAGS CXXFLAGS). nano.

Gentoo /proc, /etc/resolv.conf , (chroot) Gentoo. 1.1: # mount -t proc none /mnt/gentoo/proc 43

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

, emerge --sync . , /etc/make.profile . ; (, 2.4/ , 2.4). ln -sfn. ( ) scripts/bootstrap.sh /usr/portage. ( ) emerge -e system ( -N, CFLAGS/CXXFLAGS ).

, /etc/localtime /usr/share/zoneinfo ln -sf. ( gentoo-sources vanilla-sources) make menuconfig, make && make modules_install /usr/src/linux. arch/i386/boot/bzImage /boot, . emerge genkernel genkernel all. , Genkernel, emerge coldplug rc-update add coldplug default.

/etc/fstab; . 1.2: fstab /dev/hda1 /boot /dev/hda2 none ext2 swap defaults,noatime sw 00 44 12

/dev/hda3 / none none /proc

ext3 proc

noatime defaults /mnt/cdrom

01 00 auto noauto,user 00

/dev/shm tmpfs nodev,nosuid,noexec 0 0

/dev/cdroms/cdrom0

/etc/conf.d/hostname /etc/conf.d/domainname, rc-update add domainname default, /etc/conf.d/net. net.eth0 (default run level). (NIC), net.eth0, . /etc/hosts; : 1.3: /etc/hosts ( IP-) 127.0.0.1 localhost 192.168.0.5 jenny.homenetwork jenny 192.168.0.6 benny.homenetwork benny 192.168.0.7 tux.homenetwork tux ( IP-) 127.0.0.1 localhost.homenetwork tux localhost

(emerge) pcmcia-cs . root passwd. : /etc/rc.conf, /etc/conf.d/rc, /etc/conf.d/keymaps, /etc/conf.d/clock.

2.4 emerge --unmerge udev emerge devfsd. , syslog-ng, 45

. cron, , vixie-cron ( ). (xfsprogs, reiserfsprogs jfsutils), (dhcpcd rp-pppoe).

(emerge) grub lilo. /boot/grub/grub.conf /etc/lilo.conf, . .

grub 1.4: grub.conf default 0 timeout 30 splashimage=(hd0,0)/grub/splash.xpm.gz

# genkerneltitle=Gentoo Linux 2.6.11-r3 root (hd0,0) kernel /kernel-genkernel-x86-2.6.11-gentoo-r3 root=/dev/ram0 init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev initrd /initramfs-genkernel-x86-2.6.11-gentoo-r3

# ( initrd)title=Gentoo Linux 2.6.11 r3 root (hd0,0) kernel /kernel-2.6.11-gentoo-r3 root=/dev/hda3

# title=Windows XP root (hd0,5) makeactive chainloader +1

46

lilo 1.5: lilo.conf boot=/dev/hda prompt timeout=50 default=gentoo

# , genkernelimage=/boot/kernel-2.6.11-gentoo-r3 label=gentoo read-only root=/dev/hda3

# genkernelimage=/boot/kernel-genkernel-x86-2.6.11-gentoo-r3 label=gentoo read-only root=/dev/ram0 append="init=/linuxrc ramdisk=8192 real_root=/dev/hda3 udev" initrd=/boot/initramfs-genkernel-x86-2.6.11-gentoo-r3

# other=/dev/hda6 label=windows

GRUB GRUB (MBR) grub-install /dev/hda /proc/mounts /etc/mtab. LILO /sbin/lilo. , .

47

root, useradd -m -G . , - /mnt/cdrom export PKGDIR="/mnt/cdrom", , , kde, emerge -k . . Gentoo!

Gentoo Linux : http://www.gentoo.org/doc/ru/altinstall.xml

1. boot-from-CD ( ), . Gentoo Linux , . , , "" . , , , Bugzilla.

2. Smart BootManager Smart BootManager http://btmgr.sourceforge.net/download.html. , Linux, .exe . -, , , NASM. . , . 2.1: Smart BootManager sbminst [-t theme] [-d drv] [-b backup_file] [-u backup_file] -t , : us = English de = German hu = Hungarian zh = Chinese ru = Russian cz = Czech es = Spanish fr = French 48

pt = Portuguese -d , Smart BootManager; Linux: /dev/fd0 floppy-, /dev/hda IDE-. /dev/sda SCSI-. DOS: 0 floppy- 128 ; CD-ROM;

-c

-b backup_file ( ) , ; -u backup_file Smart BootManager, ; -y .

2.2: sbminst # sbminst -t us -d /dev/fd0 : fd0 floppy- ( -). , , . Smart BootManager. CD-ROM ENTER . , . Smart BootManager http://btmgr.sourceforge.net/

3. Knoppix: Knoppix x86. Knoppix LiveCD, Gentoo. Tux Racer , OpenOffice. : , - Knoppix, Gentoo, Gentoo. , !

49

Knoppix CD. Knoppix 3.6-3.8.2, knoppix26 , 2.6. , chroot , . , Knoppix 3.9+, , 2.6 . KDE. su -, . root Knoppix. , , sshd . 3.1: /mnt/gentoo # mkdir /mnt/gentoo , 4. /proc. -: 3.2: - proc # mount -o bind /proc /mnt/gentoo/proc , (FEATURES) knoppix. userpriv usersandbox. , , .

4. Stage 1 - iso-. snapshot http://distro.ibiblio.org/pub/linux/distributions/gentoo/snapshots/ ( ). tarball , , CD. Gentoo Install Doc chroot /mnt/gentoo 6. CD-ROM, docache CD snapshot- . (Alt-F2), , bootstrap.sh. : - passwd . (Alt-F1, without chroot) CD /mnt/gentoo/mnt/cdrom2. portage tarball cdrom2 /mnt/gentoo/usr.

50

4.1: snapshot cd # umount /mnt/cdrom # mkdir /mnt/gentoo/mnt/cdrom2 # mount /dev/cdroms/cdrom0 /mnt/gentoo/mnt/cdrom2 # cp /mnt/gentoo/mnt/cdrom2/portage-$date.tar.bz2 /mnt/gentoo/usr # cd /mnt/gentoo/usr # tar -xvjpf portage-$date.tar.bz2 . bootstrap.sh, , . /usr/portage/distfiles ( F2). Stage1: glibc, baselayout, texinfo, gettext, zlib, binutils, gcc, ncurses . : , , . 4.2: ( 2 >) # emerge -fp glibc baselayout texinfo gettext zlib binutils gcc ncurses 2> stage1.list # mount -t vfat /dev/fd0 /mnt/floppy # cp /mnt/gentoo/stage1.list /mnt/floppy # umount /mnt/floppy . stage1.list, , . , , . : 4.3: Stripping URLs ( emerge, - !) # cut -f 1 -d ' ' stage1.list > stage1.download wget : 4.4: wget # wget -N -i stage1.download , /mnt/gentoo/usr/portage/distfiles. bootstrap.sh. wget stage2 3.

5. PXE 51

, PXE ( 3com). BIOS . : -, , . /diskless, . 'eta'. 5.1: # mkdir /diskless # mkdir /diskless/eta # mkdir /diskless/eta/boot DHCP TFTP: , DHCP, TFTP. DHCP emerge . /etc/dhcp/dhcpd.conf: : IP PXE, pxegrub. MAC- , . DHCPd, emerge dhcp ( DHCP ). , /etc/conf.d/dhcp . 5.2: dhcp.conf option option-150 code 150 = text ; ddns-update-style none ; host eta { hardware ethernet 00:00:00:00:00:00; fixed-address ip.add.re.ss; option option-150 "/eta/boot/grub.lst"; filename "/eta/boot/pxegrub"; } TFTP, app-admin/tftp-hpa. /etc/conf.d/in.tftpd: 5.3: in.tftpd INTFTPD_PATH="/diskless" INTFTPD_USER="nobody" INTFTPD_OPTS="-u ${INTFTPD_USER} -l -vvvvvv -p -c -s ${INTFTPD_PATH}" GRUB: GRUB PXE-. PXE, GRUB ... . -, GRUB (emerge -f grub 52

tarball /usr/portage/distfiles). tarball /diskless GRUB, pxe . boot- . grub.lst: 5.4: grub # tar zxvf grub-0.92.tar.gz # cd grub-0.92 # ./configure --help ( .) ( , . $nic) # ./configure --enable-diskless --enable-$nic # make # cd stage2 # cp pxegrub /diskless/eta/boot/pxegrub # nano -w /diskless/eta/boot/grub.lst 5.5: grub.lst default 0 timeout 30 title=Diskless Gentoo root (nd) kernel /eta/bzImage ip=dhcp root=/dev/nfs nfsroot=ip.add.re.ss:/diskless/eta ( nfsroot IP ,) ( .) NFS: NFS . - /etc/exports: 5.6: /etc/exports # nano -w /etc/exports # /etc/exports: NFS file systems being exported. See exports(5). /diskless/eta eta(rw,sync,no_root_squash) hosts: - /etc/hosts. 5.7: /etc/hosts 127.0.0.1 localhost 192.168.1.10 eta.example.com eta 192.168.1.20 sigma.example.com sigma Gentoo, , , Gentoo . , Gentoo Install Howto, : 53

( hdaX - , /diskless). , /diskless/eta. 5.8: # mount /dev/hdaX /mnt/gentoo Stage tarballs chroot: tarball stage3. /proc chroot () . - . : stage tarball. . 5.9: stage tarball # cd /mnt/gentoo/diskless/eta/ # tar -xvjpf /mnt/cdrom/gentoo/stage3-*.tar.bz2 # mount -t proc /proc /mnt/gentoo/diskless/eta/proc # cp /etc/resolv.conf /mnt/gentoo/diskless/eta/etc/resolv.conf # chroot /mnt/gentoo/diskless/eta/ /bin/bash # env-update # source /etc/profile : make menuconfig , ( ): 5.10: menuconfig - Your network card device support ( , ** !) - Under "Networking options" : [*] TCP/IP networking [*] IP: kernel level autoconfiguration [*] IP: DHCP support [*] IP: BOOTP support - Under "File systems --> Network File Systems" : NFS file system support [*] Provide NFSv3 client support [*] Root file system on NFS / ( /boot), pxegrub, . /etc/fstab . 5.11: /etc/fstab # nano -w /etc/fstab 54

/dev/cdroms/cdrom0 /mnt/cdrom iso9660 noauto,ro 0 0 proc /proc proc defaults 0 0 tmpfs /dev/shm tmpfs nodev,nosuid,noexec 0 0 : 5.12: # touch /fastboot # echo "touch /fastboot" >> /etc/conf.d/local.start nfs-utils, : 5.13: nfs-utils # emerge nfs-utils . , pxegrub. . , : DHCP, TFTPD NFS. 5.14: # /etc/init.d/dhcp start # /etc/init.d/in.tftpd start # /etc/init.d/nfs start , bios PXE - CD-ROM floppy. website . IP DHCP PXE- GRUB TFTP. - GRUB, , Enter, . , , NFS, . .

6. Gentoo Linux- Gentoo Linux chroot, tarball- Gentoo, ISO-. , , tarball-. ( , tarball - , .tbz .tar.gz). (.) RedHat Linux 7.3 "" , . , !

55

Gentoo, Linux, , tarball, chroot , . , , , Gentoo. Gentoo? - , /. mount , . df (disk free), , . root ! , , . 6.1: # mount /dev/hdb2 on / type ext3 (rw) none on /proc type proc (rw) none on /dev/pts type devpts (rw,gid=5,mode=620) none on /dev/shm type tmpfs (rw,nodev,nosuid,noexec) # df -h Filesystem Size Used Avail Use% Mounted on /dev/hdb2 4.0G 1.9G 2.4G 82% / none 38M 0 38M 0% /dev/shm , , /, /dev/hdb2 2.4 . , , 400 , , Gentoo 2 . , , . ! parted Parted - , GNU foundation, , , , . , . parted, partition editor, http://www.gnu.org/software/parted/ : , , / , PartitionMagic(tm) , . - . parted, , , , parted . , , . - -, Gentoo. , , . . , linux- parted /. , Linux, 56

, . parted , . , . : , , , parted! / mininux ( - Linux c 2.4 ) http://mininux.free.fr/uk/, , , . : , Linux - " ". - parted . boot/root , mininux. , , - , Gentoo, , parted. 6.2: # mkfs.minix /dev/fd0 480 inodes 1440 blocks Firstdatazone=19 (19) Zonesize=1024 Maxsize=268966912 parted. , . , . . 6.3: # mkdir /floppy; mount -t minix /dev/fd0 /floppy && export CFLAGS="-O3 -pipe -fomit-frame-pointer -static" && ./configure && make && cp parted/parted /floppy && umount /floppy , . parted GNU website. - . mininux, , . mount /dev/fd0 /floppy parted /floppy. . parted . , , , Gentoo. , - , , . , /dev/hda3, , , /dev/hda. 6.4: , , mininux # mount /dev/fd0 /floppy # cd /floppy; ./parted [, ] 57

(parted) print Disk geometry for /dev/hdb: 0.000-9787.148 megabytes Disk label type: msdos Minor Start End Type Filesystem Flags 1 0.031 2953.125 primary ntfs 3 2953.125 3133.265 primary linux-swap 2 3133.266 5633.085 primary ext3 4 5633.086 9787.148 extended 5 5633.117 6633.210 logical 6 6633.242 9787.148 logical ext3 (parted) help resize resize MINOR START END resize filesystem on partition MINOR MINOR is the partition number used by Linux. On msdos disk labels, the primary partitions number from 1-4, and logical partitions are 5 onwards. START and END are in megabytes (parted) resize 2 3133.266 4000.000 : ! ! ( ), , . 2 30 . , linux-. Gentoo: . chroot, : 6.5: chroot # env -i HOME=$HOME TERM=$TERM chroot /mnt/gentoo /bin/bash # /usr/sbin/env-update # source /etc/profile !

Gentoo/x8 6 : http://www.gentoo.org/doc/ru/gentoo-x86-tipsntricks.xml

1. Gentoo/x86. , , .

58

2. RAID : RAID, , Software-RAID-HOWTO (.). : RAID LVM2 x86 (.). CD, RAID. , RAID-1: 2.1: RAID-1 # modprobe raid1 , , fd (Linux raid autodetect), 83 (Linux native). , t fdisk. , RAID, : 2.2: # mknod /dev/md1 b 9 1 # mknod /dev/md2 b 9 2 # mknod /dev/md3 b 9 3 , /etc/mdadm.conf (, , CD), mdadm, RAID. , (RAID-1) boot, swap root, /dev/sda /dev/sdb, : 2.3: raid mdadm # mdadm --create --verbose /dev/md1 --level=1 --raid-devices=2 /dev/sda1 /dev/sdb1 # mdadm --create --verbose /dev/md2 --level=1 --raid-devices=2 /dev/sda2 /dev/sdb2 # mdadm --create --verbose /dev/md3 --level=1 --raid-devices=2 /dev/sda3 /dev/sdb3 : (striping), RAID-0 or RAID-5. Linux Software RAID . /proc/mdstat. , .. 2.4: # mdadm --detail --scan > /etc/mdadm.conf

59

/dev/md1 , /dev/md2 /dev/md3 . (chroot), /etc/mdadm.conf /mnt/gentoo/etc. , RAID , . , mdadm. , CD, Gentoo raid. MBR , . ATA RAID c 2.4 , CD doataraid. , /dev/ataraid. disc* , ATA RAID. disc, part*. /dev/ataraid/disc*/*, Gentoo. /dev/hda, . , /dev : 2.5: /dev # mount -o bind /dev /mnt/gentoo/dev ATA RAID . , ATA RAID Promise FastTrack built-in RAID Promise FastTrack Options. GRUB GRUB. , . GRUB , , GRUB MBR, : 2.6: GRUB # cd /boot/grub # dd if=stage1 of=/dev/fd0 bs=512 count=1 # dd if=stage2 of=/dev/fd0 bs=512 seek=1 grub.conf. , , root= ATA RAID. , GRUB. GRUB. GRUB 60

ATA RAID: 2.7: GRUB ATA RAID grub> root (hd0,x) grub> setup (hd0) grub> quit ( GRUB ). LILO . CD , - . Gentoo , (AltF2) ROOT, , (passwd root). : 2.8: CD (${KN} , - 'gentoo' 'smp') cdimage ~# cp /mnt/cdrom/isolinux/${KN} /mnt/cdrom/isolinux/${KN}.gz /mnt/gentoo/boot cdimage ~# mkdir -p /mnt/gentoo/lib/modules cdiamge ~# cp -Rp /lib/modules/`uname -r` /mnt/gentoo/lib/modules , hotplug (emerge hotplug) . ( CD) , (chroot): 2.9: modules.conf # cat /proc/modules | cut -d ' ' -f 1 >> \ /etc/modules.autoload.d/kernel-`uname -r | cut -d . -f -2` # modules-update

3. , . , , . , . . screen. LiveCD, root screen: : screen LiveCD. , 61

, . 3.1: screen # screen -S gentoo screen . , Ctrl-a, d ( control a , d), screen. . , root screen: 3.2: screen # screen -x gentoo screen, . , , (, ./scripts/bootstrap.sh), nohup, , . "&", ! , ( pwd ), . 3.3: nohup # pwd /usr/portage # nohup ./scripts/bootstrap.sh & (exit) CD. . , root ( CD) chroot , : 3.4: Chroot # chroot /mnt/gentoo /bin/bash # env-update && source /etc/profile # cd /usr/portage less nohup.out, . , less nohup.out F, . , . , Ctrl-C, q. less, .

62

4. / , ( ..), -c ext2 ext3 ( mke2fs). , . , -c -c, /. 4.1: # mke2fs -j -c /dev/hda3 - Gentoo , . , , , ( , , ), . , Gentoo Linux chroot. , , . , /mnt/gentoo. , make.conf , ? Gentoo Linux, , , , -. , , , - . , , grub.conf, , /boot/grub/grub.conf. , , , , . , . : make.conf, , make.conf /boot/grub/grub.conf, , grub.conf , , (, /boot!), /etc/fstab, , 63

. .

Gentoo : http://www.gentoo.org/doc/ru/gentoo-upgrading.xml

1. Gentoo , Gentoo, , Linux. , , , : , , , , , . ( Gentoo), , . apt apt-rpm, , , . Gentoo, Gentoo . , , : Portage Gentoo, , . , , . Gentoo : , ?". : . GRP, , (stage3 + ), . , , . 64

, , , , , . , /usr/portage/profiles, ebuild , (USE) , , , . /etc/make.profile, /usr/portage/profiles, . , x86 2005.1 /usr/portage/profiles/defaultlinux/x86/2005.1. (, , ). . , , /usr/portage/profiles , . deprecated. , . Portage . : (, baselayout, gcc, glibc), USE- , , , .

2. Gentoo, , , :). , Gentoo. (, , 2005.1 x86), .

65

, , , , Gentoo. , Gentoo , . , , . , . . , , . , /etc/make.profile, , . . , . alpha 2005.0, 2005.0/2.4 arm 2004.3 2005.1, 2005.1/no-multilib 2005.0, 2005.0/no-multilib, 2004.3 2004.3 2005.0, 2004.3, 2004.0 2004.2 2005.0 amd64 ia64 ppc Gentoo:

hppa 2005.0, 2005.0/2.4 2004.3, 2004.2 2005.0 2005.1

mips 2005.0 s390 2004.3 sparc 2005.1 x86

2005.1, 2005.1/2.4 2005.0, 2005.0/2.4

3. 2005.1 2005.1 /etc/make.profile . , Portage . 66

3.1: 2005.1 # rm /etc/make.profile # ln -s ../usr/portage/profiles/ /etc/make.profile

. . ppc 2005.1 ppc ppc64 , . 2005.1 , . 2005.0 2005.0 . - . , 2.6 2.4. . . default-linux/alpha/2005.0 Alpha 2005.0 2.6 default-linux/alpha/2005.0/2.4 Alpha 2005.0 2.4 default-linux/amd64/2005.0 AMD64 2005.0 2.6 2005.0 (.) default-linux/amd64/2005.0/no-multilib AMD64 2005.0 2005.0 (.) default-linux/arm/2005.0 ARM 2005.0 2.6 HPPA 2005.0 2.4 default-linux/hppa/2005.0 HPPA 2005.0 2.6 default-linux/hppa/2005.0/2.4 default-linux/mips/2005.0 MIPS 2005.0 default-linux/mips/cobalt/2005.0 MIPS 2005.0 Cobalt default-linux/mips/mips64/n32/2005.0 n32 2005.0 MIPS-

default-linux/mips/mips64/ip28/2005.0 64- 2005.0 Indigo2 Impact default-linux/mips/mips64/2005.0 64- MIPS 2005.0 default-linux/ppc/2005.0 PPC 2005.0 2.6 default-linux/ppc64/2005.0 PPC64 2005.0 2.6 67

default-linux/s390/2005.0 S390 2005.0 default-linux/sparc/sparc32/2005.0 default-linux/sparc/sparc64/2005.0 default-linux/x86/2005.0 default-linux/x86/2005.0/2.4 32- 64- Sparc Sparc 2005.0 2005.0

x86 2005.0 2.6 x86 2005.0 2.4

, /etc/make.profile, . Portage. 3.2: 2005.0 # rm /etc/make.profile # ln -s ../usr/portage/profiles/ /etc/make.profile

2.4, 2.6 Gentoo Linux 2.6 (.). 2004.3 2004.3 ( ). Gentoo , , , , /usr/portage/profiles, , /usr/portage/profiles/default-linux/x86/2004.3 ( Portage 2.0.51). 2004.3, /etc/make.profile: : Portage !!!

3.3: /etc/make.profile # rm /etc/make.profile # ln -s ../usr/portage/profiles/default-linux//2004.3 /etc/make.profile

68

, . , , sys-apps/slocate net-misc/dhcpcd . , emerge -depclean Portage . , /var/lib/portage/world, . ppc sys-fs/udev sys-fs/devfs. . Portage , . , , Portage, . , Portage, , , Portage . , , Portage, , . , : 3.4: Portage # rm /etc/make.profile # cd /etc # ln -sf ../usr/portage/profiles/obsolete/ make.profile # emerge -n '>=sys-apps/portage-2.0.51'

2004.2 2004.2, , /etc/make.profile, : : Portage !!!

3.5: /etc/make.profile # rm /etc/make.profile # ln -s ../usr/portage/profiles/default-linux//2004.2 /etc/make.profile

69

x86 X11 x11-base/xfree x11-base/xorg-x11. , , X . , ; , , . amd64 , . 2004.0 2004.0, , /etc/make.profile, : 3.6: /etc/make.profile # rm /etc/make.profile # ln -s ../usr/portage/profiles/default--2004.0 /etc/make.profile

, . 1.4 c , .

Gentoo Linux x86 : http://www.gentoo.org/doc/ru/handbook/handbook-x86.xml :

Gentoo

, Gentoo . Gentoo Linux .

70

Gentoo -. , Gentoo . . , . . Gentoo, . , . Gentoo Gentoo (stage3). , Portage. Gentoo Gentoo. , . Linux . , . . , . , Gentoo . . x86 . -. . Gentoo . ( ) . , .

?

Gentoo. ? Gentoo Gentoo: , , Portage .. Portage , . 71

USE- USE- ( ) Gentoo. , , USE- . Portage Portage: , . Gentoo (initscript), , , , , . , , . Gentoo . , , . Portage Portage, Gentoo. Portage, , . Portage , . Gentoo . , , . Portage Portage , Gentoo. dispatch-conf . Portage, , , .. ebuild , Portage , ebuild.

72

Gentoo

Gentoo. . , . Gentoo : DHCP, , , (VLAN) .. . , . , . , . A. Gentoo

1. Gentoo Linux 1.a. ! , Gentoo! ! Gentoo . Gentoo : , Gentoo, .. Gentoo , . Gentoo , , . Portage, Gentoo, Python, . C Gentoo ( ), Gentoo . ! , Gentoo . . 73

, (.). ? Gentoo 10 , 211. : 1: , Gentoo 2: Gentoo 3: Gentoo 4: , (chroot) 5: , Gentoo 6: Linux 7: Gentoo 8: ( ) 9: , Gentoo 10: Gentoo Linux! , , . : . : . , . , . . : , Gentoo. , . , , . ? Gentoo . -, , CD (, Knoppix), , .. Gentoo, , , (netboot). , . , , Gentoo 2006.1 (.), . GRP (Gentoo Reference Platform Gentoo, , Gentoo), , Gentoo 2006.1 (.). , . 74

Gentoo. , , (. ), , , . , , Gentoo . , , , . ? ( ), (.) , . , , . , () . , , , , , . , Gentoo ( , - ). , . , (- , ), (- , /), , #gentoo irc.freenode.net. , :) , Gentoo, (FAQ), Gentoo. FAQ (.) . , #gentoo, IRC- irc.freenode.net. -, - , IRC :-)

2. 2.a. , , Gentoo . i486 64 1.5 ( ) 256

75

2.b. - Gentoo - Gentoo , Gentoo. Linux . . Gentoo. - , , Gentoo . -, Gentoo . Gentoo , , , , Gentoo 2006.0 (.). -: Gentoo, - , , Gentoo. Gentoo, Gentoo. , , , , . , , . Gentoo install-x86-minimal-2006.0.iso 49 . Gentoo . + stage3, Portage, , Gentoo install-x86-universal-2006.0.iso 697 . Gentoo , , Gentoo :) Gentoo + , ; 76

Stage3 stage3 , Gentoo, Gentoo , . - Gentoo . , Gentoo stage1 stage2, stage3. Gentoo stage1 stage2, , Gentoo, Gentoo, Stage1 Stage2? stage3 releases/x86/2006.0/stages/ Gentoo; .

2.c. , Gentoo , Gentoo. , -. , ? ( , ) . releases/x86/2006.0/installcd. ISO-. -, CD-R. , , MD5 (, install-x86-minimal-2006.0.iso.DIGESTS). MD5 md5sum Linux/Unix, md5sum (.) Windows. GnuPG , ( .asc). , : 1: $ gpg --keyserver subkeys.pgp.net --recv-keys 17072058 : 2: $ gpg --verify ISO- - . 77

, . cdrecord K3B. . cdrecord, cdrecord dev=/dev/hdc (/dev/hdc CD-RW). K3B, Tools > CD > Burn Image ( > > ). 'Image to Burn' (' ') ISO-. Start (). - : , , , , , . -, . - CD, BIOS. BIOS, DEL, F1 ESC. BIOS , CD-ROM . CMOS Setup. , , CD-ROM. CD-ROM (-!) . . ENTER, , -: , , ENTER. ? , - . gentoo. ; -nofb . : gentoo 2.6 ( ) gentoo-nofb gentoo, memtest86 , . , F2 . 3: , - agpgart agpgart ( , ) - acpi=on ACPI - ide=nodma DMA IDE- - doscsi scsi- ( ethernet-) - dopcmcia pcmcia PCMCIA- - - nofirewire initrd firewire ( - firewire ..) - nokeymap - docache - , 78

/mnt/cdrom - nodetect hwsetup/kudzu hotplug - nousb usb initrd, hotplug - nodhcp dhcp - nohotplug hotplug - noapic apic (, scsi, ..) - noevms EVMS2 - nolvm2 LVM2 - hdx=stroke , BIOS - noload=module1,[module2,[...]] -, ( gentoo) . , gentoo dopcmcia: 4: boot: gentoo dopcmcia . Gentoo , ALT+F1, , . 10 , ( ), . Gentoo Linux root (). root (#). , ALT-F2, ALT-F3 ALTF4. ALT-F1. . - . . , . PCI, . 8139too ( ): 5: # modprobe 8139too PCMCIA, pcmcia: 79

6: PCMCIA # /etc/init.d/pcmcia start : , , IDE hdparm. -tT, ( ): 7: # hdparm -tT /dev/hda ( ), /dev/hda: 8: DMA: # hdparm -d 1 /dev/hda : # hdparm -d 1 -A 1 -m 16 -u 1 -a 64 /dev/hda : , irssi ( ), . passwd: 9: # passwd New password: ( ) Re-enter password: ( ) , . useradd passwd. john: 10: # useradd -m -G users john # passwd john New password: ( john) Re-enter password: ( ) (root) su:

80

11: # su - john : Gentoo ( , -), , (. : ). ALT+F2 , . c -, links: 12: - # links /mnt/cdrom/docs/html/index.html Gentoo ( , -). links, ( , ): 13: , # links http://www.gentoo.org/doc/ru/handbook/handbook-x86.xml ALT+F1. : SSH Gentoo ( , ), , , ( , ). SSH, : 14: SSH # /etc/init.d/sshd start sshd, . .

3. 3.a. , ? Ethernet, DHCP, 81

, . , , -, , ssh, scp, ping, irssi, wget links. , /sbin/ifconfig lo, , eth0: 1: /sbin/ifconfig # /sbin/ifconfig (...) eth0 Link encap:Ethernet HWaddr 00:50:BA:8F:61