             Bezdiskovyj X-server: rukovodstvo po nastrojke

  Jerry Kendall

       <jerry@kcis.com>
     

   Copyright (c) 1996 Jerry Kendall

   28 dekabrya 1996

   FreeBSD `eto zaregistrirovannaya torgovaya marka FreeBSD
   Foundation.

   3Com i HomeConnect `eto zaregistrirovannye torgovye marki 3Com
   Corporation.

   Microsoft, FrontPage, IntelliMouse, MS-DOS, Outlook, Windows,
   Windows Media i Windows NT `eto ili zaregistrirovannye torgovye
   marki ili torgovye marki Microsoft Corporation v Soedinennyh
   SHtatah i/ili drugih stranah.

   Sun, Sun Microsystems, Java, Java Virtual Machine, JavaServer
   Pages, JDK, JRE, JSP, JVM, Netra, Solaris, StarOffice, Sun Blade,
   Sun Enterprise, Sun Fire, SunOS i Ultra `eto torgovye marki ili
   zaregistrirovannye torgovye marki Sun Microsystems, Inc. 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)''.

   S pomosch'yu neskol'kih druzej iz spiska rassylki FreeBSD-hackers
   ya smog nastroit' bezdiskovyj X-terminal. Sozdanie X-terminala,
   vo-pervyh, trebuet snachala nastrojki bezdiskovoj sistemy s
   minimal'nym naborom utilit, dostupnyh cherez NFS. Te zhe samye
   shagi byli primeneny dlya sozdaniya dvuh raznyh bezdiskovyh
   sistem. Pervaya iz nih byla altair.example.com. Bezdiskovyj
   X-terminal, kotoryj rabotal na moej staroj mashine 386DX-40. Na
   nej byl disk ob"emom 340 megabajt, no ya ne hotel ego menyat'. Tak
   chto mashina zagruzhalas' s antares.example.com po seti Ethernet.
   Vtoroj sistemoj yavlyaetsya 486DX2-66. YA nastroil (polnost'yu)
   bezdiskovuyu sistemu FreeBSD, kotoraya ne ispol'zuet lokal'nyj
   disk. Serverom v `etom sluchae vystupaet Sun 670MP pod upravleniem
   SunOS(TM) 4.1.3. V oboih sluchayah trebovalas' odna i ta zhe
   nachal'naya nastrojka.

   YA uveren, chto k `etomu est' chto dobavit'. Pozhalujsta,
   prisylajte mne lyubye zamechaniya.

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

1. Sozdanie zagruzochnoj diskety (na bezdiskovoj sisteme)

   Tak kak setevye nachal'nye zagruzchiki ne budut rabotat' s
   nekotorymi rezidentnymi (TSR) i prochimi programmami,
   ispol'zuemymi v MS-DOS(R), to luchshe sozdat' otdel'nuyu
   zagruzochnuyu disketu, ili, esli vy mozhete, sozdat' menyu MS-DOS,
   kotoroe budet (pri pomoschi fajlov config.sys/autoexec.bat)
   sprashivat', kakuyu konfiguraciyu sleduet zagruzit' pri zapuske
   sistemy. YA ispol'zoval poslednij metod i on prekrasno rabotaet.
   Moe menyu MS-DOS (6.x) privoditsya nizhe.

   Primer 1. config.sys

 [menu]
 menuitem=normal, normal
 menuitem=unix, unix
 [normal]
 ....
 normal config.sys stuff
 ...
 [unix]

   Primer 2. autoexec.bat

 @ECHO OFF
 goto %config%

 :normal
 ...
 normal autoexec.bat stuff
 ...
 goto end

 :unix
 cd \netboot
 nb8390.com

 :end

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

2. Poluchenie programm dlya setevoj zagruzki (na servere)

   Otkompilirujte programmy ''net-boot'', raspolozhennye v kataloge
   /usr/src/sys/i386/boot/netboot. Vy dolzhny prochest' zamechaniya v
   nachale fajla Makefile. Izmenite nastrojki, kak `eto nuzhno.
   Sdelajte rezervnuyu kopiyu originala na tot sluchaj, esli chto-to
   pojdiot ne tak, kak ozhidalos'. Kogda postroenie budet zakoncheno,
   dolzhno poluchit'sya 2 vypolnimyh fajla dlya MS-DOS, nb8390.com i
   nb3c509.com. Odna iz `etih programm i budet tem, chto vam nuzhno
   zapustit' na bezdiskovom servere. Ona budet zagruzhat' yadro s
   servera. Na `etom `etape pomestite obe programmy na zagruzochnuyu
   disketu MS-DOS, sozdannuyu ranee.

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

3. Opredelite, kakuyu programmu nuzhno zapuskat' (na bezdiskovoj
sisteme)

   Esli vy znaete, kakoj nabor mikroshem ispol'zuetsya v vashem
   adaptere Ethernet, `eto legko. Esli u vas ispol'zuetsya nabor
   mikroshem NS8390 ili drugoj na ee osnove, to nuzhno ispol'zovat'
   nb8390.com. Esli u vas ispol'zuetsya nabor mikroshem na osnove
   3Com(R) 509, to ispol'zujte programmu zagruzki nb3C509.com. Esli
   vy ne uvereny v tom, chto u vas ustanovleno, poprobujte
   ispol'zovat' lyuboj, i esli on vydast soobschenie "No adapter
   found", poprobujte drugoj. Krome `etogo, vam nichego ne ostaetsya
   delat'.

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

4. Zagruzka po seti

   Zagruzite bezdiskovuyu sistemu bez kakih-libo fajlov
   config.sys/autoexec.bat. Poprobujte zapustit' zagruzochnuyu
   programmu dlya vashego adaptera Ethernet.

   Moj adapter Ethernet rabotaet na nabore WD8013 v 16-razryadnom
   rezhime, tak chto ya zapuskayu nb8390.com

 C:> cd \netboot
 C:> nb8390

 Boot from Network (Y/N) ?  Y

 BOOTP/TFTP/NFS bootstrap loader     ESC for menu

 Searching for adapter..
 WD8013EBT base 0x0300, memory 0x000D8000, addr 00:40:01:43:26:66

 Searching for server...

   Teper' moya bezdiskovaya sistema pytaetsya najti mashinu, kotoraya
   vystupaet v kachestve servera zagruzki. Zapomnite stroku addr
   vyshe, pozzhe ona vam ponadobitsya. Perezagruzite bezdiskovuyu
   sistemu i izmenite vashi fajly config.sys i autoexec.bat, chtoby
   oni vypolnyali `eti dejstviya avtomaticheski. Mozhet byt', v
   menyu. Esli vy zapuskali nb3c509.com, a ne nb8390.com, to
   vyvodimye soobscheniya budut tochno takimi zhe. Esli vy poluchili
   soobschenie "No adapter found" posle Searching for adapter...,
   prover'te pravil'nost' zadaniya parametrov vremeni kompilyacii v
   fajle Makefile.

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

5. Nastrojka vozmozhnosti sistemam zagruzhat'sya po seti (na servere)

   Prover'te, chto v fajle /etc/inetd.conf imeyutsya zapisi dlya tftp
   i bootps. Nizhe pokazany moi zapisi:

 tftp    dgram   udp     wait    nobody  /usr/libexec/tftpd      tftpd /tftpboot
 #
 # Additions by who ever you are
 bootps  dgram  udp  wait  root  /usr/libexec/bootpd bootpd /etc/bootptab
    

   Esli vy izmenili fajl /etc/inetd.conf, to poshlite programme
   inetd(8) signal HUP. Dlya `etogo najdite ID processa inetd
   komandoj ps -ax | grep inetd | grep -v grep. Posle `etogo poshlite
   emu signal HUP. `Eto delaetsya komandoj kill -HUP <pid>. `Eto
   zastavit inetd povtorno prochest' svoj konfiguracionnyj fajl.

   Ne zabyli li vy stroku s addr iz vyvoda nachal'nogo zagruzchika na
   bezdiskovoj sisteme? Kak vy mozhete ugadat', teper' on vam
   trebuetsya.

   Dobav'te zapis' v fajl /etc/bootptab (mozhet byt', vam
   potrebuetsya ego sozdat'). Ona dolzhna imet' sleduyuschij vid:

 altair:\
         :ht=ether:\
         :ha=004001432666:\
         :sm=255.255.255.0:\
         :hn:\
         :ds=199.246.76.1:\
         :ip=199.246.76.2:\
         :gw=199.246.76.1:\
         :vm=rfc1048:

   Stroki imeyut takoj smysl:

   altair           nazvanie bezdiskovoj sistemy bez domennoj chasti. 
   ht=ether         tip oborudovaniya ''ethernet''.                   
   ha=004001432666  apparatnyj adres (chislo, zapisannoe ranee).      
   sm=255.255.255.0 maska podseti.                                    
   hn               ukazyvaet serveru posylat' klientu ego imya       
                    hosta.                                            
   ds=199.246.76.1  ukazyvaet klientu raspolozhenie servera imen.     
   ip=199.246.76.2  ukazyvaet klientu ego IP-adres.                   
   gw=199.246.76.1  ukazyvaet klientu marshrutizator po umolchaniyu.  
   vm=...           prosto ostav'te `eto tak.                         

     Zamechanie: Prover'te pravil'nost' nastrojki IP-adresov, adresa
     vyshe yavlyayutsya moimi.

   Sozdajte katalog /tftpboot, v kotorom budut raspolagat'sya
   konfiguracionnye fajly dlya bezdiskovyh sistem, kotorye budet
   obsluzhivat' server. `Eti fajly budut imenovat'sya cfg.ip, gde ip
   yavlyaetsya IP-adresom bezdiskovoj sistemy. Konfiguracionnyj fajl
   dlya altair budet nosit' nazvanie /tftpboot/cfg.199.246.76.2. Ego
   soderzhimoe:

 rootfs 199.246.76.1:/DiskLess/rootfs/altair
 hostname altair.example.com

   Stroka hostname altair.example.com prosto ukazyvaet bezdiskovoj
   sisteme eio polnoe domennoe imya.

   Stroka rootfs 199.246.76.1:/DiskLess/rootfs/altair ukazyvaet
   bezdiskovoj sisteme mestopolozhenie ee kornevoj fajlovoj sistemy,
   montiruemoj po protokolu NFS.

     Zamechanie: Kornevaya fajlovaya sistema, montiruemaya cherez
     NFS, budet montirovat'sya v rezhime tol'ko dlya chteniya.

   Derevo dlya bezdiskovoj sistemy mozhet byt' smontirovano povtorno
   s pravom na vypolnenie operacij chteniya i zapisi, esli `eto
   potrebuetsya.

   YA ispol'zuyu svoj nikomu ne nuzhnyj 386DX-40 v kachestve
   vydelennogo X-terminala.

   Derevo dlya altair imeet takoj vid:

   /
   /bin
   /etc
   /tmp
   /sbin
   /dev
   /dev/fd
   /usr
   /var
   /var/run

   Vot real'nyj spisok fajlov:

 -r-xr-xr-x  1 root  wheel  779984 Dec 11 23:44 ./kernel
 -r-xr-xr-x  1 root    bin  299008 Dec 12 00:22 ./bin/sh
 -rw-r--r--  1 root  wheel     499 Dec 15 15:54 ./etc/rc
 -rw-r--r--  1 root  wheel    1411 Dec 11 23:19 ./etc/ttys
 -rw-r--r--  1 root  wheel     157 Dec 15 15:42 ./etc/hosts
 -rw-r--r--  1 root    bin    1569 Dec 15 15:26 ./etc/XF86Config.altair
 -r-x------  1 bin     bin  151552 Jun 10  1995 ./sbin/init
 -r-xr-xr-x  1 bin     bin  176128 Jun 10  1995 ./sbin/ifconfig
 -r-xr-xr-x  1 bin     bin  110592 Jun 10  1995 ./sbin/mount_nfs
 -r-xr-xr-x  1 bin     bin  135168 Jun 10  1995 ./sbin/reboot
 -r-xr-xr-x  1 root    bin   73728 Dec 13 22:38 ./sbin/mount
 -r-xr-xr-x  1 root  wheel    1992 Jun 10  1995 ./dev/MAKEDEV.local
 -r-xr-xr-x  1 root  wheel   24419 Jun 10  1995 ./dev/MAKEDEV
    

   Esli vy ne ispol'zuete devfs(5) (kotoraya vo FreeBSD 5.X po
   umolchaniyu aktivirovana), to dolzhny ubedit'sya, chto zapuskali
   komandu MAKEDEV all v kataloge dev.

   Moj /etc/rc dlya altair vyglyadit vot tak:

 #!/bin/sh
 #
 PATH=/bin:/
 export PATH
 #
 # configure the localhost
 /sbin/ifconfig lo0 127.0.0.1
 #
 # configure the ethernet card
 /sbin/ifconfig ed0 199.246.76.2 netmask 0xffffff00
 #
 # mount the root filesystem via NFS
 /sbin/mount antares:/DiskLess/rootfs/altair /
 #
 # mount the /usr filesystem via NFS
 /sbin/mount antares:/DiskLess/usr /usr
 #
 /usr/X11R6/bin/XF86_SVGA -query antares -xf86config /etc/XF86Config.altair > /dev/null 2>&1
 #
 # Reboot after X exits
 /sbin/reboot
 #
 # We blew up....
 exit 1

   Privetstvuyutsya lyubye zamechaniya i voprosy.

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

            `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.
