From f8c45539cc364b6cfd7d7ad7bafccebbfdf8420d Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Tue, 15 Aug 2017 16:04:58 +0100 Subject: [PATCH 1/3] cmd: Add iPXE support for arm64 on packet.net Signed-off-by: Rolf Neugebauer --- src/cmd/linuxkit/run_packet.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/cmd/linuxkit/run_packet.go b/src/cmd/linuxkit/run_packet.go index 5657e36a6..b98eb0186 100644 --- a/src/cmd/linuxkit/run_packet.go +++ b/src/cmd/linuxkit/run_packet.go @@ -128,9 +128,18 @@ func runPacket(args []string) { userData := "#!ipxe\n\n" userData += "dhcp\n" userData += fmt.Sprintf("set base-url %s\n", url) - userData += fmt.Sprintf("set kernel-params ip=dhcp nomodeset ro serial console=ttyS1,115200 %s\n", cmdline) - userData += fmt.Sprintf("kernel ${base-url}/%s-kernel ${kernel-params}\n", name) - userData += fmt.Sprintf("initrd ${base-url}/%s-initrd.img\n", name) + if *machineFlag != "baremetal_2a" { + userData += fmt.Sprintf("set kernel-params ip=dhcp nomodeset ro serial console=ttyS1,115200 %s\n", cmdline) + userData += fmt.Sprintf("kernel ${base-url}/%s-kernel ${kernel-params}\n", name) + userData += fmt.Sprintf("initrd ${base-url}/%s-initrd.img\n", name) + } else { + // With EFI boot need to specify the initrd and root dev explicitly. See: + // http://ipxe.org/appnote/debian_preseed + // http://forum.ipxe.org/showthread.php?tid=7589 + userData += fmt.Sprintf("initrd --name initrd ${base-url}/%s-initrd.img\n", name) + userData += fmt.Sprintf("set kernel-params ip=dhcp nomodeset ro %s\n", cmdline) + userData += fmt.Sprintf("kernel ${base-url}/%s-kernel initrd=initrd root=/dev/ram0 ${kernel-params}\n", name) + } userData += "boot" log.Debugf("Using userData of:\n%s\n", userData) From f2c7dd7731669a3bcb8607a787c1afe55b7263e2 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Tue, 15 Aug 2017 17:36:58 +0100 Subject: [PATCH 2/3] doc: Add a note on arm64 on packet.net Signed-off-by: Rolf Neugebauer --- docs/platform-packet.md | 9 +++++++++ log.txt | 9 +++++++++ 2 files changed, 18 insertions(+) create mode 100644 log.txt diff --git a/docs/platform-packet.md b/docs/platform-packet.md index a9afcba0e..36588094f 100644 --- a/docs/platform-packet.md +++ b/docs/platform-packet.md @@ -45,11 +45,20 @@ moby build linuxkit.yml PACKET_API_KEY= linuxkit run packet -serve :8080 -base-url http://9b828514.ngrok.io -project-id linuxkit ``` +To boot a `arm64` kernel on a Type 2a machine (`-machine +baremetal_2a`) you currently need to un-compress both the kernel and +the initrd before booting, e.g: +``` +mv linuxkit-initrd.img linuxkit-initrd.img.gz && gzip -d linuxkit-initrd.img.gz +mv linuxkit-kernel.img linuxkit-kernel.img.gz && gzip -d linuxkit-kernel.img.gz +``` + **Note**: It may take several minutes to deploy a new server. If you are attached to the console, you should see the BIOS and the boot messages. + ## Console By default, `linuxkit run packet ...` will connect to the diff --git a/log.txt b/log.txt new file mode 100644 index 000000000..7b82c53ee --- /dev/null +++ b/log.txt @@ -0,0 +1,9 @@ +[=3h[=3h[=3h[=3h[=3h[=3h..PXE-E16: No offer received. +Boot Failed. EFI Network + UEFI Interactive Shell v2.1 +EDK II +UEFI v2.40 (BHYVE, 0x00010000) +Mapping table +Error. No mapping found +Press ESC in 5 seconds to skip startup.nsh or any other key to continue.Press ESC in 4 seconds to skip startup.nsh or any other key to continue.Press ESC in 3 seconds to skip startup.nsh or any other key to continue.Press ESC in 2 seconds to skip startup.nsh or any other key to continue.Press ESC in 1 seconds to skip startup.nsh or any other key to continue. +Shell> time="2017-08-08T23:15:51+01:00" level=fatal msg="Cannot run hyperkit: signal: killed" From a6e25b0825d5e4b93703e7f0ef8c31110930bdda Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Tue, 15 Aug 2017 17:55:47 +0100 Subject: [PATCH 3/3] cmd: Print the packet machine ID when booting This is useful if the connection to the SOS fails and you want to debug manually after. Signed-off-by: Rolf Neugebauer --- src/cmd/linuxkit/run_packet.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/linuxkit/run_packet.go b/src/cmd/linuxkit/run_packet.go index b98eb0186..50a4e0b91 100644 --- a/src/cmd/linuxkit/run_packet.go +++ b/src/cmd/linuxkit/run_packet.go @@ -172,7 +172,7 @@ func runPacket(args []string) { } log.Debugf("%s\n", string(b)) - log.Printf("Machine booting...") + log.Printf("Booting %s...", dev.ID) sshHost := "sos." + dev.Facility.Code + ".packet.net" if *consoleFlag {