Merge pull request #382 from Cygnus-Labs/adding-base-dev-pkg-flag

Enhanced dev_image_util with equivalent to --base_pkg
This commit is contained in:
Michael Marineau 2015-04-30 17:00:16 -07:00
commit fed42e2d12
2 changed files with 11 additions and 3 deletions

View File

@ -26,6 +26,8 @@ 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 base_dev_pkg "coreos-base/coreos-dev" \
"The base portage package to base the build off of (only applies to dev images)"
DEFINE_string output_root "${DEFAULT_BUILD_ROOT}/images" \
"Directory in which to place image result directories (named by version)"
DEFINE_string disk_layout "" \
@ -152,14 +154,14 @@ fi
fix_mtab
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} ${FLAGS_base_dev_pkg}
if [[ ${FLAGS_extract_update} -eq ${FLAGS_TRUE} ]]; then
extract_update "${COREOS_DEVELOPER_IMAGE_NAME}" "${DISK_LAYOUT}"
fi
fi
if [[ "${CONTAINER}" -eq 1 ]]; then
create_dev_image "${COREOS_DEVELOPER_CONTAINER_NAME}" "${CONTAINER_LAYOUT}" "${FLAGS_group}"
create_dev_image "${COREOS_DEVELOPER_CONTAINER_NAME}" "${CONTAINER_LAYOUT}" "${FLAGS_group}" ${FLAGS_base_dev_pkg}
fi
if [[ "${PROD_IMAGE}" -eq 1 ]]; then

View File

@ -70,9 +70,15 @@ create_dev_image() {
local image_name=$1
local disk_layout=$2
local update_group=$3
local base_pkg="$4"
local devserver=$(detect_dev_url)
local auserver=""
if [ -z "${base_pkg}" ]; then
echo "did not get base package!"
exit 1
fi
if [[ -n "${devserver}" ]]; then
info "Using ${devserver} for local dev server URL."
auserver="${devserver}/update"
@ -89,7 +95,7 @@ create_dev_image() {
start_image "${image_name}" "${disk_layout}" "${root_fs_dir}" "${update_group}"
set_image_profile dev
emerge_to_image "${root_fs_dir}" @system coreos-base/coreos-dev
emerge_to_image "${root_fs_dir}" @system ${base_pkg}
write_packages "${root_fs_dir}" "${BUILD_DIR}/${image_packages}"
write_licenses "${root_fs_dir}" "${BUILD_DIR}/${image_licenses}"