mirror of
https://github.com/linuxkit/linuxkit.git
synced 2025-07-23 11:00:25 +00:00
cmd: Enable always-pxe for packet.net
This option configures the machine to always PXE boot. By default it would only PXE boot for the first time. Signed-off-by: Rolf Neugebauer <rolf.neugebauer@docker.com>
This commit is contained in:
parent
bdc06ee30a
commit
c804ff0dc1
@ -65,6 +65,7 @@ func runPacket(args []string) {
|
|||||||
projectFlag := flags.String("project-id", "", "Packet Project ID (or "+packetProjectIDVar+")")
|
projectFlag := flags.String("project-id", "", "Packet Project ID (or "+packetProjectIDVar+")")
|
||||||
hostNameFlag := flags.String("hostname", packetDefaultHostname, "Hostname of new instance (or "+packetHostnameVar+")")
|
hostNameFlag := flags.String("hostname", packetDefaultHostname, "Hostname of new instance (or "+packetHostnameVar+")")
|
||||||
nameFlag := flags.String("img-name", "", "Overrides the prefix used to identify the files. Defaults to [name] (or "+packetNameVar+")")
|
nameFlag := flags.String("img-name", "", "Overrides the prefix used to identify the files. Defaults to [name] (or "+packetNameVar+")")
|
||||||
|
alwaysPXE := flags.Bool("always-pxe", true, "Reboot from PXE every time.")
|
||||||
if err := flags.Parse(args); err != nil {
|
if err := flags.Parse(args); err != nil {
|
||||||
log.Fatal("Unable to parse args")
|
log.Fatal("Unable to parse args")
|
||||||
}
|
}
|
||||||
@ -93,6 +94,7 @@ func runPacket(args []string) {
|
|||||||
name := getStringValue(packetNameVar, *nameFlag, prefix)
|
name := getStringValue(packetNameVar, *nameFlag, prefix)
|
||||||
osType := "custom_ipxe"
|
osType := "custom_ipxe"
|
||||||
billing := "hourly"
|
billing := "hourly"
|
||||||
|
// TODO(rn): Extract the kernel commandline from the file generated by moby build
|
||||||
userData := fmt.Sprintf("#!ipxe\n\ndhcp\nset base-url %s\nset kernel-params ip=dhcp nomodeset ro serial console=ttyS1,115200\nkernel ${base-url}/%s-kernel ${kernel-params}\ninitrd ${base-url}/%s-initrd.img\nboot", url, name, name)
|
userData := fmt.Sprintf("#!ipxe\n\ndhcp\nset base-url %s\nset kernel-params ip=dhcp nomodeset ro serial console=ttyS1,115200\nkernel ${base-url}/%s-kernel ${kernel-params}\ninitrd ${base-url}/%s-initrd.img\nboot", url, name, name)
|
||||||
log.Debugf("Using userData of:\n%s\n", userData)
|
log.Debugf("Using userData of:\n%s\n", userData)
|
||||||
initrdURL := fmt.Sprintf("%s/%s-initrd.img", url, name)
|
initrdURL := fmt.Sprintf("%s/%s-initrd.img", url, name)
|
||||||
@ -110,6 +112,7 @@ func runPacket(args []string) {
|
|||||||
ProjectID: projectID,
|
ProjectID: projectID,
|
||||||
UserData: userData,
|
UserData: userData,
|
||||||
Tags: tags,
|
Tags: tags,
|
||||||
|
AlwaysPXE: *alwaysPXE,
|
||||||
}
|
}
|
||||||
d, _, err := client.Devices.Create(&req)
|
d, _, err := client.Devices.Create(&req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user