flatcar-scripts/chroot_version_hooks.d/30_crossdev_metadata
Mike Frysinger 69d139f766 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 <zbehan@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
2012-03-07 17:12:07 -08:00

29 lines
947 B
Plaintext

# 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