| commit | edc0e968c61942d56a78288f923b135f0737d77c | [log] [tgz] |
|---|---|---|
| author | Zhiyi Chen <zhiyichen@google.com> | Tue Aug 29 03:10:12 2023 +0000 |
| committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Tue Aug 29 03:10:12 2023 +0000 |
| tree | 7af84655ed0f8c40ac99ff79f44d6e669e99bd1f | |
| parent | f686c62800423e1df487471572776c9d32f517a9 [diff] |
[iwlwifi] Copy async-patterns library to support new unittests driver-testing-cpp lib is available in bazel SDK now, however, another dependency of out new driver unittests -- async-patterns, has not been available in bazel SDK yet. This change copies the library to third_party/driver-lib to unblock the unittest migration. Note that the directory structure of async-patterns is modified and header files are changed to make the lib work better with bazel, also some unnecessary content(e.g. tests in the library) are deleted. Bug: b/293654612 Change-Id: I022eafd5d03fc97e02bfae619997247896232f25 Reviewed-on: https://fuchsia-review.googlesource.com/c/drivers/wlan/intel/iwlwifi/+/905865 Reviewed-by: Sakthi Vignesh Radhakrishnan <rsakthi@google.com> Commit-Queue: Zhiyi Chen <zhiyichen@google.com>
This repository contains instructions and source code to build, package and run the Intel Wifi driver for Fuchsia using the Fuchsia Bazel SDK.
WARNING: Currently this repository uses libraries that are not exported in the SDK, so it will not build directly.
By default the Bazel SDK will fetch a specific version of the Fuchsia SDK tools and libraries, but this driver currently uses libraries that are not yet exported in the SDK, so you may need a local Fuchsia tree and some cherry-picked CLs. Contact the owner of this repo if you don't know exactly what you need.
From your cherry-picked Fuchsia tree, you can produce the SDK with the following commands:
cd ~/fuchsia # adjust accordingly fx --dir out/oot-qemu set core.qemu-x64 \ --args='dev_bootfs_labels=["//products/kernel_cmdline:devmgr.enable-ephemeral--true"]' fx --dir=out/oot-qemu/ build :default sdk sdk:driver
git submodule update --recursive --init
Since you need to use an SDK built locally to build this repo, set the LOCAL_FUCHSIA_PLATFORM_BUILD environmental variable accordingly, for example:
export LOCAL_FUCHSIA_PLATFORM_BUILD=~/fuchsia/out/oot-qemu
Run the script that fetches and installs the Bazel binary in //tools/bazel:
scripts/bootstrap.sh
TODO: there is no easy way to use a product bundle produced from a local Fuchsia tree. In the meantime, you may use fx ffx emu from the Fuchsia tree:
cd ~/fuchsia
fx ffx emu start --headless \
--kernel-args "driver_manager.use_driver_framework_v2=true" \
--kernel-args "driver_manager.root-driver=fuchsia-boot:///#meta/platform-bus.cm" \
--kernel-args "devmgr.enable-ephemeral=true"
Let the emulator know where are the system packages for on-demand loading:
tools/ffx repository add-from-pm ${LOCAL_FUCHSIA_PLATFORM_BUILD}/amber-files -r localtree
tools/ffx target repository register --alias fuchsia.com -r localtree
git -C third_party/sdk-integration fetch origin main git -C third_party/sdk-integration checkout FETCH_HEAD
tools/bazel run --config=fuchsia_x64 third_party/iwlwifi/platform:iwlwifi_pkg.iwlwifi_component
This command will build the driver and make it available as a package on a local Fuchsia repository and register the driver with the device/emulator.
tools/bazel test --config=fuchsia_x64 third_party/iwlwifi/test:iwlwifi_test_pkg
This command will build and run all the tests on the emulator or device. Specific tests can be executed by appending .<test_name> right after the test package, for example:
tools/bazel test --config=fuchsia_x64 third_party/iwlwifi/test:iwlwifi_test_pkg.platform_test