2022-09-26 21:20:48 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# Copyright 2022 The ChromiumOS Authors
|
|
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
|
|
# found in the LICENSE file.
|
|
|
|
|
|
|
|
STUB_DIR=$(dirname "$0")
|
|
|
|
SYSTEM_API_DIR="$HOME/chromiumos/src/platform2/system_api"
|
|
|
|
|
|
|
|
if ! [ -e "$SYSTEM_API_DIR" ]; then
|
|
|
|
echo "This script must be run from a ChromeOS checkout and inside cros_sdk."
|
|
|
|
fi
|
|
|
|
|
|
|
|
# The system_api build.rs will generate bindings in $SYSTEM_API_DIR/src
|
|
|
|
(cd "$SYSTEM_API_DIR" && cargo build)
|
|
|
|
|
|
|
|
FILES=(
|
2023-07-20 12:34:27 +00:00
|
|
|
"src/bindings/client/org_chromium_spaced.rs"
|
2022-09-26 21:20:48 +00:00
|
|
|
"src/bindings/client/org_chromium_vtpm.rs"
|
2024-09-24 08:40:53 +00:00
|
|
|
"src/bindings/client/org_chromium_power_manager.rs"
|
2023-07-20 12:34:27 +00:00
|
|
|
"src/protos/spaced.rs"
|
2022-09-26 21:20:48 +00:00
|
|
|
"src/protos/vtpm_interface.rs"
|
|
|
|
)
|
|
|
|
|
|
|
|
for FILE in "${FILES[@]}"; do
|
|
|
|
TARGET_DIR=$(dirname "$STUB_DIR/$FILE")
|
|
|
|
mkdir -p "$TARGET_DIR"
|
|
|
|
cp "$SYSTEM_API_DIR/$FILE" "$TARGET_DIR"
|
|
|
|
done
|