xref: /aosp_15_r20/external/crosvm/tools/bindgen-all-the-things (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
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#
6# Regenerate all bindgen-generated Rust bindings in the crosvm tree.
7#
8# This script expects to be executed from a full ChromeOS checkout so it has access to the kernel
9# and other repositories. Note that it must be run from OUTSIDE the chroot.
10
11set -e
12cd "$(dirname "${BASH_SOURCE[0]}")/.."
13
14source tools/impl/bindgen-common.sh
15
16die() {
17    echo "$@"
18    exit 1
19}
20
21dirs=(
22    io_uring
23    kernel_loader
24    kvm_sys
25    media/libvda
26    net_sys
27    vfio_sys
28    virtio_sys
29    vm_memory
30)
31
32for d in "${dirs[@]}"; do
33    echo "bindgen ${d}"
34    "${d}"/bindgen.sh || die "Failed to generate bindings for ${d}"
35done
36
37echo "Done!"
38