diff --git a/chroot_version_hooks.d/14_board_portage_env b/chroot_version_hooks.d/14_board_portage_env new file mode 100644 index 0000000000..e338d2ab3b --- /dev/null +++ b/chroot_version_hooks.d/14_board_portage_env @@ -0,0 +1,19 @@ +# Copyright (c) 2011 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. + +cfgd="/usr/local/portage/chromiumos/chromeos/config" + +# Make sure the board's /etc/portage/env is a symlink and not a dir. +for board_root in /build/*; do + envd="${board_root}/etc/portage/env" + if [ -d "${envd}" ]; then + sudo rm -rf "${envd}" + sudo ln -s "${cfgd}/env" "${envd}" + fi +done + +# Make sure we have bashrc on the host. +sudo ln -sf "${cfgd}/bashrc-host" /etc/portage/bashrc + +exit 0