mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-07 13:06:59 +02:00
updates: extract usr partition when building images
The current generate_update function is now less useful, the important part that we need is just the partition image now. Also by defaulting to extracting the partition the old cors_generate_update which is still in use by devserver can be removed entirely, devserver will just expect the extracted partition image instead.
This commit is contained in:
parent
eb605751cd
commit
7231b95af1
@ -34,6 +34,8 @@ DEFINE_string group "${DEFAULT_GROUP}" \
|
|||||||
"The update group."
|
"The update group."
|
||||||
DEFINE_boolean generate_update "${FLAGS_FALSE}" \
|
DEFINE_boolean generate_update "${FLAGS_FALSE}" \
|
||||||
"Generate update payload. (prod only)"
|
"Generate update payload. (prod only)"
|
||||||
|
DEFINE_boolean extract_update "${FLAGS_TRUE}" \
|
||||||
|
"Extract the /usr partition for generating updates."
|
||||||
DEFINE_string developer_data "" \
|
DEFINE_string developer_data "" \
|
||||||
"Insert a custom cloudinit file into the image."
|
"Insert a custom cloudinit file into the image."
|
||||||
|
|
||||||
@ -151,6 +153,9 @@ fi
|
|||||||
|
|
||||||
if [[ "${DEV_IMAGE}" -eq 1 ]]; then
|
if [[ "${DEV_IMAGE}" -eq 1 ]]; then
|
||||||
create_dev_image ${COREOS_DEVELOPER_IMAGE_NAME} ${DISK_LAYOUT} ${FLAGS_group}
|
create_dev_image ${COREOS_DEVELOPER_IMAGE_NAME} ${DISK_LAYOUT} ${FLAGS_group}
|
||||||
|
if [[ ${FLAGS_extract_update} -eq ${FLAGS_TRUE} ]]; then
|
||||||
|
extract_update "${COREOS_DEVELOPER_IMAGE_NAME}" "${DISK_LAYOUT}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${CONTAINER}" -eq 1 ]]; then
|
if [[ "${CONTAINER}" -eq 1 ]]; then
|
||||||
@ -161,6 +166,8 @@ if [[ "${PROD_IMAGE}" -eq 1 ]]; then
|
|||||||
create_prod_image ${COREOS_PRODUCTION_IMAGE_NAME} ${DISK_LAYOUT} ${FLAGS_group}
|
create_prod_image ${COREOS_PRODUCTION_IMAGE_NAME} ${DISK_LAYOUT} ${FLAGS_group}
|
||||||
if [[ ${FLAGS_generate_update} -eq ${FLAGS_TRUE} ]]; then
|
if [[ ${FLAGS_generate_update} -eq ${FLAGS_TRUE} ]]; then
|
||||||
generate_update "${COREOS_PRODUCTION_IMAGE_NAME}" ${DISK_LAYOUT}
|
generate_update "${COREOS_PRODUCTION_IMAGE_NAME}" ${DISK_LAYOUT}
|
||||||
|
elif [[ ${FLAGS_extract_update} -eq ${FLAGS_TRUE} ]]; then
|
||||||
|
extract_update "${COREOS_PRODUCTION_IMAGE_NAME}" "${DISK_LAYOUT}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -54,6 +54,16 @@ delete_prompt() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extract_update() {
|
||||||
|
local image_name="$1"
|
||||||
|
local disk_layout="$2"
|
||||||
|
local update_path="${BUILD_DIR}/${image_name%_image.bin}_update.bin"
|
||||||
|
|
||||||
|
"${BUILD_LIBRARY_DIR}/disk_util" --disk_layout="${disk_layout}" \
|
||||||
|
extract "${BUILD_DIR}/${image_name}" "USR-A" "${update_path}"
|
||||||
|
upload_image "${update_path}"
|
||||||
|
}
|
||||||
|
|
||||||
generate_update() {
|
generate_update() {
|
||||||
local image_name="$1"
|
local image_name="$1"
|
||||||
local disk_layout="$2"
|
local disk_layout="$2"
|
||||||
|
Loading…
Reference in New Issue
Block a user