mirror of
https://chromium.googlesource.com/crosvm/crosvm
synced 2024-10-23 04:46:29 +00:00
8b21047281
Add test for the device tree overlay mechanism. Bug: b/296796644 Test: cd cros_fdt && cargo test Change-Id: I8e8d129344e1ad4ddf0d7af7b3f21c0c9d9ca038 Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/4855966 Commit-Queue: Jakob Vukalović <jakobvukalovic@google.com> Reviewed-by: Daniel Verkamp <dverkamp@chromium.org>
24 lines
664 B
Bash
Executable file
24 lines
664 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# Copyright 2023 The ChromiumOS Authors
|
|
# Use of this source code is governed by a BSD-style license that can be
|
|
# found in the LICENSE file.
|
|
|
|
# Compile device tree source files to binaries used as test inputs.
|
|
# Run this when source files are changed.
|
|
|
|
# Check if dtc is present
|
|
if ! command -v dtc >/dev/null 2>&1; then
|
|
echo "Error: device tree compiler (dtc) not found."
|
|
exit 1
|
|
fi
|
|
|
|
# Compile all dts files
|
|
testfiles_loc="$(dirname -- "$0")"
|
|
for source_file in "$testfiles_loc"/*.dts; do
|
|
if [ -f "$source_file" ]; then
|
|
binary_file="${source_file%.dts}.dtb"
|
|
dtc -@ -I dts -O dtb -o "$binary_file" "$source_file"
|
|
fi
|
|
done
|