Mac OS X:跨网段Netboot
1最简单的命令:
/usr/sbin/bless --netboot --server bsdp://bootServerIP
2.复杂的
下面的可以定义更复杂的参数,适用于复杂的环境,把其中的前部参数都设置好。
#!/bin/sh ## Set the following variablesserver="server.school.edu"# Enter IP or FQDN of netboot server sharepoint="NetBootSP0" # Won't need to change in most cases setName="DeployStudioRuntime-intel.nbi" # Enter netboot set name for Intel machinesppcSetName="DeployStudioRuntime-ppc.nbi" # Enter PPC netboot set name - typically Tiger or LeopardimageName="DeployStudioRuntime.sparseimage" # Enter image name, if using DeployStudio, no need to changeprotocol="nfs"# Enter protocol, nfs or httpsimple="false" -- If set to true, will boot from default netboot imagenextboot="--nextonly"## You shouln't need to change anything belowif [ $simple == true ]; thenif [ "`arch`" == "ppc" ]; then/usr/sbin/nvram boot-device="enet:${server}" boot-args="" boot-file=""else/usr/sbin/bless --netboot --server "bsdp://${server}" $nextbootfielseif [ "`arch`" == "ppc" ]; then/usr/sbin/nvram boot-args="rp=${protocol}:${server}:/private/tftpboot/NetBoot/${sharepoint}:${ppcSetName}/${imageName}" boot-file="enet:${server},NetBoot//${sharepoint}//${ppcSetName}//ppc//mach.macosx" boot-device="enet:${server},NetBoot//${sharepoint}//${ppcSetName}//ppc//booter"else/usr/sbin/bless --netboot --booter "tftp://${server}/NetBoot/${sharepoint}/${setName}/i386/booter" --kernel "tftp://${server}/NetBoot/${sharepoint}/${setName}/i386/mach.macosx" --options "rp=${protocol}:${server}:/private/tftpboot/NetBoot/${sharepoint}:${setName}/${imageName}" $nextbootfifi
3. AppleScript的方法
(*Set NetBoot Across Subnets.scpt© 2011 Patrick Gallagherhttp://blog.macadmincorner.comThis script may be freely modified. Use at your own risk, no warranty. Based on NBAS from Mike Bombich*)-- Set the following optionsset server to "server.school.edu" --Enter IP or FQDN of netboot serverset sharepoint to "NetBootSP0" --In most cases this will not need to changeset setName to "DeployStudioRuntime-Intel.nbi" --Enter your Intel compatible netboot set nameset ppcSetName to "DeployStudioRuntime-PPC.nbi" --Enter your PPC netboot set name, if you have oneset imageName to "DeployStudioRuntime.sparseimage" --Enter image name, if using DeployStudio, no need to changeset protocol to "nfs" --Enter nfs or httpset nextboot to "--nextonly"set arch to do shell script "arch"--No modification should be needed belowif arch is equal to "i386" thendo shell script "usr/sbin/bless --netboot --booter tftp://" & server & "/NetBoot/" & sharepoint & "/" & setName & "/i386/booter --kernel tftp://" & server & "/NetBoot/" & sharepoint & "/" & setName & "/i386/mach.macosx --options rp=nfs:" & server & ":/private/tftpboot/NetBoot/" & sharepoint & ":" & setName & "/" & imageName & space & "--nextonly" with administrator privilegeselsedo shell script "/usr/sbin/nvram boot-args=rp=" & protocol & ":" & server & ":/private/tftpboot/NetBoot/" & sharepoint & ":" & ppcSetName & "/" & imageName & space & "boot-file=enet:" & server & ",NetBoot////" & sharepoint & "////" & ppcSetName & "////ppc////mach.macosx/" boot-device=enet:" & server & ",NetBoot////" & sharepoint & "////" & ppcSetName & "////ppc////booter/"" with administrator privilegesend iftell application "loginwindow"«event aevtrrst»end tell
页:
[1]