From 224c7fda0c0999941c1fe041328d6c4b20bda15e Mon Sep 17 00:00:00 2001 From: David McMahon Date: Tue, 26 Jan 2010 18:12:55 -0800 Subject: [PATCH] Add mechanism to support 'official' repositories and packages for releases. --- build_image.sh | 4 ++++ install_packages.sh | 4 ++++ make_chroot.sh | 13 ++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/build_image.sh b/build_image.sh index 982c6035e8..cfa29d1770 100755 --- a/build_image.sh +++ b/build_image.sh @@ -127,6 +127,10 @@ PKGLIST="$FLAGS_pkglist" if [ $FLAGS_with_dev_pkgs -eq $FLAGS_TRUE ]; then PKGLIST="$PKGLIST,${SRC_ROOT}/package_repo/package-list-debug.txt" fi +# Add official packages for ChromeOS if the file exists +if [ -f ${SRC_ROOT}/package_repo/package-list-official.txt ]; then + PKGLIST="$PKGLIST,${SRC_ROOT}/package_repo/package-list-official.txt" +fi "${SCRIPTS_DIR}/install_packages.sh" \ --build_root="${FLAGS_build_root}" \ --root="$ROOT_FS_DIR" \ diff --git a/install_packages.sh b/install_packages.sh index fd2afda7cc..2ed454ab67 100755 --- a/install_packages.sh +++ b/install_packages.sh @@ -101,6 +101,10 @@ if [ -n "$FLAGS_mirror2" ] && [ -n "$FLAGS_suite2" ]; then deb $FLAGS_mirror2 $FLAGS_suite2 main restricted multiverse universe EOF fi +# Look for official file and use it if it exists +if [ -f ${SRC_ROOT}/package_repo/sources-official.list ]; then + cat ${SRC_ROOT}/package_repo/sources-official.list >> "$APT_SOURCE" +fi # Cache directory for APT to use. This cache is re-used across builds. We # rely on the cache to reduce traffic to the hosted repositories. diff --git a/make_chroot.sh b/make_chroot.sh index b2e8e85dad..70e10b908c 100755 --- a/make_chroot.sh +++ b/make_chroot.sh @@ -47,7 +47,10 @@ eval set -- "${FLAGS_ARGV}" # TODO: replace shflags with something less error-prone, or contribute a fix. set -e -COMPONENTS=`cat $FLAGS_pkglist | sed -e 's/#.*//' | grep -v '^ *$' | tr '\n' ' '` +# Add additional components if file exists +OFFICIAL_COMPONENTS=$SRC_ROOT/package_repo/package-list-official.txt +[ -f $OFFICIAL_COMPONENTS ] || OFFICIAL_COMPONENTS= +COMPONENTS=$(cat $FLAGS_pkglist $OFFICIAL_COMPONENTS | sed -e 's/#.*//' | grep -v '^ *$' | tr '\n' ' ') FULLNAME="Chrome OS dev user" DEFGROUPS="eng,admin,adm,dialout,cdrom,floppy,audio,dip,video" PASSWORD=chronos @@ -136,6 +139,14 @@ bash_chroot "echo $USER ALL=NOPASSWD: ALL >> /etc/sudoers" # prefer our tools or custom packages bash_chroot "echo deb $DEFAULT_CHROMEOS_SERVER/tools chromiumos_dev \ main > /etc/apt/sources.list" +# Add official apt source if file exists +OFFICIAL_SOURCE_LIST=$SRC_ROOT/package_repo/sources-official.list +if [ -f $OFFICIAL_SOURCE_LIST ] +then + # Copy the file into the chroot so it's cat'able + cp -fp $OFFICIAL_SOURCE_LIST $FLAGS_chroot/tmp + bash_chroot "cat /tmp/$(basename $OFFICIAL_SOURCE_LIST) >> /etc/apt/sources.list" +fi # use specified mirror and suite for the rest of the development chroot bash_chroot "echo deb $FLAGS_mirror $FLAGS_suite \ main restricted multiverse universe >> /etc/apt/sources.list"