diff --git a/build_image b/build_image index 39ed8446b5..1dc23e870d 100755 --- a/build_image +++ b/build_image @@ -32,7 +32,7 @@ DEFINE_boolean enable_rootfs_verification ${FLAGS_TRUE} \ "Default all bootloaders to use kernel-based root fs integrity checking." DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \ "Directory in which to place image result directories (named by version)" -DEFINE_string disk_layout "base" \ +DEFINE_string disk_layout "" \ "The disk layout type to use for this image." DEFINE_string group "${DEFAULT_GROUP}" \ "The update group." @@ -46,9 +46,9 @@ FLAGS_HELP="USAGE: build_image [flags] [list of images to build]. This script is used to build a CoreOS image. CoreOS comes in many different forms. This scripts can be used to build the following: -base - Pristine CoreOS image for generating update payloads or a dev/prod image. prod - Production image for CoreOS. This image is for booting. dev - Developer image. Like base but with additional developer packages. +container - Developer image with single filesystem, bootable by nspawn. Examples: @@ -93,10 +93,12 @@ check_gsutil_opts PROD_IMAGE=0 DEV_IMAGE=0 +CONTAINER=0 for arg in "$@"; do case "${arg}" in prod) PROD_IMAGE=1 ;; dev) DEV_IMAGE=1 ;; + container) CONTAINER=1 ;; *) die_notrace "Unknown image type ${arg}" ;; esac done @@ -130,12 +132,18 @@ fi mkdir -p "${BUILD_DIR}" DISK_LAYOUT="${FLAGS_disk_layout:-base}" +CONTAINER_LAYOUT="${FLAGS_disk_layout:-container}" if [[ "${DEV_IMAGE}" -eq 1 ]]; then create_dev_image ${COREOS_DEVELOPER_IMAGE_NAME} ${DISK_LAYOUT} ${FLAGS_group} upload_image "${BUILD_DIR}/${COREOS_DEVELOPER_IMAGE_NAME}" fi +if [[ "${CONTAINER}" -eq 1 ]]; then + create_dev_image "${COREOS_DEVELOPER_CONTAINER_NAME}" "${CONTAINER_LAYOUT}" "${FLAGS_group}" + upload_image "${BUILD_DIR}/${OREOS_DEVELOPER_CONTAINER_NAME}" +fi + if [[ "${PROD_IMAGE}" -eq 1 ]]; then create_prod_image ${COREOS_PRODUCTION_IMAGE_NAME} ${DISK_LAYOUT} ${FLAGS_group} upload_image "${BUILD_DIR}/${COREOS_PRODUCTION_IMAGE_NAME}" diff --git a/build_library/disk_layout.json b/build_library/disk_layout.json index a1004966ac..d10d60a638 100644 --- a/build_library/disk_layout.json +++ b/build_library/disk_layout.json @@ -79,6 +79,37 @@ "label":"ROOT", "blocks":"33587200" } + }, + "container":{ + "1":{ + "type":"blank" + }, + "2":{ + "type":"blank" + }, + "3":{ + "type":"blank" + }, + "4":{ + "type":"blank" + }, + "5":{ + "type":"blank" + }, + "6":{ + "type":"blank" + }, + "7":{ + "type":"blank" + }, + "8":{ + "type":"blank" + }, + "9":{ + "label":"ROOT", + "type":"4f68bce3-e8cd-4db1-96e7-fbcaf984b709", + "blocks":"6291456" + } } } } diff --git a/common.sh b/common.sh index f036e18f9b..3a175d22aa 100644 --- a/common.sh +++ b/common.sh @@ -405,6 +405,7 @@ BUILD_DIR= # Standard filenames COREOS_DEVELOPER_IMAGE_NAME="coreos_developer_image.bin" +COREOS_DEVELOPER_CONTAINER_NAME="coreos_developer_container.bin" COREOS_PRODUCTION_IMAGE_NAME="coreos_production_image.bin" # -----------------------------------------------------------------------------