Intel MAC Netboot survey

Intel MAC Netboot survey

首先,最近公司有一台 MacBookPro,內建的 OSX 並不是讓我很滿意,所以就拿掉原本的 OS 換成 Ubuntu 8.04.1。安裝過程順利,並不需要什麼特別的手段就可以開機操作,於是就想到要用 DRBL 來遠端開機。

Mac 系列的電腦並沒有 BIOS,它在 PPC 時代使用的是 Open Firmware,Intel 系列則在 Open Firmware 上加一層 Interface 叫作 EFI (Extensible Firmware Interface),角色是作業系統與軔體之間的橋樑。由於 Open Firmware 不像 BIOS 有一個簡單的介面控制,反到有點像小型的作業系統(令人聯想到 busybox),提供簡單的 shell 給使用者操作。MAC PPC 的使用者可以在開機的時候用鍵盤 "cmd+opt+O+F" 進入操作介面;而 MAC Intel 就沒這方便了,我個人是猜測 EFI 的關係,但是可以依照 Nak's Blog 的方式去做,就可以在 OS 之前進入 Open Firmware。

第一個遇到的問題是網路開機:

最簡單的方法是開機的時候按 "N" 即可。另外如果想每次都是網路開機,Forcing the Mac Mini to boot from the net 有提供方法,主要就是 OSX 用 nvram 去下指令與 firmware 溝通。

第二個問題是 DHCP/BSDP:

一般像是 DRBL 都有提供 DHCP Server 的功能,但是 MAC 需要的是 BSDP (Boot Server Discovery Protocol),因此ISC DHCP Server 已經提供 BSDP 的服務,主要是加上 allow bootp;

可以參考我的設定檔:

#

# Sample configuration file for ISC dhcpd for netbooting NewWorld macs

#

# \$Id: dhcpd.conf,v 1.4 2002/05/05 21:28:06 peloy Exp \$

#

# The ddns-updates-style parameter controls whether or not the server will

# attempt to do a DNS update when a lease is confirmed. We default to the

# behavior of the version 2 packages ('none', since DHCP v2 didn't

# have support for DDNS.)

ddns-update-style none;

# option definitions common to all supported networks...

option domain-name "TDRBL";

option domain-name-servers 168.95.1.1;

default-lease-time 600;

max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local

# network, the authoritative directive should be uncommented.

authoritative;

allow bootp;

##Mac NetBoot Options

## (these require dhcpd 3.0+)

option mac-version code 230 = string;

option mac-version 0:0:0:0;

class "AppleNBI-i386" {

match if substring (option vendor-class-identifier, 0, 14) = "AAPLBSDPC/i386";

option dhcp-parameter-request-list 1,3,17,43,60;

if (option dhcp-message-type = 1) { option vendor-class-identifier "AAPLBSDPC/i386"; }

if (option dhcp-message-type = 1) { option vendor-encapsulated-options 08:04:81:00:00:67; }

}

subnet 192.168.1.0 netmask 255.255.255.0 {

range dynamic-bootp 192.168.1.1 192.168.1.253;

option routers 192.168.1.254;

filename "/elilo.efi"; # relative to the /tftpboot directory, due to the -s option

server-name "nimble";

server-identifier 192.168.1.254; # your tftp server

next-server 192.168.1.254; # your tftp server

}

第三個問題,TFTP的部份:

嘗試用 DRBL 預設的 PXELinux 但是失敗,所以陸續又嘗試了 grub, elilo, yaboot(想也知道當然不行吧),我把最後的希望放在 grun-efi (grub2),另外不想嘗試傳統綁網卡的作法。

這個測試實在花很多時間和精力,所以暫時卡在這邊,還沒有辦法成功導入 kernel ... 殘念

用 tcpdump 開機的結果

> Client-Ethernet-Address 00:1f:f3:50:b2:49 (oui Unknown) [|bootp]22:26:31.256877 IP (tos 0x10, ttl  16, id 0, offset 0, flags [none], proto: UDP (17), length: 328) 192.168.1.254.bootps > 192.168.1.253.bootpc: BOOTP/DHCP, Reply, length 300, xid 0x306f, secs 5, Flags [ none ] (0x0000)Your-IP 192.168.1.253Server-IP 192.168.1.254Client-Ethernet-Address 00:1f:f3:50:b2:49 (oui Unknown)sname "nimble" [|bootp]22:26:32.356443 IP (tos 0x0, ttl  16, id 7365, offset 0, flags [none], proto: UDP (17), length: 576) illegalhost.bootpc > illegalhost.bootps: BOOTP/DHCP, Request from 00:1f:f3:50:b2:49 (oui Unknown), length 548, xid 0x306f, secs 5, Flags [ none ] (0x0000)Client-Ethernet-Address 00:1f:f3:50:b2:49 (oui Unknown) [|bootp]22:26:32.359731 IP (tos 0x10, ttl  16, id 0, offset 0, flags [none], proto: UDP (17), length: 328) 192.168.1.254.bootps > 192.168.1.253.bootpc: BOOTP/DHCP, Reply, length 300, xid 0x306f, secs 5, Flags [ none ] (0x0000)Your-IP 192.168.1.253Server-IP 192.168.1.254Client-Ethernet-Address 00:1f:f3:50:b2:49 (oui Unknown)sname "nimble" [|bootp]22:26:33.359838 IP (tos 0x0, ttl  16, id 58641, offset 0, flags [none], proto: UDP (17), length: 67) 192.168.1.253.54144 > 192.168.1.254.tftp: [udp sum ok]  39 RRQ "/elilo.efi" octet blksize 512 tsize 022:26:34.391287 IP (tos 0x0, ttl  16, id 39577, offset 0, flags [none], proto: UDP (17), length: 60) 192.168.1.253.54145 > 192.168.1.254.tftp: [udp sum ok]  32 RRQ "/elilo.efi" octet blksize 8192

可以看到 MAC 透過 BSTP 拿到 IP,同時 TFTP 也有運作,但就是失敗!

Reference:

Debian -- Details of package eliloThis is the Linux bootloader for systems using the Intel EFI firmware specification. This includes all ia64 systems, and some ia32 systems. Diskless_Mac-Mini_HowtoThis Diskless Mac-Mini Howto should allow you to netboot a Mac Mini MythTV frontend (powerpc, not the newer intel mini!) from a Fedora 4 server netboot.sf.netNetboot is a set of tools that allows you to boot a Intel compatible CPU off of a network, provided the necessary infrastructure of network cards , DHCP, TFTP servers and network connectivity etc. 【翻譯】Mac OSX開機有關Mac的韌體 與開機流程的說明,翻譯的很好也很清楚! Introduction (macppc-specific), Diskless NetBSD HOW-TOAll NetBSD-supported Power Macs can boot over their built-in network interface. There are no reported cases of people being able to netboot over PCI, Cardbus, SCSI, or Airport network interfaces. Open Firmware - Wikipedia, the free encyclopediaOpen Firmware, or OpenBoot in Sun Microsystems parlance, is a standard defining the interfaces of a computer firmware system, formerly endorsed by the IEEE. Extensible_Firmware_InterfaceThe Extensible Firmware Interface (EFI) is a specification that defines a software interface between an operating system and platform firmware. Debian -- Details of package grub-efi in sidThis package contains a version of GRUB that has been built for use with EFI architecture, such as the one provided by Intel Macs (that is, unless a BIOS interface has been activated). Open FirmwareOpen Firmware is processor and system independent boot firmware. This is the home page for the Open Firmware Working Group. You can read more about Open Firmware, the working group, and several documents related to Open Firmware. Extensible Firmware Interface (EFI)The EFI specification defines a model for the interface between operating systems and platform firmware. 5.1. 在 IA-64 上啟動安裝程式Debian CD 包含了一個小型版本的 EFI 分割區來放置其設定檔ELILO、安裝程式核心以及初始的檔案系統 (initrd)。運行的系統同時也包含了一個 EFI 分割區用於放置開機系統所需要的必要檔案。 Nak's BlogI figured out a way to get in to the EFI menu on the new Intel iMac.

convert from Thomas blog post id 352 old convert log: ./140138/tag%3E2008%2009%20linux)

@2008 @09 @linux

Comments