···119119- [NixOS netboot with pixiecore](https://nixos.wiki/wiki/Netboot)
120120- [The Pixiecore library](https://github.com/danderson/netboot/tree/main/pixiecore)
121121- Custom agent for the installation process inspired by [OpenStack ironic-python-agent](https://opendev.org/openstack/ironic-python-agent) and [Tinkerbell Worker](https://tinkerbell.org/docs/services/tink-worker)
122122+- Wireshark's [WakeOnLAN wiki page](https://wiki.wireshark.org/WakeOnLAN)
123123+- AMD's [Magic Packet Technology](https://www.amd.com/content/dam/amd/en/documents/archived-tech-docs/white-papers/20213.pdf) white paper
+30
internal/network/wol.go
···11+package network
22+33+import "net"
44+55+func buildMacicPacket(mac net.HardwareAddr) []byte {
66+ // A physical WakeOnLAN (Magic Packet) will look like this:
77+ //
88+ // | Synchronization Stream | Target MAC | Password (optional) |
99+ // | 6 | 96 | 0, 4 or 6 |
1010+ //
1111+ // See also https://wiki.wireshark.org/WakeOnLAN
1212+ packet := make([]byte, 0)
1313+1414+ const (
1515+ // The synchronization stream is defined as 6 bytes of FFh
1616+ syncStreamLength = 6
1717+ // The Target MAC block contains 16 duplications of the IEEE address of the target
1818+ macRepeat = 16
1919+ // We don't support passwords, at least not yet
2020+ )
2121+2222+ for range syncStreamLength {
2323+ packet = append(packet, 0xFF)
2424+ }
2525+ for range macRepeat {
2626+ packet = append(packet, mac...)
2727+ }
2828+2929+ return packet
3030+}