Installation

Enable binder for Linux

Please refer to Enable binder for Linux for detailed instructions on setting it up.

Create binder device file for Linux

After the binder configuration of the Linux kernel is complete, a binder device file must be created. Install rsbinder-tools and run to create a binder device.

$ cargo install rsbinder-tools
$ sudo rsb_device binder

Run a service manager for Linux

If rsbinder-tools is already installed, the rsb_hub executable is also installed. Let's run it as follows.

$ rsb_hub

Dependecies of rsbinder

Add the following configuration to your Cargo.toml file:

[dependencies]
rsbinder = "0.2.0"
lazy_static = "1"
async-trait = "0.1"

[build-dependencies]
rsbinder-aidl = "0.2.0"

The crates purposes:

  • rsbinder: This library provides various functionalities for Binder IPC, including communication with the Linux kernel and data serialization/deserialization.
  • lazy_static: The code generated by the rsbinder-aidl compiler depends on the lazy_static crate.
  • async-trait: The code generated by rsbinder-aidl creates both sync and async code. The async code depends on the async-trait crate.
  • rsbinder-aidl: This is used for AIDL compilation and is invoked in build.rs.