diff --git a/chroot_version_hooks.d/25_suppress_incremental_build_across_chroot b/chroot_version_hooks.d/25_suppress_incremental_build_across_chroot new file mode 100644 index 0000000000..b2e1484afc --- /dev/null +++ b/chroot_version_hooks.d/25_suppress_incremental_build_across_chroot @@ -0,0 +1,35 @@ +# Copyright (c) 2012 The Chromium OS Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# As of update 24, we preserve distfiles across chroot rebuilds via storing +# the content outside of the chroot, and binding it in. +# +# chromeos-chrome stores its build output in distdir however, which we +# don't currently want preserved across chroot builds, thus this script +# pulls the content out to the new location within the chroot. + +upgrade_path() { + local src="/var/cache/distfiles/target/$1" + local dest="/var/cache/chromeos-chrome/$1" + + if [ -d "$src" ]; then + if [ -d "$dest" ]; then + # User has already built it- thus wipe the src and use what's in + # the chrome specific cache. + sudo rm -rf "$src" + else + sudo mv "$src" "$dest" + fi + fi +} + +sudo mkdir -p 0775 /var/cache/chromeos-chrome/ +sudo chown "$USER:portage" /var/cache/chromeos-chrome/ + +upgrade_path chrome-src +upgrade_path chrome-src-internal +upgrade_path chrome-src-custom +upgrade_path chrome-src-custom-internal + +exit 0 diff --git a/sdk_lib/make_chroot.sh b/sdk_lib/make_chroot.sh index 2ac5767657..5479a0fc33 100755 --- a/sdk_lib/make_chroot.sh +++ b/sdk_lib/make_chroot.sh @@ -198,7 +198,13 @@ EOF sudo chmod 0644 "${FLAGS_chroot}"/etc/make.conf.user # Create directories referred to by our conf files. - sudo mkdir -p -m 775 "${FLAGS_chroot}/var/lib/portage/pkgs" + sudo mkdir -p -m 775 "${FLAGS_chroot}/var/lib/portage/pkgs" \ + "${FLAGS_chroot}/var/cache/distfiles" \ + "${FLAGS_chroot}/var/cache/chromeos-chrome" + + # Run this from w/in the chroot so we use whatever uid/gid + # these are defined as w/in the chroot. + sudo_chroot chown "${USER}:portage" /var/cache/chromeos-chrome # These are created for compatibility while transitioning # make.conf and friends over to the new location.