• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/usr/bin/env bash
2# Copyright 2022 The ChromiumOS Authors
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5
6STUB_DIR=$(dirname "$0")
7SYSTEM_API_DIR="$HOME/chromiumos/src/platform2/system_api"
8
9if ! [ -e "$SYSTEM_API_DIR" ]; then
10    echo "This script must be run from a ChromeOS checkout and inside cros_sdk."
11fi
12
13# The system_api build.rs will generate bindings in $SYSTEM_API_DIR/src
14(cd "$SYSTEM_API_DIR" && cargo build)
15
16FILES=(
17    "src/bindings/client/org_chromium_spaced.rs"
18    "src/bindings/client/org_chromium_vtpm.rs"
19    "src/protos/spaced.rs"
20    "src/protos/vtpm_interface.rs"
21)
22
23for FILE in "${FILES[@]}"; do
24    TARGET_DIR=$(dirname "$STUB_DIR/$FILE")
25    mkdir -p "$TARGET_DIR"
26    cp "$SYSTEM_API_DIR/$FILE" "$TARGET_DIR"
27done
28