mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-09 22:16:58 +02:00
build_image: add ability to pick different base package
This commit is contained in:
parent
9435772269
commit
1854bc2028
@ -24,6 +24,8 @@ DEFINE_string board "${DEFAULT_BOARD}" \
|
|||||||
"The board to build an image for."
|
"The board to build an image for."
|
||||||
DEFINE_boolean enable_rootfs_verification ${FLAGS_TRUE} \
|
DEFINE_boolean enable_rootfs_verification ${FLAGS_TRUE} \
|
||||||
"Default all bootloaders to use kernel-based root fs integrity checking."
|
"Default all bootloaders to use kernel-based root fs integrity checking."
|
||||||
|
DEFINE_string base_pkg "coreos-base/coreos" \
|
||||||
|
"The base portage package to base the build off of (only applies to prod images)"
|
||||||
DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \
|
DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \
|
||||||
"Directory in which to place image result directories (named by version)"
|
"Directory in which to place image result directories (named by version)"
|
||||||
DEFINE_string disk_layout "" \
|
DEFINE_string disk_layout "" \
|
||||||
@ -161,7 +163,7 @@ if [[ "${CONTAINER}" -eq 1 ]]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "${PROD_IMAGE}" -eq 1 ]]; then
|
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} ${FLAGS_base_pkg}
|
||||||
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
|
elif [[ ${FLAGS_extract_update} -eq ${FLAGS_TRUE} ]]; then
|
||||||
|
@ -29,6 +29,11 @@ create_prod_image() {
|
|||||||
local image_name="$1"
|
local image_name="$1"
|
||||||
local disk_layout="$2"
|
local disk_layout="$2"
|
||||||
local update_group="$3"
|
local update_group="$3"
|
||||||
|
local base_pkg="$4"
|
||||||
|
if [ -z "${base_pkg}" ]; then
|
||||||
|
echo "did not get base package!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
info "Building production image ${image_name}"
|
info "Building production image ${image_name}"
|
||||||
local root_fs_dir="${BUILD_DIR}/rootfs"
|
local root_fs_dir="${BUILD_DIR}/rootfs"
|
||||||
@ -40,7 +45,7 @@ create_prod_image() {
|
|||||||
# Install minimal GCC (libs only) and then everything else
|
# Install minimal GCC (libs only) and then everything else
|
||||||
set_image_profile prod
|
set_image_profile prod
|
||||||
extract_prod_gcc "${root_fs_dir}"
|
extract_prod_gcc "${root_fs_dir}"
|
||||||
emerge_to_image "${root_fs_dir}" coreos-base/coreos
|
emerge_to_image "${root_fs_dir}" "${base_pkg}"
|
||||||
write_packages "${root_fs_dir}" "${BUILD_DIR}/${image_packages}"
|
write_packages "${root_fs_dir}" "${BUILD_DIR}/${image_packages}"
|
||||||
|
|
||||||
# Assert that if this is supposed to be an official build that the
|
# Assert that if this is supposed to be an official build that the
|
||||||
|
Loading…
Reference in New Issue
Block a user