| # Copyright 2015 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. |
| |
| description "Ensure adb home directory exists." |
| author "chromium-os-dev@chromium.org" |
| |
| start on starting boot-services |
| |
| script |
| # In case stateful is wiped, recreate the moblab home directory and ensure |
| # moblab owns it. |
| ADB_HOME=/home/adb |
| mkdir -p "${ADB_HOME}" |
| |
| chown adb:adb "${ADB_HOME}" |
| # Copy over the ssh keys if they don't already exist. |
| ADB_SSH_DIR="${ADB_HOME}"/.ssh |
| if [ ! -e "${ADB_SSH_DIR}"/id_rsa ]; then |
| mkdir -p "${ADB_SSH_DIR}" |
| cp /root/.ssh/* "${ADB_SSH_DIR}" |
| chown -R adb:adb "${ADB_SSH_DIR}" |
| fi |
| |
| # Ensure the adb server is up and running as root. |
| adb start-server |
| end script |