From 34af6335525593607740b32ed10c9bb9852123d1 Mon Sep 17 00:00:00 2001 From: Rolf Neugebauer Date: Mon, 10 Apr 2017 16:12:08 +0100 Subject: [PATCH] infrakit: rename the Moby property to kernel+initrd The infrakit plugin is not specific to Moby and should be able to boot other Linux systems as long as a kernel image and initial RAM disk are supplied. Reflect this in the property passed to the plugin. Signed-off-by: Rolf Neugebauer --- projects/demo/etcd/infrakit.json | 2 +- src/cmd/infrakit-instance-hyperkit/hyperkit.json | 3 ++- src/cmd/infrakit-instance-hyperkit/instance.go | 8 ++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/projects/demo/etcd/infrakit.json b/projects/demo/etcd/infrakit.json index 0d7cef887..b9b83e274 100644 --- a/projects/demo/etcd/infrakit.json +++ b/projects/demo/etcd/infrakit.json @@ -13,7 +13,7 @@ "Instance": { "Plugin": "instance-hyperkit", "Properties": { - "Moby": "etcd", + "kernel+initrd": "etcd", "Disk" : 1024, "CPUs" : 1, "Memory" : 1024 diff --git a/src/cmd/infrakit-instance-hyperkit/hyperkit.json b/src/cmd/infrakit-instance-hyperkit/hyperkit.json index 8521611b9..ef158bbf1 100644 --- a/src/cmd/infrakit-instance-hyperkit/hyperkit.json +++ b/src/cmd/infrakit-instance-hyperkit/hyperkit.json @@ -7,7 +7,8 @@ "Instance": { "Plugin": "instance-hyperkit", "Properties": { - "Moby": "../../moby", + "_comment" : "kernel+initrd specifies the prefix as in -bzImage and -initrd.img", + "kernel+initrd": "linux", "Disk" : 512, "CPUs" : 2, "Memory" : 1024 diff --git a/src/cmd/infrakit-instance-hyperkit/instance.go b/src/cmd/infrakit-instance-hyperkit/instance.go index 917bd641a..46a4bb3b8 100644 --- a/src/cmd/infrakit-instance-hyperkit/instance.go +++ b/src/cmd/infrakit-instance-hyperkit/instance.go @@ -54,8 +54,8 @@ func (p hyperkitPlugin) Provision(spec instance.Spec) (*instance.ID, error) { } } - if properties["Moby"] == nil { - return nil, errors.New("Property 'Moby' must be set") + if properties["kernel+initrd"] == nil { + return nil, errors.New("Property 'kernel+initrd' must be set") } if properties["CPUs"] == nil { properties["CPUs"] = 1 @@ -122,8 +122,8 @@ func (p hyperkitPlugin) Provision(spec instance.Spec) (*instance.ID, error) { if err != nil { return nil, err } - h.Kernel = properties["Moby"].(string) + "-bzImage" - h.Initrd = properties["Moby"].(string) + "-initrd.img" + h.Kernel = properties["kernel+initrd"].(string) + "-bzImage" + h.Initrd = properties["kernel+initrd"].(string) + "-initrd.img" h.UUID = uuidStr h.DiskImage = diskImage h.ISOImage = isoImage