由于 TCP/IP BootPROM 中唯一可用的网络支持是 TFTP,因此人们对增强 TFTP 服务器以提供新功能特别感兴趣。
InCom GmbH 随 TCP/IP BootPROM 分发了一个增强型 TFTP 服务器,它可以发送高达 1408 字节的数据包,而不是标准的 512 字节。这是一个很大的增强,您应该使用它。此服务器在 Solaris、Windows 和 Netware NLM 的 TCP/IP Bootprom 实用程序磁盘上可用。
我们构建了一个修改版的 Linux TFTP 服务器,使其行为类似于 InCom 增强型 TFTP 服务器。基本上,我们只是将数据包大小从 512 字节更改为 1408 字节,并将端口从 69 更改为 59。它可以从 http://cuiwww.unige.ch/info/pc/remote-boot/soft/etdtpd.tar.gz
获取。
我们编写了一个特殊的 TFTP 服务器,用作验证用户的安全网关。此服务器在 Linux 或 Solaris 下运行,并且可以根据 Unix 密码数据库(支持 NIS 和 shadow 密码)、Windows NT(或 Samba)服务器或 Radius 服务器验证用户身份。它可以从 http://cuiwww.unige.ch/info/pc/remote-boot/soft/stdtpd.tar.gz
获取,包含源代码和预编译的二进制文件。预编译的二进制文件不包含 NT 密码加密,因为我们无法分发 libdes
,但编译过程很简单。
为了使用安全网关,您只需设置一个简单的安全域配置文件,该文件描述了每个逻辑安全域映射到哪个身份验证服务器(Unix
域隐式映射到服务器 Unix 密码数据库)。这是一个示例配置文件
#
# STFTPD configuration file
#
# This file specify the server of the "security domains". Two types of
# authentication servers are supported : radius or winnt (winnt includes
# NT Server and Samba)
#
# Format of radius servers
# radius <domain> <serveraddress> <secret>
#
# secret is the secret word as specified in your /etc/raddb/clients file
#
# Format of SMB servers
# winnt <domain> <serveraddress> <netbiosname>
#
# netbiosname is the NETBIOS name of your server
#
# Examples
radius sec-dom-rad radiusserver testing123
winnt sec-dom-nt1 192.168.1.1 NTSERVER1
winnt sec-dom-smb samba SAMBA1
请注意,如果您使用 Samba,则必须设置 security = user
。您还可以向安全服务器提供一个文件,其中包含不允许登录的用户列表(无论如何,对这些用户的检查都会失败)。
我们编写了一个特殊的 TFTP 服务器,它实现了 TFTP 的自制广播变体。使用此服务器,我们能够在负载很重的 10 Mb 以太网网络上以 6 Mb/s 的速度将映像下载到 25 个客户端(它比常规 TFTP 更有效,因为它不需要确认每个数据包)。此服务器在 Linux 或 Solaris 下运行。它可以从 http://cuiwww.unige.ch/info/pc/remote-boot/soft/btdtpd.tar.gz
获取,包含源代码和预编译的二进制文件。
由于 TCP/IP bootprom 不支持此协议,我们的解决方案是使用本文档中描述的工具启动一个基于内存盘的微型 Linux 系统,并运行 Linux 版本的 MrBatch,它内置了对广播 TFTP 的支持。一个简单的批处理文件可以在几分钟内将所有文件下载到缓存,同时在所有客户端计算机上进行。您无需自行安装 Linux 即可使用此软件包,除非您有特殊的硬件并且无法直接使用软件包中提供的内核。
该过程如下所示。首先,手动启动广播服务器,并将预期的客户端计算机数量作为参数给出(请记住,此过程不是每天使用,而仅当您更改了映像并希望确保立即将其上传到所有客户端计算机时才使用)。然后,打开所有客户端计算机,它们将运行以下 BpBatch 脚本
#
# This batch is run by bpbatch to launch a mini-linux using an initial
# ramdisk, which will then run mrbatch under linux.
#
# The broadcast TFTP protocol only works with the Linux implementation of
# mrbatch, because of the lack of broadcast support in the bootprom itself.
#
# 1. Setup a tiny partition, to let a lot of space for the cache
setpartitions "BIGDOS:50"
# 2. Clean the MBR
clean 0
# 3. Run a Linux Kernel with initrd (Initial Ramdisk) supprt, and use
# bcastrd.gz as the initial ramdisk (will be mounted root and then
# executed via /linuxrc). See initrd.txt for more details about
# initial ramdisks. You don't have to specify a root device (second
# parameter is null) to the kernel, it will use the initial ramdisk.
linuxboot "linux.krn" "" "bcastrd.gz"
# 4. The initial ramdisk will run dhcpcd to setup networking using DHCP.
# It will then run mrbatch -w bcastlx
初始内存盘包含dhcpcd
,一个用于设置网络的 DHCP 客户端mrbatch
linuxrc
,一个由 initrd 自动启动的小型包装器,它启动 dhcpcd
,然后启动 mrbatch
。usr/lib/terminfo/l/linux
,MrBatch 使用dev/*
,运行 Linux 和 mrbatch 所需的设备libc.so
。生成的内存盘经过 Gzip 压缩,小于 300 KB。内核本身占用 450 KB(具有许多网卡和 initrd 支持)。当 Linux 启动并运行时,将使用以下脚本调用 MrBatch(您应该根据自己的需要编辑该脚本)
# This file is executed when mrbatch is launched by the initial ramdisk
# bcastrd.gz
# It's main purpose is to "broacast copy" files to the cache
#
# 1. Be verbose
showlog
# 2. Don't want a "press a key"
set pauselog="OFF"
# 3. Set partitions at their final values.
# Important: Since you will copy files into the cache to be used in future
# boot, you need to specify the same partitions as in the future boots.
setpartitions "BIGDOS:1024"
# 4. Clean the CACHE partition
clean -1
# 5. And the copy files into the cache, using the Broadcast TFTP protocol
# (port 99)
#
# You can use the script "as is", but you surely need to modify the following
# line ! In our example, we download the file mblinux.imz, which is the image
# file for our installation of Linux.
copy "$BOOTP-Server-IP@99:mblinux.imz" "{:-1}mblinux.imz"
传输完成后,您可以简单地关闭所有客户端计算机,并将它们的初始启动脚本更改为您喜欢的菜单。