diff --git a/chroot_version_hooks.d/30_crossdev_metadata b/chroot_version_hooks.d/30_crossdev_metadata new file mode 100644 index 0000000000..23b64e2f0c --- /dev/null +++ b/chroot_version_hooks.d/30_crossdev_metadata @@ -0,0 +1,28 @@ +# 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. + +# Newer crossdev will create a metadata layout for us, but the older one used +# a symlink for the dir, and crossdev won't auto-migrate for us. Delete the +# symlink and automatically seed a file that crossdev will update itself. We +# can't just delete the symlink and wait for setup_board to run as that will +# break the metadata lookup needed by the cross-compilers in the meantime. + +dir="/usr/local/portage/crossdev" +if [[ ! -d ${dir} || ! -L ${dir}/metadata ]] ; then + # Nothing for us to do. Great! (?) + exit 0 +fi + +set -e + +cd "${dir}" +sudo rm -f metadata +sudo mkdir metadata +sudo_clobber metadata/layout.conf <<-EOF +# Autogenerated and managed by crossdev +# Delete the above line if you want to manage this file yourself +masters = chromiumos portage-stable +EOF + +exit 0