From 5b1cb7ec508e49020ce21b4c69d9917345517d3f Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Mon, 13 Nov 2017 15:38:36 +0000 Subject: [PATCH] examples: Update packet.net examples - Add getty to get access to the serial console - Add a arm64 example for baremetal type 2a - Update documentation (and use example in documentation) I've tested the PXE boot on arm64 and the bond interface gets set up and seems usable. Signed-off-by: Rolf Neugebauer --- docs/platform-packet.md | 30 ++++++++++++++++++++++-------- examples/packet.arm64.yml | 4 ++++ examples/packet.yml | 6 +++++- 3 files changed, 31 insertions(+), 9 deletions(-) create mode 100644 examples/packet.arm64.yml diff --git a/docs/platform-packet.md b/docs/platform-packet.md index 1ce5cdad2..d15c80ec9 100644 --- a/docs/platform-packet.md +++ b/docs/platform-packet.md @@ -29,6 +29,11 @@ device ID on subsequent `linuxkit run` invocations to re-use an existing machine. These subsequent runs will update the iPXE data so you can boot alternative kernels on an existing machine. +There is an example YAML file for [x86_64](../examples/packet.yml) and +an additional YAML for [arm64](../examples/packet.arm64.yml) servers +which provide both access to the serial console and via ssh and +configures bonding for network devices via metadata (if supported). + **Note**: The update of the iPXE configuration sometimes may take some time and the first boot may fail. Hitting return on the console to retry the boot typically fixes this. @@ -46,22 +51,31 @@ If you don't have a public HTTP server at hand, you can use the be run on another Packet machine or be made accessible with tools like [ngrok](https://ngrok.com/). -For example, to boot the toplevel [linuxkit.yml](../linuxkit.yml) -example with a local HTTP server: +For example, to boot the [example](../examples/packet.net) +with a local HTTP server: ```sh -moby build linuxkit.yml +moby build packet.yml # run the web server # run 'ngrok http 8080' in another window -PACKET_API_KEY= linuxkit run packet -serve :8080 -base-url http://9b828514.ngrok.io -project-id linuxkit +PACKET_API_KEY= PACKET_PROJECT_ID= \ +linuxkit run packet -serve :8080 -base-url packet ``` -To boot a `arm64` kernel on a Type 2a machine (`-machine -baremetal_2a`) you currently need to un-compress both the kernel and +To boot a `arm64` image for Type 2a machine (`-machine +baremetal_2a`) you currently need build using `moby build packet.yml packet.arm64.yml` and then un-compress both the kernel and the initrd before booting, e.g: + +```sh +mv packet-initrd.img packet-initrd.img.gz && gzip -d packet-initrd.img.gz +mv packet-kernel packet-kernel.gz && gzip -d packet-kernel.gz ``` -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 + +The LinuxKit image can then be booted with: + +```sh +PACKET_API_KEY= PACKET_PROJECT_ID= \ +linuxkit run packet -machine baremetal_2a -serve :8080 -base-url -base-url packet ``` **Note**: It may take several minutes to deploy a new server. If you diff --git a/examples/packet.arm64.yml b/examples/packet.arm64.yml new file mode 100644 index 000000000..453c996bc --- /dev/null +++ b/examples/packet.arm64.yml @@ -0,0 +1,4 @@ +onboot: + - name: modprobe + image: linuxkit/modprobe:2d153653d1111877a8f53704ef85063a44182ade + command: ["modprobe", "nicvf"] diff --git a/examples/packet.yml b/examples/packet.yml index e2ee0287f..625872d3e 100644 --- a/examples/packet.yml +++ b/examples/packet.yml @@ -1,6 +1,6 @@ kernel: image: linuxkit/kernel:4.9.61 - cmdline: "console=ttyS1" + cmdline: "console=ttyS1 console=ttyAMA0" init: - linuxkit/init:42a92119e1ca10380e0d33e26c0cbcf85b9b3558 - linuxkit/runc:817fdc592eac6cb7804fa1721a43a7f6e23fb50f @@ -21,6 +21,10 @@ onboot: services: - name: rngd image: linuxkit/rngd:842e5e8ece7934f0cab9fd0027b595ff3471e5b9 + - name: getty + image: linuxkit/getty:6af22c32c98536a79230eef000e9abd06b037faa + env: + - INSECURE=true - name: sshd image: linuxkit/sshd:b7f21ef1b13300a994e35eac3644e4f84f0ada8a trust: