Skip to content

Commit 32df583

Browse files
committed
Write ttyS0
1 parent a02ea07 commit 32df583

3 files changed

Lines changed: 3 additions & 13 deletions

File tree

‎pixiecore/booters.go‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ func (g *grpcbooter) BootSpec(m Machine) (*Spec, error) {
115115
if g.config.Debug {
116116
cmdline = append(cmdline, "DEBUG=1")
117117
}
118-
cmdline = append(cmdline, "console=ttyS0,115200n8")
119118

120119
r = rawSpec{
121120
Kernel: resp.GetKernel(),

‎pixiecore/http.go‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,9 +196,6 @@ func ipxeScript(mach Machine, spec *Spec, serverHost string) ([]byte, error) {
196196
urlTemplate := fmt.Sprintf("http://%s/_/file?name=%%s&type=%%s&mac=%%s", serverHost)
197197
var b bytes.Buffer
198198
b.WriteString("#!ipxe\n")
199-
b.WriteString("set console ttyS0\n")
200-
b.WriteString("iseq ${manufacturer} \"Dell Inc.\" && set console ttyS0\n")
201-
b.WriteString("iseq ${manufacturer} \"Supermicro\" && set console ttyS1\n")
202199
u := fmt.Sprintf(urlTemplate, url.QueryEscape(string(spec.Kernel)), "kernel", url.QueryEscape(mach.MAC.String()))
203200
fmt.Fprintf(&b, "kernel --name kernel %s\n", u)
204201
for i, initrd := range spec.Initrd {
@@ -222,7 +219,7 @@ func ipxeScript(mach Machine, spec *Spec, serverHost string) ([]byte, error) {
222219
if err != nil {
223220
return nil, fmt.Errorf("expanding cmdline %q: %w", spec.Cmdline, err)
224221
}
225-
// b.WriteString("console=ttyS0,115200n8 ")
222+
b.WriteString("console=ttyS0,115200n8 ")
226223
b.WriteString(cmdline)
227224
b.WriteByte('\n')
228225

‎pixiecore/http_test.go‎

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,12 @@ func TestIpxe(t *testing.T) {
6666
}
6767

6868
expected := `#!ipxe
69-
set console ttyS0
70-
iseq ${manufacturer} "Dell Inc." && set console ttyS0
71-
iseq ${manufacturer} "Supermicro" && set console ttyS1
7269
kernel --name kernel http://localhost:1234/_/file?name=k-01%3A02%3A03%3A04%3A05%3A06-0&type=kernel&mac=01%3A02%3A03%3A04%3A05%3A06
7370
initrd --name initrd0 http://localhost:1234/_/file?name=i1-01%3A02%3A03%3A04%3A05%3A06-0&type=initrd&mac=01%3A02%3A03%3A04%3A05%3A06
7471
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
7572
imgfetch --name ready http://localhost:1234/_/booting?mac=01%3A02%3A03%3A04%3A05%3A06 ||
7673
imgfree ready ||
77-
boot kernel initrd=initrd0 initrd=initrd1 thing=http://localhost:1234/_/file?name=f-01%3A02%3A03%3A04%3A05%3A06-0 foo=bar
74+
boot kernel initrd=initrd0 initrd=initrd1 console=ttyS0,115200n8 thing=http://localhost:1234/_/file?name=f-01%3A02%3A03%3A04%3A05%3A06-0 foo=bar
7875
`
7976
if rr.Body.String() != expected {
8077
t.Fatalf("Wrong iPXE script\nwant: %s\ngot: %s", expected, rr.Body.String())
@@ -94,15 +91,12 @@ boot kernel initrd=initrd0 initrd=initrd1 thing=http://localhost:1234/_/file?nam
9491
}
9592

9693
expected = `#!ipxe
97-
set console ttyS0
98-
iseq ${manufacturer} "Dell Inc." && set console ttyS0
99-
iseq ${manufacturer} "Supermicro" && set console ttyS1
10094
kernel --name kernel http://localhost:1234/_/file?name=k-fe%3Afe%3Afe%3Afe%3Afe%3Afe-1&type=kernel&mac=fe%3Afe%3Afe%3Afe%3Afe%3Afe
10195
initrd --name initrd0 http://localhost:1234/_/file?name=i1-fe%3Afe%3Afe%3Afe%3Afe%3Afe-1&type=initrd&mac=fe%3Afe%3Afe%3Afe%3Afe%3Afe
10296
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
10397
imgfetch --name ready http://localhost:1234/_/booting?mac=fe%3Afe%3Afe%3Afe%3Afe%3Afe ||
10498
imgfree ready ||
105-
boot kernel initrd=initrd0 initrd=initrd1 thing=http://localhost:1234/_/file?name=f-fe%3Afe%3Afe%3Afe%3Afe%3Afe-1 foo=bar
99+
boot kernel initrd=initrd0 initrd=initrd1 console=ttyS0,115200n8 thing=http://localhost:1234/_/file?name=f-fe%3Afe%3Afe%3Afe%3Afe%3Afe-1 foo=bar
106100
`
107101
if rr.Body.String() != expected {
108102
t.Fatalf("Wrong iPXE script\nwant: %s\ngot: %s", expected, rr.Body.String())

0 commit comments

Comments
 (0)