dockerfile: Clean up no longer used files.
Now the Satlab/Moblab servod image is based on the HW Tools image
these files are no longer required.
BUG=b:249806109
TEST=None
Change-Id: I724e324066a3c46f1296e2240fb91802a8ab284c
diff --git a/src/dockerfiles/servod/dobin b/src/dockerfiles/servod/dobin
deleted file mode 100755
index 5107309..0000000
--- a/src/dockerfiles/servod/dobin
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2021 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.
-
-#!/bin/bash
-set -eu
-
-# Copy binary into /usr/bin and chmod 0755
-binary="$1"
-cp $binary /usr/bin
-chmod 0755 /usr/bin/"$(basename -- $binary)"
diff --git a/src/dockerfiles/servod/dosbin b/src/dockerfiles/servod/dosbin
deleted file mode 100755
index b535953..0000000
--- a/src/dockerfiles/servod/dosbin
+++ /dev/null
@@ -1,11 +0,0 @@
-# Copyright 2021 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.
-
-#!/bin/bash
-set -eu
-
-# Copy binary into /usr/sbin and chmod 0755
-binary="$1"
-cp $binary /usr/sbin
-chmod 0755 /usr/sbin/"$(basename -- $binary)"
\ No newline at end of file
diff --git a/src/dockerfiles/servod/requirements.in b/src/dockerfiles/servod/requirements.in
deleted file mode 100644
index a28cb80..0000000
--- a/src/dockerfiles/servod/requirements.in
+++ /dev/null
@@ -1,10 +0,0 @@
-gsutil
-meson
-ninja
-numpy
-pexpect
-pyserial
-pytest
-pyusb
-requests
-six
\ No newline at end of file
diff --git a/src/dockerfiles/servod/requirements.txt b/src/dockerfiles/servod/requirements.txt
deleted file mode 100644
index aed3c2c..0000000
--- a/src/dockerfiles/servod/requirements.txt
+++ /dev/null
@@ -1,120 +0,0 @@
-#
-# This file is autogenerated by pip-compile with python 3.9
-# To update, run:
-#
-# pip-compile
-#
-argcomplete==1.12.3
- # via gsutil
-attrs==21.2.0
- # via pytest
-boto==2.49.0
- # via gcs-oauth2-boto-plugin
-certifi==2021.10.8
- # via requests
-cffi==1.14.5
- # via cryptography
-charset-normalizer==2.0.12
- # via requests
-crcmod==1.7
- # via gsutil
-cryptography==3.4.7
- # via pyopenssl
-fasteners==0.16
- # via
- # google-apitools
- # gsutil
-gcs-oauth2-boto-plugin==2.7
- # via gsutil
-google-apitools==0.5.32
- # via gsutil
-google-reauth==0.1.1
- # via
- # gcs-oauth2-boto-plugin
- # gsutil
-gsutil==4.62
- # via -r requirements.in
-httplib2==0.19.1
- # via
- # gcs-oauth2-boto-plugin
- # google-apitools
- # gsutil
- # oauth2client
-idna==3.3
- # via requests
-iniconfig==1.1.1
- # via pytest
-meson==0.60.3
- # via -r requirements.in
-mock==2.0.0
- # via gsutil
-monotonic==1.6
- # via gsutil
-ninja==1.10.2.3
- # via -r requirements.in
-numpy==1.19.5
- # via -r requirements.in
-oauth2client==4.1.3
- # via
- # gcs-oauth2-boto-plugin
- # google-apitools
-packaging==20.9
- # via pytest
-pbr==5.6.0
- # via mock
-pexpect==4.8.0
- # via -r requirements.in
-pluggy==0.13.1
- # via pytest
-ptyprocess==0.7.0
- # via pexpect
-py==1.10.0
- # via pytest
-pyasn1==0.4.8
- # via
- # oauth2client
- # pyasn1-modules
- # rsa
-pyasn1-modules==0.2.8
- # via oauth2client
-pycparser==2.20
- # via cffi
-pyopenssl==20.0.1
- # via
- # gcs-oauth2-boto-plugin
- # gsutil
-pyparsing==2.4.7
- # via
- # httplib2
- # packaging
-pyserial==3.5
- # via -r requirements.in
-pytest==6.2.4
- # via -r requirements.in
-pyu2f==0.1.5
- # via google-reauth
-pyusb==1.1.1
- # via -r requirements.in
-requests==2.27.1
- # via -r requirements.in
-retry-decorator==1.1.1
- # via
- # gcs-oauth2-boto-plugin
- # gsutil
-rsa==4.7.2
- # via oauth2client
-six==1.16.0
- # via
- # -r requirements.in
- # fasteners
- # gcs-oauth2-boto-plugin
- # google-apitools
- # gsutil
- # mock
- # oauth2client
- # pyopenssl
- # pyu2f
-toml==0.10.2
- # via pytest
-urllib3==1.26.9
- # via requests
diff --git a/src/dockerfiles/servod/servo_firmware_provision.py b/src/dockerfiles/servod/servo_firmware_provision.py
deleted file mode 100644
index 2b2c91f..0000000
--- a/src/dockerfiles/servod/servo_firmware_provision.py
+++ /dev/null
@@ -1,91 +0,0 @@
-# Copyright 2021 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.
-
-import os
-import subprocess
-
-
-# TODO (anhdle): Update to track servo-firmware ebuild instead of hardcoding.
-C2D2_NAME = "c2d2_v2.4.35-f1113c92b" # servo-firmware-R81-12768.40.0
-SERVO_MICRO_NAME = "servo_micro_v2.4.57-ce329f64f" # servo-firmware-R81-12768.71.0
-SERVO_V4_NAME = "servo_v4_v2.4.58-c37246f9c" # servo-firmware-R81-12768.74.0
-SERVO_V4P1_NAME = "servo_v4p1_v2.0.8584+1a7e7e64c" # Local builds are temporary b/153464312
-SWEETBERRY_NAME = "sweetberry_v2.3.7-096c7ee84" # servo-firmware-R70-11011.14.0
-
-# Prev channel firmware
-SERVO_MICRO_NAME_PREV = "servo_micro_v2.4.35-f1113c92b" # servo-firmware-R81-12768.40.0
-SERVO_V4_NAME_PREV = "servo_v4_v2.4.57-ce329f64f" # servo-firmware-R81-12768.71.0
-SERVO_V4P1_NAME_PREV = "servo_v4p1_v2.0.5159-529612865" # Local builds are temporary b/153464312
-
-MIRROR_PATH = "gs://chromeos-localmirror/distfiles/"
-
-C2D2_FILE = '{}.tar.gz'.format(C2D2_NAME)
-SERVO_MICRO_FILE = '{}.tar.xz'.format(SERVO_MICRO_NAME)
-SERVO_MICRO_FILE_PREV = '{}.tar.gz'.format(SERVO_MICRO_NAME_PREV)
-SERVO_V4_FILE = '{}.tar.xz'.format(SERVO_V4_NAME)
-SERVO_V4_FILE_PREV = '{}.tar.xz'.format(SERVO_V4_NAME_PREV)
-SERVO_V4P1_FILE = '{}.tar.xz'.format(SERVO_V4P1_NAME)
-SERVO_V4P1_FILE_PREV = '{}.tar.xz'.format(SERVO_V4P1_NAME_PREV)
-SWEETBERRY_FILE = '{}.tar.gz'.format(SWEETBERRY_NAME)
-
-
-def create_sym_link(src, dst):
- os.symlink(src, dst)
-
-
-def download_unpack(path, filename):
- """Download the tarball from Google Cloud storage, untar, clean up.
-
- Args:
- path (str): path to the gs bucket.
- filename (str): name of the tarball
- dst (str): local folder to download and extract.
- """
- subprocess.check_call(['gsutil', 'cp', path + filename, filename])
- subprocess.check_call(['tar', 'xf',filename])
- os.remove(filename)
-
-
-def main():
- download_unpack(MIRROR_PATH, C2D2_FILE)
- os.chmod(C2D2_NAME + '.bin', 420)
- create_sym_link(C2D2_NAME + '.bin', 'c2d2.alpha.bin')
- create_sym_link(C2D2_NAME + '.bin', 'c2d2.stable.bin')
- create_sym_link(C2D2_NAME + '.bin', 'c2d2.dev.bin')
- create_sym_link(C2D2_NAME + '.bin', 'c2d2.prev.bin')
-
- download_unpack(MIRROR_PATH, SERVO_MICRO_FILE)
- download_unpack(MIRROR_PATH, SERVO_MICRO_FILE_PREV)
- os.chmod(SERVO_MICRO_NAME + '.bin', 420)
- os.chmod(SERVO_MICRO_NAME_PREV + '.bin', 420)
- create_sym_link(SERVO_MICRO_NAME + '.bin', 'servo_micro.alpha.bin')
- create_sym_link(SERVO_MICRO_NAME + '.bin', 'servo_micro.stable.bin')
- create_sym_link(SERVO_MICRO_NAME + '.bin', 'servo_micro.dev.bin')
- create_sym_link(SERVO_MICRO_NAME_PREV + '.bin', 'servo_micro.prev.bin')
-
- download_unpack(MIRROR_PATH, SERVO_V4_FILE)
- download_unpack(MIRROR_PATH, SERVO_V4_FILE_PREV)
- os.chmod(SERVO_V4_NAME + '.bin', 420)
- os.chmod(SERVO_V4_NAME_PREV + '.bin', 420)
- create_sym_link(SERVO_V4_NAME + '.bin', 'servo_v4.alpha.bin')
- create_sym_link(SERVO_V4_NAME + '.bin', 'servo_v4.stable.bin')
- create_sym_link(SERVO_V4_NAME + '.bin', 'servo_v4.dev.bin')
- create_sym_link(SERVO_V4_NAME_PREV + '.bin', 'servo_v4.prev.bin')
-
- download_unpack(MIRROR_PATH, SERVO_V4P1_FILE)
- download_unpack(MIRROR_PATH, SERVO_V4P1_FILE_PREV)
- os.chmod(SERVO_V4P1_NAME + '.bin', 420)
- os.chmod(SERVO_V4P1_NAME_PREV + '.bin', 420)
- create_sym_link(SERVO_V4P1_NAME + '.bin', 'servo_v4p1.alpha.bin')
- create_sym_link(SERVO_V4P1_NAME + '.bin', 'servo_v4p1.stable.bin')
- create_sym_link(SERVO_V4P1_NAME + '.bin', 'servo_v4p1.dev.bin')
- create_sym_link(SERVO_V4P1_NAME_PREV + '.bin', 'servo_v4p1.prev.bin')
-
- download_unpack(MIRROR_PATH, SWEETBERRY_FILE)
- os.chmod(SWEETBERRY_NAME + '.bin', 420)
- create_sym_link(SWEETBERRY_NAME + '.bin', 'sweetberry.alpha.bin')
- create_sym_link(SWEETBERRY_NAME + '.bin', 'sweetberry.stable.bin')
- create_sym_link(SWEETBERRY_NAME + '.bin', 'sweetberry.dev.bin')
-
-main()
\ No newline at end of file
diff --git a/src/dockerfiles/servod/setup.py b/src/dockerfiles/servod/setup.py
deleted file mode 100644
index a309af3..0000000
--- a/src/dockerfiles/servod/setup.py
+++ /dev/null
@@ -1,96 +0,0 @@
-#!/usr/bin/env python3
-# Copyright (c) 2021 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.
-
-
-import imp
-import os
-import sys
-
-from setuptools import setup
-from setuptools.command import build_py
-import servo.sversion_util as svu
-
-__version__ = svu.setuptools_version()
-
-
-class servo_build_py(build_py.build_py):
- """Custom build_py class for servod to do setup"""
-
- # The only reason we include the servo.data package is to build INA
- # XML configuration files from simplified .py files. So we pop it
- # out to avoid building the python files.
- # See generate_ina_controls.py & servo/data/README.md for more
- # information.
-
- def build_ina_maps(self):
- """Generate .xml servod configuration files from the servo/data/*.py"""
- # get package_data files
- # run generate_ina_controls.py over all the files,
- # giving the file an output directory?
- data_dir = self.get_package_dir(self.packages.pop(1))
- module_name = 'generate_ina_controls'
- ina_generator = imp.load_module(module_name, *imp.find_module(module_name,
- [data_dir]))
- ina_generator.GenerateINAControls(data_dir)
-
- def run(self):
- """Build INA maps."""
- self.build_ina_maps()
- build_py.build_py.run(self)
-
-setup(
- name = 'servo',
- version = __version__,
- package_dir = {'': '.'},
- py_modules=['servo.servod', 'servo.dut_control'],
- packages=['servo', 'servo.data', 'servo.drv', 'servo.interface',
- 'servo.tools', 'servo.utils'],
- package_data={
- 'servo': [
- 'data/*.xml',
- 'data/*.scenario',
- 'data/*.board',
- ],
- },
- cmdclass={'build_py': servo_build_py},
- url = 'http://www.chromium.org',
- maintainer='chromium os',
- maintainer_email='chromium-os-dev@chromium.org',
- license = 'Chromium',
- description = 'Server to communicate and control servo debug board.',
- long_description = 'Server to communicate and control servo debug board.',
- entry_points={
- 'console_scripts': [
- 'servod = servo.servod:main',
- 'dut-control = servo.dut_control:main',
- 'dut-power = servo.dut_power:main',
- 'servodutil = servo.servodtool:servodutil',
- 'servodtool = servo.servodtool:main',
- ],
- })
-
-setup(
- name = 'usbkm232',
- version = __version__,
- package_dir = {'': '.'},
- py_modules=['usbkm232.ctrld', 'usbkm232.ctrlu', 'usbkm232.enter',
- 'usbkm232.space', 'usbkm232.tab'],
- packages=['usbkm232'],
- url = 'http://www.chromium.org',
- maintainer='chromium os',
- maintainer_email='chromium-os-dev@chromium.org',
- license = 'Chromium',
- description = 'Communicate and control usbkm232 USB keyboard device.',
- long_description = 'Communicate and control usbkm232 USB keyboard device.',
- entry_points={
- 'console_scripts': [
- 'usbkm232-ctrld = usbkm232.ctrld:main',
- 'usbkm232-ctrlu = usbkm232.ctrlu:main',
- 'usbkm232-enter = usbkm232.enter:main',
- 'usbkm232-space = usbkm232.space:main',
- 'usbkm232-tab = usbkm232.tab:main',
- 'usbkm232-test = usbkm232.usbkm232:main',
- ],
- })
diff --git a/src/dockerfiles/servod/start_servod.sh b/src/dockerfiles/servod/start_servod.sh
deleted file mode 100755
index bbecbc2..0000000
--- a/src/dockerfiles/servod/start_servod.sh
+++ /dev/null
@@ -1,112 +0,0 @@
-# Copyright 2021 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.
-
-#!/bin/bash
-
-set -x
-
-CONFIG_FILE_DIR="/var/lib/servod"
-CONFIG_FILE=$CONFIG_FILE_DIR/config_$PORT
-LOG="/var/log/servod_$PORT.STARTUP.log"
-LOG_BACKUP_COUNT=1024
-
-# Default port to be 9999.
-PORT=${PORT:-9999}
-mkdir -p /var/lib/servod
-. /hdctools/chromeos/servod_utils.sh
-
-echo "Pre-start PORT=$PORT BOARD=$BOARD MODEL=$MODEL SERIAL=$SERIAL."
-
-for CMD in iptables-legacy ip6tables-legacy ; do
- $CMD -A INPUT -p tcp --dport $PORT -j ACCEPT || echo "Failed to configure $CMD."
-done
-
-echo "Update config. PORT=$PORT BOARD=$BOARD MODEL=$MODEL SERIAL=$SERIAL."
-
-# We'll want to update the config file with all the args passed in.
-update_config $CONFIG_FILE BOARD $BOARD
-update_config $CONFIG_FILE MODEL $MODEL
-update_config $CONFIG_FILE SERIAL $SERIAL
-update_config $CONFIG_FILE CONFIG $CONFIG
-update_config $CONFIG_FILE DUAL_V4 $DUAL_V4
-
-echo "Store servo hub location and servo micro serial if presents. "\
- "$CONFIG_FILE $SERIAL"
-cache_servov4_hub_and_servo_micro $CONFIG_FILE $SERIAL
-echo "Pre-start complete."
-
-SERVO_MICRO_VIDPID="18d1:501a"
-SERVO_V4_VIDPID="18d1:501b"
-
-if [ ! -f $CONFIG_FILE ]; then
- echo "No configuration file ($CONFIG_FILE); terminating"
- stop
- exit 0
-fi
-
-if [ -z "$BOARD" ]; then
- echo "No board specified; terminating"
- stop
- exit 0
-fi
-
-MODEL_MSG=""
-MODEL_FLAG=""
-if [ -n "$MODEL" ]; then
- MODEL_FLAG="--model ${MODEL}"
- MODEL_MSG=" model ${MODEL}"
-fi
-
-SERIAL_FLAG=""
-SERIAL_MSG=""
-if [ -z "$SERIAL" ]; then
- log_output "No serial specified"
-else
- SERIAL_FLAG="--serialname ${SERIAL}"
- SERIAL_MSG="using servo serial $SERIAL"
-fi
-
-BOARD_FLAG="--board ${BOARD}"
-PORT_FLAG="--port ${PORT}"
-
-if [ "$DEBUG" = "1" ]; then
- DEBUG_FLAG="--debug"
-else
- DEBUG_FLAG=""
-fi
-
-CONFIG_FLAG=""
-if [ ! -z "$CONFIG" ]; then
- CONFIG_FLAG="--config ${CONFIG}"
-fi
-
-REC_MODE_FLAG=""
-if [ ! -z "$REC_MODE" ]; then
- REC_MODE_FLAG="--recovery_mode"
-fi
-
-if [ "$DUAL_V4" = "1" ]; then
- DUAL_V4_FLAG="--allow-dual-v4"
-else
- DUAL_V4_FLAG=""
-fi
-
-if [ -n "$SERIAL" ]; then
- servodtool device -s $SERIAL reboot
- sleep 5
-fi
-
-echo "Launching servod for $BOARD $MODEL_MSG on port $PORT $SERIAL_MSG"
-
-servod \
- --host 0.0.0.0 \
- --log-dir-backup-count $LOG_BACKUP_COUNT \
- $BOARD_FLAG \
- $MODEL_FLAG \
- $SERIAL_FLAG \
- $PORT_FLAG \
- $DEBUG_FLAG \
- $REC_MODE_FLAG \
- $CONFIG_FLAG \
- $DUAL_V4_FLAG
diff --git a/src/dockerfiles/servod/stop_servod.sh b/src/dockerfiles/servod/stop_servod.sh
deleted file mode 100755
index 4313829..0000000
--- a/src/dockerfiles/servod/stop_servod.sh
+++ /dev/null
@@ -1,13 +0,0 @@
-# Copyright 2021 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.
-
-#!/bin/bash
-
-set -x
-
-dut-control -p $PORT "log_msg:Turning down servod."
-
-for CMD in iptables-legacy ip6tables-legacy ; do
- $CMD -D INPUT -p tcp --dport $PORT -j ACCEPT || true
-done
diff --git a/src/dockerfiles/servod/sync b/src/dockerfiles/servod/sync
deleted file mode 100644
index 45836e3..0000000
--- a/src/dockerfiles/servod/sync
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-
-# Copyright 2022 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.
-
-set -x
-
-if [ $# -eq 0 ]; then
- echo "Calling sync without arguments is not allowed"
- exit 0
-fi
-
-/usr/local/bin/real_sync "$@"
\ No newline at end of file
diff --git a/src/dockerfiles/servod/update_servo_firmware.py b/src/dockerfiles/servod/update_servo_firmware.py
deleted file mode 100644
index 19d1533..0000000
--- a/src/dockerfiles/servod/update_servo_firmware.py
+++ /dev/null
@@ -1,26 +0,0 @@
-# Copyright 2021 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.
-
-import logging
-import subprocess
-import sys
-
-
-if __name__ == "__main__":
- # Start udev service.
- try:
- subprocess.check_call(['service', 'udev', 'start'])
- except subprocess.CalledProcessError as e:
- logging.exception('Fail to start udev service.')
- raise e
-
- # Invoke servo_updater.
- try:
- servo_update_command = ['servo_updater'] + sys.argv[1:]
- logging.debug('Updating firmware using: {}'.format(' '.join(servo_update_command)))
- subprocess.check_call(['servo_updater'] + sys.argv[1:])
- except subprocess.CalledProcessError as e:
- logging.exception('Fail to update firmware.')
- logging.info('Update firmware fails if servod is running.')
- raise e