From 69d139f76689698f77edb000ce227339fc2fb396 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 6 Mar 2012 11:33:14 -0500 Subject: [PATCH] update hooks: update metadata dir for installed crossdev overlays Old crossdev would symlink its metadata dir to the chromiumos overlay. New crossdev manages this itself iff it had created the layout.conf before. Add an upgrade hook to convert the symlink over to a config file that crossdev will update. BUG=chromium-os:26998 TEST=`./update_chroot` with old chroot created metadata overlay that crossdev would update Change-Id: I03faa78a988e0cd0a94dcd4f0f01151c32bb215b CQ-DEPEND=I3f2775111da800622591c9b56ba00428d6106207 Reviewed-on: https://gerrit.chromium.org/gerrit/17408 Reviewed-by: Zdenek Behan Tested-by: Mike Frysinger Commit-Ready: Mike Frysinger --- chroot_version_hooks.d/30_crossdev_metadata | 28 +++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 chroot_version_hooks.d/30_crossdev_metadata 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