Factory Installer.

Change build_image to support building a factory install image. Also,
a shell script and startup script to run the factory installer.

Change software_update startup script to detect if it's a factory
install and abort if so.

BUG=2378,2379,2380
TEST=Tested factory install worked on device.
Wrapper script to perform factory install at boot.

AU: New arg to install on non-boot device partition. This is used to
install in the factory. Also, switch to shflags for argument parsing.

Review URL: http://codereview.chromium.org/1556022
This commit is contained in:
Andrew de los Reyes 2010-04-08 15:58:17 -07:00
parent 503efe1f65
commit e7a04adc83

View File

@ -41,6 +41,8 @@ DEFINE_string to "" \
"The target image file or device" "The target image file or device"
DEFINE_boolean withtest $FLAGS_FALSE \ DEFINE_boolean withtest $FLAGS_FALSE \
"Include packages required for testing and prepare image for testing" "Include packages required for testing and prepare image for testing"
DEFINE_string factory_server $FLAGS_FALSE \
"Build a factory install image pointing to given server."
# Parse command line. # Parse command line.
FLAGS "$@" || exit 1 FLAGS "$@" || exit 1
@ -318,6 +320,12 @@ if [[ $FLAGS_withdev -eq $FLAGS_TRUE ]] ; then
sudo cp -a "$(which ldd)" "${ROOT_DEV_DIR}/usr/bin" sudo cp -a "$(which ldd)" "${ROOT_DEV_DIR}/usr/bin"
fi fi
if [ -n "$FLAGS_factory_server" ]; then
sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \
--root="$ROOT_DEV_DIR" --root-deps=rdeps \
--usepkgonly chromeos-factoryinstall $EMERGE_JOBS
fi
# Install packages required for testing. # Install packages required for testing.
if [[ $FLAGS_withtest -eq $FLAGS_TRUE ]] ; then if [[ $FLAGS_withtest -eq $FLAGS_TRUE ]] ; then
sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \ sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \
@ -326,9 +334,14 @@ if [[ $FLAGS_withtest -eq $FLAGS_TRUE ]] ; then
fi fi
# Perform any customizations on the root file system that are needed. # Perform any customizations on the root file system that are needed.
WITH_DEV="" EXTRA_CUSTOMIZE_ROOTFS_FLAGS=""
if [[ $FLAGS_withdev -eq $FLAGS_TRUE ]]; then if [ $FLAGS_withdev -eq $FLAGS_TRUE ]; then
WITH_DEV="--withdev" EXTRA_CUSTOMIZE_ROOTFS_FLAGS="--withdev"
fi
if [ -n "$FLAGS_factory_server" ]; then
# Indentation off b/c of long line
EXTRA_CUSTOMIZE_ROOTFS_FLAGS="$EXTRA_CUSTOMIZE_ROOTFS_FLAGS"\
" --factory_server=$FLAGS_factory_server"
fi fi
# Extract the kernel from the root filesystem for use by the GPT image. Legacy # Extract the kernel from the root filesystem for use by the GPT image. Legacy
@ -378,7 +391,7 @@ fi
--root="$ROOT_FS_DIR" \ --root="$ROOT_FS_DIR" \
--target="$ARCH" \ --target="$ARCH" \
--board="$BOARD" \ --board="$BOARD" \
$WITH_DEV $EXTRA_CUSTOMIZE_ROOTFS_FLAGS
# Check that the image has been correctly created. # Check that the image has been correctly created.
"${SCRIPTS_DIR}/test_image" \ "${SCRIPTS_DIR}/test_image" \