Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
google
GitHub Repository: google/crosvm
Path: blob/main/cros_fdt/test-files/compile_testfiles.sh
5392 views
1
#!/bin/sh
2
3
# Copyright 2023 The ChromiumOS Authors
4
# Use of this source code is governed by a BSD-style license that can be
5
# found in the LICENSE file.
6
7
# Compile device tree source files to binaries used as test inputs.
8
# Run this when source files are changed.
9
10
# Check if dtc is present
11
if ! command -v dtc >/dev/null 2>&1; then
12
echo "Error: device tree compiler (dtc) not found."
13
exit 1
14
fi
15
16
# Compile all dts files
17
testfiles_loc="$(dirname -- "$0")"
18
for source_file in "$testfiles_loc"/*.dts; do
19
if [ -f "$source_file" ]; then
20
binary_file="${source_file%.dts}.dtb"
21
dtc -@ -I dts -O dtb -o "$binary_file" "$source_file"
22
fi
23
done
24
25