From e130d95518bd1be7a1c24438bec60643119e5754 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Sat, 17 Jun 2017 17:06:29 +0200 Subject: vm/gce: accept un-tar-ed image vm/gce differs from other VM types in that it accepts image in a weird, GCE-specific format (namely, image named disk.raw is put into .tar.gz file). This makes it impossible to write generic code that creates images for any VM types. Make vm/gce accept just image like e.g. vm/qemu and handle own specifics internally. --- pkg/kernel/generated.go | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'pkg/kernel/generated.go') diff --git a/pkg/kernel/generated.go b/pkg/kernel/generated.go index 0e6ba5b89..e9b00b345 100644 --- a/pkg/kernel/generated.go +++ b/pkg/kernel/generated.go @@ -8,17 +8,12 @@ const createImageScript = `#!/bin/bash set -eux if [ ! -e $1/sbin/init ]; then - echo "usage: create-gce-image.sh /dir/with/user/space/system /path/to/bzImage /path/to/vmlinux 'image tag'" + echo "usage: create-gce-image.sh /dir/with/user/space/system /path/to/bzImage" exit 1 fi if [ "$(basename $2)" != "bzImage" ]; then - echo "usage: create-gce-image.sh /dir/with/user/space/system /path/to/bzImage /path/to/vmlinux 'image tag'" - exit 1 -fi - -if [ "$(basename $3)" != "vmlinux" ]; then - echo "usage: create-gce-image.sh /dir/with/user/space/system /path/to/bzImage /path/to/vmlinux 'image tag'" + echo "usage: create-gce-image.sh /dir/with/user/space/system /path/to/bzImage" exit 1 fi @@ -75,10 +70,4 @@ sudo grub-install --boot-directory=disk.mnt/boot --no-floppy /dev/nbd0 sudo umount disk.mnt rm -rf disk.mnt sudo qemu-nbd -d /dev/nbd0 -tar -Szcf disk.tar.gz disk.raw -mkdir -p obj -cp $3 obj/ -echo -n "$4" > tag -tar -czvf image.tar.gz disk.tar.gz key tag obj/vmlinux -rm -rf tag obj ` -- cgit mrf-deployment