Skip to content
Open
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
8 changes: 7 additions & 1 deletion cmd/boot-script-service/default_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ type scriptParams struct {
xname string
nid string
referralToken string
mac string
}

// Note that we allow an empty string if the env variable is defined as such.
Expand Down Expand Up @@ -689,6 +690,11 @@ func buildParams(bd BootData, sp scriptParams, role, subRole string) (string, er
if sp.referralToken != "" {
params = checkParam(params, "bss_referral_token=", sp.referralToken)
}
// Add BOOTIF to params to force 1st mac
if sp.mac != "" {
bootif := "01-" + strings.ReplaceAll(sp.mac, ":", "-")
params = checkParam(params, "BOOTIF=", bootif)
}

// Inject the cloud init address info into the kernel params. If the target
// image does not have cloud-init enabled this wont hurt anything.
Expand Down Expand Up @@ -841,7 +847,7 @@ func BootscriptGet(w http.ResponseWriter, r *http.Request) {
log.Printf("BSS request failed: bootscript request without mac=, name=, or nid= parameter")
return
}
sp := scriptParams{comp.ID, comp.NID.String(), bd.ReferralToken}
sp := scriptParams{comp.ID, comp.NID.String(), bd.ReferralToken, mac}

debugf("bd: %v\n", bd)
debugf("comp: %v\n", comp)
Expand Down
Loading