servod: Implement get_files_and_version

When the cable is not connected properly, servod goes through a codepath
that shows a very confusing error, due to the lack of this function.

From:
  File "/home/ribalda/.local/hdctools/lib/python3.10/site-packages/usbkm232-0.9999.0.dev0-py3.10.egg/servo/servo_postinit.py", line 329, in post_init
    faults = diagnose.diagnose_ccd(self.servod)
  File "/home/ribalda/.local/hdctools/lib/python3.10/site-packages/usbkm232-0.9999.0.dev0-py3.10.egg/servo/utils/diagnose.py", line 46, in diagnose_ccd
    servo_latest_fw = servo_dev.get('root.servo_latest_fw_version')
  File "/home/ribalda/.local/hdctools/lib/python3.10/site-packages/usbkm232-0.9999.0.dev0-py3.10.egg/servo/servo_server.py", line 474, in get
    val = drv.get()
  File "/home/ribalda/.local/hdctools/lib/python3.10/site-packages/usbkm232-0.9999.0.dev0-py3.10.egg/servo/drv/hw_driver.py", line 289, in get
    return self._get()
  File "/home/ribalda/.local/hdctools/lib/python3.10/site-packages/usbkm232-0.9999.0.dev0-py3.10.egg/servo/drv/servo_updater_reader.py", line 46, in _get
    except servo_updater.ServoUpdaterException as e:
AttributeError: type object 'servo_updater' has no attribute 'ServoUpdaterException'

to:

    self._servod = servo_server.Servod(
  File "/home/ribalda/.local/hdctools/lib/python3.10/site-packages/usbkm232-0.9999.0.dev0-py3.10.egg/servo/servo_server.py", line 166, in __init__
    servo_postinit.post_init(self)
  File "/home/ribalda/.local/hdctools/lib/python3.10/site-packages/usbkm232-0.9999.0.dev0-py3.10.egg/servo/servo_postinit.py", line 366, in post_init
    post_init_class(servod).post_init()
  File "/home/ribalda/.local/hdctools/lib/python3.10/site-packages/usbkm232-0.9999.0.dev0-py3.10.egg/servo/servo_postinit.py", line 347, in post_init
    raise ServoPostInitError('No device interface '
servo.servo_postinit.ServoPostInitError: No device interface (Servo Micro, C2D2, or CCD) connected.
libusb: debug [libusb_get_configuration] active config 1

BUG=none
TEST=on servo_v4p1 connected to volteer. Run servod -m volteer

Change-Id: I85b46057132b9ff28d9a66fe5f67494d1d9ff3ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/standalone-hdctools/+/3913295
Tested-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Sergey Frolov <sfrolov@google.com>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ricardo Ribalda <ribalda@chromium.org>
1 file changed
tree: 4d32738d7780cad4f8b0afadaf7a2ae5b7d69316
  1. flashrom
  2. README.md
  3. servod
README.md

Standalone scripts for hardware debug and control

This is a repository of scripts that enable common hardware debug tasks outside of a Chromium chroot.

When all you need is quick access to servod, flashrom, or others, the wrapper scripts here will get you up and running without the overhead of creating, syncing, or entering a chroot.

Usage

This repo is designed such that you can clone or download the entire repo and run scripts within, or grab and run individual scripts.

Running individual scripts

You can download and run individual scripts without checking out the entire repo:

script=servod
repo='https://chromium.googlesource.com/chromiumos/platform/standalone-hdctools/'
curl -f "${repo}/+/main/${script}?format=TEXT" | base64 -d > "${script}"
"./${script}"

Guidelines

  • Follow the Chromium shell style guidelines.
  • Unless making a symlink, do not assume any other script in the repo is available.
  • With few exceptions, these scripts should download, prepare, and run other Chromium OS tools -- not provide any new functionality.

Making changes

Since this repo isn‘t in the manifest, it won’t show up in your chroot. Instead, to make changes:

git clone https://chromium.googlesource.com/chromiumos/platform/standalone-hdctools
cd standalone-hdctools
curl -Lo .git/hooks/commit-msg https://gerrit-review.googlesource.com/tools/hooks/commit-msg
chmod +x .git/hooks/commit-msg
git checkout -b changes
# (make some changes)
git commit -a
git push origin HEAD:refs/for/main

The above steps will upload a patch to chromium-review.googlesource.com where you can get your patch reviewed, and submit.