mirror of
https://github.com/flatcar/scripts.git
synced 2025-08-10 06:26:57 +02:00
build_image: remove --dev_install flag
The dev install shim is deprecated. This CL removes --dev_install support from build_image. This is part of a larger rewrite of build_image to allow it to be the single script from which all image types are generated. BUG=chromium-os:12899 TEST=manual Change-Id: Ic3a49f0d476d198f81001a05c75f24f16bc640c0 Review URL: http://codereview.chromium.org/6694042
This commit is contained in:
parent
798f78f0ee
commit
96d116d25e
44
build_image
44
build_image
@ -70,8 +70,6 @@ DEFINE_string to "" \
|
|||||||
DEFINE_boolean factory_install ${FLAGS_FALSE} \
|
DEFINE_boolean factory_install ${FLAGS_FALSE} \
|
||||||
"Build a smaller image to overlay the factory install shim on; this argument \
|
"Build a smaller image to overlay the factory install shim on; this argument \
|
||||||
is also required in image_to_usb."
|
is also required in image_to_usb."
|
||||||
DEFINE_boolean dev_install ${FLAGS_FALSE} \
|
|
||||||
"Build a smaller image to overlay the dev recovery install shim on"
|
|
||||||
DEFINE_integer rootfs_partition_size 1024 \
|
DEFINE_integer rootfs_partition_size 1024 \
|
||||||
"rootfs partition size in MiBs."
|
"rootfs partition size in MiBs."
|
||||||
DEFINE_integer rootfs_size 850 \
|
DEFINE_integer rootfs_size 850 \
|
||||||
@ -144,12 +142,8 @@ check_blacklist
|
|||||||
# transition dust settles.
|
# transition dust settles.
|
||||||
"${SCRIPTS_DIR}"/set_shared_user_password.sh --move_to_etc
|
"${SCRIPTS_DIR}"/set_shared_user_password.sh --move_to_etc
|
||||||
|
|
||||||
# Verify user didn't specify incompatible flags for dev install shim
|
# TODO(vlaviano): Validate command line flags. Check for conflicting flags and
|
||||||
if [ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ] &&
|
# reconcile them if possible. Exit with an error message otherwise.
|
||||||
[ "${FLAGS_dev_install}" -eq "${FLAGS_TRUE}" ] ; then
|
|
||||||
die "Incompatible flags: --factory_install and --dev_install cannot be \
|
|
||||||
both set to True. Please specify one or none."
|
|
||||||
fi
|
|
||||||
|
|
||||||
INSTALL_MASK=""
|
INSTALL_MASK=""
|
||||||
if [ "${FLAGS_installmask}" -eq "${FLAGS_TRUE}" ] ; then
|
if [ "${FLAGS_installmask}" -eq "${FLAGS_TRUE}" ] ; then
|
||||||
@ -157,14 +151,13 @@ if [ "${FLAGS_installmask}" -eq "${FLAGS_TRUE}" ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Reduce the size of factory install shim.
|
# Reduce the size of factory install shim.
|
||||||
if [ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ] ||
|
if [ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ]; then
|
||||||
[ "${FLAGS_dev_install}" -eq "${FLAGS_TRUE}" ] ; then
|
# Disable --withdev flag when --factory_install is set to True. Otherwise, the
|
||||||
# Disable --withdev flag when --*_install is set to True. Otherwise, the
|
|
||||||
# dev image produced will be based on install shim, rather than a pristine
|
# dev image produced will be based on install shim, rather than a pristine
|
||||||
# image
|
# image
|
||||||
if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then
|
if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then
|
||||||
info "Incompatible flags: --withdev and --dev_install or --factory_install \
|
info "Incompatible flags: --withdev and --factory_install cannot both be \
|
||||||
cannot be both set to True. Reset --withdev to False."
|
set to True. Resetting --withdev to False."
|
||||||
FLAGS_withdev=${FLAGS_FALSE}
|
FLAGS_withdev=${FLAGS_FALSE}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -228,9 +221,7 @@ PRISTINE_IMAGE_NAME=chromiumos_image.bin
|
|||||||
if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then
|
if [ "${FLAGS_withdev}" -eq "${FLAGS_TRUE}" ]; then
|
||||||
PRISTINE_IMAGE_NAME=chromiumos_base_image.bin
|
PRISTINE_IMAGE_NAME=chromiumos_base_image.bin
|
||||||
DEVELOPER_IMAGE_NAME=chromiumos_image.bin
|
DEVELOPER_IMAGE_NAME=chromiumos_image.bin
|
||||||
elif [ "${FLAGS_dev_install}" -eq "${FLAGS_TRUE}" ]; then
|
# Rename pristine image for factory install shim
|
||||||
# Rename pristine images for install shims
|
|
||||||
PRISTINE_IMAGE_NAME=dev_install_shim.bin
|
|
||||||
elif [ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ]; then
|
elif [ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ]; then
|
||||||
PRISTINE_IMAGE_NAME=factory_install_shim.bin
|
PRISTINE_IMAGE_NAME=factory_install_shim.bin
|
||||||
fi
|
fi
|
||||||
@ -487,10 +478,9 @@ update_dev_packages() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Check that the image has been correctly created. Only do it if not
|
# Check that the image has been correctly created. Only do it if not
|
||||||
# building a factory install image and not a dev install shim, as the
|
# building a factory install shim, as the INSTALL_MASK for it will make
|
||||||
# INSTALL_MASK for it will make test_image fail.
|
# test_image fail.
|
||||||
if [ ${FLAGS_factory_install} -eq ${FLAGS_FALSE} ] &&
|
if [ ${FLAGS_factory_install} -eq ${FLAGS_FALSE} ]; then
|
||||||
[ ${FLAGS_dev_install} -eq ${FLAGS_FALSE} ] ; then
|
|
||||||
"${SCRIPTS_DIR}/test_image" \
|
"${SCRIPTS_DIR}/test_image" \
|
||||||
--root="${ROOT_FS_DIR}" \
|
--root="${ROOT_FS_DIR}" \
|
||||||
--target="${ARCH}"
|
--target="${ARCH}"
|
||||||
@ -671,9 +661,8 @@ create_base_image() {
|
|||||||
--install \
|
--install \
|
||||||
${enable_rootfs_verification}
|
${enable_rootfs_verification}
|
||||||
|
|
||||||
# Don't test the factory install shim or the dev install shim
|
# Don't test the factory install shim
|
||||||
if [ ${FLAGS_factory_install} -eq ${FLAGS_FALSE} ] &&
|
if [ ${FLAGS_factory_install} -eq ${FLAGS_FALSE} ]; then
|
||||||
[ ${FLAGS_dev_install} -eq ${FLAGS_FALSE} ]; then
|
|
||||||
# Check that the image has been correctly created.
|
# Check that the image has been correctly created.
|
||||||
"${SCRIPTS_DIR}/test_image" \
|
"${SCRIPTS_DIR}/test_image" \
|
||||||
--root="${ROOT_FS_DIR}" \
|
--root="${ROOT_FS_DIR}" \
|
||||||
@ -762,8 +751,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
USE_DEV_KEYS=
|
USE_DEV_KEYS=
|
||||||
if [ "${FLAGS_dev_install}" -eq "${FLAGS_TRUE}" ] || \
|
if [ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ]; then
|
||||||
[ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ]; then
|
|
||||||
USE_DEV_KEYS="--use_dev_keys"
|
USE_DEV_KEYS="--use_dev_keys"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -779,10 +767,10 @@ if [[ "${ARCH}" = "x86" ]] ||
|
|||||||
[[ "${ARCH}" = "arm" &&
|
[[ "${ARCH}" = "arm" &&
|
||||||
"${FLAGS_crosbug12352_arm_kernel_signing}" -eq "${FLAGS_TRUE}" ]]; then
|
"${FLAGS_crosbug12352_arm_kernel_signing}" -eq "${FLAGS_TRUE}" ]]; then
|
||||||
BOOT_FLAG=
|
BOOT_FLAG=
|
||||||
if [ "${FLAGS_dev_install}" -eq "${FLAGS_TRUE}" ] ||
|
if [ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ]; then
|
||||||
[ "${FLAGS_factory_install}" -eq "${FLAGS_TRUE}" ]; then
|
|
||||||
BOOT_FLAG="-b 1" # BOOT_FLAG_DEVELOPER value defined in load_kernel_fw.h
|
BOOT_FLAG="-b 1" # BOOT_FLAG_DEVELOPER value defined in load_kernel_fw.h
|
||||||
info "--dev_install set, pass BOOT_FLAG_DEVELOPER flag to load_kernel_test"
|
info "--factory_install set, pass BOOT_FLAG_DEVELOPER flag to \
|
||||||
|
load_kernel_test"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify the final image.
|
# Verify the final image.
|
||||||
|
Loading…
Reference in New Issue
Block a user