build_image: add ability to pick different base package

This commit is contained in:
Alex Polvi 2015-01-02 14:41:41 -05:00
parent 9435772269
commit 1854bc2028
2 changed files with 9 additions and 2 deletions

View File

@ -24,6 +24,8 @@ DEFINE_string board "${DEFAULT_BOARD}" \
"The board to build an image for."
DEFINE_boolean enable_rootfs_verification ${FLAGS_TRUE} \
"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" \
"Directory in which to place image result directories (named by version)"
DEFINE_string disk_layout "" \
@ -161,7 +163,7 @@ if [[ "${CONTAINER}" -eq 1 ]]; then
fi
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
generate_update "${COREOS_PRODUCTION_IMAGE_NAME}" ${DISK_LAYOUT}
elif [[ ${FLAGS_extract_update} -eq ${FLAGS_TRUE} ]]; then

View File

@ -29,6 +29,11 @@ create_prod_image() {
local image_name="$1"
local disk_layout="$2"
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}"
local root_fs_dir="${BUILD_DIR}/rootfs"
@ -40,7 +45,7 @@ create_prod_image() {
# Install minimal GCC (libs only) and then everything else
set_image_profile prod
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}"
# Assert that if this is supposed to be an official build that the