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_userdataauth.rs" 18 "src/bindings/client/org_chromium_vtpm.rs" 19 "src/protos/auth_factor.rs" 20 "src/protos/fido.rs" 21 "src/protos/key.rs" 22 "src/protos/rpc.rs" 23 "src/protos/UserDataAuth.rs" 24 "src/protos/vtpm_interface.rs" 25) 26 27for FILE in "${FILES[@]}"; do 28 TARGET_DIR=$(dirname "$STUB_DIR/$FILE") 29 mkdir -p "$TARGET_DIR" 30 cp "$SYSTEM_API_DIR/$FILE" "$TARGET_DIR" 31done 32