blob: befb92a6936c9e3b74bf3881b605f78bae6f708a [file] [log] [blame]
#!/bin/bash
# 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.
die() {
echo "ERROR: $*"
exit 1
}
echo "Rebasing autotest/client folder for factory."
autotest_path="/usr/local/build/autotest"
base_dir="${ROOT_FS_DIR}${autotest_path}"
old_base_dir="${ROOT_FS_DIR}/usr/local/autotest"
[ -d "${base_dir}/client" ] || die "Missing client in root: ${base_dir}"
rm -rf ${base_dir}/packages || die "Failed to wipe packages directory."
mv "${base_dir}/client/"* "${base_dir}" || die "Failed moving client folder."
rmdir "${base_dir}/client" || die "Failed removing client folder."
ln -s . "${base_dir}/client" || die "Failed creating symlink."
ln -s "${autotest_path}" "${old_base_dir}" || die "Failed legacy symlink."