               Rukovodstvo po nachal'nomu zapusku FreeBSD

  Alfred Perlstein

   <alfred@FreeBSD.org>

   $FreeBSD: doc/ru_RU.KOI8-R/articles/pxe/article.sgml,v 1.5
   2005/10/10 03:17:22 bvs Exp $

   FreeBSD `eto zaregistrirovannaya torgovaya marka FreeBSD
   Foundation.

   Intel, Celeron, EtherExpress, i386, i486, Itanium, Pentium i Xeon
   `eto torgovye marki ili zaregistrirovannye torgovye marki Intel
   Corporation ili ee dochernih kompanij v Soedinennyh SHtatah i
   drugih stranah.

   Mnogie iz oboznachenij, ispol'zuemye proizvoditelyami i prodavcami
   dlya oboznacheniya svoih produktov, zayavlyayutsya v kachestve
   torgovyh marok. Kogda takie oboznacheniya poyavlyayutsya v `etom
   dokumente, i Proektu FreeBSD izvestno o torgovoj marke, k
   oboznacheniyu dobavlyaetsya znak ''(TM)'' ili ''(R)''.

   `Eta stat'ya podrobno opisyvaet podhod kompanii Intel(R),
   pozvolyayuschij mashinam ustanavlivat' FreeBSD pri pomoschi metoda
   PXE zagruzki mashiny po seti.

     --------------------------------------------------------------

1. Vvedenie

     Vnimanie: `Eta procedura delaet ''Server'' kak
     nezaschischionnym, tak i opasnym, luchshe prosto derzhat'
     ''Server'' na otdel'nom setevom koncentratore i nikakim drugim
     sposobom ne davat' dostup k nemu s mashin, ne yavlyayuschihsya
     ''Klientami''.

   Terminologiya:

   Server Mashina, predostavlyayuschaya uslugi po zagruzke i          
          ustanovke cherez set'.                                      
   Klient Mashina, na kotoruyu budet ustanavlivat'sya FreeBSD.        

   Trebovaniya: Klienty, podderzhivayuschie metod Intel PXE zagruzki
   po seti, podklyuchenie k Ethernet.

   Pozhalujsta, dajte mne znat', esli vy reshili kakie-to problemy,
   ili esli u vas est' pozhelaniya k dopolnitel'noj dokumentacii.

   Esli vam nuzhen kto-to dlya obucheniya/realizacii konkretnoj
   sistemy ustanovki po seti, to, pozhalujsta, poshlite pis'mo,
   chtoby my mogli obgovorit' usloviya.

   YA takzhe priznatelen Paul Saab <ps@FreeBSD.org> i John Baldwin
   <jhb@FreeBSD.org> za to, chto oni sdelali osnovnuyu rabotu po
   programmirovaniyu pxeboot, interfejsa k sisteme setevoj zagruzki
   PXE (netboot) ot Intel.

     --------------------------------------------------------------

2. Nastrojka servera

    1. Ustanovite DHCP: Ustanoviv net/isc-dhcp3-server, vy mozhete
       ispol'zovat' konfiguracionnyj fajl dhcpd.conf, pomestiv ego v
       katalog /usr/local/etc/.

    2. Vklyuchite tftp:

         1. Sozdajte katalog /usr/tftpboot

         2. Dobav'te sleduyuschuyu stroku v vash /etc/inetd.conf:

 tftp    dgram   udp     wait    nobody  /usr/libexec/tftpd    tftpd /usr/tftpboot

    3. Vklyuchite NFS:

         1. Dobav'te sleduyuschee v /etc/rc.conf:

 nfs_server_enable="YES"

         2. Dobav'te takuyu stroku v fajl /etc/exports:

 /usr -alldirs -ro

    4. Perezagruzite mashinu dlya vklyucheniya novyh servisov ili
       zapustite ih vruchnuyu.

     --------------------------------------------------------------

3. Nastrojka nachal'noj zagruzki

    1. Sgruzite zagruzochnye fajly: Sgruzite obrazy diskov kern.flp i
       mfsroot.flp.

    2. Podgotov'te katalog tftp/pxe-boot:

         1. Pomestite pxeboot v zagruzochnyj katalog:

 # rm -rf /usr/obj/*
 # cd /usr/src/sys/boot
 # make
 # cp /usr/src/sys/boot/i386/pxeldr/pxeboot /usr/tftpboot

         2. CHerez ustrojstvo vndevice smontirujte fajl kern.flp i
            skopirujte ego soderzhimoe v katalog /usr/tftpboot:

 # mdconfig -a -t vnode -f kern.flp -u 0 # (vnconfig vn0 kern.flp) associate a vndevice with the file
 # mount /dev/md0 /mnt # (mount /dev/vn0 /mnt) mount it
 # cp -R /mnt /usr/tftpboot # copy the contents to /usr/tftpboot
 # umount /mnt              # unmount it
 # vnconfig -u vn0          # disassociate the vndevice from the file

    3. Sozdajte sobstvennoe yadro dlya klientov (v chastnosti, chtoby
       izbavit'sya ot `ekrana nastrojki ustrojstv pri zagruzke) i
       pomestite ego v /usr/tftpboot.

    4. Napishite special'nyj skript loader.rc i ustanovite ego v
       /usr/tftpboot/boot/loader.rc, tak, chtoby on ne vydaval
       zaprosa na vtoroj disk, kak sdelal ya v moiom fajle.

    5. Vyberite utilitu ustanovki i vspomogatel'nye utility s diska
       mfsroot i raspakujte ih, posle chego pomestite ih takzhe v
       katalog /usr/tftpboot:

 # vnconfig vn0 mfsroot.flp         # associate a vndevice with the file
 # mount /dev/vn0 /mnt              # mount it
 # cp /mnt/mfsroot.gz /usr/tftpboot # copy the contents to /usr/tftpboot
 # umount /mnt                      # unmount it
 # vnconfig -u vn0                  # disassociate the vndevice from the file
 # cd /usr/tftpboot                 # get into the pxeboot directory
 # gunzip mfsroot.gz                # uncompress the mfsroot

    6. Sozdajte sobstvennyj skript install.cfg dlya sysinstall, pri
       `etom vy mozhete ispol'zovat' moj v kachestve obrazca, no vam
       pridiotsya ego otredaktirovat'.

    7. Skopirujte skript dlya sysinstall v raspakovannyj obraz
       mfsroot:

 # cd /usr/tftpboot
 # vnconfig vn0 mfsroot
 # mount /dev/vn0 /mnt
 # cp install.cfg /mnt
 # umount /mnt
 # vnconfig -u vn0

     --------------------------------------------------------------

4. Nastrojka ustanovki

    1. Pomestite ustanovochnye fajly na Server v mesto, dostupnoe
       cherez NFS. Sozdajte katalog, sootvetstvuyuschij direktive
       'nfs' v fajle install.cfg i sozdajte zdes' zerkal'nuyu kopiyu
       ustanovochnyh fajlov FreeBSD, nuzhno, chtoby `eto vyglyadelo
       primerno tak:

 ABOUT.TXT       TROUBLE.TXT     compat20        floppies        ports
 ERRATA.TXT      UPGRADE.TXT     compat21        games           proflibs
 HARDWARE.TXT    XF86336         compat22        info            src
 INSTALL.TXT     bin             compat3x        kern.flp
 LAYOUT.TXT      catpages        crypto          manpages
 README.TXT      cdrom.inf       dict            mfsroot.flp
 RELNOTES.TXT    compat1x        doc             packages

    2. Skopirujte upakovannye pakadzhi v katalog packages/All pod
       nfs.

    3. V kataloge packages dolzhen nahodit'sya prigotovlennyj fajl
       INDEX. Vy mozhete sozdat' sobstvennye zapisi v fajle INDEX,
       kotorye vyglyadyat tak:

 alfred-1.0||/|Alfred install bootstrap||alfred@FreeBSD.org||||

       Zatem vy mozhete ustanovit' kakie-to drugie pakadzhi, v
       chastnosti, sobstvennye pakadzhi dlya ustanovki posle
       ustanovki sistemy.

     --------------------------------------------------------------

5. Sobstvennye pakadzhi dlya ustanovki posle ustanovki sistemy

   Dlya sozdaniya sobstvennogo pakadzha dlya ustanovki posle
   installyacii sistemy vy mozhete ispol'zovat' skript pkgmaker.sh,
   ideya zaklyuchaetsya v ego ustanovke i nastrojke kakih-to
   parametrov, kotoruyu nuzhno vypolnit'. pkgmaker zapuskaetsya v
   kataloge, nahodyaschemsya vyshe kataloga s pakadzhem, kotoryj vy
   hotite sozdat', s edinstvennym argumentom, predstavlyayuschim
   soboj nazvanie pakadzha (to est' mypkg), i kotoryj zatem sozdast
   dlya vas mypkg.tgz dlya vklyucheniya v vash pakadzh dlya
   sysinstall.

   Vnutri kataloga s vashim pakadzhem vam nuzhen fajl s imenem PLIST,
   kotoryj soderzhit vse fajly, kotorye vam nuzhno ustanovit' i
   vklyuchit' v vash pakadzh.

   Vam takzhe mogut potrebovat'sya fajly pre i post v `etom kataloge,
   yavlyayuschiesya skriptami komandnogo processora, kotorye
   neobhodimo zapuskat' pered i posle ustanovki vashego pakadzha.

   Tak kak `etot pakadzh nahoditsya v vashem fajle install.cfg, to on
   dolzhen byt' zapuschen i vypolnit' dlya vas okonchatel'nuyu
   nastrojku.

     --------------------------------------------------------------

            `Etot, i drugie dokumenty, mogut byt' skachany s
                ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

  Po voprosam, svyazannym s FreeBSD, prochitajte dokumentaciyu prezhde
                 chem pisat' v <questions@FreeBSD.org>.
         Po voprosam, svyazannym s `etoj dokumentaciej, pishite
                           <doc@FreeBSD.org>.
  Po voprosam, svyazannym s russkim perevodom dokumentacii, pishite v
                    rassylku <frdp@FreeBSD.org.ua>.
  Informaciya po podpiske na `etu rassylku nahoditsya na sajte proekta
                               perevoda.
