Add --with_dev_pkgs option to build_image.sh to pull in developer debug packages.

This defaults to TRUE when building an image.

This CL moves some developer-only packages from package-list-prod.txt to
package-list-debug.txt and adds support for a comma-separated list of
package lists to build_image.sh.

Actually, I'd like to rename package-list-dev.txt to package-list-build.txt
and package-list-debug.txt to package-list-dev.txt but maybe in another CL.

Also there is a patch from lool that we should grab some stuff from that
can filter the package lists by build architecture. Eventually we will
likely add target-specific package lists as well.

With this change, build_image.sh --nowith_dev_pkgs will build an image
that does not contain niceties such as xterm.

Review URL: http://codereview.chromium.org/549107
This commit is contained in:
tedbo 2010-01-20 10:34:33 -08:00
parent 8d2a034fa0
commit 7237f473fb
2 changed files with 18 additions and 7 deletions

View File

@ -37,6 +37,8 @@ DEFINE_string mirror "$DEFAULT_EXT_MIRROR" "Repository mirror to use."
DEFINE_string suite "$DEFAULT_IMG_SUITE" "Repository suite to base image on." DEFINE_string suite "$DEFAULT_IMG_SUITE" "Repository suite to base image on."
DEFINE_string pkglist "$DEFAULT_PKGLIST" \ DEFINE_string pkglist "$DEFAULT_PKGLIST" \
"Name of file listing packages to install from repository." "Name of file listing packages to install from repository."
DEFINE_boolean with_dev_pkgs $FLAGS_TRUE \
"Include additional developer-friendly packages in the image."
# Parse command line # Parse command line
FLAGS "$@" || exit 1 FLAGS "$@" || exit 1
@ -117,12 +119,15 @@ sudo tune2fs -L "$DISK_LABEL" -U "$UUID" -c 0 -i 0 "$LOOP_DEV"
sudo mount "$LOOP_DEV" "$ROOT_FS_DIR" sudo mount "$LOOP_DEV" "$ROOT_FS_DIR"
# -- Install packages and customize root file system. -- # -- Install packages and customize root file system. --
PKGLIST="$FLAGS_pkglist"
if [ $FLAGS_with_dev_pkglist -eq $FLAGS_TRUE ]; then
PKGLIST="$PKGLIST,${SRC_ROOT}/package_repo/package-list-debug.txt"
fi
"${SCRIPTS_DIR}/install_packages.sh" \ "${SCRIPTS_DIR}/install_packages.sh" \
--build_root="${FLAGS_build_root}" \ --build_root="${FLAGS_build_root}" \
--root="$ROOT_FS_DIR" \ --root="$ROOT_FS_DIR" \
--output_dir="${OUTPUT_DIR}" \ --output_dir="${OUTPUT_DIR}" \
--package_list="$FLAGS_pkglist" \ --package_list="$PKGLIST" \
--server="$FLAGS_mirror" \ --server="$FLAGS_mirror" \
--suite="$FLAGS_suite" --suite="$FLAGS_suite"

View File

@ -29,7 +29,7 @@ DEFINE_string arch "x86" \
DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \
"Root of build output" "Root of build output"
DEFINE_string package_list "$DEFAULT_PKGLIST" \ DEFINE_string package_list "$DEFAULT_PKGLIST" \
"The package list file to use." "Comma separated set of package-list files to use."
DEFINE_string server "$DEFAULT_EXT_MIRROR" \ DEFINE_string server "$DEFAULT_EXT_MIRROR" \
"The package server to use." "The package server to use."
DEFINE_string suite "$DEFAULT_IMG_SUITE" \ DEFINE_string suite "$DEFAULT_IMG_SUITE" \
@ -213,10 +213,16 @@ sudo ln -sf /bin/true "${ROOT_FS_DIR}/usr/sbin/update-rc.d"
sudo mount -t proc proc "${ROOT_FS_DIR}/proc" sudo mount -t proc proc "${ROOT_FS_DIR}/proc"
trap cleanup_rootfs_mounts EXIT trap cleanup_rootfs_mounts EXIT
# Install prod packages # Install packages from the given package-lists
COMPONENTS=`cat $FLAGS_package_list | sed -e 's/#.*//' | grep -v '^ *$' | sed '/$/{N;s/\n/ /;}'` PACKAGE_LISTS=$(echo "$FLAGS_package_list" | sed -e 's/,/ /g')
sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ for p in $PACKAGE_LISTS; do
apt-get --force-yes install $COMPONENTS COMPONENTS=$(cat "$p" | \
sed -e 's/#.*//' | \
grep -v '^ *$' | \
sed '/$/{N;s/\n/ /;}')
sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \
apt-get --force-yes install $COMPONENTS
done
# Create kernel installation configuration to suppress warnings, # Create kernel installation configuration to suppress warnings,
# install the kernel in /boot, and manage symlinks. # install the kernel in /boot, and manage symlinks.