mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 13:06:59 +02:00
feat(build_image): Add 'container' image type.
This image type is the same as the developer image except that it is a single root filesystem and is bootable via systemd-nspawn. This may become obsolete eventually when it becomes possible to boot the normal disk images under nspawn but it is useful for testing until then. The partition type is defined by the Discoverable Partitions Spec. http://www.freedesktop.org/wiki/Specifications/DiscoverablePartitionsSpec/
This commit is contained in:
parent
54f774d931
commit
b24df04465
12
build_image
12
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}"
|
||||
|
@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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"
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
|
Loading…
Reference in New Issue
Block a user