Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Unified Diff: src/scripts/build_image

Issue 998002: Build image part of http://codereview.chromium.org/913004/show (Closed)
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/scripts/build_image
diff --git a/src/scripts/build_image b/src/scripts/build_image
index 4cb68dad8b41a9ae7936bba7de81cbdf29126ff8..33437458ad33337a1484dd15d878a1e947a16cbe 100755
--- a/src/scripts/build_image
+++ b/src/scripts/build_image
@@ -37,6 +37,8 @@ DEFINE_integer jobs -1 \
"How many packages to build in parallel at maximum."
DEFINE_boolean statefuldev $FLAGS_FALSE \
"Install development packages on stateful partition -- still experimental"
+DEFINE_boolean withtest $FLAGS_TRUE \
+ "Include packages required for testing and prepare image for testing"
# Parse command line.
FLAGS "$@" || exit 1
@@ -271,32 +273,42 @@ fi
sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \
--root="$ROOT_FS_DIR" --root-deps=rdeps \
--usepkgonly chromeos $EMERGE_JOBS
+
+# Determine the root dir for development packages.
+ROOT_DEV_DIR="$ROOT_FS_DIR"
+[ $FLAGS_statefuldev -eq $FLAGS_TRUE ] && ROOT_DEV_DIR="$ROOT_FS_DIR/usr/local"
+
+# Install development packages.
if [[ $FLAGS_withdev -eq $FLAGS_TRUE ]] ; then
- # Determine the root dir for development packages
- ROOT_DIR="$ROOT_FS_DIR"
- [ $FLAGS_statefuldev -eq $FLAGS_TRUE ] && ROOT_DIR="$ROOT_FS_DIR/usr/local"
-
sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \
- --root="$ROOT_DIR" --root-deps=rdeps \
+ --root="$ROOT_DEV_DIR" --root-deps=rdeps \
--usepkgonly chromeos-dev $EMERGE_JOBS
-
- if [ $FLAGS_statefuldev -eq $FLAGS_TRUE ] ; then
- # Fix symlinks so they work on live system.
- for path in bin include lib libexec sbin share; do
- sudo unlink $DEV_IMAGE_ROOT/usr/$path
- sudo ln -s /usr/local/$path $DEV_IMAGE_ROOT/usr/$path
- done
-
- # Fix exceptions.
- sudo unlink "$DEV_IMAGE_ROOT/usr/lib64"
- sudo unlink "$DEV_IMAGE_ROOT/usr/local"
-
- sudo ln -s "/usr/local/lib" "$DEV_IMAGE_ROOT/usr/lib64"
- sudo ln -s "/usr/local" "$DEV_IMAGE_ROOT/usr/local"
- fi
# The ldd tool is a useful shell script but lives in glibc; just copy it.
- sudo cp -a "$(which ldd)" "${ROOT_FS_DIR}/usr/bin"
+ sudo cp -a "$(which ldd)" "${ROOT_DEV_DIR}/usr/bin"
+fi
+
+# Install packages required for testing.
+if [[ $FLAGS_withtest -eq $FLAGS_TRUE ]] ; then
+ sudo INSTALL_MASK="$INSTALL_MASK" emerge-${BOARD} \
+ --root="$ROOT_DEV_DIR" --root-deps=rdeps \
+ --usepkgonly chromeos-test $EMERGE_JOBS
+fi
+
+# Clean up links setup for stateful install of extra packages.
+if [ $FLAGS_statefuldev -eq $FLAGS_TRUE ] ; then
+ # Fix symlinks so they work on live system.
+ for path in bin include lib libexec sbin share; do
+ sudo unlink $DEV_IMAGE_ROOT/usr/$path
+ sudo ln -s /usr/local/$path $DEV_IMAGE_ROOT/usr/$path
+ done
+
+ # Fix exceptions.
+ sudo unlink "$DEV_IMAGE_ROOT/usr/lib64"
+ sudo unlink "$DEV_IMAGE_ROOT/usr/local"
+
+ sudo ln -s "/usr/local/lib" "$DEV_IMAGE_ROOT/usr/lib64"
+ sudo ln -s "/usr/local" "$DEV_IMAGE_ROOT/usr/local"
fi
# Perform any customizations on the root file system that are needed.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698