Mac mini G4をネットブートしてNetBSD/macppcをdiskless利用する
2003年頃に新品で入手したMac mini G4があって、macOSは10.5まで動いている。これはネットワーク越しに起動できると聞いたことがあるので、NetBSD/macppcが動くかどうか試してみた。NetBSDを起動したい場合にはOpenFirmwareで
boot enet:,ofwboot.xcf
とすればいいという話であるが、ここで、tftpサーバーからofwboot.xcfは読み込まれるのだけれど、その先、カーネルファイル(netbsd)が読み込まれない状況に数年間陥った。結果としては、ISC-DHCPサーバーの設定不足だったのだが、なかなか気づけないものであり、詳しい人から参考文献を教えてもらって何とかなった。つまり、macOSならではのネットブート設定が必要だった。
例えば、対象とするMac miniをホスト名snipsとする、IPアドレスなどは192.168.42.199/24とする、NFS rootはNFSサーバーの/export/root/snipsを使う、有線LANのMACアドレスが00:11:24:xx:yy:zzであるという場合、ISC-DHCPサーバー利用の場合にはdhcpd.confを次のようにする必要があった。
subnet 192.168.42.0 netmask 255.255.255.0 {
authoritative;
range 192.168.42.200 192.168.42.250;
next-server = config-option dhcp-server-identifier;
}
# Defintions for Apple's Boot Server Discovery Protocol (BSDP)
option space BSDP;
option BSDP.message-type code 1 = unsigned integer 8;
option BSDP.version code 2 = unsigned integer 16;
option BSDP.server-identifier code 3 = ip-address;
option BSDP.server-priority code 4 = unsigned integer 16;
option BSDP.reply-port code 5 = unsigned integer 16;
# Implement dummy BSDP interaction to keep OFW happy
class "Apple-BSDP" {
match if substring (option vendor-class-identifier, 0, 10) = "AAPLBSDPC/";
vendor-option-space BSDP;
if (option dhcp-message-type = 8) { # DHCP INFORM
option vendor-class-identifier "AAPLBSDPC";
parse-vendor-option;
# reply with an empty list
if (option BSDP.message-type = 1) { # BSDP LIST
log(info, "BSDP_LIST");
option BSDP.message-type 1;
option BSDP.server-identifier = config-option dhcp-server-identifier;
option BSDP.server-priority 32768;
}
# just ack SELECT
elsif (option BSDP.message-type = 2) { # BSDP SELECT
log(info, "BSDP_SELECT");
option BSDP.message-type 2;
}
} # INFORM
}
host snips {
hardware ethernet 00:11:24:xx:yy:zz;
fixed-address 192.168.42.199;
filename "ofwboot.elf";
option root-path "/export/root/snips";
}
swapの設定やら何やらは別途必要として、これでめでたくNetBSD/macppcが使えるようになった。dmesg.bootをgithubに置いておく。