On Thu, Aug 09, 2007 at 06:11:54PM -0500, John Heim wrote:
> I am pretty sure that freeDOS has a dhcp client. Google for freedos and you 
> will find it.
> 
> 
> ----- Original Message ----- From: "Henning Fehrmann" <[EMAIL PROTECTED]>
> To: <linux-fai@uni-koeln.de>
> Sent: Thursday, August 09, 2007 2:37 AM
> Subject: BIOS

Hello,

We worked a while on the problem of flashing a bios and writing into the nvram 
of the motherboard.
Here is a recipe which is still under development. Maybe somebody needs it.

Create a bootable dos image

   1. Go to http://www.freedos.org/ and download an installation-cd image, burn 
it onto a cd
   2. Install freedos on a box. We tried it on
         1. a Single-Dual Core Opteron 2218
               1. with a Supermicro H8SSL-i2 board
               2. and WD 1600YS SATA hd's 
         2. a Single-Dual Core Xeon 3060
               1. with a Supermicro PDSML-LN2 board
               2. and WD 1600YS SATA hd's 
         3. We have not been able to install freedos on a box with a Fujitsu 
Siemens D2461-A2 board but you can readout and write the board's nvram in a 
running system 
   3. Create a dos partition which starts from the first sector using the dos 
fdisk tool and format it with fat16. Make this partition not to big, since it 
has to go with pxeboot over the net. We toke approximately 32M.
   4. Install a basic dos environment with mbr writing tools (smbtmgrx) and 
other programs you consider to be useful.
   5. Reboot the box and go into the dos environment, execute a mbr writing 
tool.
   6. Reboot again using liveCD Linux system (Knoppix).
   7. Copy the first 63+N blocks of the hd into a file dd if=/dev/sda of=hd.img 
bs=512 count=63.
   8. Copy the the complete dos partition into another file dd if=/dev/sda1 
of=dos.img bs=512.
   9. Combine the files dd if=dos.img of=hd.img bs=512 seek=63 and copy hd.img 
onto the tftp server. 

Modify the Image

The idea is to mount the image to put different tools on there. Unfortunately, 
the image we just created has an MBR, which mount complains about. To get 
around that, we cut off the first (in our case: 63) blocks. The dos partition 
starts on block 64. dd if=hd.img of=dos.img bs=512 skip=63. To find out at 
which block the partition starts, you can search for the ASCII-string "FRDOS4", 
which indicates the beginning of a dos partition. This is a dos partition which 
can be loopback mounted. Copy the needed files into the mounted path. After 
umount, you update the image of the hd partition using dd again, with the seek 
parameter indicating the blocks you keep:
dd if=dos.img of=hd.img bs=512 seek=63.

Fill the dos partition with the tools and drivers you need. For us, this was 
basically:

    * WATT-32 (TCP/IP stack for DOS) http://www.bgnett.no/~giva/ 
    * card driver    http://www.georgpotthast.de/sioux/packet.htm
    In our case it worked with broadcom ethernet cards 
    * ssh2dos        http://sourceforge.net/projects/sshdos
    * and misc. tools like vim 


Booting the dos image

Assuming you use pxelinux, you can put this in the appropriate config file for 
the boot start:

 default fai-generated

 label fai-generated
 kernel kernel/memdisk
 append initrd=path/to/hd.img

* After that, you should be able to boot into the dos image and see all the 
tools you have put there. 
* Next, you need to load the appropriate network drivers. 
* Search for the bios flash and nvram reading and writing tools.
* The ssh client works with a key, so you avoid the passwd prompt.
  ssh the FAI server and change the pxelinux.cfg files to initialize the FAI 
installation (fai-chboot). 
* reboot

Put everything in the autoexec.bat and it works automatically. (Has not been 
tested yet)

Regards
Henning Fehrmann

Antwort per Email an