blob: 07e93b643dca7e73fb3777460a186073990d115e [file] [log] [blame]
#!/bin/bash
# Copyright (c) 2009 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.
#
# Copy public keys to root's homedir for ssh pubkey auth, which
# is necessary for test automation.
echo "Copying public keys and changing PATH for ssh clients"
if [ "$BACKDOOR" -eq 1 ]; then
KEYS_DIR=${GCLIENT_ROOT}/src/scripts/mod_for_test_scripts/ssh_keys
else
KEYS_DIR=${GCLIENT_ROOT}/../.ssh
fi
mkdir -p ${ROOT_FS_DIR}/root/.ssh
ROOT_AUTHKEYS=${ROOT_FS_DIR}/root/.ssh/authorized_keys
cat ${KEYS_DIR}/*.pub >> ${ROOT_AUTHKEYS}
# Environment on test machines for su and ssh now set to include
touch ${ROOT_FS_DIR}/etc/environment
echo "PATH=/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin" \
>> "${ROOT_FS_DIR}/etc/environment"