Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions pixiecore/boot.ipxe
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ set user-class pixiecore

echo metal-stack pixie

echo Manufacturer: ${manufacturer}

# Detect serial console based on manufacturer.
# Implicitly ttyS1 is used as console for Supermicro.

set console ttyS1
set sp:hex 20 && set sp ${sp:string}
iseq ${manufacturer} Dell${sp}Inc. && set console ttyS0 ||
iseq ${manufacturer} Giga${sp}Computing && set console ttyS0 ||

# Try to get a filename from ProxyDHCP, retrying a couple of times if
# we fail.
:loop
Expand Down
1 change: 1 addition & 0 deletions pixiecore/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ func ipxeScript(mach Machine, spec *Spec, serverHost string) ([]byte, error) {
if err != nil {
return nil, fmt.Errorf("expanding cmdline %q: %w", spec.Cmdline, err)
}
b.WriteString("console=${console},115200n8 ")
b.WriteString(cmdline)
b.WriteByte('\n')

Expand Down
4 changes: 2 additions & 2 deletions pixiecore/http_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ initrd --name initrd0 http://localhost:1234/_/file?name=i1-01%3A02%3A03%3A04%3A0
initrd --name initrd1 http://localhost:1234/_/file?name=i2-01%3A02%3A03%3A04%3A05%3A06-0&type=initrd&mac=01%3A02%3A03%3A04%3A05%3A06
imgfetch --name ready http://localhost:1234/_/booting?mac=01%3A02%3A03%3A04%3A05%3A06 ||
imgfree ready ||
boot kernel initrd=initrd0 initrd=initrd1 thing=http://localhost:1234/_/file?name=f-01%3A02%3A03%3A04%3A05%3A06-0 foo=bar
boot kernel initrd=initrd0 initrd=initrd1 console=${console},115200n8 thing=http://localhost:1234/_/file?name=f-01%3A02%3A03%3A04%3A05%3A06-0 foo=bar
`
if rr.Body.String() != expected {
t.Fatalf("Wrong iPXE script\nwant: %s\ngot: %s", expected, rr.Body.String())
Expand All @@ -96,7 +96,7 @@ initrd --name initrd0 http://localhost:1234/_/file?name=i1-fe%3Afe%3Afe%3Afe%3Af
initrd --name initrd1 http://localhost:1234/_/file?name=i2-fe%3Afe%3Afe%3Afe%3Afe%3Afe-1&type=initrd&mac=fe%3Afe%3Afe%3Afe%3Afe%3Afe
imgfetch --name ready http://localhost:1234/_/booting?mac=fe%3Afe%3Afe%3Afe%3Afe%3Afe ||
imgfree ready ||
boot kernel initrd=initrd0 initrd=initrd1 thing=http://localhost:1234/_/file?name=f-fe%3Afe%3Afe%3Afe%3Afe%3Afe-1 foo=bar
boot kernel initrd=initrd0 initrd=initrd1 console=${console},115200n8 thing=http://localhost:1234/_/file?name=f-fe%3Afe%3Afe%3Afe%3Afe%3Afe-1 foo=bar
`
if rr.Body.String() != expected {
t.Fatalf("Wrong iPXE script\nwant: %s\ngot: %s", expected, rr.Body.String())
Expand Down