[satlab] Fix build error and add sync
BUG=None
Change-Id: Iba847653040c58d2546881a4134a6e81bdc18a2e
diff --git a/src/dockerfiles/servod/Dockerfile b/src/dockerfiles/servod/Dockerfile
index f6572d9..eea4d9e 100644
--- a/src/dockerfiles/servod/Dockerfile
+++ b/src/dockerfiles/servod/Dockerfile
@@ -90,17 +90,17 @@
WORKDIR /ec
RUN make utils-host \
&& make -C extra/usb_updater usb_updater2
-RUN dosbin /ec/build/bds/util/ectool
-RUN dosbin /ec/build/bds/util/ec_parse_panicinfo
-RUN dosbin /ec/build/bds/util/ec_sb_firmware_update
-RUN dobin /ec/build/bds/util/stm32mon
-RUN dobin /ec/build/bds/util/ec_parse_panicinfo
-RUN dobin /ec/build/bds/util/uartupdatetool
-RUN dobin /ec/build/bds/util/iteflash
+RUN dosbin /ec/build/elm/util/ectool
+RUN dosbin /ec/build/elm/util/ec_parse_panicinfo
+RUN dosbin /ec/build/elm/util/ec_sb_firmware_update
+RUN dobin /ec/build/elm/util/stm32mon
+RUN dobin /ec/build/elm/util/ec_parse_panicinfo
+RUN dobin /ec/build/elm/util/uartupdatetool
+RUN dobin /ec/build/elm/util/iteflash
RUN dobin /ec/util/flash_ec
RUN dobin /ec/util/uart_stress_tester.py
RUN mkdir -p /usr/share/ec-devutils
-RUN cp /ec/util/openocd/* /usr/share/ec-devutils/
+RUN cp -r /ec/util/openocd/* /usr/share/ec-devutils/
RUN dosbin /ec/extra/usb_updater/usb_updater2
RUN curl https://raw.githubusercontent.com/kward/shflags/master/shflags --output /usr/share/misc/shflags
RUN python3 setup.py build
@@ -122,6 +122,10 @@
COPY setup.py /hdctools/build
RUN cd build && python3 setup.py install
+RUN mv /bin/sync /usr/local/bin/real_sync
+COPY sync /bin
+RUN chmod 755 /bin/sync
+
# Install cbfstool for flashrom and ec.
COPY --from=gcr.io/satlab-images/servod/overlays/cbfstool:4.14 /coreboot-4.14/util/cbfstool/cbfstool /usr/local/bin/
RUN chmod 755 /usr/local/bin/cbfstool
@@ -141,7 +145,6 @@
WORKDIR /
RUN rm -rf vboot_reference
RUN rm -rf flashrom
-RUN rm -rf hdctools
RUN rm -rf ec
# Avoid watchtower updating servod, it gets pulled before every start of the
diff --git a/src/dockerfiles/servod/requirements.in b/src/dockerfiles/servod/requirements.in
index 6818d71..a28cb80 100644
--- a/src/dockerfiles/servod/requirements.in
+++ b/src/dockerfiles/servod/requirements.in
@@ -5,4 +5,6 @@
pexpect
pyserial
pytest
-pyusb
\ No newline at end of file
+pyusb
+requests
+six
\ No newline at end of file
diff --git a/src/dockerfiles/servod/requirements.txt b/src/dockerfiles/servod/requirements.txt
index c77ecfa..aed3c2c 100644
--- a/src/dockerfiles/servod/requirements.txt
+++ b/src/dockerfiles/servod/requirements.txt
@@ -10,8 +10,12 @@
# 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
@@ -36,6 +40,8 @@
# google-apitools
# gsutil
# oauth2client
+idna==3.3
+ # via requests
iniconfig==1.1.1
# via pytest
meson==0.60.3
@@ -89,6 +95,8 @@
# 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
@@ -97,6 +105,7 @@
# via oauth2client
six==1.16.0
# via
+ # -r requirements.in
# fasteners
# gcs-oauth2-boto-plugin
# google-apitools
@@ -107,3 +116,5 @@
# pyu2f
toml==0.10.2
# via pytest
+urllib3==1.26.9
+ # via requests
diff --git a/src/dockerfiles/servod/sync b/src/dockerfiles/servod/sync
new file mode 100644
index 0000000..45836e3
--- /dev/null
+++ b/src/dockerfiles/servod/sync
@@ -0,0 +1,14 @@
+#!/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