From 0cb0cbf71e78ef43faf52d7a7b86490012dc1a3d Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Mon, 7 Oct 2013 11:31:58 -0700 Subject: [PATCH 1/3] feat(image_to_vm): Add minimal GCE support. Simply rolls our disk image into a tarball that can be passed to gcutil. To actually be useful we need an OEM package to handle SSH keys. --- build_library/vm_image_util.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index db157004ec..2a0828a44f 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -17,6 +17,7 @@ VALID_IMG_TYPES=( vmware vmware_insecure xen + gce ) # Set at runtime to one of the above types @@ -110,6 +111,9 @@ IMG_pxe_PARTITIONED_IMG=0 IMG_pxe_CONF_FORMAT=pxe IMG_pxe_OEM_PACKAGE=oem-pxe +## gce, image tarball +IMG_gce_CONF_FORMAT=gce + ## rackspace # TODO: package doesn't exist yet IMG_rackspace_OEM_PACKAGE=oem-rackspace @@ -695,6 +699,16 @@ EOF VM_GENERATED_FILES=( "${box}" "${VM_README}" ) } +_write_gce_conf() { + local src_name=$(basename "$VM_SRC_IMG") + local dst_dir=$(dirname "$VM_DST_IMG") + local tar_path="${dst_dir}/$(_src_to_dst_name "${src_name}" ".tar.gz")" + + mv "${VM_DST_IMG}" "${VM_TMP_DIR}/disk.raw" + tar -czf "${tar_path}" -C "${VM_TMP_DIR}" "disk.raw" + VM_GENERATED_FILES=( "${tar_path}" ) +} + vm_cleanup() { info "Cleaning up temporary files" sudo rm -rf "${VM_TMP_DIR}" From 95388caab16f76a4f9b5f3730b7925535922a5b4 Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sat, 30 Nov 2013 17:33:33 -0800 Subject: [PATCH 2/3] fix(image_to_vm): Add GCE oem package --- build_library/vm_image_util.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build_library/vm_image_util.sh b/build_library/vm_image_util.sh index 2a0828a44f..568e5ab402 100644 --- a/build_library/vm_image_util.sh +++ b/build_library/vm_image_util.sh @@ -113,6 +113,7 @@ IMG_pxe_OEM_PACKAGE=oem-pxe ## gce, image tarball IMG_gce_CONF_FORMAT=gce +IMG_gce_OEM_PACKAGE=oem-gce ## rackspace # TODO: package doesn't exist yet From 6dd768b8109b7175df9e5dadd745a3bd78e288cd Mon Sep 17 00:00:00 2001 From: Michael Marineau Date: Sat, 30 Nov 2013 17:36:38 -0800 Subject: [PATCH 3/3] feat(release_util.sh): Support changing default upload path with env var --- build_library/release_util.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_library/release_util.sh b/build_library/release_util.sh index fad1936cfd..8d96e04cff 100644 --- a/build_library/release_util.sh +++ b/build_library/release_util.sh @@ -3,7 +3,7 @@ # found in the LICENSE file. GSUTIL_OPTS= -UPLOAD_ROOT="gs://storage.core-os.net/coreos" +UPLOAD_ROOT="${COREOS_UPLOAD_ROOT:-gs://storage.core-os.net/coreos}" UPLOAD_PATH= UPLOAD_DEFAULT=${FLAGS_FALSE} if [[ ${COREOS_OFFICIAL:-0} -eq 1 ]]; then