diff --git a/build_image.sh b/build_image.sh index 34567223aa..5762ce35fc 100755 --- a/build_image.sh +++ b/build_image.sh @@ -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 pkglist "$DEFAULT_PKGLIST" \ "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 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" # -- 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" \ --build_root="${FLAGS_build_root}" \ --root="$ROOT_FS_DIR" \ --output_dir="${OUTPUT_DIR}" \ - --package_list="$FLAGS_pkglist" \ + --package_list="$PKGLIST" \ --server="$FLAGS_mirror" \ --suite="$FLAGS_suite" diff --git a/install_packages.sh b/install_packages.sh index 39e2f8d67b..1f5f06ed3f 100755 --- a/install_packages.sh +++ b/install_packages.sh @@ -29,7 +29,7 @@ DEFINE_string arch "x86" \ DEFINE_string build_root "$DEFAULT_BUILD_ROOT" \ "Root of build output" 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" \ "The package server to use." 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" trap cleanup_rootfs_mounts EXIT -# Install prod packages -COMPONENTS=`cat $FLAGS_package_list | sed -e 's/#.*//' | grep -v '^ *$' | sed '/$/{N;s/\n/ /;}'` -sudo APT_CONFIG="$APT_CONFIG" DEBIAN_FRONTEND=noninteractive \ - apt-get --force-yes install $COMPONENTS +# Install packages from the given package-lists +PACKAGE_LISTS=$(echo "$FLAGS_package_list" | sed -e 's/,/ /g') +for p in $PACKAGE_LISTS; do + 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, # install the kernel in /boot, and manage symlinks.