commit | fd4a44c3d37c2b7d50fc6d32b52d38f09d2e6133 | [log] [tgz] |
---|---|---|
author | Renato Mangini Dias <mangini@google.com> | Thu Aug 04 20:41:59 2022 +0000 |
committer | CQ Bot <fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com> | Thu Aug 04 20:41:59 2022 +0000 |
tree | fecef88429404280f36295e88e5d528a40d7f1bc | |
parent | 71606a639c02215971ba55a708229ed35dff9279 [diff] |
[version roller] Update dependencies SDK version updated from 8.20220609.3.1 to 9.20220728.1.1 Also: - fix invalid dependencies on fidl-llcpp (squashed fxrev.dev/693743) - remove version reference for sdk and clang in WORKSAPCE.bazel. Now those are defined by the sdk-integration version. - updated tools/ and scripts symlinks and scripts for the latest - updated smoke_test.sh to use the full product bundle URI and the new bazel running/testing workflows - remove experimental flag for new syntax in fidlc invocation Change-Id: I1b5b34863e535fae9221cce45e5a8daae5582d7b Reviewed-on: https://fuchsia-review.googlesource.com/c/sdk-samples/drivers/+/691514 Reviewed-by: Wayne Piekarski <waynepie@google.com> Commit-Queue: Atul Sharma <atshar@google.com> Reviewed-by: Chase Latta <chaselatta@google.com> Reviewed-by: Dave Smith <smithdave@google.com>
This repository contains instructions and source code to build, package and run Fuchsia samples using only the Fuchsia SDK.
Make sure this repository has the required submodules:
git submodule update --recursive --init
Run the bootstrap script that downloads the appropriate Bazel binary:
scripts/bootstrap.sh
Ensure that there are Fuchsia SSH keys in your host machine. You will need them for running the Fuchsia emulator.
[[ -f "${HOME}/.ssh/fuchsia_ed25519" ]] || ssh-keygen -P "" -t ed25519 -f "${HOME}/.ssh/fuchsia_ed25519" -C "${USER}@$(hostname -f) Shared SSH Key for Fuchsia" [[ -f "${HOME}/.ssh/fuchsia_authorized_keys" ]] || ssh-keygen -y -f "${HOME}/.ssh/fuchsia_ed25519" > "${HOME}/.ssh/fuchsia_authorized_keys"
The repository is ready to build the samples.
Note: in order to use an SDK produced by a local Fuchsia platform tree, you can set an environment variable named
LOCAL_FUCHSIA_PLATFORM_BUILD
as described in https://fuchsia.googlesource.com/sdk-integration/+/0503b02c059a6de76242280b467898358ba30ae3
If using an emmulator:
Fetch the system images
tools/ffx product-bundle get workstation_eng.qemu-x64 --repository workstation-repo
Note: if the command above fails with an error message that states that there are multiple product bundles with the same name, you can either specify the full qualified URL as printed in the error message, or you can wipe out old and unused product bundles in the pbms storage, which should be located in ~/.local/share/Fuchsia/ffx/pbms on Linux, or ~/Library/Fuchsia/ffx/pbms on MacOS.
Start the emulator
tools/ffx emu start workstation_eng.qemu-x64 --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"
The product bundle comes with on-demand packages in a separate repository. Use the following command to register it with the emulator:
tools/ffx target repository register -r workstation-repo --alias fuchsia.com
If using a physical device like a Pixelbook Go:
Fetch the system images
tools/ffx product-bundle get workstation_eng.qemu-x64-dfv2 --repository workstation
Prepare and connect the Pixelbook Go, by flashing and/or paving it (not covered here), and connect using Ethernet.
The product bundle comes with on-demand packages in a separate repository. Use the following command to register it with the device:
tools/ffx target repository register -r workstation.qemu-x64-dfv2 --alias fuchsia.com
Update (OTA) the device to the version of the SDK:
tools/ffx target update check-now --monitor
(optional) watch the device log in a separate window
tools/ffx log
Load the sample drivers
Now you are ready to register a driver. Starting with the example driver:
First, let's confirm that the driver is not loaded:
tools/ffx driver list | grep example_driver
The command above should not return any driver named “example_driver” because it has not been registered.
Now register the driver:
tools/bazel run --config=fuchsia_x64 src/example_driver:pkg.component
The driver now should show in the list of loaded drivers:
tools/ffx driver list | grep example_driver fuchsia-pkg://bazel.pkg.component/example_driver#meta/example_driver.cm
You can also watch in the log to see if the driver is loaded correctly. The ffx log window should show a message similar to:
[88.961][bootstrap/driver_manager][driver_manager.cm][I] Loaded driver 'fuchsia-pkg://bazel.pkg.component/example_driver#meta/example_driver.cm'