Solaris 10 10/08 安裝指南:網路安裝

撰寫使用 dhtadm 建立選項與巨集的程序檔

您可改寫範例 3–1 中的範例來建立 Korn shell 程序檔,以建立列於表 3–3表 3–4 中的所有選項,以及一些實用巨集。一定要將所有的 IP 位址和引號中的值變更為正確的網路 IP 位址、伺服器名稱以及路徑。您還應該編輯 Vendor= 金鑰以指示您所擁有的用戶端之類別。使用 add_install_client -d 報告的資訊,以取得改寫程序檔所需的資料。


範例 3–1 支援網路安裝的程序檔範例

# Load the Solaris vendor specific options. We'll start out supporting 
# the Sun-Blade-1000, Sun-Fire-880, and i86 platforms. Note that the 
# SUNW.i86pc option only applies for the Solaris 10 3/05 release. 
# Changing -A to -M would replace the current values, rather than add them.
dhtadm -A -s SrootOpt -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,1,ASCII,1,0'
dhtadm -A -s SrootIP4 -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,2,IP,1,1'
dhtadm -A -s SrootNM -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,3,ASCII,1,0'
dhtadm -A -s SrootPTH -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,4,ASCII,1,0'
dhtadm -A -s SswapIP4 -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,5,IP,1,0'
dhtadm -A -s SswapPTH -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,6,ASCII,1,0'
dhtadm -A -s SbootFIL -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,7,ASCII,1,0'
dhtadm -A -s Stz -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,8,ASCII,1,0'
dhtadm -A -s SbootRS -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,9,NUMBER,2,1'
dhtadm -A -s SinstIP4 -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,10,IP,1,1'
dhtadm -A -s SinstNM -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,11,ASCII,1,0'
dhtadm -A -s SinstPTH -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,12,ASCII,1,0'
dhtadm -A -s SsysidCF -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,13,ASCII,1,0'
dhtadm -A -s SjumpsCF -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,14,ASCII,1,0'
dhtadm -A -s Sterm -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,15,ASCII,1,0'
dhtadm -A -s SbootURI -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,16,ASCII,1,0'
dhtadm -A -s SHTTPproxy -d \
'Vendor=SUNW.Sun-Blade-1000 SUNW.Sun-Fire-880 SUNW.i86pc,17,ASCII,1,0'
# Load some useful Macro definitions.
# Define all Solaris-generic options under this macro named Solaris.
dhtadm -A -m Solaris -d \
':SrootIP4=10.21.0.2:SrootNM="blue2":SinstIP4=10.21.0.2:SinstNM="red5":'
# Define all sparc-platform specific options under this macro named sparc.
dhtadm -A -m sparc -d \
':SrootPTH="/export/sparc/root":SinstPTH="/export/sparc/install":'
# Define all sun4u architecture-specific options under this macro named sun4u. 
#  (Includes Solaris and sparc macros.)
dhtadm -A -m sun4u -d ':Include=Solaris:Include=sparc:'
# Solaris on IA32-platform-specific parameters are under this macro named i86pc.
# Note that this macro applies only for the Solaris 10 3/05 release.
dhtadm -A -m i86pc -d \
':Include=Solaris:SrootPTH="/export/i86pc/root":SinstPTH="/export/i86pc/install"\
:SbootFIL="/platform/i86pc/kernel/unix":'
# Solaris on IA32 machines are identified by the "SUNW.i86pc" class. All
# clients identifying themselves as members of this class will see these
# parameters in the macro called SUNW.i86pc, which includes the i86pc macro.
# Note that this class only applies for the Solaris 10 3/05 release.
dhtadm -A -m SUNW.i86pc -d ':Include=i86pc:'
# Sun-Blade-1000 platforms identify themselves as part of the 
# "SUNW.Sun-Blade-1000" class.
# All clients identifying themselves as members of this class
#  will see these parameters.
dhtadm -A -m SUNW.Sun-Blade-1000 -d \
':SbootFIL="/platform/sun4u/kernel/sparcv9/unix":\
Include=sun4u:'
# Sun-Fire-880 platforms identify themselves as part of the "SUNW.Sun-Fire-880" class.
# All clients identifying themselves as members of this class will see these parameters.
dhtadm -A -m SUNW.Sun-Fire-880 -d \
':SbootFIL="/platform/sun4u/kernel/sparcv9/unix":Include=sun4u:'
# Add our boot server IP to each of the network macros for our topology served by our
# DHCP server. Our boot server happens to be the same machine running our DHCP server.
dhtadm -M -m 10.20.64.64 -e BootSrvA=10.21.0.2
dhtadm -M -m 10.20.64.0 -e BootSrvA=10.21.0.2
dhtadm -M -m 10.20.64.128 -e BootSrvA=10.21.0.2
dhtadm -M -m 10.21.0.0 -e BootSrvA=10.21.0.2
dhtadm -M -m 10.22.0.0	-e BootSrvA=10.21.0.2
# Make sure we return host names to our clients.
dhtadm -M -m DHCP-servername -e Hostname=_NULL_VALUE_
# Create a macro for PXE clients that want to boot from our boot server.
# Note that this macro applies for the Solaris 10 3/05 release.
dhtadm -A -m PXEClient:Arch:00000:UNDI:002001 -d \
:BootFile=nbp.i86pc:BootSrvA=10.21.0.2:
# Create a macro for PXE clients that want to boot from our boot server.
# Note that this macro applies for the Solaris 10 2/06 release.
dhtadm -A -m PXEClient:Arch:00000:UNDI:002001 -d \
:BootFile=i86pc:BootSrvA=10.21.0.2:
# Create a macro for the x86 based client with the Ethernet address 00:07:e9:04:4a:bf 
# to install from the network by using PXE.
dhtadm -A -m 010007E9044ABF -d :BootFile=010007E9044ABF:BootSrvA=10.21.0.2:
# The client with this MAC address is a diskless client. Override the root settings
# which at the network scope setup for Install with our client's root directory.
dhtadm -A -m 0800201AC25E -d \
':SrootIP4=10.23.128.2:SrootNM="orange-svr-2":SrootPTH="/export/root/10.23.128.12":'

以超級使用者的身份使用批次模式執行 dhtadm。指定程序檔的名稱,以將選項與巨集增加到您的 dhcptab。例如,如果程序檔的名稱為 netinstalloptions,請鍵入以下指令。


# dhtadm -B netinstalloptions

具有 Vendor= 字串中所列供應商用戶端類別的用戶端,現在可以使用 DHCP 透過網路進行安裝。

如需有關如何使用 dhtadm 指令的更多資訊,請參閱「dhtadm(1M) 線上手冊」。如需有關 dhcptab 檔案的更多資訊,請參閱「dhcptab(4) 線上手冊」。