Mac OS X:跨网段Netboot

1最简单的命令:

/usr/sbin/bless --netboot --server bsdp://bootServerIP

2.复杂的

下面的可以定义更复杂的参数,适用于复杂的环境,把其中的前部参数都设置好。

#!/bin/sh ## Set the following variables server="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 machines ppcSetName="DeployStudioRuntime-ppc.nbi" # Enter PPC netboot set name - typically Tiger or Leopard imageName="DeployStudioRuntime.sparseimage" # Enter image name, if using DeployStudio, no need to change protocol="nfs" # Enter protocol, nfs or http simple="false" -- If set to true, will boot from default netboot image nextboot="--nextonly" ## You shouln't need to change anything below if [ $simple == true ]; then if [ "`arch`" == "ppc" ]; then /usr/sbin/nvram boot-device="enet:${server}" boot-args="" boot-file="" else /usr/sbin/bless --netboot --server "bsdp://${server}" $nextboot fi else if [ "`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}" $nextboot fi fi

3. AppleScript的方法

(* Set NetBoot Across Subnets.scpt © 2011 Patrick Gallagher http://blog.macadmincorner.com This script may be freely modified. Use at your own risk, no warranty. Based on NBAS from Mike Bombich *) -- Set the following options set server to "server.school.edu" --Enter IP or FQDN of netboot server set sharepoint to "NetBootSP0" --In most cases this will not need to change set setName to "DeployStudioRuntime-Intel.nbi" --Enter your Intel compatible netboot set name set ppcSetName to "DeployStudioRuntime-PPC.nbi" --Enter your PPC netboot set name, if you have one set imageName to "DeployStudioRuntime.sparseimage" --Enter image name, if using DeployStudio, no need to change set protocol to "nfs" --Enter nfs or http set nextboot to "--nextonly" set arch to do shell script "arch" --No modification should be needed below if arch is equal to "i386" then do 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 privileges else do shell script "/usr/sbin/nvram boot-args=rp=" & protocol & ":" & server & ":/private/tftpboot/NetBoot/" & sharepoint & ":" & ppcSetName & "/" & imageName & space & "boot-file=enet:" & server & ",NetBoot" & sharepoint & "" & ppcSetName & "ppcmach.macosx/" boot-device=enet:" & server & ",NetBoot" & sharepoint & "" & ppcSetName & "ppcbooter/"" with administrator privileges end if tell application "loginwindow" «event aevtrrst» end tell

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值