diff options
author | Franck Cuny <franck@fcuny.net> | 2021-05-15 15:07:44 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-06-11 13:57:43 -0700 |
commit | 7471460dc4705969821fdeb7c2e08865a9526110 (patch) | |
tree | 03ca67f69e2e54ef8d5d79b3eb898cc8b39c7e40 /users/fcuny | |
parent | c2vm: fix kernel boot options (diff) | |
download | world-7471460dc4705969821fdeb7c2e08865a9526110.tar.gz |
rename the variable for the linux kernel
Diffstat (limited to 'users/fcuny')
-rw-r--r-- | users/fcuny/exp/containerd-to-vm/cmd/c2vm/main.go | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/users/fcuny/exp/containerd-to-vm/cmd/c2vm/main.go b/users/fcuny/exp/containerd-to-vm/cmd/c2vm/main.go index 9b7567e..66f881b 100644 --- a/users/fcuny/exp/containerd-to-vm/cmd/c2vm/main.go +++ b/users/fcuny/exp/containerd-to-vm/cmd/c2vm/main.go @@ -41,9 +41,9 @@ var ( func main() { var ( containerName = flag.String("container", "", "Name of the container") - outFile = flag.String("out", "container.img", "firecracker output to create") - linuxKernel = flag.String("linux-kernel", "", "path to the linux kernel to use") - firecrackerBinary = flag.String("firecracker-binary", "", "path to the firecracker binary") + outFile = flag.String("out", "container.img", "Path to store the image") + kernel = flag.String("kernel", "", "Path to the linux kernel image") + firecrackerBinary = flag.String("firecracker-binary", "", "Path to the firecracker binary") ) flag.Parse() @@ -52,7 +52,7 @@ func main() { log.Fatal("a container is required") } - if *linuxKernel == "" { + if *kernel == "" { log.Fatalf("a linux kernel is required") } @@ -114,7 +114,7 @@ func main() { log.Fatalf("failed to resize the image %s: %s\n", *outFile, err) } - bootVM(ctx, *outFile, *linuxKernel, *firecrackerBinary) + bootVM(ctx, *outFile, *kernel, *firecrackerBinary) } func extract(ctx context.Context, client *containerd.Client, image containerd.Image, mntDir string) error { @@ -240,7 +240,7 @@ func writeToFile(filepath string, content string) error { return nil } -func bootVM(ctx context.Context, rawImage, linuxKernel, firecrackerBinary string) { +func bootVM(ctx context.Context, rawImage, kernel, firecrackerBinary string) { vmmCtx, vmmCancel := context.WithCancel(ctx) defer vmmCancel() @@ -254,7 +254,7 @@ func bootVM(ctx context.Context, rawImage, linuxKernel, firecrackerBinary string fcCfg := firecracker.Config{ LogLevel: "debug", SocketPath: firecrackerSock, - KernelImagePath: linuxKernel, + KernelImagePath: kernel, KernelArgs: "console=ttyS0 reboot=k panic=1 acpi=off pci=off i8042.noaux i8042.nomux i8042.nopnp i8042.dumbkbd init=/init.sh random.trust_cpu=on", Drives: devices, MachineCfg: models.MachineConfiguration{ |