9 Star 0 Fork 9

src-openEuler / communication_ipc

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
README.md 3.17 KB
Copy Edit Raw Blame History

communication_ipc

介绍

openEuler 内核中存在开启 binder(边缘版本的树莓派)和未开启 binder(服务器版本等)两种情况。在未开启 binder 的场景下,本仓库提供将 binder 编译成 ko 的方式,插入该 ko 文件即可开启 binder 功能。

说明:openEuler-22.03-LTS-SP2 分支下,本仓库主要存储 binder 的 rpm 包制作文件。

安装

  1. 判断运行环境的内核是否开启 binder
    cat /boot/config-$(uname -r) | grep CONFIG_ANDROID_BINDER_IPC=y
    如果有 CONFIG_ANDROID_BINDER_IPC=y 输出,说明内核已经开启 binder,只需 挂载 binderfs 来使用 binder;否则,插入 ko 文件 来使用 binder

挂载 binderfs 来使用 binder

  1. 检查环境中是否已有 /dev/binder 文件,如果已有,则无需再做任何操作,binder 已经是可使用状态。

  2. 如果环境还没有 /dev/binder 文件,通过以下命令来生成,进而让 binder 处于可使用状态。

    mkdir /dev/binderfs
    sudo mount -t binder binder /dev/binderfs
    sudo ln -s /dev/binderfs/binder /dev/binder

插入 ko 文件来使用 binder

  1. 下载本仓库 openEuler-22.03-LTS-SP2 分支的内容

    git clone -b openEuler-22.03-LTS-SP2 https://gitee.com/src-openeuler/communication_ipc.git
  2. 安装编译需要的软件包

    sudo dnf install make patch tar gcc kernel-devel
  3. 进入 communication_ipc 目录,解压源码包,并打上 patch

    cd communication_ipc
    tar zxvf binder-openEuler-22.03-LTS-SP2.tar.gz
    cd binder
    patch -p1 < ../0001-Adapt-binder-as-a-kernel-module.patch
  4. 编译生成 binder_linux.ko

    make -j4
  5. 插入 binder_linux.ko

    insmod binder_linux.ko

    插入 ko 文件之后,即可看到 /dev/binder 文件已生成,此时 binder 功能已可用。

说明: 使用 rmmod binder_linux 命令卸载插入的 binder 可能会导致操作系统重启!!!,如果有重要业务在运行请勿直接卸载。

常用问题

  1. 编译 binder 的时候,报错找不到 /lib/modules/xxx 目录

    原因:当前环境的 kernel-devel 包和实际系统 kernel 版本不一致。

    解决:修改 Makefile 中的 KERNEL_SRC 变量的值中 $(uname -r) 改成 kernel-devel 的版本号。

参与贡献

  1. Fork 本仓库
  2. 新建 Feat_xxx 分支
  3. 提交代码
  4. 新建 Pull Request

特技

  1. 使用 Readme_XXX.md 来支持不同的语言,例如 Readme_en.md, Readme_zh.md
  2. Gitee 官方博客 blog.gitee.com
  3. 你可以 https://gitee.com/explore 这个地址来了解 Gitee 上的优秀开源项目
  4. GVP 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
  5. Gitee 官方提供的使用手册 https://gitee.com/help
  6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 https://gitee.com/gitee-stars/
1
https://gitee.com/src-openeuler/communication_ipc.git
git@gitee.com:src-openeuler/communication_ipc.git
src-openeuler
communication_ipc
communication_ipc
openEuler-22.03-LTS-SP2

Search

53164aa7 5694891 3bd8fe86 5694891