home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Edition 1: Linux / CD1.iso / doc / HOWTO / mini / Remote-Boot < prev    next >
Text File  |  1998-10-14  |  121KB  |  3,235 lines

  1.   Linux Remote-Boot mini-HOWTO:      Configuring Remote-Boot
  2.   Workstations    with Red-Hat Linux, DOS, Windows 3.1, Win¡
  3.   dows 95 and Windows NT
  4.   Marc Vuilleumier Stⁿckelberg, David Clerc and Sandro Viale
  5.   v3.13, June 1998
  6.  
  7.   This document describes how to set up a very robust and secure server-
  8.   based configuration for a cluster of PCs, allowing each client to
  9.   choose at boot-time which operating system to run. The key of this
  10.   configuration is a bootprom based program, which let the user choose
  11.   at boot time one of several boot images. This configuration is appli¡
  12.   cable using InCom TCP/IP Bootprom (add-on for most network cards) or
  13.   any PXE-compliant Boot ROM (ready-to-use in most recent PC with built-
  14.   in network cards).  The most up-to-date version of this document, with
  15.   hypertext links to downloadable software and other related materials,
  16.   can be found at the address http://cuiwww.unige.ch/info/pc/remote-
  17.   boot/howto.html.  Linuxdoc-SGML, DVI and PostScript versions are
  18.   available in the same directory.  If you are interested in getting
  19.   info on further developpments, send an E-mail to
  20.   David.Clerc@cui.unige.ch.
  21.   ______________________________________________________________________
  22.  
  23.   Table of Contents
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.   1. Disclaimer and Copyrights
  68.  
  69.   2. What has changed...
  70.  
  71.      2.1 ...since version 2.x ?
  72.      2.2 ...since version 3.0 ?
  73.  
  74.   3. Introduction
  75.  
  76.      3.1 Boot ROM and Hard-disk
  77.      3.2 The Network
  78.      3.3 How it Works
  79.      3.4 Related non-commercial documentations
  80.  
  81.   4. The Configuration How-To
  82.  
  83.      4.1 Server-side configuration
  84.         4.1.1 Setting up DHCP
  85.         4.1.2 Setting up a Proxy DHCP
  86.         4.1.3 Setting up TFTP
  87.      4.2 Client-side configuration
  88.      4.3 Setting Up the Boot Process
  89.         4.3.1 Discovering BpBatch
  90.      4.4 Setting Up Linux
  91.         4.4.1 Configuring the Client
  92.         4.4.2 Testing the Configuration
  93.         4.4.3 Building the Disk Image
  94.         4.4.4 System Maintenance and Upgrades
  95.      4.5 Setting up DOS 6 and Windows 3.1
  96.         4.5.1 Building the Disk Image
  97.         4.5.2 Adapting the configuration for other machines
  98.         4.5.3 System Maintenance and Upgrades
  99.      4.6 Setting up Windows 95
  100.         4.6.1 Setting up a Stand-Alone Client
  101.         4.6.2 Building the Disk Image
  102.         4.6.3 Adapting the configuration for other Machines
  103.         4.6.4 System Maintenance and Upgrades
  104.      4.7 Setting up Windows NT
  105.         4.7.1 Building the Disk Image
  106.         4.7.2 System Maintenance and Upgrades
  107.      4.8 Troubleshooting
  108.  
  109.   5. Remote-Boot Tools Reference Manual
  110.  
  111.      5.1 BpBatch, MrBatch and MrZip
  112.         5.1.1 Command Line Arguments
  113.         5.1.2 Syntax rules
  114.         5.1.3 The Cache Filesystem
  115.         5.1.4 Special variables
  116.         5.1.5 Monitoring commands
  117.         5.1.6 Control commands
  118.         5.1.7 Keyboard-related commands
  119.         5.1.8 Text output commands
  120.         5.1.9 Graphics output commands
  121.         5.1.10 Security-related commands
  122.         5.1.11 Disk-related commands
  123.         5.1.12 Boot commands
  124.         5.1.13 National language support
  125.         5.1.14 Commands specific to MrZip
  126.      5.2 NoBreak.sys
  127.  
  128.   6. Special TFTP Servers
  129.  
  130.      6.1 Incom Enhanced TFTP Server
  131.      6.2 Linux Enhanced TFTP Server
  132.      6.3 The Security Gateway
  133.      6.4 The Broadcast TFTP Server
  134.  
  135.  
  136.   ______________________________________________________________________
  137.  
  138.   1.  Disclaimer and Copyrights
  139.  
  140.   This document and the related software are provided as is to the Linux
  141.   and Internet community, with no form of warranty. Please note that
  142.   some operations related in this document may destroy the content of
  143.   your hard-disk. We assume no liability for any use, correct or not, of
  144.   this document and of the related software.
  145.  
  146.   You are free to do anything you want with the remote-boot tools as
  147.   long as you do not make money by selling them or by distributing them
  148.   with a commercial product. If you want to commercialize a product
  149.   derived from these tools, please contact the authors first to make a
  150.   commercial agreement. These remote-boot tools will remain available
  151.   for free forever, but we may authorize derived commercial tools.
  152.  
  153.   These provisions shall be interpreted under and in accordance with the
  154.   laws of Switzerland, canton of Geneva. All disputes, defenses,
  155.   controversies or claims arrising in conncetion with this document and
  156.   the related software, shall be subject to the exclusive juridiction of
  157.   the courts of the canton of Geneva, Switzerland.
  158.  
  159.   If you like this program, you can send us a Postcard and/or make a
  160.   gift to the International Committee of the Red Cross (ICRC) or to the
  161.   UNICEF.
  162.  
  163.  
  164.   2.  What has changed...
  165.  
  166.  
  167.   2.1.  ...since version 2.x ?
  168.  
  169.   To say it frankly, almost everything. The underlying concepts are the
  170.   same, but the software part has been completly redesigned to overcome
  171.   the limitations of previous versions and to make it easier to use. An
  172.   highlight of the new features :
  173.  
  174.   ╖  All functions (bpmenu, bpclean, bpunzip) are encompassed in a
  175.      single program.
  176.  
  177.   ╖  The program can run not only from the boot rom, but also under DOS,
  178.      Windows 95 and Linux.
  179.  
  180.   ╖  The program can now restore images of FAT16, FAT32 and EXT2FS
  181.      partitions. If someone want to write NTFS support, let me know...
  182.      For now, NT users still have to stick to FAT16.
  183.  
  184.   ╖  The program can not only restore disk images but also add and patch
  185.      individual files in order to customize the client behaviour.
  186.  
  187.   ╖  Disk images are not any more bound to 87 MB. They are now file-
  188.      system independant archives.
  189.  
  190.   ╖  We provide a mean for automatically downloading a disk image to an
  191.      arbitrary big number of clients at the same time (broadcast).
  192.  
  193.   ╖  You can now write your own secure boot script, that will determine
  194.      the behaviour of the machine before the real boot.
  195.  
  196.   ╖  You can now boot any Linux kernel, without applying any patch. Its
  197.      is also possible to provide a command line and a ramdisk image.
  198.  
  199.   ╖  You can authenticate users at boot time using a Unix, NT or Radius
  200.      server and deny them any access to the machine.
  201.  
  202.   ╖  Full national language support is included.
  203.  
  204.   ╖  And many, many other new features...
  205.  
  206.  
  207.      Is there a program for converting old archives to the new format ?
  208.         No, because the internal format is radically different. But you
  209.         can easily do the conversion by yourself:
  210.  
  211.         1. Boot an old image (unzip it to your disk)
  212.  
  213.         2. Remove calls to the old unzipreg utility and replace them by
  214.            the adequate patch commands (it is very easy, see the
  215.            detailed instructions below)
  216.  
  217.         3. Run the new mrzip program to create a new-style disk image
  218.  
  219.   2.2.  ...since version 3.0 ?
  220.  
  221.   Version 3.0 was the beta-release. A dozen of sites around the world
  222.   have tested it during a month and given much of their time to help us
  223.   finding bugs and to suggest enhancements. Thanks to all of them for
  224.   their patience, and in particular to Maciek Uhlig, Dick Velders and
  225.   Jeff Teeters.
  226.  
  227.   A few minor features have been added since 3.01, such as support for
  228.   diskless Linux boot (by disabling the cache).
  229.  
  230.   Version 3.10 introduced compatibility with Intel's Wired for
  231.   Management 1.1a NetPC standard. The tools now work with any PXE-
  232.   compliant boot ROM (as are most on-board boot ROMs) available today.
  233.   Thanks to InCom GmbH for giving us the PXE bootprom that permitted
  234.   this developpment. We also succesfully tested the tools with the PXE
  235.   Boot ROM that I found incidentally in my Dell computer with onboard
  236.   network card (called LanDesk Service Agent).
  237.  
  238.   Version 3.11 to 3.12 added UNIX server-side tools (a PXE Proxy DHCP
  239.   server for Solaris and Linux, and an enhanced TFTP server for Linux),
  240.   as well as detailled informations on server-side setup and the PXE
  241.   booting process.
  242.  
  243.   Version 3.13 added Advanced Power Management support (PowerOff
  244.   command).
  245.  
  246.  
  247.   3.  Introduction
  248.  
  249.   The configuration described here was developped since Summer 1996 at
  250.   the CUI, University of Geneva. The Computer Science Department uses
  251.   several servers and a number of PCs, which fall into two classes:
  252.  
  253.   ╖  computers devoted to students
  254.  
  255.   ╖  computers devoted to research and teaching assistants
  256.  
  257.      We developped the current configuration with the following aims:
  258.  
  259.   ╖  Every computer should be able to run under Linux, DOS, Windows 3.1,
  260.      Windows 95 or Windows NT. One should be able to choose the desired
  261.      operating system for each session.
  262.  
  263.   ╖  All softwares, including operating systems, should be take from the
  264.      server, in order to facilitate the installations and upgrades.
  265.   ╖  Clients computers should be able to run without any write-access on
  266.      the server (for security reasons), except for their home directory.
  267.  
  268.   ╖  Client-side configuration should be reduced to its very minimum.
  269.      Clients should automatically get their IP configuration parameters
  270.      from the server, and this information should be located in a single
  271.      file, used for all operating systems.
  272.  
  273.   ╖  Since almost every computer now has a hard-disk, clients should be
  274.      able to take profit of it for reducing network load and as
  275.      temporary storage space for the user.
  276.  
  277.   ╖  Users must have a login to be able to use any of the computers.
  278.  
  279.   ╖  The login should be the same for all operating system and should
  280.      let the user access its unique home directory, common to all
  281.      operating systems.
  282.  
  283.   ╖  Student (and secretary :-) computers should be fully cleaned up at
  284.      each start. That is, the PC should always look like if it were just
  285.      installed.
  286.  
  287.   ╖  Every computer has to be protected from virus attacks.
  288.  
  289.      These constraints lead us to base our configuration on bootprom
  290.      tools. We first developped new tools for the excellent TCP/IP
  291.      Bootprom from InCom GmbH.  Now that a standard for preboot
  292.      execution environments as finally emerged, we ported the tools so
  293.      that it now also works for any PXE-compliant bootprom. PXE boot
  294.      roms, also called LanDesk Service Agent, are now distributed with
  295.      almost all on-board network adapter.  For more info on PXE and
  296.      Intel Wired for Management standard in general, read from
  297.      http://www.intel.com/managedpc.
  298.  
  299.  
  300.   3.1.  Boot ROM and Hard-disk
  301.  
  302.   Bootproms exist for quite a long time, but until recently, they were
  303.   solely used with diskless computers. Since 1996, this How-to has been
  304.   claiming that bootproms are even more interesting for computers which
  305.   have a local harddisk, since they allow to take profit of both sides:
  306.  
  307.   ╖  A boot rom make the configurations more robust, since it ensure
  308.      that the computer will always boot the same way, no matter any
  309.      virus or partition table crash. It can be used, as we did, to
  310.      cleanup the harddisk even before the operating system is loaded.
  311.  
  312.   ╖  A local harddisk make the configuration more efficient, since it
  313.      can reduce the network trafic through caching, and allows for
  314.      efficient swap.
  315.  
  316.      Today, we have the pleasure to see that all computer manufacturers
  317.      have come to the same point and provide boot roms as part of new
  318.      computer standards.
  319.  
  320.   Note that you can still use the tools described below in an old
  321.   fashioned way, that is as a simple kernel/ramdisk loader, even for
  322.   diskless computers. However, we do not encourage this use.
  323.  
  324.  
  325.   3.2.  The Network
  326.  
  327.   The University of Geneva owns a class B domain, subdivided into
  328.   several subnets. The CUI uses four subnets, among them one is
  329.   dedicated to students.
  330.  
  331.   Originally, our PCs were concerned about two network protocols: IPX
  332.   and IP.  On the IPX side, we used a single Novell Netware 3 server for
  333.   sharing software and users files for DOS and Windows. On the IP side,
  334.   we used a SUN server for sharing software and users partitions for
  335.   Linux, with NFS.
  336.  
  337.   In our latest configuration, we do not any more use IPX. There is a
  338.   single Unix server (which could be Linux as well as a SUN), sharing
  339.   software and user files using NFS for Linux clients and using SMB
  340.   (NetBIOS) over TCP/IP for Dos and Windows clients. In this way, we
  341.   have a single home directory used by all operating systems.
  342.  
  343.  
  344.   3.3.  How it Works
  345.  
  346.  
  347.   1. When a client PC is turned on, it first performs the traditional
  348.      system checks before the TCP/IP Bootprom or PXE Boot ROM takes the
  349.      control.
  350.  
  351.   2. The bootprom issues a BOOTP/DHCP request in order to get its IP
  352.      configuration parameters.
  353.  
  354.   3. If the server knows the PC issuing the request, it will send back a
  355.      BOOTP/DHCP reply with informations such as the client's IP address,
  356.      the default gateway, and which bootdisk image to use.
  357.  
  358.   4. In case of a PXE boot ROM, there might be some more exchanges
  359.      between the client and the server to determine installation
  360.      parameters.
  361.  
  362.   5. The bootprom then downloads the boot image from the server using
  363.      the TFTP protocol. The boot image happens to be a small program
  364.      called bpbatch, our boot-time batch file interpreter.
  365.  
  366.   6. The batch interpreter is started. At this time, it is almost alone
  367.      in the computer memory. There is no operating system loaded, except
  368.      the preboot execution environment (offered by the Boot ROM).
  369.  
  370.   7. The batch interpreter look in the BOOTP/DHCP reply for command-line
  371.      options, and in particular for the name of the batch to execute.
  372.  
  373.   8. According to the instructions in the batch file, it will for
  374.      instance:
  375.  
  376.      a. Load a national keyboard mapping
  377.  
  378.      b. Authenticate the user according to a remote server (Unix, Radius
  379.         or Windows NT)
  380.  
  381.      c. Let the user choose between the available operating systems
  382.  
  383.      d. According to the operating system choosen, repartition the hard-
  384.         disk and quick-format some partitions
  385.  
  386.      e. Check if an up-to-date compressed image of the selected OS is
  387.         present at the end of the disk. If not, it download it using
  388.         TFTP
  389.  
  390.      f. Uncompress the selected OS to the main partition
  391.  
  392.      g. If the selected OS is Linux, load a kernel and start it
  393.  
  394.      h. If the selected OS is DOS or Windows, simply let the computer
  395.         boot on its fresh new hard-disk
  396.  
  397.      For DOS and Windows 3.1, we use the freely available Microsoft Lan¡
  398.      Manager for DOS (search the network for the mirror nearest to you;
  399.      the distribution consists of three files named disk1 to disk4) as
  400.      SMB client. Microsoft LanManager supports dynamic configuration
  401.      using DHCP. After logging in, the user is faced to DOS, and can
  402.      start Windows 3.1 by typing the traditional win command. Note that
  403.      at this point, DOS and Windows 3.1 appear to be installed locally.
  404.  
  405.      For Windows 95 and Windows NT, we also use Microsoft SMB client
  406.      (called Client for the Microsoft Network), that supports dynamic
  407.      configuration using DHCP. We reduce network load using Shared LAN
  408.      Cache, a nice and powerful network-to-disk cache program.
  409.  
  410.      Students computers can be turned off the hard way at any time with¡
  411.      out risks, since the hard disk is reinitialized at each start.
  412.  
  413.   For "safe" computers (ie. for assistants computers), once the computer
  414.   has been booted once using the above described system, the boot script
  415.   simply redirect the boot to the local hard-disk, without cleaning it
  416.   again. This allow users to leave data on their local hard disk. But
  417.   whenever the configuration gets corrupted, the user can simply choose
  418.   from the boot menu in order to have a fresh installation.
  419.  
  420.  
  421.   3.4.  Related non-commercial documentations
  422.  
  423.   This configuration has been successfully reproduced at several places
  424.   around the world. A few people have written some hints and tricks that
  425.   complement this How-To. If you did so and that your page is not
  426.   already referenced in this documentation, please send an e-mail to
  427.   Marc.VuilleumierStuckelberg@cui.unige.ch.  And if you experience
  428.   problems while reproducing this configuration, have a look at these
  429.   pages !
  430.  
  431.   ╖  http://www.katedral.se/system/elevsyst, by Johan Carlstedt of The
  432.      Cathedral School of Uppsala, Sweden.  At this day, the
  433.      configuration described at this place is still based on the
  434.      previous version of the remote-boot tools. However, almost
  435.      everything remains applicable, given a few changes.
  436.  
  437.   ╖  http://vitoria.upf.tche.br/~fred/, in portuguese, by Frederico
  438.      Goldschmidt of the Passo Fundo University, Brasil.
  439.  
  440.   You can also send me your BpBatch script if you want me to include it
  441.   in the sample scripts collection.
  442.  
  443.  
  444.   4.  The Configuration How-To
  445.  
  446.   First, arrange to have the following two machines within arm's reach:
  447.  
  448.   ╖  the server, usually a Unix or Windows NT machine
  449.  
  450.   ╖  the client, a PC with a bootprom enabled, and nothing valuable on
  451.      the hard disk.
  452.  
  453.      If you want to test the configuration but you do not yet have a
  454.      bootprom, you can download the TCP/IP BootProm demo diskette from
  455.      InCom GmbH at http://www.incom.de.  This diskette will make your
  456.      computer behave like if it had a TCP/IP Bootprom plugged in.
  457.  
  458.   If you already have a Boot ROM, you need to enable it. If you are
  459.   using Incom TCP/IP Bootprom, you can do that using a special program
  460.   from your network card manufacturer. If you have a PXE Bootprom, you
  461.   can do it simply from BIOS setup, by changing the default boot device.
  462.  
  463.   For student computers, we configured the boot on network first, and
  464.   disabled hard-disk and floppy-disk boot. For assistant computers, we
  465.   also configured network-boot first, but we allow hard-disk and floppy-
  466.   disk boot.
  467.  
  468.  
  469.   4.1.  Server-side configuration
  470.  
  471.   On the server, you will need the following services:
  472.  
  473.   1. A BOOTP/DHCP server
  474.  
  475.   2. May be a Proxy DHCP server
  476.  
  477.   3. A TFTP server
  478.  
  479.      Note for PXE Boot ROM users: We found after severals hours of
  480.      tedious search that some (all ?) PXE Boot ROMs do not follow the IP
  481.      protocol and discard all packets that have the Don't Fragment (DF)
  482.      flag set.  That means, you will have to disable Path MTU Discovery
  483.      on the server, or the Boot ROM will not see any of its packets. On
  484.      Solaris, use ndd /dev/ip ip_path_mtu_discovery to see if you have
  485.      it enabled and ndd -set /dev/ip ip_path_mtu_discovery 0 to disable
  486.      it.  However, this fix only works for non-broadcast packets (ask
  487.      SUN why...).  That means, it will work for TFTP but not for DHCP
  488.      :-(.
  489.  
  490.  
  491.   4.1.1.  Setting up DHCP
  492.  
  493.   The role of the DHCP server is to give to the client an IP address and
  494.   to make it load the file named bpbatch.P from the TFTP server.  DHCP
  495.   is a superprotocol over BOOTP. If you are using InCom TCP/IP Bootprom,
  496.   you may live without DHCP (using an old BOOTP server).
  497.  
  498.   On Windows NT, you will probably use the native DHCP server.  If you
  499.   are using InCom TCP/IP Bootprom, you will have to use a special trick
  500.   to specify the boot file name (get more info from InCom WWW site). If
  501.   you are using a PXE Bootrom, you will need a Proxy DHCP server, but no
  502.   other trick is needed as the boot file name will be provided by the
  503.   Proxy DHCP server.
  504.  
  505.   On Linux, the best choice is the standard DHCP server from the
  506.   Internet Software Consortium. If you are using a PXE Bootrom, in
  507.   addition to the usual options, you will need to add the following
  508.   ones:
  509.  
  510.   ╖  option dhcp-class-identifier "PXEClient"
  511.  
  512.   ╖  option vendor-encapsulated-options ff;
  513.  
  514.   On Solaris, you can either use the Internet Software Consortium DHCP
  515.   server (available on the Web), or use Solaris DHCP server (available
  516.   since Solaris 2.5). However, as Solaris DHCP server does not seems to
  517.   be able to insert a client class identifier in its DHCP offer, you
  518.   must install a Proxy DHCP server. Morever, this Proxy DHCP server must
  519.   reside on another computer since Solaris DHCP server locks the DHCP
  520.   port.
  521.  
  522.   We suggest giving infinite lease time for remote-boot clients.  Don't
  523.   forget that BOOTP/DHCP requests are bounded by subnets. If the client
  524.   and the server do not reside on the same subnet, you should install a
  525.   BOOTP/DHCP Relay agent on any computer between the two.  For now, just
  526.   assume that both machines are on the same subnet.
  527.  
  528.  
  529.   4.1.2.  Setting up a Proxy DHCP
  530.  
  531.   The role of the Proxy DHCP server is to overcome limitions of some
  532.   DHCP servers and to provide PXE specific extensions. A proxy DHCP
  533.   server only makes sense for a PXE Boot rom.
  534.  
  535.   As BpBatch itself is quite powerfull, you wont need to use any PXE
  536.   specific DHCP extension (menus, etc.).  However, if your DHCP server
  537.   is not able to show minimal PXE compliance, you will need a Proxy DHCP
  538.   server or your PXE Boot ROM will not accept to go further.
  539.  
  540.   On Windows NT, you can try to use Intel WfM PDK (available from their
  541.   web site), but it is not very easy to use. We rather suggest having a
  542.   Linux machine on the subnet and using our small Proxy DHCP.  The major
  543.   advantage of our Proxy DHCP Server for BpBatch is that our server will
  544.   let you specify an option 155 vendor tag that will be interpreted by
  545.   BpBatch as a command line.
  546.  
  547.   On Linux and Solaris, you can run our Proxy DHCP program, that simply
  548.   takes as argument the TFTP server IP address, boot file name and
  549.   optional arguments, and does everything for you.  If the DHCP port on
  550.   the server is already requested by another daemon, the proxy DHCP
  551.   server will run on port 4011. In this case, it is necessary that the
  552.   other daemon on DHCP port answer a DHCP offer with client class
  553.   PXEClient so that the PXE client knows that it must try on port 4011.
  554.  
  555.   If you want to understand better PXE extensions to DHCP, there is an
  556.   extensive description available on Intel WWW site. However, be warned
  557.   that the documents are quite confusing, as the protocol has been
  558.   extended to a number of optional stages, in order to allow for a
  559.   maximal flexibility. The key to understand it is that all what a PXE
  560.   client needs is a complete enhanced DHCP answer. If it receives only a
  561.   standard DHCP offer, it will look further until it gets
  562.  
  563.   1. a client class (T60) set to PXEClient
  564.  
  565.   2. vendor encapsulated options (T43) (possibly empty, ie. hex ff)
  566.  
  567.   3. a non-empty boot filename
  568.  
  569.      The PXE specific negociation ends as soon as all these infos are
  570.      received, but can lead to a very complex process (install server
  571.      discovery, etc.)  if some are missing.
  572.  
  573.  
  574.   4.1.3.  Setting up TFTP
  575.  
  576.   The TFTP server is a very simple file server. In its basic version,
  577.   TFTP use 512 bytes data blocks, which are quite inefficients.  InCom
  578.   TCP/IP Bootprom and PXE Boot ROMs allow to use larger blocks (1408
  579.   bytes), which speeds up transfers a lot. However, this can only work
  580.   with an enhanced TFTP server.
  581.  
  582.   On Windows NT, we suggest using InCom enhanced TFTP server, available
  583.   on their web site.
  584.  
  585.   On Linux, you can use our enhanced TFTP server, available at
  586.   http://cuiwww.unige.ch/info/pc/remote-boot/soft/etftpd.tar.gz.
  587.  
  588.   On Solaris, you should use InCom enhanced TFTP serer, available on the
  589.   utility disk provided with the TCP/IP Bootprom.
  590.  
  591.   If you prefer using a standard TFTP daemon, remove the P in all boot
  592.   image name extensions, in order to tell the Bootprom to use only the
  593.   standard TFTP port (This trick was introduced by InCom GmbH for the
  594.   TCP/IP Bootprom. We still use it as an easy way to select the default
  595.   TFTP port with PXE bootproms).
  596.  
  597.  
  598.   4.2.  Client-side configuration
  599.  
  600.   First, we will do set up the part common to all operating systems, ie.
  601.   the batch-file interpreter.  Then, for each operating system, we will
  602.   go through the following steps:
  603.  
  604.   1. Setup a stand-alone client
  605.  
  606.   2. Save its configuration on the server
  607.  
  608.   3. Test it as a remote-boot client
  609.  
  610.   4. Adapt it so that it works for any similar client machine
  611.  
  612.      Once this is done, you will be able to setup any supplemental
  613.      client just by plugging a Boot ROM in it (or buying a Wired for
  614.      Management ready computer...) and adding one line in the DHCP
  615.      configuration file.
  616.  
  617.   Our examples assume that you have a hard disk of 1.4 Gb or more.  If
  618.   you have less, reduce the sizes of the partitions, but remember the
  619.   you need to leave a few hundreds megabytes unallocated (that is, the
  620.   last partition must not take up to the last cylinder) to leave free
  621.   room for the special cache partition. Moreover, as the cache always
  622.   starts at the cylinder following the last allocated cylinder, if you
  623.   do not use the same total size for all your tests, you will have to
  624.   download several times the same files (the cache will be automatically
  625.   cleared).
  626.  
  627.   Never despair. If you can't get it to work, first look in the
  628.   Troubleshooting section if your problem is not already solved (get the
  629.   latest version from the Web).  If it still does not work, think about
  630.   monitoring network traffic for network related problems (use tcpdump
  631.   on Linux or snoop on Solaris). If you really cannot get it to work,
  632.   you can send an E-mail to David.Clerc@cui.unige.ch or
  633.   Marc.VuilleumierStuckelberg@cui.unige.ch.  If your problem is strictly
  634.   related with the remote-boot configuration and if we are not
  635.   overflowed, we will try to solve your problem.
  636.  
  637.  
  638.   4.3.  Setting Up the Boot Process
  639.  
  640.   Get the BpBatch software, either as .zip or as .tar.gz.  The
  641.   executables are available at
  642.  
  643.   ╖  http://cuiwww.unige.ch/info/pc/remote-boot/soft/bpb-exe.zip
  644.  
  645.   ╖  http://cuiwww.unige.ch/info/pc/remote-boot/soft/bpb-exe.tar.gz
  646.  
  647.      The source code (Assembler and C) is also available on request.
  648.  
  649.   In the server /tftpboot directory, put the following three special
  650.   boot images, which together make our pre-boot batch file interpreter:
  651.  
  652.   ╖  bpbatch.P, the dynamic loader (respect the uppercase !)
  653.  
  654.   ╖  bpbatch.ovl, the relocated interpreter
  655.  
  656.   ╖  bpbatch.hlp, the on-line help file
  657.  
  658.      Then add an entry in the DHCP configuration file for your client,
  659.      with the boot file set to "bpbatch.P". Define a vendor option tag
  660.      155 (decimal) with the value "-i" (on the standard DHCP server,
  661.      this is done by the following command: option option-155 "-i";). It
  662.      is interpreted by bpbatch as the command line, and -i stands for
  663.      "interactive".
  664.  
  665.   Boot the client computer. You might shortly see
  666.  
  667.   ╖  The Boot ROM copyright
  668.  
  669.   ╖  The string DHCP while the client waits for a DHCP reply
  670.  
  671.   ╖  The string TFTP while the client waits for the first TFTP packet
  672.  
  673.   ╖  The string Loading BpBatch while the loader download the
  674.      interpreter
  675.  
  676.   ╖  And finaly our banner, followed by a nice greather-than prompt
  677.  
  678.      Congratulations ! You have started the batch interpreter...  If you
  679.      are curious about what you can do with it, continue reading the
  680.      next section. If you are on a hurry, skip it and go directly
  681.      install the operating system of your choice. If you have any doubt
  682.      about a command within the interpreter, type help.
  683.  
  684.   Note that you can run the same interpreter within DOS and Linux by
  685.   running the MrBatch program. There are a only very few differences
  686.   (the Linux version do not have graphics support and the DOS version
  687.   can only send BOOTP and TFTP requests if the BootProm is not hidden by
  688.   the operating system).
  689.  
  690.   It may be a good idea to read now the section about the Syntax Rules
  691.   of BpBatch, and in particular the paragraphs on File References and on
  692.   The Cache Filesystem.  This will help you understand the examples.
  693.  
  694.   Once all operating systems will be set up, you will have to make a
  695.   menu to let the user choose the one he wants. You should be able to
  696.   discover by yourself how to make such a menu. All necessary commands
  697.   are documented at the end of this document.
  698.  
  699.  
  700.   4.3.1.  Discovering BpBatch
  701.  
  702.   Try to type LogVars. You should get about thirty variables listed.
  703.   Roughly, the first are BpBatch settings, then come all parameters
  704.   extracted from the BOOTP/DHCP reply, and the last variable is a list
  705.   of disks sizes, in Megabytes.
  706.  
  707.   Type GetPartitions part, then LogVars again. There should be one more
  708.   variable containing the list of defined partitions on your first hard-
  709.   drive. Assuming that the first partition is either BIGDOS, FAT32 or
  710.   LINUX-EXT2, try LogDir "{:1}" to get the content of the root
  711.   directory, then LogDir "{:1}/usr" if there is an usr directory. You
  712.   can even try LogTree "{:1}/etc" to get a directory tree.
  713.  
  714.   Put a GIF file (format GIF-87a, interlaced or not, but NOT GIF-89a) on
  715.   your TFTP server. We will suppose that the file is named image.gif.
  716.   You can copy it wherever you want with the following command: Copy
  717.   "image.gif" "{:1}/temp/image.gif". Or you can use it directly from the
  718.   server. Now type Logvars "V*" and look at the value of the VESA
  719.   variable. If it is On, which is most probable, that means you have a
  720.   VESA-compliant video adapter and you will be able to display the image
  721.   with the following command: DrawGif "image.gif". The image should be
  722.   on the upper left corner of the screen. You can draw it on another
  723.   place by specifying X and Y coordinates after the image name. You can
  724.   also draw text with DrawText 200 200 "Hello world" yellow. Or draw an
  725.   empty window with DrawWindow 200 200 300 150. When you are tired of
  726.   graphic mode, simply type CloseGraph.
  727.   Now take a text editor, and create a file named test.bpb in the
  728.   tftpboot directory with the following content:
  729.  
  730.  
  731.        ______________________________________________________________________
  732.        :again
  733.        DrawWindow 150 200 400 160
  734.        DrawText 155 204 "Identity check" white
  735.        TextAttr Black LightGray
  736.        At 15,20 Print "Username : "
  737.        Input username 8
  738.        At 17,20 Print "Password : "
  739.        Getpasswd userpass 8
  740.        if "$username" != "smith" goto again
  741.        if not "$userpass" match-passwd "BpR8oiIlRR9bo" goto again
  742.        #
  743.        clear
  744.        DrawWindow 200 200 150 100 green
  745.        DrawText 205 204 "Congratulations" white
  746.        DrawText 220 250 "You got it !" yellow
  747.        WaitForKey 3
  748.        CloseGraph
  749.        interact
  750.        ______________________________________________________________________
  751.  
  752.  
  753.  
  754.  
  755.   In your BOOTP/DHCP configuration, change the option-155 from "-i" to
  756.   "test", and reboot the client computer. The small script should run
  757.   automatically, and ask you for a username and password.  If you do not
  758.   type smith and justdoit, you wont be able to boot the computer. Later
  759.   you will learn how to use a Unix, NT or Radius server to check valid
  760.   user names.
  761.  
  762.  
  763.   4.4.  Setting Up Linux
  764.  
  765.   In order to set up Linux, you will need to boot the floppy disk
  766.   provided with the RedHat Linux distribution. BpBatch includes a
  767.   command that can redirect the boot to the floppy: FloppyBoot.
  768.   Unfortunately, it does not seem to work correctly with this special
  769.   boot floppy (any suggestion is welcome to fix this). Consequently, you
  770.   will probably need to boot a computer without bootprom for this first
  771.   part of Linux setup.
  772.  
  773.   Set up RedHat Linux on your client, with network support, and any
  774.   packages you may want. You may want to recompile the kernel to better
  775.   fit your hardware, but it is not necessary.
  776.  
  777.  
  778.   4.4.1.  Configuring the Client
  779.  
  780.   It is probably a good idea to include BOOTP support to the kernel, so
  781.   that you do not have to customize the client IP address manually.
  782.  
  783.   In order to reduce network load, you might also want to setup the
  784.   filecache for caching on the hard disk files that are loaded by NFS.
  785.   Roughly, the principle of the filecache is that whenever a symbolic
  786.   link from the cache subdirectory is followed, it is replaced by its
  787.   target. If the target is itself a subdirectory, each entry of the
  788.   subdirectory becomes a symbolic link to the original entry of the
  789.   foreign filesystem.  The filecache has been written by Unifix GmbH,
  790.   and is part of Unifix Linux 2.0. It is freely distributable, and you
  791.   can get the necessary files from
  792.   http://cuiwww.unige.ch/info/pc/remote-boot/soft/filecache.tar.gz.  In
  793.   order to use the filecache, you have to
  794.  
  795.   ╖  apply a patch to the kernel (file patch-filecache), enable
  796.      filecache support through make config or whatever you prefer, and
  797.      recompile the kernel
  798.  
  799.   ╖  copy the filecache binary file to /sbin
  800.  
  801.   ╖  create a mount point called /mnt/nfs (using mkdir)
  802.  
  803.   ╖  copy filecache.conf to /etc. This file contains the following
  804.      lines:
  805.  
  806.      Max 100 MB 50 % #
  807.      Cache /mnt/nfs/usr /usr
  808.      Cache /mnt/nfs/opt /opt
  809.  
  810.  
  811.  
  812.   ╖  copy the content of /usr and /opt to the server, export them read-
  813.      only with anon=0 (for allowing root access) and mount them under
  814.      /mnt/nfs (add a line for that in /etc/fstab)
  815.  
  816.   ╖  rename /usr as /usr.orig
  817.  
  818.   ╖  link /usr to /mnt/nfs/usr
  819.  
  820.   ╖  rename /opt as /opt.orig
  821.  
  822.   ╖  link /opt to /mnt/nfs/opt
  823.  
  824.   ╖  ensure that /usr and /opt are not empty and contains the correct
  825.      directories
  826.  
  827.   ╖  recursively remove /usr.orig and /opt.orig
  828.  
  829.   ╖  copy filecache.init to /etc/rc.d/init.d
  830.  
  831.   ╖  And finally link /etc/rc.d/rc3.d/S35filecache to
  832.      /etc/rc.d/init.d/filecache.init
  833.  
  834.      If you successfully followed each of these steps, you should have
  835.      the filecache working next time you boot, as long as you do not
  836.      forget to use your patched kernel.
  837.  
  838.  
  839.   4.4.2.  Testing the Configuration
  840.  
  841.   Copy your compressed kernel image (zImage, bzImage, vmlinuz or
  842.   whatever you call it) to the server /tftpboot directory as linux.krn.
  843.   If you had to unplug the bootprom from the PC, you can now plug it
  844.   again. When BpBatch starts, type LinuxBoot "linux.krn" "root=/dev/hda1
  845.   BOOT_IMAGE=linux" (assuming that the root ext2 filesystem is on the
  846.   first partition). Alternatively, if you did setup your configuration
  847.   on a computer without bootprom, just boot let it boot using the loader
  848.   you installed (lilo, ...). But in the later case, if you want the
  849.   filecache to work, you should have explicitely installed your kernel
  850.   with filecache support at the right place.
  851.  
  852.   Wait until the system comes up.  If you installed the filecache, you
  853.   can check that /usr has exploded into a directory with some symlinks
  854.   and some already-exploded directories. Now start the programs that the
  855.   end-users will use most of the time, in order to load them once for
  856.   all to the hard disk.
  857.  
  858.  
  859.   You can still make adjustements to your configuration, like on any
  860.   stand-alone linux station.
  861.  
  862.  
  863.   4.4.3.  Building the Disk Image
  864.  
  865.   When you are happy with your configuration, login as root, go to the
  866.   /tmp directory and run our mrzip program.  MrZip is a command
  867.   interpreter like BpBatch, but it can understand more commands than
  868.   BpBatch does. In particular, it can understand the following commands:
  869.  
  870.  
  871.        ______________________________________________________________________
  872.        showlog
  873.        filter -"tmp/*"
  874.        filter -"var/log/*"
  875.        fullzip "/" "/tmp/linux.imz"
  876.        ______________________________________________________________________
  877.  
  878.  
  879.  
  880.  
  881.   This will create a disk image in /tmp/linux.imz. Move it to the server
  882.   /tftpboot directory. Then copy the following batch file to /tftp¡
  883.   boot/linux.bpb:
  884.  
  885.  
  886.        ______________________________________________________________________
  887.        hidelog
  888.        setpartitions "linux-ext2:992 linux-swap:32"
  889.        fullunzip "linux.imz" 1
  890.        clean 2
  891.        linuxboot "linux.krn" "root=/dev/hda1 BOOT_IMAGE=linux"
  892.        ______________________________________________________________________
  893.  
  894.  
  895.  
  896.  
  897.   The BOOT_IMAGE argument is to stay compatible with lilo for RedHat 5.1
  898.   and later rc.sysinit.
  899.  
  900.   Your remote-boot linux configuration is ready ! You can now either set
  901.   the BOOTP-option-155 to "linux", or type include "linux.bpb" from
  902.   within BpBatch to test it.
  903.  
  904.  
  905.   4.4.4.  System Maintenance and Upgrades
  906.  
  907.   If you want later to upgrade software, install bug fixes and security
  908.   fixes, proceed as follow:
  909.  
  910.   ╖  Remote-boot a client computer to get a fresh linux install
  911.  
  912.   ╖  Make your changes
  913.  
  914.   ╖  Redo the disk image
  915.  
  916.   ╖  Copy the new image in place of the old one on the server
  917.  
  918.      That means, you can upgrade software on your server-based
  919.      configuration as if it were a purely local install.
  920.  
  921.  
  922.  
  923.  
  924.  
  925.   4.5.  Setting up DOS 6 and Windows 3.1
  926.  
  927.   On the client computer, boot on your favorite dos floppy disk (either
  928.   remove the bootprom or type FloppyBoot within BpBatch).  Format the
  929.   dos partition of your hard-drive with the /S option, in order to put
  930.   the operating system on it.  The size of the partition is not
  931.   important, as disk archives created with MrZip Create a DOS
  932.   subdirectory, copy DOS in it. Install your favorite network client
  933.   (for instance Microsoft LanManager), Windows 3.1, and so on. If you
  934.   use Microsoft LanManager, do not use DHCP for the IP configuration as
  935.   it is a very poor implementation that will almost surely fail with
  936.   reasonable network load. To do that, add the following lines in your
  937.   protocol.ref file, in the section that loads tcptsr (of course,
  938.   replaces the xxx by your true IP parameters):
  939.  
  940.           IPADDRESS0 = xxx xxx xxx xxx
  941.           SUBNETMASK0 = 255 255 xxx xxx
  942.           DEFAULTGATEWAY0 = xxx xxx xxx xxx
  943.           DISABLEDHCP = 1
  944.  
  945.  
  946.  
  947.   Do not be afraid to use EMM386 to optimize the memory usage, and even
  948.   to include the area where you put your network adapter ROM, since it
  949.   is not used anymore at this time. But carefully exclude the network
  950.   adapter RAM, or you will not be able to connect to your server. Use
  951.   the NOEMS parameter.
  952.  
  953.   If you want to ensure that the client machine cannot be used without a
  954.   valid login name, download our nobreak pseudo-device driver (available
  955.   at http://cuiwww.unige.ch/info/pc/remote-boot/soft/nobreak.zip) and
  956.   run it at the beginning of your config.sys. Then add something like
  957.   this to your autoexec.bat:
  958.  
  959.  
  960.        ______________________________________________________________________
  961.        rem -- we use the dummy file c:\logged as a flag
  962.        del c:\logged >nul
  963.        :loginneeded
  964.        cls
  965.        echo Please type in your login name and password
  966.        echo.
  967.        net logon *
  968.        rem -- the login script should have created c:\logged
  969.        if not exist c:\logged goto loginneeded
  970.        del c:\logged
  971.        rem -- now enable break again
  972.        echo Yes >NOBRK
  973.        ______________________________________________________________________
  974.  
  975.  
  976.  
  977.  
  978.   Ensure that your client boot well by rebooting the client and
  979.   evaluating the following commands within BpBatch interactive mode:
  980.  
  981.           HideBootprom
  982.           HdBoot
  983.  
  984.  
  985.  
  986.  
  987.   4.5.1.  Building the Disk Image
  988.  
  989.   On the server, make a share called admin for instance, on which you
  990.   will put some stuff for the system administrator.  If the server is a
  991.   Unix machine, it is a good opportunity to put in admin a softlink to
  992.   the /tftpboot subdirectory, so that you can put images in it directly
  993.   from the client.  Within admin, create a /utils subdirectory and put
  994.   the following files in it:
  995.  
  996.   ╖  mrbatch.exe, the DOS version of BpBatch
  997.  
  998.   ╖  mrzip.exe, the DOS version of the program for building disk images
  999.  
  1000.   ╖  bpbatch.hlp, the on-line help file
  1001.  
  1002.      You might also like to put in the same directory a simple MrZip
  1003.      script named zipdos.mrz file that contains the commands needed for
  1004.      building a DOS image, like this one:
  1005.  
  1006.  
  1007.        ______________________________________________________________________
  1008.        showlog
  1009.        filter -"lanman.dos/lmuser.ini"
  1010.        filter -"temp/*"
  1011.        filter -"*.swp"
  1012.        fullzip "c:/" "L:/tftpboot/dos.imz"
  1013.        ______________________________________________________________________
  1014.  
  1015.  
  1016.  
  1017.  
  1018.   Now go back to your client, mount the admin volume on drive L:, go to
  1019.   your utils directory and type the following command:
  1020.  
  1021.           mrzip -b zipdos
  1022.  
  1023.  
  1024.  
  1025.   One minute later, you will have a new file in the server /tftpboot
  1026.   subdirectory called dos.imz, which is a compressed image of your hard
  1027.   disk. Copy the following batch file to /tftpboot/dos.bpb:
  1028.  
  1029.  
  1030.        ______________________________________________________________________
  1031.        hidelog
  1032.        setpartitions "bigdos:1024"
  1033.        setbootpart 1
  1034.        fullunzip "dos.imz" 1
  1035.        hidebootprom
  1036.        hdboot :1
  1037.        ______________________________________________________________________
  1038.  
  1039.  
  1040.  
  1041.  
  1042.   Your remote-boot DOS configuration is ready ! You can now either set
  1043.   the BOOTP-option-155 to "dos", or type include "dos.bpb" from within
  1044.   BpBatch to test it.
  1045.  
  1046.  
  1047.   4.5.2.  Adapting the configuration for other machines
  1048.  
  1049.   If you want to customize some settings according to the machine,
  1050.   typically the IP settings since Micro$oft DHCP is buggy, you can setup
  1051.   BpBatch to change some files before booting.  Firsti go to the
  1052.   lanman.dos directory and do
  1053.  
  1054.           copy *.ini *.ref
  1055.  
  1056.  
  1057.   Then edit the .ref files and replace all fixed parameters with BOOTP
  1058.   variable names as in the following examples:
  1059.  
  1060.           computername = ${BOOTP-Host-Name}
  1061.           ipaddress0 = ${MS-IPAddress}
  1062.           subnetmask0 = ${MS-IPSubnet}
  1063.           defaultgateway = ${MS-IPRouter}
  1064.  
  1065.  
  1066.   Then rebuild the disk image as previously.  Note that for IP parame¡
  1067.   ters, we do not use the BOOTP variables directly because LanManager
  1068.   needs then as space-separated numbers instead of dot-separated num¡
  1069.   bers. Change dos.bpb to the following:
  1070.  
  1071.  
  1072.        ______________________________________________________________________
  1073.        hidelog
  1074.        setpartitions "bigdos:1024"
  1075.        setbootpart 1
  1076.        fullunzip "dos.imz" 1
  1077.        set MS-IPAddress="$BOOTP-Your-IP"/.= /
  1078.        set MS-IPSubnet="$BOOTP-Subnet-Mask"/.= /
  1079.        set MS-IPRouter="$BOOTP-Routers"/.= /
  1080.        patch "{:1}lanman.dos/protocol.ref" "{:1}lanman.dos/protocol.ini"
  1081.        patch "{:1}lanman.dos/tcpputils.ref" "{:1}lanman.dos/tcputils.ini"
  1082.        patch "{:1}lanman.dos/lanman.ref" "{:1}lanman.dos/lanman.ini"
  1083.        hidebootprom
  1084.        hdboot :1
  1085.        ______________________________________________________________________
  1086.  
  1087.  
  1088.  
  1089.  
  1090.   If you prefer, you can also put the .ref files in the server /tftpboot
  1091.   directory instead of in the disk image.
  1092.  
  1093.   We like to be able to easily change the computers configuration
  1094.   without rebuilding the image. To do that, copy your autoexec.bat and
  1095.   config.sys as autoexec.ref and config.ref to the server /tftpboot and
  1096.   add the following two lines to the batch file above:
  1097.  
  1098.           patch "autoexec.ref" "{:1}autoexec.bat"
  1099.           patch "config.ref" "{:1}config.sys"
  1100.  
  1101.  
  1102.   You can then freely change the files and even customize them with
  1103.   machine-dependant values obtained from BOOTP.
  1104.  
  1105.   After making any change to the client machine configuration, do not
  1106.   forget to rebuild the disk image using mrzip if you want to preserve
  1107.   your changes.
  1108.  
  1109.  
  1110.   4.5.3.  System Maintenance and Upgrades
  1111.  
  1112.   If you want later to add new software or change anything else, proceed
  1113.   as follow:
  1114.  
  1115.   ╖  Remote-boot a client computer to get a fresh install
  1116.  
  1117.   ╖  Make your changes
  1118.  
  1119.   ╖  Redo the disk image
  1120.  
  1121.   ╖  Copy the new image in place of the old one on the server
  1122.  
  1123.      That means, you can upgrade software on your server-based
  1124.      configuration as if it were a purely local install.
  1125.  
  1126.  
  1127.   4.6.  Setting up Windows 95
  1128.  
  1129.   In previous versions of this document, we used the Microsoft server-
  1130.   based installation of Windows 95, but it was really too much pain and
  1131.   not much worth:
  1132.  
  1133.   ╖  It is very, very bogus
  1134.  
  1135.   ╖  Many software package do not support it and their install will
  1136.      fail.  Among them, Microsoft Internet Explorer, OnNet 32, Novell's
  1137.      Protected-mode client (which is MUCH more secure than Microsoft
  1138.      Client for Netware).
  1139.  
  1140.   ╖  It cannot be used with the Microsoft Network client over TCP/IP,
  1141.      since Microsoft provides no real-mode driver for TCP/IP compatibe
  1142.      with Windows 95. That means, it cannot be used with Samba
  1143.  
  1144.   ╖  It makes software upgrades almost impossible since every client
  1145.      turned on will lock many DLLs on the server, and thus produce
  1146.      sharing violations if you try to upgrade them.
  1147.  
  1148.      Consequently, we throwed away of this document all the informations
  1149.      and bug-workaround collected during months (you can still find them
  1150.      as a HTML document at http://cuiwww.unige.ch/info/pc/remote-
  1151.      boot/win95old/win95old.html) and turned to our new disk-based
  1152.      remote-boot concept.  Basically, the configuration for Windows 95
  1153.      is now almost as easy the configuration for DOS.
  1154.  
  1155.  
  1156.   4.6.1.  Setting up a Stand-Alone Client
  1157.  
  1158.   Setup a regular Windows 95 client, either starting from scratch as
  1159.   explained in the configuration of a DOS client, starting from the DOS
  1160.   client and installing over the network (that is what we did).  You can
  1161.   also start with a preconfigured Windows machine, but you will probably
  1162.   have less knowledge of what stuff is on the hard disk.
  1163.  
  1164.   Proceed as described above for a DOS client. It is usually NOT
  1165.   necessary to use EMM386 with Windows 95.  If you are using Windows 95
  1166.   OSR2 (alias MSWIN 4.1, alias Windows 95 service pack 1, alias Windows
  1167.   95 with Internet Explorer), you should add the following line in the
  1168.   [Options] section of MSDOS.SYS (yes, it is a text file):
  1169.  
  1170.  
  1171.        ______________________________________________________________________
  1172.        AUTOSCAN=0
  1173.        ______________________________________________________________________
  1174.  
  1175.  
  1176.  
  1177.  
  1178.   This will let Windows know that you do not want ScanDisk to be runned
  1179.   automatically at boot time.
  1180.  
  1181.   If you want to reduce network and server load (which will improve your
  1182.   system performances) while keeping all softwares on the server, you
  1183.   should consider installing the excellent Shared LAN Cache, from
  1184.   Measurement Techniques, Inc (see http://www.lancache.com).  This
  1185.   software runs on each client computer, and caches to the local hard
  1186.   disk every data obtained from the network. Even MS-Office starts much
  1187.   faster the second time you run it... You need one license per client
  1188.   computer, but it is not very expensive, and the firm make special
  1189.   prices for universities and colleges. The best thing to do is to go to
  1190.   their Web site and download the free evaluation copy.
  1191.  
  1192.  
  1193.   4.6.2.  Building the Disk Image
  1194.  
  1195.   Your MrZip script will be named zipwin95.mrz and contain:
  1196.  
  1197.  
  1198.        ______________________________________________________________________
  1199.        showlog
  1200.        filter -"temp/*"
  1201.        filter -"*.swp"
  1202.        fullzip "c:/" "L:/tftpboot/win95.imz"
  1203.        ______________________________________________________________________
  1204.  
  1205.  
  1206.  
  1207.  
  1208.   To build the image, mount the admin volume on drive L:, go to your
  1209.   utils directory and type the following command:
  1210.  
  1211.           mrzip -b zipwin95
  1212.  
  1213.  
  1214.  
  1215.   A few minutes later, you will have a new file if the server /tftpboot
  1216.   subdirectory called win95.imz, which is a compressed image of your
  1217.   hard disk. If your compressed image was bigger than 87 MB, it has
  1218.   probably been splitted in two or more fragments.  These fragments will
  1219.   automatically loaded one after the other when needed. Note that an
  1220.   image bigger than 87 MB will usually take More than one minute to
  1221.   uncompress and may irritate your users.  Our Windows 95 image is only
  1222.   70 MB big, because most software (except Office and Explorer)
  1223.   completely reside on the server. Only 45 seconds are needed to
  1224.   uncompress the image and restore the full disk.
  1225.  
  1226.   Copy the following batch file to /tftpboot/win95.bpb:
  1227.  
  1228.  
  1229.        ______________________________________________________________________
  1230.        hidelog
  1231.        setpartitions "bigdos:1024"
  1232.        setbootpart 1
  1233.        fullunzip "win95.imz" 1
  1234.        hidebootprom
  1235.        hdboot :1
  1236.        ______________________________________________________________________
  1237.  
  1238.  
  1239.  
  1240.  
  1241.   Your remote-boot Windows 95 configuration is ready ! You can now
  1242.   either set the BOOTP-option-155 to "win95", or type include
  1243.   "win95.bpb" from within BpBatch to test it.
  1244.  
  1245.  
  1246.   4.6.3.  Adapting the configuration for other Machines
  1247.  
  1248.   The big difference between Windows 3.1 and Windows 95 is that the
  1249.   later includes code for Plug-and-play , ie. automatic detection of
  1250.   your hardware. This not a bad thing in itself, but the trouble is that
  1251.   it is often too sensible, and that it sometimes fails.
  1252.  
  1253.   If you try to start another client with exactly the same boot image,
  1254.   you will probably get several messages during startup telling that
  1255.   Windows has detected new hardware: a new sound card, a new hard-disk,
  1256.   a new network card, and even a new mouse... There can be two reasons
  1257.   for that:
  1258.  
  1259.   ╖  the devices may not use the same ressources (for instance the mouse
  1260.      is not connected on the same port, or the sound card is not
  1261.      connected in the same slot - yes, that is detected)
  1262.  
  1263.   ╖  the devices may tell to Windows 95 their personal serial number
  1264.      (for instance, every Windows 95 differenciate every network card on
  1265.      the basis of its world-wide unique ethernet address)
  1266.  
  1267.      The fact that Windows 95 discover that the hardware has changed may
  1268.      not be a problem if the plug-and-play works as-is, but it become a
  1269.      problem when the plug-and-play does not work. For instance, Windows
  1270.      95 plug-and-play for our Logitech PS2/aux mouse does not work, and
  1271.      result in no mouse at all. To solve such kind of problems, arrange
  1272.      to have all computers as similar as possible, or make different
  1273.      images for different hardware. Later, you will discover that you
  1274.      can simply use the same image and just have several copies of the
  1275.      registery, that you can copy after having restoring the disk image
  1276.      but before booting.
  1277.  
  1278.   The thing you cannot avoid to differ between computers is the network
  1279.   card. PCI cards usually do not mind, but ISA Plug and Play do.  Bad
  1280.   luck for us, the plug-and-play code for our SMC EtherEZ card hangs the
  1281.   computer. The only solution is to let Windows 95 believe that it
  1282.   already know the network card, and that it is not necessary to trigger
  1283.   plug-and-play. The trick for doing that is to automatically insert an
  1284.   entry for the network card in Windows 95 registery, before starting
  1285.   it.  Note that this trick is not any more needed with most PCI cards.
  1286.  
  1287.   Move the autoexec.bat to the server as described above for DOS.  Edit
  1288.   it (on the server) and add the following lines:
  1289.  
  1290.   rem --- Patch Windows registery in order to avoid plug-and-play detection
  1291.   regedit /L:c:\windows\system.dat /R:c:\windows\user.dat c:\temp\patch.reg
  1292.  
  1293.  
  1294.   regedit is a standard Windows 95 program that let you browse the reg¡
  1295.   istery if you start it from within Windows 95, or do simple operations
  1296.   on the registery if you call it from DOS.  Run regedit under Windows
  1297.   95, search for your network card, usually under
  1298.  
  1299.           HKEY_LOCAL_MACHINE\Enum\ISAPNP
  1300.  
  1301.  
  1302.   and export the branch using the File menu. This will create a text
  1303.   file, that you should same as patch.ref in the server /tftpboot dire¡
  1304.   tory. Edit this file and find out where the card ethernet address is
  1305.   stored (do that on two different machines and compare the files if you
  1306.   can't find it by yourself). Replace it by a pettern in the form
  1307.   ${MACID}.  Then add lines to the win95.bpb script like this:
  1308.  
  1309.           set macid = "$BOOTP-Client-ID"
  1310.           patch "patch.ref" "{:1}temp/patch.reg"
  1311.  
  1312.  
  1313.   (do any necessary string manipulation for setting MACID if it is not
  1314.   exactly the client Ethernet address).  That's all, your clients should
  1315.   not any more try to autodect the network card.
  1316.  
  1317.   Once again, this whole trick is not necessary when using PCI network
  1318.   adapters.  Incidentally, we can use the same mechanism for
  1319.   automatically configuring the hostname, which Windows 95 does not seem
  1320.   to take into account when configuring through DHCP. We just add the
  1321.   following line to our patch.ref file:
  1322.  
  1323.  
  1324.        ______________________________________________________________________
  1325.        [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\VNETSUP]
  1326.        "ComputerName"="${BOOTP-Host-Name}"
  1327.  
  1328.        [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\VxD\MSTCP]
  1329.        "HostName"="${BOOTP-Host-Name}"
  1330.  
  1331.        [HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\ComputerName\ComputerName]
  1332.        "ComputerName"="${BOOTP-Host-Name}"
  1333.        ______________________________________________________________________
  1334.  
  1335.  
  1336.  
  1337.  
  1338.   Using this small registery trick, your configuration should normally
  1339.   be portable for all machines with similar configurations. If you
  1340.   cannot avoid that Windows detect some hardware as new on one machine,
  1341.   try to rebuild the disk image from this machine. This will include the
  1342.   registery configuration specific to this machine into the image, and
  1343.   hopefully supress the problem.
  1344.  
  1345.  
  1346.   4.6.4.  System Maintenance and Upgrades
  1347.  
  1348.   If you want later to upgrade software, install bug fixes and security
  1349.   fixes, proceed as follow:
  1350.  
  1351.   ╖  Remote-boot a client computer to get a fresh install
  1352.  
  1353.   ╖  Make your changes
  1354.  
  1355.   ╖  Redo the disk image
  1356.  
  1357.   ╖  Copy the new image in place of the old one on the server
  1358.  
  1359.      That means, you can upgrade software on your server-based
  1360.      configuration as if it were a purely local install.
  1361.  
  1362.  
  1363.   4.7.  Setting up Windows NT
  1364.  
  1365.   We do not use Windows NT for remote-boot client computers but we have
  1366.   tested our system to ensure that it work as well. And it works.
  1367.  
  1368.   As our utilities currently have no support for NTFS (we neither have
  1369.   the documentation nor the time to do that, but I would be happy to
  1370.   help anyone who is interested in doing it), you will have to install
  1371.   NT on FAT16 (simply do not convert your partitions to NTFS during the
  1372.   setup).
  1373.  
  1374.   Copy your win95.bpb boot script to winnt.bpb.  Change the
  1375.   setpartitions line in winnt.bpb to the following:
  1376.  
  1377.           setpartitions "BIGDOS:512 BIGDOS:512"
  1378.  
  1379.  
  1380.   Then boot Windows 95 using this script, and install your NT client on
  1381.   drive C. Do not worry about the second partition for now.  Do not
  1382.   install too much stuff, or you will get a really large and slow-to-
  1383.   uncompress image.  Remove Windows 95 from the disk disk C, you do not
  1384.   need it in a Windows NT image (the boot menu is handled by the boot¡
  1385.   prom, not by NT boot loader).
  1386.  
  1387.   Reboot your computer in without overwriting the hard disk, ie. do not
  1388.   execute the winnt script but just
  1389.  
  1390.           hidebootprom
  1391.           hdboot
  1392.  
  1393.  
  1394.   Your NT station should start-up correctly. Make any necessary cus¡
  1395.   tomization.
  1396.  
  1397.  
  1398.   4.7.1.  Building the Disk Image
  1399.  
  1400.   The trouble with Windows NT is that direct disk access is prohibed by
  1401.   the kernel. That means, MrZip will not even be able to read the boot
  1402.   sectors. The best way to do an image is then to boot Windows 95 and to
  1403.   run MrZip from a DOS window. To do that, change the winnt.bpb script
  1404.   so that the Windows 95 image is not restored on the first but on the
  1405.   second partition:
  1406.  
  1407.  
  1408.        ______________________________________________________________________
  1409.        hidelog
  1410.        setpartitions "BIGDOS:512 BIGDOS:512"
  1411.        setbootpart 2
  1412.        fullunzip "win95.imz" 2
  1413.        hidebootprom
  1414.        hdboot :2
  1415.        ______________________________________________________________________
  1416.  
  1417.  
  1418.  
  1419.  
  1420.   (if you have any supplementary patch, change the "{:1}" to "{:2}").
  1421.   Boot with this script; you should have Windows 95 running, but a new
  1422.   drive D: should be available, with Windows NT inside.
  1423.  
  1424.   Make your disk image as usual (but on D:, of course), and save it as
  1425.   winnt.imz on the server /tftpboot directory.  Edit one last time the
  1426.   winnt.bpb script like this:
  1427.  
  1428.  
  1429.        ______________________________________________________________________
  1430.        hidelog
  1431.        setpartitions "BIGDOS:512 BIGDOS:512"
  1432.        setbootpart 1
  1433.        fullunzip "winnt.imz" 1
  1434.        clean 2
  1435.        #fullunzip "win95.imz" 2
  1436.        hidebootprom
  1437.        hdboot :1
  1438.        ______________________________________________________________________
  1439.  
  1440.  
  1441.  
  1442.  
  1443.   Your Windows NT remote-boot configuration is ready. Of course, if you
  1444.   do not like to have two partitions, you can setup a single partition
  1445.   instead. But when you have to rebuild the image, you will have to
  1446.   setup the second partition again for booting Windows 95.
  1447.  
  1448.  
  1449.   4.7.2.  System Maintenance and Upgrades
  1450.  
  1451.   If you want later to upgrade software, install bug fixes and security
  1452.   fixes, proceed as follow:
  1453.   ╖  Remote-boot a client computer to get a fresh install
  1454.  
  1455.   ╖  Make your changes
  1456.  
  1457.   ╖  Edit winnt.bpb: comment the clean and winnt fullunzip, uncomment
  1458.      win95 fullunzip
  1459.  
  1460.   ╖  Redo the disk image
  1461.  
  1462.   ╖  Copy the new image in place of the old one on the server
  1463.  
  1464.      That's all, folks !
  1465.  
  1466.  
  1467.   4.8.  Troubleshooting
  1468.  
  1469.   This section lists most frequently encountered problems.
  1470.  
  1471.      The image download never ends
  1472.         You are probably using a standard TFTP server, and it cannot
  1473.         handle more than 65535 packets of 512 bytes (or even 32767
  1474.         packets for the Solaris server). That is, your image must be
  1475.         fragmented in pieces of no more than 30 MB (or 15 MB for
  1476.         Solaris). See under CopyArchive for instructions on fragmenting
  1477.         an existing image. But you should seriously thing about using
  1478.         InCom's extended TFTP server, as it is much more efficient (it
  1479.         uses packets of 1408 bytes instead of 512 bytes).
  1480.  
  1481.      The archive decompression fails immediately
  1482.         There are two possibilities. Either the image is really
  1483.         corrupted on the server (try use MrZip to see if it is the
  1484.         case), or the file transfer has failed because of TFTP timeout.
  1485.         TFTP timeout occurs when the network is too heavily loaded (for
  1486.         instance if you try to download a huge image with more than four
  1487.         clients at a time). In this case, BpBatch does not retry
  1488.         indefinitely because it would not help. Shut down a few
  1489.         computers and retry with no more than four computers (or maybe
  1490.         even three).  If you often need to download images for a lot of
  1491.         computers, you can try our special Broadcast TFTP server (see
  1492.         the section dedicated to it).
  1493.  
  1494.      The computer hangs instead of downloading/unzipping
  1495.         May be your computer has a bad VESA support. Try giving the -v
  1496.         command-line argument or setting the VESA variable to "OFF".
  1497.  
  1498.      VESA scrolling is broken
  1499.         We use a VESA 1.1 function for scrolling. If your video adapter
  1500.         does not support VESA 1.1, forget it. If the scrolling works for
  1501.         one page, but then produces a strange strippled pattern, do not
  1502.         worry. This is a known bug, I will fix it as soon as I have time
  1503.         for it (VESA scrolling is not really essential...)
  1504.  
  1505.      There is a corrupted file in the cache
  1506.         When a file in the cache is corrupted by an external program, it
  1507.         is automatically removed from the cache. When a file in the
  1508.         cache is not fully written (because the computer is turned off
  1509.         during the file transfer), it is also automatically removed. But
  1510.         if the server transmits a corrupted file or if the transfer
  1511.         aborts from the server side, it is possible that this file stays
  1512.         in the cache. You can clean-up the cache simply by holding both
  1513.         shift down while BpBatch access it for the first time.
  1514.         Alternatively, you can evaluate clean -1 in interactive mode.
  1515.  
  1516.      The EXIT command does not work in a batch file
  1517.         This is not a bug. Exit is not a command.  There is no exit or
  1518.         quit command because it does not make any sense to exit from a
  1519.         boot script without booting. And MrBatch is really the same
  1520.         program as BpBatch.  What you can do instead is calling HdBoot.
  1521.         This makes sense, and the DOS version will cleanly exit instead
  1522.         of rebooting.  Note that you can exit from the DOS version at
  1523.         any time by pressing Ctrl-Break. This will restore all hooked
  1524.         interrupts before leaving.
  1525.  
  1526.      The Print command does not print
  1527.         If you try to print something and immediately enter interactive
  1528.         mode, you may not see your text. This is because your text was
  1529.         written on the runtime screen and the Interact command has
  1530.         switched the display to the Log screen. Just put a GetKey after
  1531.         the print commands and you will see the text output.
  1532.  
  1533.      MrZip says Malloc failed
  1534.         MrZip needs a lot of conventional memory to run.  If you
  1535.         encounter this problem, first ensure that you have unloaded the
  1536.         bootprom either using HideBootprom or using InCom's bputil.  If
  1537.         you run MrZip from bare MS-DOS (not within Windows 95 DOS box),
  1538.         you should use EMM386 to load the network drivers high in order
  1539.         to get as much conventional memory as possible. From a Windows
  1540.         95 DOS box, there is usually no problem (as long as you have not
  1541.         left your old 16-bit stuff in your autoexec.bat when you
  1542.         installed Windows 95).
  1543.  
  1544.      MrZip aborts while reading directories
  1545.         This bug has already been fixed once. Get the latest release of
  1546.         MrZip. If the problem persists, try to build your image with
  1547.         Trace set to "ON" (and usually PauseLog set to "OFF"); this will
  1548.         let you discover which file causes the problem. Send a detailled
  1549.         bug report.
  1550.  
  1551.      MrZip cannot access some file
  1552.         MrZip is probably trying to read a locked, open or special file,
  1553.         such as Windows swap file. Such files should usually not be
  1554.         included in the image and should be filtered out (using the
  1555.         filter command).  It is also possible that the operating system
  1556.         is playing you a trick.  If MrZip does not tell you what file
  1557.         causes the problem, try to build your image with Trace set to
  1558.         "ON" (and usually PauseLog set to "OFF").  You can also try to
  1559.         use direct disk access (that is, do not refer the source
  1560.         partition as "C:" or "/" but as "{:1}" or whatever partition it
  1561.         is). Using direct disk access is usually slower because we have
  1562.         less buffers than the operating system, but it may be sometimes
  1563.         more reliable.
  1564.  
  1565.      Disk images are always reloaded from the server
  1566.         Disk images are stored in the special cache area and should not
  1567.         be reloaded if they have not changed on the server. However, as
  1568.         the cache area always starts after the last used partition,
  1569.         changing the total size of partitions will move the location of
  1570.         the cache and thus destroy its content. Another possible reason
  1571.         for a file disappearing from the cache is that the previous file
  1572.         has grown more than one-and-an-half times its initial size. The
  1573.         file would then have been overwritten and need to be downloaded
  1574.         once again. This should almost never occurs.  A third possible
  1575.         reason is a too small cache area. If the free space left outside
  1576.         the partitions is less than one-and-an-half times the sum of all
  1577.         compressed image sizes, only the most recently used images will
  1578.         be present in the cache and the other will have to be reloaded
  1579.         on demand.
  1580.  
  1581.      Red Hat Linux 5.1 does not boot properly
  1582.         This distribution assumes Linux was booted using lilo and checks
  1583.         for the BOOT_IMAGE command line argument (in
  1584.         /etc/rc.d/rc.sysinit). Simply add it in the linuxboot call, or
  1585.         change your rc.sysinit.
  1586.  
  1587.      The broadcast TFTP ramdisk hangs (Got in bound state)
  1588.         Linux dhcp client is a program that dynamically changes the IP
  1589.         address of the client according to DHCP offers. If the address
  1590.         is offered forever (infinite lease time), the DHCP client just
  1591.         set the address and returns (this is what we expect).  However,
  1592.         if the lease time is limited, the DHCP client must remain loaded
  1593.         and ask for new addresses every few minutes. And if the DHCP
  1594.         client does not return, MrBatch will never be loaded...  The
  1595.         solution is to give an infinite lease time (sometimes encoded as
  1596.         -1).
  1597.  
  1598.      File access hangs under BpBatch, but not under MrBatch
  1599.         This problem occured on an AMI BIOS dated 94/07/25. We
  1600.         investigated a little bit, and found no solution. It seems that
  1601.         this problem is due to a bug in this BIOS (some register or
  1602.         memory location must be destroyed).
  1603.  
  1604.      Unzip of a fragmented archive fails (Malloc failed)
  1605.         This problem was introduced with PXE compatibility, but has now
  1606.         been fixed. Please get the latest version.
  1607.  
  1608.      MrBatch and MrZip complain about the terminal under RedHat 5.x
  1609.         This problem is due to libc6, which is not fully downward
  1610.         compatible with libc5. Linux version was linked with libc5. With
  1611.         the growing number of complaints, we decided to move the
  1612.         distribution to libc6.  If you encounter this problem, simply
  1613.         get the latest version.
  1614.  
  1615.      MrBatch and MrZip do not start under Linux (file not found)
  1616.         This problem is the reverse of the previous one. Now that the
  1617.         distribution is libc6 ready, it cannot be used any more with
  1618.         libc5. If you encounter this problem, simply upgrade your Linux
  1619.         box (Well, if we hear too much complaints, we might try to keep
  1620.         two distributions...).
  1621.  
  1622.  
  1623.   5.  Remote-Boot Tools Reference Manual
  1624.  
  1625.   This section provides detailled informations on the use of the tools
  1626.   we developped at the CUI, University of Geneva for this remote-boot
  1627.   configuration.
  1628.  
  1629.  
  1630.   5.1.  BpBatch, MrBatch and MrZip
  1631.  
  1632.   These three names stand for three variants of the same program, with
  1633.   the following characteristics:
  1634.  
  1635.   ╖  BpBatch is a special program that can be started from the BootProm
  1636.      before the operating system is loaded. It is made of two parts:
  1637.      bpbatch.P, the dynamic loader, and bpbatch.ovl, the program itself.
  1638.      BpBatch has full disk I/O capabilities through our own
  1639.      implementation of FAT16, FAT32 and Ext2fs, as well as remote
  1640.      network I/O capabilities through the BootProm TFTP API.  BpBatch
  1641.      was compiled under DOS using Borland C 5.0 and Turbo Assembler 3.2.
  1642.  
  1643.   ╖  MrBatch is the DOS/Linux version of BpBatch.  All commands
  1644.      recognized by BpBatch are recognized by MrBatch and vice versa.
  1645.      This is very usefull if you want to test your batch scripts from a
  1646.      DOS/Linux session.  Under DOS, MrBatch emulates remote I/O by OS-
  1647.      based file access if the bootprom is not available. Under Linux,
  1648.      the bootprom cannot be seen anymore but MrBatch can emulate it
  1649.      using Linux IP support, or use OS-based file access.  MrBatch was
  1650.      compiled under Linux using GCC 2.7.2.1 and under DOS using Borland
  1651.      C 5.0 and Turbo Assembler 3.2.
  1652.  
  1653.   ╖  MrZip is an interpreter that recognizes a superset of MrBatch
  1654.      language, and that serves to build disk images.  In MrZip, the
  1655.      limited remote file I/O is replaced by a full-featured OS-based
  1656.      file access. MrZip does not include VESA support.  MrZip was
  1657.      compiled under Linux using GCC 2.7.2.1 and under DOS using Borland
  1658.      C 5.0 and Turbo Assembler 3.2.
  1659.  
  1660.  
  1661.   5.1.1.  Command Line Arguments
  1662.  
  1663.   All programs accept the same syntax of arguments. MrBatch and MrZip
  1664.   take them from the command line, while BpBatch look for them in the
  1665.   BOOTP option 155 (decimal). Here is the syntax of the arguments:
  1666.  
  1667.           [-x] [-l] [-b] [-v] [-w] [-i] [script-basename]
  1668.  
  1669.  
  1670.   where:
  1671.  
  1672.   ╖  -x disable the use of extended memory
  1673.  
  1674.   ╖  -l disable the use of ISO-latin-8859-1 as default character set
  1675.  
  1676.   ╖  -b cancel the bootprom detection (which cause a floppy seek under
  1677.      DOS)
  1678.  
  1679.   ╖  -v cancel the VESA detection (which cause a switch to full screen
  1680.      under Windows 95)
  1681.  
  1682.   ╖  -w enable direct disk write access (disabled by default under DOS
  1683.      and Linux)
  1684.  
  1685.   ╖  -i enable interactive mode even if a script name is provided
  1686.  
  1687.      The script-basename is optional. If provided, MrBatch and BpBatch
  1688.      load the file with the .bpb extension, and MrZip loads the file
  1689.      with the .mrz extension. If not provided, MrBatch and MrZip run in
  1690.      interactive mode while BpBatch loads the file with the same
  1691.      basename as the BOOTP Boot file and a .bpb extension.
  1692.  
  1693.  
  1694.   5.1.2.  Syntax rules
  1695.  
  1696.   The following rules apply when BpBatch parses an input line.
  1697.  
  1698.   ╖  Commands are parsed line by line. Lines are separated by CR and/or
  1699.      LF.
  1700.  
  1701.   ╖  The maximal line length is currently 255 characters.
  1702.  
  1703.   ╖  Keywords and variable names are case-insensitive.
  1704.  
  1705.   ╖  " is interpreted as the special string delimiter
  1706.  
  1707.   ╖  When ${variable} or $variable is encountred, it is substituted by
  1708.      the value of the variable, or by an empty string if the variable is
  1709.      undefined.  The substitution also occurs within a string. Moreover,
  1710.      the resulting substituted value must be explicitely enclosed
  1711.      between double quotes if used as a string value (ie. one should
  1712.      merely speak of macro expansion than of a variables).
  1713.  
  1714.   ╖
  1715.  
  1716.  
  1717.   ╖  \a is substituted by the audible-bell character (ASCII 7)
  1718.  
  1719.   ╖  \b is substituted by the backspace character (ASCII 8)
  1720.  
  1721.   ╖  \n is substituted by the newline character (ASCII 10)
  1722.  
  1723.   ╖  \r is substituted by the return character (ASCII 13)
  1724.  
  1725.   ╖  \t is substituted by the tabulation character (ASCII 9)
  1726.  
  1727.   ╖  \v is substituted by the vertical-tab character (ASCII ...)
  1728.  
  1729.   ╖  \nnn where n is a 3-digit octal number between 000 and 377 is
  1730.      substituted by the character with ascii code specified
  1731.  
  1732.   ╖  \X where X is any other character not listed above is substituted
  1733.      by X itself. In particular,
  1734.  
  1735.   ╖  \" is substituted by a regular double-quote (not a string-
  1736.      delimiter)
  1737.  
  1738.   ╖  \$ is substituted by a regular dollar sign (not variable
  1739.      substitution)
  1740.  
  1741.   ╖  \\ is substituted by a regular backslash (not a special character)
  1742.  
  1743.   ╖  The character "end of string" (ASCII code 0) CANNOT be used
  1744.      anywhere as it is used internally as end-of-string delimiter
  1745.  
  1746.   ╖  The character "floating diaeresis" (ASCII code dec 249, hex F9,
  1747.      octal 371) CANNOT be used in any string as it is used internally as
  1748.      string delimiter in the input parsing routine.
  1749.  
  1750.   ╖  The character "block space" (ASCII code dec 255, hex FF, octal 377)
  1751.      CANNOT be used in any variable value as it is used internally as
  1752.      variable delimiter.
  1753.  
  1754.   Empty lines are ignored.  Lines starting with a sharp (#) are treated
  1755.   as comments and are not interpreted.  Lines starting with a column (:)
  1756.   are treated as labels and are not interpreted.
  1757.  
  1758.  
  1759.      String expressions
  1760.         Strings are delimited by opening and closing double-quotes:
  1761.  
  1762.                 "Hello world"
  1763.  
  1764.  
  1765.      To include double-quotes within a string, quote them using a back¡
  1766.      slash:
  1767.  
  1768.              "I said: \"Hello world\""
  1769.  
  1770.  
  1771.      Strings can be postfixed with a few operators.
  1772.  
  1773.      ╖  The character substitution operator:
  1774.  
  1775.                 "Hello world"/o=u/      ==      "Hellu wurld"
  1776.                 "198.76.54.32"/.= /     ==      "198 76 54 32"
  1777.  
  1778.  
  1779.  
  1780.      ╖  The word selection operator (zero-based):
  1781.  
  1782.  
  1783.                 "Hello world"{0}        ==      "Hello"
  1784.                 "198 76 54 32"{1-3}     ==      "76 54 32"
  1785.  
  1786.  
  1787.  
  1788.      ╖  The substring selection operator (zero-based):
  1789.  
  1790.                 "Hello world"[4]        ==      "o"
  1791.                 "Hello world"[4-7]      ==      "o wo"
  1792.  
  1793.  
  1794.  
  1795.      Operators can be chained by postfixing one after the other.  For
  1796.      informations about the string length and word count operators, see
  1797.      under "Numerical expressions".
  1798.  
  1799.  
  1800.      Numerical expressions
  1801.         Numerical expressions work on 32-bits integer numbers (from
  1802.         -2,147,483,646 to 2,147,483,647). Hexadecimal octal and binary
  1803.         numbers are not understood.  Whenever a numerical expression is
  1804.         expected, the following are recognized:
  1805.  
  1806.      ╖  A positive or negative integer number
  1807.  
  1808.      ╖  An expression in the form (expr1 op expr2) where op can be
  1809.         either +, -, * (multiply), / (divide) or % (modulo) and expr is
  1810.         a numerical expression.  Note that EACH operation MUST be
  1811.         enclosed between parenthesis :
  1812.  
  1813.                 ((3 * 5)+2)             == 17
  1814.  
  1815.  
  1816.  
  1817.      ╖  The string-length operator (@), followed by a string :
  1818.  
  1819.                 @"Hello world"          == 11
  1820.  
  1821.  
  1822.  
  1823.      ╖  The word-count operator (#) followed by a string :
  1824.  
  1825.                 #"Hello world"          == 2
  1826.  
  1827.  
  1828.  
  1829.  
  1830.      Durations
  1831.         A few commands expect durations as arguments. Durations are
  1832.         measured in seconds, with a precision of up to a tenth of
  1833.         second:
  1834.  
  1835.                 Delay 3                 waits for 3 seconds
  1836.                 Delay 0.3               waits for 3/10 seconds
  1837.  
  1838.  
  1839.  
  1840.  
  1841.      Colors
  1842.         Whenever a color is expected, you can either use the numeric
  1843.         value of the color or its symbolic name (case-insensitive).  The
  1844.         following colors are recognized
  1845.  
  1846.  
  1847.  
  1848.  
  1849.                 Black           0
  1850.                 Blue            1
  1851.                 Green           2
  1852.                 Cyan            3
  1853.                 Red             4
  1854.                 Magenta         5
  1855.                 Brown           6
  1856.                 LightGray       7
  1857.                 DarkGray        8
  1858.                 LightBlue       9
  1859.                 LightGreen     10
  1860.                 LightCyan      11
  1861.                 LightRed       12
  1862.                 LightMagenta   13
  1863.                 Yellow         14
  1864.                 White          15
  1865.  
  1866.  
  1867.  
  1868.  
  1869.      File References
  1870.         File names are strings. They must therefore always be enclosed
  1871.         between double-quotes. File names are case-sensitive on case-
  1872.         sensitive filesystems, case-insensitive on case-insensitive
  1873.         filesystems.  Slash and backslash can be freely used one in
  1874.         place of the other.  Do not forget to double backslash since a
  1875.         single backslash is an escape character.
  1876.  
  1877.         There are two kinds of file references:
  1878.  
  1879.      ╖  Direct disk files
  1880.  
  1881.      ╖  Foreign files
  1882.  
  1883.         Direct disk files are referenced using the following notation:
  1884.  
  1885.                 "{disk:partition}/absolute/filename"
  1886.  
  1887.  
  1888.      The disk number can be omitted and defaults to zero.  For instance,
  1889.      "{:1}/usr/bin" points to /usr/bin assuming there is such a direc¡
  1890.      tory on the first partition. Direct file I/O is solely based on our
  1891.      own file access routines (we do not use the operating system).
  1892.  
  1893.      There are two special partitions. Partition zero corresponds to the
  1894.      hard disk master boot record (MBR) and has a pseudo file-system
  1895.      which let you access the boot code. Partition minus-one (-1)
  1896.      corresponds to the cache filesystem (see below).
  1897.  
  1898.      Under BpBatch/MrBatch, foreign files correspond to remote files on
  1899.      the TFTP server when the BootProm is available:
  1900.  
  1901.              "help.bpb"           is the file help.bpb in the /tftpboot directory
  1902.              "gifs/MyImage.gif"   is a file in /tftpboot/gifs
  1903.  
  1904.  
  1905.      Other TFTP servers can be referenced :
  1906.  
  1907.              "198.76.54.32:help.bpb"
  1908.  
  1909.  
  1910.      If the other server is behind a gateway :
  1911.  
  1912.              "198.70.0.1/198.76.54.31:help.bpb"
  1913.  
  1914.  
  1915.      One can also specify a specific port for the TFTP connection :
  1916.  
  1917.              "198.76.54.32@89:getpasswd/smith"
  1918.  
  1919.  
  1920.      There can be only one open remote file at a time.  If the BootProm
  1921.      is not available, remote files are emulated using the operating
  1922.      system file I/O, but the same restriction apply.
  1923.  
  1924.      Under MrZip, foreign files correspond to files as seen by the
  1925.      operating system. There is no limitation, and foreign files can be
  1926.      used wherever direct disk files can be. Foreign files are usually
  1927.      faster than direct disk files, because the operating system has
  1928.      more buffers. Foreign files can refer to network files if supported
  1929.      by the operating system.
  1930.  
  1931.              "C:\\autoexec.bat"
  1932.              "C:/config.sys"
  1933.              "/mnt/net/usr"
  1934.  
  1935.  
  1936.  
  1937.  
  1938.   5.1.3.  The Cache Filesystem
  1939.  
  1940.   In order to reduce network load and to fasten the boot process, disk
  1941.   archives, linux kernels and possibly other files are cached on the
  1942.   hard disk. This disk cache is located at the end of the hard disk,
  1943.   between the last cylinder allocated in the partition table and the
  1944.   last physical cylinder of the disk (out of any allocated partition).
  1945.   There MUST be room between the last partition and the end of the disk
  1946.   if you want the cache filesystem to work.  The cache filesystem MUST
  1947.   work if you want to restore a disk image.
  1948.  
  1949.   The disk cache is organised in a volatile, CRC-validated filesystem :
  1950.   Each directory entry and each 32 KB data block is validated by a
  1951.   32-bits CRC. Whenever a directory entry or a data block unexpectedly
  1952.   changes, the file is automatically removed from the cache and
  1953.   downloaded again upon the next request.
  1954.  
  1955.   You can freely access the cache filesystem from within BpBatch,
  1956.   MrBatch and MrZip using direct disk access on the special partition
  1957.   "{:-1}".  To see the content of the cache, just type :
  1958.  
  1959.           logdir "{:-1}"
  1960.  
  1961.  
  1962.   If the cache ever gets corrupted and is not automatically cleaned
  1963.   (which should never occurs), you can either type :
  1964.  
  1965.           clean -1
  1966.  
  1967.  
  1968.   (in interactive mode) or hold both shifts down when BpBatch access the
  1969.   cache for the first time.
  1970.  
  1971.  
  1972.   5.1.4.  Special variables
  1973.  
  1974.   Some variable are initially set and/or have special meanings.  Some of
  1975.   them exist within all programs, other are only available under MrZip
  1976.   and other are only available when a BOOTP/DHCP reply has been
  1977.   received.
  1978.  
  1979.  
  1980.  
  1981.      General variables
  1982.  
  1983.      ╖  $Program is set to "BpBatch" within BpBatch, "MrBatch" within
  1984.         MrBatch and "MrZip" within MrZip
  1985.  
  1986.      ╖  $Basename is set to the basename of the script on which the
  1987.         batch interpreter was started
  1988.  
  1989.      ╖  $HelpFile is the name of the file loaded when Help is invoked.
  1990.         Default: "${Basename}.hlp"
  1991.  
  1992.      ╖  $BOOTP-... are variables set from the BOOTP/DHCP reply (see the
  1993.         paragraph on BOOTP/DHCP variables for more details)
  1994.  
  1995.      ╖  $DHCP-... are variables set from the DHCP reply (see the
  1996.         paragraph on BOOTP/DHCP variables for more details)
  1997.  
  1998.      ╖  $Disks is set to the space-separated list of sizes for each
  1999.         disk.  That means, #"$Disks" represent the number of disks and
  2000.         "$Disks"{0} is the size of the first disk
  2001.  
  2002.      ╖  $Keypressed is set to the next ready-to-read key available in
  2003.         the keyboard buffer (if available)
  2004.  
  2005.      ╖  $LBA    controls the use of LBA to access disks > 2Gb.  Default:
  2006.         "ON"
  2007.  
  2008.      ╖  $FDA    controls the use of fast disk access (write accross
  2009.         cylinders).  Default: "ON"
  2010.  
  2011.      ╖  $VESA   controls the use of VESA graphics.  Default: "ON" if
  2012.         available
  2013.  
  2014.      ╖  $Trace controls the display of each command before execution. It
  2015.         also controls the display of file names when creating new
  2016.         archives.  Default: "OFF"
  2017.  
  2018.      ╖  $AutoShowLog controls the automatic switch to the text log
  2019.         whenever the ESC key is pressed.  Default: "ON"
  2020.  
  2021.      ╖  $PauseLog controls the pause between each page of log when the
  2022.         log is visible.  Default: "ON"
  2023.  
  2024.      ╖  $CacheDisk is set to the disk used for caching remote files.
  2025.         Default: empty == 0, the first hard disk
  2026.  
  2027.      ╖  $CacheAlways controls the automatic caching of remote files
  2028.         copied, patched or drawn as GIF.  Default: "OFF"
  2029.  
  2030.      ╖  $CacheNever prevents any file from being cached.  Turn this
  2031.         variable on for diskless Linux boot.  Default: "OFF"
  2032.  
  2033.      ╖  $CacheReserve controls the preventive allocation of 25 percent
  2034.         more space than necessary in the cache partition, to let the
  2035.         files grow. Turn this variable off if you are short of disk
  2036.         space.  Default: "ON"
  2037.  
  2038.      ╖  $ExtMemory controls the use of Extended Memory (or XMS).  Once
  2039.         deactivated, extended memory cannot be reactivated.  Default:
  2040.         "ON" if available
  2041.  
  2042.      ╖  $IsoLatin controls the interpretation of upper ASCII codes in
  2043.         included and patched files. The IsoLatin settings are processed
  2044.         at the time the file is loaded, not at the time the file is
  2045.         processed.  Default: "ON"
  2046.  
  2047.      ╖  $ProgressX and $ProgressY controls the position of the progress
  2048.         window displayed in VESA graphics during archive download and
  2049.         decompression.  Default: 200 200
  2050.  
  2051.      ╖  $EXT2-Backup controls the update of superblock backups in Linux
  2052.         ext2 filesystem. Superblock backups take a few seconds to do and
  2053.         are never used by current kernels (only by e2fsck).
  2054.  
  2055.      ╖  $Security-Gateway controls the gateway-server used for user
  2056.         authentication. Our special authentication gateway must be
  2057.         running on the target computer.  Default: "${BOOTP-Server-
  2058.         IP}@89" (ie. the TFTP server, on port 89)
  2059.  
  2060.      ╖  $Security-Check contains the answer of the security server for
  2061.         the last check performed, either PASSED or FAILED.  Default:
  2062.         "FAILED"
  2063.  
  2064.      ╖  $Security-Passwd, $HelpTopic, $OnExit, $OnKey-...  are used
  2065.         internally.
  2066.  
  2067.         See also BOOTP variables and MrZip-specific variables.
  2068.  
  2069.  
  2070.      MrZip-specific variables
  2071.         The following variables are only used within MrZip.
  2072.  
  2073.      ╖  $TempPath controls the directory where temporary files will be
  2074.         stored.  Default: <empty> == current directory
  2075.  
  2076.      ╖  $DumpFormat controls the way archives are dumped to the log when
  2077.         requested.  It is a string containing
  2078.  
  2079.      ╖  "h"/"H" to display the archive header
  2080.  
  2081.      ╖  "b"/"B" to summarize/dump boot sectors
  2082.  
  2083.      ╖  "s"/"S" to display a short/long allocation summary
  2084.  
  2085.      ╖  "d"/"D" to display a short/long directory listing
  2086.  
  2087.      ╖  "f"/"F" to summarize/dump files
  2088.  
  2089.         Default: "hbD"
  2090.  
  2091.      ╖  $FragmentSize controls the size of archive pieces.  If you do
  2092.         not use InCom's extended TFTP server, you should set this to "30
  2093.         MB".  Default: "87 MB"
  2094.  
  2095.      ╖  $SourceArchive, $DestArchive, $Filter... are used internally.
  2096.  
  2097.  
  2098.      BOOTP variables
  2099.         The following BOOTP-... and DHCP-... variables are recognized,
  2100.         as long as a BOOTP/DHCP reply has been received (TCP/IP Bootprom
  2101.         must be reported as detected):
  2102.  
  2103.  
  2104.  
  2105.  
  2106.  
  2107.  
  2108.  
  2109.  
  2110.  
  2111.  
  2112.  
  2113.                 $BOOTP-Client-ID
  2114.                 $BOOTP-Your-IP
  2115.                 $BOOTP-Server-IP
  2116.                 $BOOTP-Gateway-IP
  2117.                 $BOOTP-Bootfile
  2118.                 $BOOTP-Server-Name
  2119.                 $BOOTP-Subnet-Mask
  2120.                 $BOOTP-Time-Offset
  2121.                 $BOOTP-Routers
  2122.                 $BOOTP-Time-Servers
  2123.                 $BOOTP-Name-Servers
  2124.                 $BOOTP-Domain-name-Servers
  2125.                 $BOOTP-BOOTP-Log-Servers
  2126.                 $BOOTP-Cookie-Servers
  2127.                 $BOOTP-Lpr-Servers
  2128.                 $BOOTP-Impress-Servers
  2129.                 $BOOTP-Resource-Location-Servers
  2130.                 $BOOTP-Host-Name
  2131.                 $BOOTP-Boot-Size
  2132.                 $BOOTP-Merit-Dump
  2133.                 $BOOTP-Domain-Name
  2134.                 $BOOTP-Swap-Servers
  2135.                 $BOOTP-Root-Path
  2136.                 $BOOTP-Extensions-Path
  2137.                 $BOOTP-IP-Forwarding
  2138.                 $BOOTP-Interface-MTU
  2139.                 $BOOTP-All-Subnets-Are-Local
  2140.                 $BOOTP-Broadcast-Address
  2141.                 $BOOTP-NIS-Domain
  2142.                 $BOOTP-NIS-Servers
  2143.                 $BOOTP-NTP-Servers
  2144.                 $BOOTP-Font-Servers
  2145.                 $BOOTP-X-Display-Manager
  2146.                 $DHCP-IP-Address-Lease-Time
  2147.                 $DHCP-Message-Type
  2148.                 $DHCP-Server-Identifier
  2149.                 $DHCP-Message
  2150.                 $DHCP-Renewal-Time
  2151.                 $DHCP-Rebinding-Time
  2152.                 $BOOTP-NIS+-Domain
  2153.                 $BOOTP-NIS+-Servers
  2154.                 $BOOTP-Server-Name
  2155.                 $BOOTP-Bootfile
  2156.                 $BOOTP-Mobile-IP-Agent
  2157.                 $BOOTP-SMTP-Servers
  2158.                 $BOOTP-POP3-Servers
  2159.                 $BOOTP-NNTP-Servers
  2160.                 $BOOTP-WWW-Servers
  2161.                 $BOOTP-Finger-Servers
  2162.                 $BOOTP-IRC-Servers
  2163.                 $BOOTP-StreetTalk-Servers
  2164.                 $BOOTP-STDA-Servers
  2165.  
  2166.  
  2167.  
  2168.      Other BOOTP/DHCP parameters can be used under the name
  2169.  
  2170.              $BOOTP-Option-n
  2171.  
  2172.  
  2173.      where n is the decimal representation of the BOOTP option number.
  2174.  
  2175.      Do not mix-up BOOTP-Gateway-IP, which is the gateway to use for
  2176.      TFTP and should be 0.0.0.0 if the TFTP server is in the same
  2177.      subnet, and BOOTP-Routers, which contains the default IP
  2178.      gateway(s). The TCP/IP Bootprom sometimes seems to set the value of
  2179.      BOOTP-Gateway-IP from the value in BOOTP-Routers, causing each TFTP
  2180.      ack packet to be sent to the router first. To avoid such behaviour,
  2181.      if your TFTP server is in the same subnet as the client, force
  2182.      BOOTP-Gateway-IP to 0.0.0.0 (thanks to Maciek Uhlig for having
  2183.      pointed out this problem).
  2184.  
  2185.  
  2186.   5.1.5.  Monitoring commands
  2187.  
  2188.   This section lists commands for monitoring the system state.  Optional
  2189.   arguments are listed between parenthesis (I would have prefered square
  2190.   brackets, but LaTeX do not like them at this place...)
  2191.  
  2192.      Interact
  2193.         Show the log and turn to interactive mode until QUIT or EXIT is
  2194.         entered.  Type HideLog before quitting if you want to avoid
  2195.         disturbing log messages during batch execution.
  2196.  
  2197.  
  2198.      Help (topic)
  2199.         Load the on-line help file (bpbatch.hlp) and display the
  2200.         description of the given topic. If no topic is provided, or if
  2201.         the topic is unknown, display the help index.
  2202.  
  2203.  
  2204.      Log
  2205.         Display the string on the log. No return/linefeed is implicitely
  2206.         added.
  2207.  
  2208.  
  2209.      Echo
  2210.         Display the string on the log and go to the next line.
  2211.         Equivalent to
  2212.  
  2213.                 Log "text\r\n".
  2214.  
  2215.  
  2216.  
  2217.  
  2218.      LogVars (
  2219.         Log (ie. display on the log) all variables matching the given
  2220.         pattern.  The pattern can contain wildcards (? and *).
  2221.  
  2222.         Example: LogVars "BOOTP-*"              list all BootP variables
  2223.  
  2224.  
  2225.  
  2226.      LogDir
  2227.         Log (ie. display on the log) all files from the given path that
  2228.         match the pattern. The pattern can contain wildcards (? and *).
  2229.  
  2230.         Example: LogDir "/usr/g*p"              list files names like g...p
  2231.  
  2232.  
  2233.  
  2234.      LogTree
  2235.         Log the directory tree starting with the given path as root.
  2236.  
  2237.  
  2238.      LogFile
  2239.         Log the content of the file. The file must be no more than 64 KB
  2240.         big.
  2241.  
  2242.  
  2243.      ShowLog
  2244.         Make the log visible if it was hidden.  Automatically performed
  2245.         when ESC is pressed with "$AutoShowLog" == "ON" and when
  2246.         entering interactive mode.
  2247.  
  2248.  
  2249.      HideLog
  2250.         Prevent log messages to appear on the screen. Default state when
  2251.         BpBatch, MrBatch and MrZip are started on a script file.
  2252.  
  2253.  
  2254.      CaptureLog
  2255.         Record all log output to a 64 KB buffer until EndCapture is
  2256.         issued.  Wrap around buffer if the log output is more than 64 KB
  2257.         big.  This command can be used to create a text file with an
  2258.         arbitrary content.  The EndCapture MUST occurs within the same
  2259.         batch file.
  2260.  
  2261.  
  2262.      EndCapture (
  2263.         End up the capture of the log. If a filename is given, store the
  2264.         captured text to a file. Otherwise, discard it.
  2265.  
  2266.  
  2267.   5.1.6.  Control commands
  2268.  
  2269.   This section lists commands that control the batch execution.
  2270.   Optional arguments are listed between parenthesis.
  2271.  
  2272.      Include
  2273.         Load the given file and start up the parser on it. Go back to
  2274.         the current point when the include file processing is done.  The
  2275.         interpretation of characters above ASCII 127 within the include
  2276.         file depends on the value of $IsoLatin at the time the file is
  2277.         included.
  2278.  
  2279.  
  2280.      OnExit command
  2281.         Setup an exit-handler that will automatically be evaluated at
  2282.         the end of current batch file.
  2283.  
  2284.  
  2285.      Goto label
  2286.         Move the execution cursor to the given label (ie. the line
  2287.         starting with :label)
  2288.  
  2289.  
  2290.      Eval
  2291.         Perform all substitutions on the "command" and run the parser on
  2292.         it.
  2293.  
  2294.  
  2295.      If ...
  2296.  
  2297.           If (not) <expr1> (==|!=|<|>|>=|<=|=>|=<|<>) <expr2> <command>
  2298.           If (not) (ci) "str1" (==|!=|<|>|>=|<=|=>|=<|<>) "str2" <command>
  2299.           If (not) (ci) "str1" Match-Expr "pattern" <command>
  2300.           If (not) (ci) "str1" Match-Passwd "unix-passwd" <command>
  2301.           If (not) (ci) "str1" In "wordlist" <command>
  2302.           If (not) (ci) "str1" In-File "filename" <command>
  2303.           If (not) exist "filename" <command>
  2304.  
  2305.  
  2306.  
  2307.      These commands execute command; if the test succeeds.  The 1st form
  2308.      compares two numerical expressions.  The 2nd form compares two
  2309.      strings, optionally case-insensitive.  The 3rd form tests if "str1"
  2310.      matches the given pattern (wildcards allowed).  The 4th form tests
  2311.      if the clear password "str1" matches the Unix-crypted password.
  2312.      The 5th form tests if "str1" is included in the word list.  The 6th
  2313.      form tests if "str1" is included in the word file.  The 7th form
  2314.      tests if the given file exists.
  2315.  
  2316.  
  2317.      Set ...
  2318.  
  2319.           Set variable = "string-value"
  2320.           Set variable = <expr>
  2321.  
  2322.  
  2323.  
  2324.      Setup a value for the given variable. If the given value is a
  2325.      numerical expresison, it will be implicitely converted to a string.
  2326.      A variable can be used anywhere by refering it as $variable or
  2327.      ${variable}.  If the resulting reference is to be interpreted as a
  2328.      string, it should be enclosed between double quotes: "$variable" or
  2329.      "${variable}".
  2330.  
  2331.  
  2332.      Delay duration
  2333.         Waits until the specified duration (expressed in seconds)
  2334.         expired.  See also the paragraph on the format of durations.
  2335.  
  2336.  
  2337.      GetTime variable, GetDate variable
  2338.         Get the CMOS time and store it into variablein the form
  2339.         HH:MM:SS.  Get the CMOS date and store it into variablein the
  2340.         form YY/MM/DD.  This can be used to customize the behavior of
  2341.         your boot scripts depending on the time of day or on the date.
  2342.  
  2343.  
  2344.      SetTime
  2345.         Set the computer CMOS time or date to the given value.  If you
  2346.         have a security gateway (our special TFTP server) running, you
  2347.         can automatically adjust the CMOS time and date of the client
  2348.         computers at each boot by evaluating the following command:
  2349.  
  2350.                 include "$Security-Gateway:gettime"
  2351.  
  2352.  
  2353.      If you want to understand what this command does, just type:
  2354.  
  2355.              logfile "$Security-Gateway:gettime"
  2356.  
  2357.  
  2358.  
  2359.  
  2360.      Poweroff
  2361.         Turn off the computer.  This command only works if the computer
  2362.         is Advanced Power Management (APM) compatible.
  2363.  
  2364.  
  2365.   5.1.7.  Keyboard-related commands
  2366.  
  2367.   This section lists commands that let you monitor the keyboard input.
  2368.   Optional arguments are listed between parenthesis.  See also under
  2369.   National Language Support.
  2370.  
  2371.      GetKey (variable)
  2372.         Indefinitely wait until a key is pressed and store it in the
  2373.         variable.
  2374.  
  2375.  
  2376.  
  2377.      WaitForKey duration (command)
  2378.         Wait until a key is pressed for no more than duration seconds.
  2379.         If no key has been pressed after the given time, evaluate the
  2380.         command.  Otherwise, leave the key in the keyboard buffer.  See
  2381.         also the paragraph on the format of durations.
  2382.  
  2383.  
  2384.      Input (variable (max-length))
  2385.         Read a return-terminated string from the keyboard and store the
  2386.         result string in variable (without the terminating return). If
  2387.         max-length is given, do not allow the user to enter more than
  2388.         this number of characters.
  2389.  
  2390.         See also GetPasswd under Security-related commands.
  2391.  
  2392.  
  2393.      OnKey
  2394.         Setup a key handler that will automatically evaluate the given
  2395.         command when the key "c" is pressed (except is explicitely
  2396.         waited by a GetChar or an Input command). If the string
  2397.         "default" is used instead of a single character, the command is
  2398.         executed if any other key is pressed.
  2399.  
  2400.  
  2401.   5.1.8.  Text output commands
  2402.  
  2403.   This section lists commands used to perform regular text output.  All
  2404.   these commands can be used in graphic mode also, with the same
  2405.   behaviour (except that text mode provides 80x25 characters while
  2406.   graphic mode provides 100x37, because graphic mode characters are of
  2407.   size 8x16).  Optional arguments are listed between parenthesis.  See
  2408.   also under National Language Support.
  2409.  
  2410.      Print
  2411.         Print the specified string/expression at current cursor position
  2412.         and using current text attributes, then move the cursor.  Add
  2413.         "\r\n" to the end of the string to go to the next line.
  2414.  
  2415.  
  2416.      TextAttr fg-color bg-color
  2417.         Setup the text attributes. One can also put a single numeric
  2418.         value representing both colors and defined as 16*bg-color+fg-
  2419.         color.
  2420.  
  2421.         If you need more fantasy, you can use LoadFont. See under
  2422.         National Language Support.
  2423.  
  2424.  
  2425.      At line,col (command)
  2426.         Move the cursor position to the specified position and evaluate
  2427.         the command if provided.
  2428.  
  2429.         Example: At 10,20 Print "Gnats and rats !"
  2430.  
  2431.  
  2432.  
  2433.      Clear (color (pattern-char (top,left,bottom,right)))
  2434.         Fill the given text area with the given pattern-char (either a
  2435.         string or the decimal ascii code). The area defaults to the full
  2436.         screen, the pattern char defaults to the full block (ASCII dec
  2437.         219) and the color defaults to black (clear screen). Move the
  2438.         cursor to the upper left corner of the cleared area.
  2439.  
  2440.      BpMenu backward compatibility commands
  2441.  
  2442.  
  2443.           .ATT (<attribute>)
  2444.           .CLS (<attribute>)
  2445.           .DEF <key> (<timeout_val>)
  2446.           .KEY <key> <filename>
  2447.           .POS ((<x>) <y>)
  2448.           .PWD <key> <cpasswd>
  2449.           .WLN (<text>)
  2450.           .WRT <text>
  2451.  
  2452.  
  2453.  
  2454.      See InCom's manual for more infos. We wrote some time ago a program
  2455.      program for editing menu files using this syntax, but it is
  2456.      preferable to make your menus using the new explicit syntax.  Note
  2457.      that the .PWD command is not implemented because we do not now the
  2458.      password crypting algorithm used by InCom GmbH.
  2459.  
  2460.  
  2461.   5.1.9.  Graphics output commands
  2462.  
  2463.   This section lists commands used to perform graphic-mode output.  For
  2464.   the functions listed in this section, coordinates are given in pixels.
  2465.   You can also use all text output commands (see above) in graphic mode.
  2466.   Optional arguments are listed between parenthesis.
  2467.  
  2468.   Note that the graphic mode is automatically turned on whenever a
  2469.   graphic command is used, unless the variable VESA is set to "OFF".
  2470.  
  2471.      InitGraph
  2472.         Turn on VESA graphics (800 pixels width, 600 pixels height, 256
  2473.         colors).  The origin is on the upper-left corner of the screen
  2474.         (0 0).  VESA graphics may hang some computers under Windows 95.
  2475.         Run MrBatch with the -v option to avoid such problems.
  2476.  
  2477.  
  2478.      CloseGraph
  2479.         Close VESA graphic mode and go back to text mode.
  2480.  
  2481.  
  2482.      DrawBar x-pos y-pos width height color
  2483.         VESA graphics. Draw a filled bar of the given size and colors.
  2484.  
  2485.  
  2486.      DrawWindow x-pos y-pos width height (bg-color (title-color))
  2487.         VESA graphics. Draw a window of the given size and colors. The
  2488.         background color defaults to LightGray and the title color
  2489.         defaults to Blue.
  2490.  
  2491.  
  2492.      Drawtext x-pos y-pos
  2493.         VESA graphics. Draw the text string at the given position with a
  2494.         transparent background. The color defaults to text foreground
  2495.         color.
  2496.  
  2497.  
  2498.      DrawGif
  2499.         VESA graphics. Load the given GIF-87a file and draw it on the
  2500.         screen.  The file can be interlaced, but must be in GIF-87a (not
  2501.         GIF-89a).  The image size should be no more than 800x600 with
  2502.         256 colors.  The GIF position defaults to the top left corner of
  2503.         the screen (0 0).
  2504.  
  2505.         The color-strategy defines the allocation of colors in the
  2506.         palette when more than 256 colors are needed (for instance when
  2507.         two 256 colors GIF files are displayed simultaneously):
  2508.  
  2509.      ╖  Best-Colors  use best possible colors for the most recent GIF
  2510.  
  2511.      ╖  Spare-Colors try to avoid allocating colors, change existing
  2512.         colors
  2513.  
  2514.      ╖  Share-Colors try to avoid allocating colors, use existing colors
  2515.  
  2516.      ╖  Reuse-Colors allocate no new color, only use existing colors
  2517.  
  2518.         The default strategy is Best-Colors.
  2519.  
  2520.  
  2521.   5.1.10.  Security-related commands
  2522.  
  2523.   This section lists commands that help you authenticate a user.
  2524.   Optional arguments are listed between parenthesis.
  2525.  
  2526.   Some of these functions cooperate with a Security gateway, that you
  2527.   should first install. See the section on Special TFTP servers for more
  2528.   infos.
  2529.  
  2530.      GetPasswd (variable (max-length))
  2531.         Same as Input, but echo stars instead of the typed characters.
  2532.  
  2533.  
  2534.      Crypt
  2535.         Apply the Unix crypt function to the given 8-chars text and
  2536.         store the resulting crypted string into variable. The "salt" is
  2537.         usually a two-character string that will be found as the first
  2538.         two characters of the crypted string.
  2539.  
  2540.         Note that Unix crypt is a one-way function. It is not possible
  2541.         to decode the crypted string. One can only try to crypt another
  2542.         string with the same salt and compre the resulting crypted
  2543.         string.
  2544.  
  2545.  
  2546.      DESCrypt
  2547.         Crypt the given text using the given 8-chars key and store the
  2548.         result as an hexadecimal string in variable.
  2549.  
  2550.  
  2551.      DESDecrypt
  2552.         Decrypt the given hexadecimal string using the given 8-chars key
  2553.         and store the result in variable.
  2554.  
  2555.  
  2556.      MD5
  2557.         Compute the MD5 checksum of the given text and store it as an
  2558.         hexadecimal string in variable. Can be used as an alternative to
  2559.         the Unix crypt function to check for passwords bigger than 8
  2560.         characters.
  2561.  
  2562.  
  2563.      CheckUser
  2564.         Connect to the $Security-Gateway and check if the given user
  2565.         exist in the given radius domain and uses the specified
  2566.         password.  If the domain is "Unix", use the Unix user/password
  2567.         definition on the security gateway. For any other domain, use
  2568.         the security gateway domain definition file to determine the
  2569.         real Radius or NT domain to check.
  2570.  
  2571.         Set the value of $Security-Check to "PASSED" or "FAILED".  The
  2572.         password do not transit in clear on the network.
  2573.  
  2574.  
  2575.   5.1.11.  Disk-related commands
  2576.  
  2577.   This section lists commands for preparing the hard-disk.  Optional
  2578.   arguments are listed between parenthesis.
  2579.  
  2580.      GetPartitions variable (disk)
  2581.         Read the partition table(s) for the given disk and store it as a
  2582.         string into the given variable. The result string is a space-
  2583.         separated list of Type:Size, where
  2584.  
  2585.      ╖  Type is FAT16, EXT, BIGDOS, NTFS, FAT32, FAT32-LBA, BIGDOS-LBA,
  2586.         EXT-LBA, LINUX-SWAP, LINUX-EXT2 or the decimal filesystem id for
  2587.         unknown types.
  2588.  
  2589.      ╖  Size is the size of the partition in megabytes.
  2590.  
  2591.  
  2592.      SetPartitions
  2593.         Setup the partition table(s) to the content of the string. The
  2594.         format used is the same that for GetPartitions. This command
  2595.         also reset all boot flags (hint: use SetBootPart).
  2596.  
  2597.         If you want to use extended partitions, remember that they begin
  2598.         after each four partitions. You can use EMPTY to leave a free
  2599.         entry in the partition table. For instance, if you want to setup
  2600.         a primary dos partition of 100 MB and a logical dos partition of
  2601.         400 MB, you must execute
  2602.  
  2603.                 SetPartitions "BIGDOS:100 EXT:400 EMPTY EMPTY BIGDOS:400"
  2604.  
  2605.  
  2606.  
  2607.  
  2608.      GetBootPart variable (disk)
  2609.         Get the partition number with the boot flag turned on (DOS says:
  2610.         the activated primary partition) and store it to the variable.
  2611.         The first partition is numbered 1.  If no partitions has the
  2612.         boot flag turned on, answers zero.
  2613.  
  2614.  
  2615.      SetBootPart partition (disk)
  2616.         Set the boot flag to the given partition. The boot flag let the
  2617.         master boot record (MBR) choose which partition to boot on.  The
  2618.         first partition is numbered 1.
  2619.  
  2620.  
  2621.      Blank partition (disk)
  2622.         Fill the given partitions with zeroes. Can take quite a lot of
  2623.         time for big partitions. Do not format the partition for any
  2624.         operating system. See also Clean.
  2625.  
  2626.  
  2627.      Clean partitions (disk) (
  2628.         Fast-format the given partition(s) according to the type
  2629.         declared in the partition table. If a label is given and the
  2630.         filesystem supports it, setup the partition label. For a
  2631.         paranoiac full format, call Blank on the partition first.
  2632.  
  2633.         Clean is supported for (FAT16) BIGDOS, FAT32, EXT, LINUX-EXT2
  2634.         and LINUX-SWAP partitions. To clean the master boot record
  2635.         (MBR), use Clean 0.
  2636.  
  2637.         Clean should be used on data partitions and on MBR/EXT
  2638.         partitions.  It is totally useless to clean a partition before
  2639.         unzipping a filesystem on it using FullUnzip.
  2640.  
  2641.      FullUnzip
  2642.         Decompress a full disk archive to the given partition,
  2643.         overwriting any existing file (clean-up on the fly).
  2644.  
  2645.         FullUnzip is supported for (FAT16) BIGDOS, FAT32 and LINUX-EXT2.
  2646.         Unfortunately, images restored from FAT32 do not seem to be
  2647.         bootable, although all files are restored correctly. This should
  2648.         be fixed in a future release.
  2649.  
  2650.         This commands turn on VESA graphics to display a progress
  2651.         banner, unless VESA has been turned OFF.
  2652.  
  2653.  
  2654.      IncrUnzip
  2655.         Decompress an incremental disk archive to the given path. Files
  2656.         in the archive replace those with the same name on the target
  2657.         path, but other files are not deleted.
  2658.  
  2659.         IncrUnzip is supported for (FAT16) BIGDOS, FAT32 and LINUX-EXT2.
  2660.         This command is far less efficient than FullUnzip since the
  2661.         existing filesystem structure must be preserved. However, it
  2662.         avoids multiplying the number of different disk images by
  2663.         storing the differences only.
  2664.  
  2665.  
  2666.      FileUnzip
  2667.         Uncompress a file previously compressed with MrZip FileZip
  2668.         command.  The file is validated by a 32-bits CRC.
  2669.  
  2670.  
  2671.      Copy
  2672.         Copy the source file to the destinaton file, byte-to-byte.  Can
  2673.         be used after a FullUnzip for instance to update configuration
  2674.         files from the server without rebuilding the image.  Better to
  2675.         use FileUnzip for big and easy-to-compress files.
  2676.  
  2677.  
  2678.      Append
  2679.         Copy the first, then the second file to the destination file,
  2680.         byte-to-byte.  Can be used on arbitrary large files.  The
  2681.         destination file cannot be one of the two source files.
  2682.  
  2683.  
  2684.      Patch
  2685.         Read the source file and perform variable substitution before
  2686.         writing it to the destination file. The interpretation of
  2687.         characters above ASCII 127 depends on the value of $IsoLatin.
  2688.  
  2689.         By default, variables are recognized when prefixed by "${" and
  2690.         postfixed by "}". This can be changed to any other non-empty
  2691.         string.  remember that if you want to use a dollar sign within
  2692.         the prefix or suffix, you must escape it or it will get macro-
  2693.         evaluated. For instance, if you want to explicitely use the
  2694.         default prefix and postfix, use:
  2695.  
  2696.                 Patch "source-file" "dest-file" "\${" "}"
  2697.  
  2698.  
  2699.  
  2700.  
  2701.      MkDir
  2702.         Recursively create directories from the root to the given full
  2703.         path.  If the path already exists, this command has no effect.
  2704.  
  2705.  
  2706.  
  2707.      Delete
  2708.         Remove the given file. The file must exist.
  2709.  
  2710.  
  2711.      DelTree
  2712.         Recursively remove all files and directories under the given
  2713.         path, and remove the directory itself.
  2714.  
  2715.  
  2716.   5.1.12.  Boot commands
  2717.  
  2718.   This section lists commands for continuing the boot process.  Optional
  2719.   arguments are listed between parenthesis.
  2720.  
  2721.      HideBootProm
  2722.         Restore the memory and the interrupt vectors allocated by the
  2723.         bootprom.  All attempts to make TFTP transfers will fail after
  2724.         calling this command.  It is usually a good idea to call this
  2725.         command before HdBoot, or you might run short of memory under
  2726.         DOS/Windows. This command is implicitely called by FloppyBoot.
  2727.  
  2728.         Note that although this function restore all vectors
  2729.         "officially" rerouted by the BootProm, it does not seems to
  2730.         restore everything.  But it works well enough for DOS and
  2731.         Windows.
  2732.  
  2733.  
  2734.      LoadRamDisk
  2735.         Load a floppy disk image into the extended memory and redirect
  2736.         the BIOS Disk Services to make floppy disk calls use this image
  2737.         instead. This command implicitely calls HideBootProm. Call
  2738.         FloppyBoot to boot on the ramdisk you just loaded.
  2739.  
  2740.         This kind of ramdisk may not be as robust as what you get when
  2741.         you use the TFTPBoot command. The only advantage is that it only
  2742.         steals a few hundred bytes of conventional memory instead of the
  2743.         >64 KB reserved by the TCP/IP BootPROM. Warning, nothing secures
  2744.         the extended memory in which the ramdisk resides.  There is no
  2745.         way to uninstall such a ramdisk.
  2746.  
  2747.  
  2748.      LoadZRamDisk
  2749.         Do the same as LoadRamDisk, but for an image that has been
  2750.         compressed using MrZip FileZip command. Compressed ramdisks are
  2751.         protected against data corruption (and uncomplete download) by a
  2752.         byte count and a 32-bits CRC.
  2753.  
  2754.  
  2755.      TFTPBoot
  2756.         Chain to another boot file (for instance a floppy image made
  2757.         with InCom's BpShell program). See the file referencing
  2758.         conventions for accessing a file on another TFTP server.
  2759.  
  2760.  
  2761.      FloppyBoot
  2762.         Hide the Boot ROM, load the floppy disk boot sector and boot on
  2763.         it.  Unfortunately, this command does not seems to work well
  2764.         enough for LDLINUX.SYS (used on RedHat Linux setup disk) to
  2765.         work.
  2766.  
  2767.  
  2768.      HdBoot (disk)(:partition)
  2769.         Load the given boot sector and boot from it. The disk default to
  2770.         zero, the first hard disk, and the partition defaults to zero,
  2771.         ie. the master boot record. You can boot from any partition, but
  2772.         be warned that Windows 95 may not let you boot a partition that
  2773.         has not been set as the boot partition (hint: use SetBootPart).
  2774.  
  2775.         This command does not implicitely call HideBootProm, so you
  2776.         might want to call it before.
  2777.  
  2778.  
  2779.      LinuxBoot
  2780.         Load the given kernel and ramdisk into the high memory, setup
  2781.         the command line and boot the kernel. It is a good idea to put
  2782.         at least a minimal command line with the location of the root
  2783.         filesystem (like "root=dev/hda1"/). If you are using a linux
  2784.         system that heavily relies on lilo (like RedHat Linux 5.1), it
  2785.         may be necessary to add to the command line something like
  2786.         BOOT_IMAGE=linux. Note that the kernel can be loaded by TFTP
  2787.         (automatically cached on the hard disk) or directly from the
  2788.         target root partition.
  2789.  
  2790.         This command works for small and big kernels (zImage and
  2791.         bzImage).
  2792.  
  2793.  
  2794.   5.1.13.  National language support
  2795.  
  2796.   This section lists commands related not national language support.
  2797.   Optional arguments are listed between parenthesis.
  2798.  
  2799.      RemapKeys
  2800.         National keyboard support. Remap given keys to other characters.
  2801.         For instance, to swap the Y and Z keys, use
  2802.  
  2803.                 Remapkeys "yzYZ" "zyZY"
  2804.  
  2805.  
  2806.      It is a good idea to use the quoted octal notation when using char¡
  2807.      acters not included in the minimal ASCII character set, in order to
  2808.      avoid a dependency to the iso-latin modal settings.
  2809.  
  2810.      For international keyboards, there are two keys that produce a
  2811.      backslash in non-remapped (US) mode. Each of them can be
  2812.      independantly remapped, thanks to the fact that BpBatch sees one of
  2813.      them as a key answering ASCII code 252 (octal) or ASCII code 335
  2814.      (octal) when shifted.
  2815.  
  2816.      If you send me a sample script that does keyboard mapping for your
  2817.      national keyboard, I will make it available under
  2818.      http://cuiwww.unige.ch/info/pc/remote-boot/soft/sample-scripts To
  2819.      help you make your own keyboard mapping, I suggest pressing all
  2820.      special keys without remapping the keyboard and writing down the
  2821.      character they produce.  These will be the original-keys. The
  2822.      remapped-keys simply are the key you would have liked to see, in
  2823.      the same order. If some keys (either original or remapped) produce
  2824.      characters above ASCII dec 127, use the quoted octal notation. You
  2825.      can easily get the octal code for any given character by looking in
  2826.      the ASCII table of HelpPC for instance (HelpPC is a shareware
  2827.      hypertext on-line help program by David Jurgens).
  2828.  
  2829.  
  2830.      RemapAltkeys
  2831.         National keyboard support. Remap the given keys when ALT is
  2832.         depressed For instance, to map Alt-2 to the ampersand sign, use
  2833.  
  2834.                 RemapAltKeys "2" "@"
  2835.  
  2836.  
  2837.      Note that dead keys are not supported.
  2838.  
  2839.      LoadCodePage
  2840.         Load and activate the given binary Codepage file.  Codepages are
  2841.         used for the translation of Unicode characters (present on VFAT
  2842.         valumes for instance) into 8-bits characters.  If you do not
  2843.         have the right Codepage loaded, you will get FAT warnings while
  2844.         accessing the filesystem when special characters are encountred.
  2845.  
  2846.         All binary codepage files are available at
  2847.         http://cuiwww.unige.ch/info/pc/remote-boot/soft/codepage.zip
  2848.  
  2849.         The default codepage is 850, a reordered superset of ISO-
  2850.         Latin-1.  If you load a more exotic codepage, you should usually
  2851.         turn the variable $IsoLatin to "off" or you might get
  2852.         meaningless implicit conversions. Moreover, if you want to
  2853.         display exotic characters, you should also load the proper
  2854.         screen font (use "LoadFont").
  2855.  
  2856.  
  2857.      LoadFont
  2858.         Load and activate a VGA/VESA font, both in text and graphic
  2859.         mode.  The font file must be a binary file of 16
  2860.         bztes/characters (8x16 bitmap). This command can be used for
  2861.         National Language Support as well as for Fantasy support.
  2862.  
  2863.         An archive with several fantasy fonts is available at
  2864.         http://cuiwww.unige.ch/info/pc/remote-boot/soft/fonts.zip.  This
  2865.         archive also contains a program to extract fonts for your
  2866.         codepage from the DOS .CPI file.
  2867.  
  2868.  
  2869.   5.1.14.  Commands specific to MrZip
  2870.  
  2871.  
  2872.      Source...
  2873.  
  2874.           Source (i)archive "filename"
  2875.           Source path "path"
  2876.  
  2877.  
  2878.  
  2879.      Set the source for the archive manipulation to the given
  2880.      (incremental) archive file or disk path.
  2881.  
  2882.  
  2883.      Dest...
  2884.  
  2885.           Dest (i)archive "filename"
  2886.           Dest (i)dump
  2887.           Dest path "path"
  2888.  
  2889.  
  2890.  
  2891.      Set the destination for the archive manipulation to the given
  2892.      (incremental) archive file, dump or disk path. To control the
  2893.      quantity of data displayed during dump, use the $DumpFormat special
  2894.      variable.
  2895.  
  2896.  
  2897.      FileZip
  2898.         Compress a file for further decompression with FileUnzip or for
  2899.         using as ZRamDisk. The file is validated by a 32-bits CRC.
  2900.  
  2901.  
  2902.      Filter...
  2903.  
  2904.  
  2905.           Filter -"pattern"
  2906.           Filter +"pattern"
  2907.  
  2908.  
  2909.  
  2910.      Avoid/allow files and directories matching the given pattern
  2911.      (wildcards allowed) to be included in the archive. The pattern is
  2912.      matched agains the full pathname. By default, all files are
  2913.      included in the image.  You only need to explicitely allow files
  2914.      that where cancelled by a filter.  Each negative filter has its own
  2915.      positive filter (allowed) sublist.
  2916.  
  2917.      For DOS/Windows images, you will typically use
  2918.  
  2919.              Filter -"*.swp"
  2920.              Filter -"temp/*"
  2921.  
  2922.  
  2923.      and for Unix images, you will typically use
  2924.  
  2925.              Filter -"var/log/*"
  2926.              Filter -"tmp/*"
  2927.  
  2928.  
  2929.  
  2930.  
  2931.      CopyArchive
  2932.         Start the archive manipulation operation, according to source,
  2933.         destination and filter settings. Except in a few circumstances,
  2934.         you will probably use the shortcut below instead of explicitely
  2935.         calling CopyArchive.  One circumstance in which you will use
  2936.         CopyArchive explicitely is when you want to change the
  2937.         fragmentation of an image, as follow:
  2938.  
  2939.                 set FragmentSize="30 MB"
  2940.                 Source archive "original.imz"
  2941.                 Dest archive "refragmented.imz"
  2942.                 CopyArchive
  2943.  
  2944.  
  2945.  
  2946.  
  2947.      FullZip
  2948.         Shortcut for
  2949.  
  2950.                         Source path "path"
  2951.                         Dest archive "full-archive"
  2952.                         CopyArchive
  2953.  
  2954.  
  2955.      You should usually first setup filters.
  2956.  
  2957.  
  2958.      IncrZip
  2959.         Shortcut for
  2960.  
  2961.                         Source path "path"
  2962.                         Dest iarchive "incr-archive"
  2963.                         CopyArchive
  2964.  
  2965.  
  2966.  
  2967.  
  2968.      FullDump
  2969.         Shortcut for
  2970.  
  2971.                         Source archive "full-archive"
  2972.                         Dest dump
  2973.                         CopyArchive
  2974.  
  2975.  
  2976.  
  2977.  
  2978.      IncrDump
  2979.         Shortcut for
  2980.  
  2981.                         Source iarchive "incr-archive"
  2982.                         Dest dump
  2983.                         CopyArchive
  2984.  
  2985.  
  2986.  
  2987.  
  2988.      XCopy
  2989.         Shortcut for
  2990.  
  2991.                         Source path "srcpath"
  2992.                         Dest path "dstpath"
  2993.                         CopyArchive
  2994.  
  2995.  
  2996.  
  2997.  
  2998.   5.2.  NoBreak.sys
  2999.  
  3000.   Nobreak.sys is a very small (about 350 bytes only) driver that you
  3001.   include at the beginning of your config.sys. Its goal is to secure the
  3002.   boot process, until the user is logged in.  DOS provides a setting for
  3003.   this (namely BREAK=OFF), but it is not drastic enough, and has almost
  3004.   no effect in the autoexec.bat.  Our driver works by modifying the
  3005.   scan-code of the key pressed when a break is requested, directly at
  3006.   the BIOS level.  This way, no program at all can receive a break until
  3007.   break is enabled again.
  3008.  
  3009.   The driver must be loaded from the config.sys (or using the devlod
  3010.   program from Undocumented DOS). Afterwards, break can be enabled by
  3011.   sending Yes to the NOBRK pseudo-device, and disabled again by sending
  3012.   No (in fact, only the first character, Y or N is significant).
  3013.  
  3014.   As this driver relies on the BIOS, it does only work for DOS and
  3015.   Windows 3.1.  Windows 95 has its own low-level keyboard handling
  3016.   routines.
  3017.  
  3018.   Assembler source code is available.
  3019.  
  3020.  
  3021.   6.  Special TFTP Servers
  3022.  
  3023.   As the only network support available in the TCP/IP BootPROM is TFTP,
  3024.   there is a special interest in enhancing TFTP servers for providing
  3025.   new capabilities.
  3026.  
  3027.  
  3028.   6.1.  Incom Enhanced TFTP Server
  3029.  
  3030.   InCom GmbH distributes with the TCP/IP BootPROM an enhanced TFTP
  3031.   server that can send packets of up to 1408 bytes instead of the
  3032.   standard 512 bytes.  This is a great enhancement that you should use.
  3033.   This server is available on the TCP/IP Bootprom Utility disk for
  3034.   Solaris, Windows and as Netware NLM.
  3035.  
  3036.  
  3037.   6.2.  Linux Enhanced TFTP Server
  3038.  
  3039.   We built a modified version of Linux TFTP server that acts as InCom
  3040.   enhanced TFTP server. Basically, we simply changed the packet size
  3041.   from 512 to 1408 bytes and the port from 69 to 59.  It is available
  3042.   from http://cuiwww.unige.ch/info/pc/remote-boot/soft/etdtpd.tar.gz.
  3043.  
  3044.  
  3045.   6.3.  The Security Gateway
  3046.  
  3047.   We wrote a special TFTP server that serves as security gateway for
  3048.   authenticating users. This server runs under Linux or Solaris, and can
  3049.   authenticate users according to a Unix password database (NIS and
  3050.   shadow passwords are supported), a Windows NT (or Samba) server or a
  3051.   Radius server.  It is available from
  3052.   http://cuiwww.unige.ch/info/pc/remote-boot/soft/stdtpd.tar.gz, with
  3053.   source and precompiled binaries.  The precompiled binaries do not
  3054.   include NT password encryption as we cannot distribute libdes but
  3055.   compilation is straightforward.
  3056.  
  3057.   In order to use the security gateway, you just have to setup a trivial
  3058.   security domains configuration file that describes to which
  3059.   authentication server each logical security domains maps (the Unix
  3060.   domain implicitely maps to the server Unix password database). This is
  3061.   a sample configuration file:
  3062.  
  3063.  
  3064.        ______________________________________________________________________
  3065.        #
  3066.        # STFTPD configuration file
  3067.        #
  3068.        # This file specify the server of the "security domains". Two types of
  3069.        # authentication servers are supported : radius or winnt (winnt includes
  3070.        # NT Server and Samba)
  3071.        #
  3072.        # Format of radius servers
  3073.        # radius        <domain>        <serveraddress>         <secret>
  3074.        #
  3075.        # secret is the secret word as specified in your /etc/raddb/clients file
  3076.        #
  3077.        # Format of SMB servers
  3078.        # winnt         <domain>        <serveraddress>         <netbiosname>
  3079.        #
  3080.        # netbiosname is the NETBIOS name of your server
  3081.        #
  3082.        # Examples
  3083.        radius         sec-dom-rad     radiusserver    testing123
  3084.        winnt          sec-dom-nt1     192.168.1.1     NTSERVER1
  3085.        winnt          sec-dom-smb     samba           SAMBA1
  3086.        ______________________________________________________________________
  3087.  
  3088.  
  3089.  
  3090.  
  3091.   Note that if you are using Samba, you must set security = user.
  3092.  
  3093.   You can also provide to the security server a file containing a list
  3094.   of users which are not allowed to log on (for which the check will
  3095.   fail anyways).
  3096.  
  3097.  
  3098.   6.4.  The Broadcast TFTP Server
  3099.  
  3100.   We wrote a special TFTP server that implements a home-made Broadcast
  3101.   variant of TFTP. Using this server, we were able to download images to
  3102.   25 clients on a heavily loaded 10 Mb ethernet network at 6 Mb/s (it is
  3103.   more efficient than the regular TFTP because it does not need to
  3104.   acknowledge each packets).  This server runs under Linux or Solaris.
  3105.   It is available from http://cuiwww.unige.ch/info/pc/remote-
  3106.   boot/soft/btdtpd.tar.gz, with source and precompiled binaries.
  3107.  
  3108.   As the TCP/IP bootprom does not support this protocol, our solution
  3109.   consist in booting a tiny ramdisk-based linux system using the tools
  3110.   described in this document, and running the Linux version of MrBatch
  3111.   which has built-in support for Broadcast TFTP. A simple batch file can
  3112.   the download all files to the cache in a few minutes, simultaneously
  3113.   on all client computers.  You do not need to install Linux yourself to
  3114.   use this package, except if you have exotic hardware and cannot
  3115.   directly use the kernel provided in the package.
  3116.  
  3117.   The process works as follow. First, you startup the broadcast server
  3118.   manually, giving the number of expected client computers as argument
  3119.   (remember, this procedure is not to be used every day but only when
  3120.   you changed an image and want to ensure it is immediately uploaded to
  3121.   all your client computers). Then, you turn on all client computers,
  3122.   which will run the following BpBatch script:
  3123.  
  3124.  
  3125.        ______________________________________________________________________
  3126.        #
  3127.        # This batch is run by bpbatch to launch a mini-linux using an initial
  3128.        # ramdisk, which will then run mrbatch under linux.
  3129.        #
  3130.        # The broadcast TFTP protocol only works with the Linux implementation of
  3131.        # mrbatch, because of the lack of broadcast support in the bootprom itself.
  3132.        #
  3133.        # 1. Setup a tiny partition, to let a lot of space for the cache
  3134.        setpartitions "BIGDOS:50"
  3135.        # 2. Clean the MBR
  3136.        clean 0
  3137.        # 3. Run a Linux Kernel with initrd (Initial Ramdisk) supprt, and use
  3138.        #    bcastrd.gz as the initial ramdisk (will be mounted root and then
  3139.        #    executed via /linuxrc). See initrd.txt for more details about
  3140.        #    initial ramdisks. You don't have to specify a root device (second
  3141.        #    parameter is null) to the kernel, it will use the initial ramdisk.
  3142.        linuxboot "linux.krn" "" "bcastrd.gz"
  3143.        # 4. The initial ramdisk will run dhcpcd to setup networking using DHCP.
  3144.        #    It will then run mrbatch -w bcastlx
  3145.        ______________________________________________________________________
  3146.  
  3147.  
  3148.  
  3149.  
  3150.   The initial ramdisk contains:
  3151.  
  3152.   ╖  dhcpcd, a DHCP client used to setup networking
  3153.  
  3154.   ╖  mrbatch
  3155.  
  3156.   ╖  linuxrc, a little wrapper automatically started by initrd and that
  3157.      starts dhcpcd then mrbatch.
  3158.  
  3159.   ╖  usr/lib/terminfo/l/linux, used by MrBatch
  3160.  
  3161.   ╖  dev/*, devices needed to run Linux and mrbatch
  3162.  
  3163.      All programs are statically linked and stripped, to avoid libc.so
  3164.      which is really huge. The resulting ramdisk is Gzipped and takes
  3165.      less than 300 KB. The kernel itself takes 450 KB (with many network
  3166.      cards and initrd support).  When Linux is up and running, MrBatch
  3167.      is called with the following script (that you should edit for your
  3168.      needs):
  3169.        ______________________________________________________________________
  3170.        # This file is executed when mrbatch is launched by the initial ramdisk
  3171.        # bcastrd.gz
  3172.        # It's main purpose is to "broacast copy" files to the cache
  3173.        #
  3174.        # 1. Be verbose
  3175.        showlog
  3176.        # 2. Don't want a "press a key"
  3177.        set pauselog="OFF"
  3178.        # 3. Set partitions at their final values.
  3179.        #    Important: Since you will copy files into the cache to be used in future
  3180.        #    boot, you need to specify the same partitions as in the future boots.
  3181.        setpartitions "BIGDOS:1024"
  3182.        # 4. Clean the CACHE partition
  3183.        clean -1
  3184.        # 5. And the copy files into the cache, using the Broadcast TFTP protocol
  3185.        #    (port 99)
  3186.        #
  3187.        # You can use the script "as is", but you surely need to modify the following
  3188.        # line ! In our example, we download the file mblinux.imz, which is the image
  3189.        # file for our installation of Linux.
  3190.        copy "$BOOTP-Server-IP@99:mblinux.imz" "{:-1}mblinux.imz"
  3191.        ______________________________________________________________________
  3192.  
  3193.  
  3194.  
  3195.  
  3196.   When the transfer is done, you can simply turn off all client comput¡
  3197.   ers and change their initial boot script to your favorite menu.
  3198.  
  3199.  
  3200.  
  3201.  
  3202.  
  3203.  
  3204.  
  3205.  
  3206.  
  3207.  
  3208.  
  3209.  
  3210.  
  3211.  
  3212.  
  3213.  
  3214.  
  3215.  
  3216.  
  3217.  
  3218.  
  3219.  
  3220.  
  3221.  
  3222.  
  3223.  
  3224.  
  3225.  
  3226.  
  3227.  
  3228.  
  3229.  
  3230.  
  3231.  
  3232.  
  3233.  
  3234.  
  3235.