From 426ad2f9a4cb1ee4ebf469a54ac9da0f929ca721 Mon Sep 17 00:00:00 2001 From: yykk Date: Fri, 22 Sep 2023 11:26:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=B5=8C=E5=85=A5=E5=BC=8F?= =?UTF-8?q?=E7=89=88=E6=9C=AC3.2=E8=BD=AF=E6=80=BB=E7=BA=BF=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=8C=87=E5=AF=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application_guide_3_2.md | 89 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 application_guide_3_2.md diff --git a/application_guide_3_2.md b/application_guide_3_2.md new file mode 100644 index 00000000..09936ecd --- /dev/null +++ b/application_guide_3_2.md @@ -0,0 +1,89 @@ +## 以下操作均在宿主机进行 + +准备树莓派嵌入式镜像,由于需要使用的isula容器在systemd镜像中能力较完善,所以使用的是systemd管理进程的镜像 +``` +http://121.36.84.172/dailybuild/EBS-openEuler-23.09/openeuler-2023-09-21-14-42-10/embedded_img/aarch64/raspberrypi4-64-systemd/openeuler-image-raspberrypi4-64-20230921165629.rootfs.rpi-sdimg +``` + +嵌入式设备网络配置 +``` +https://openeuler.gitee.io/yocto-meta-openeuler/master/linux/network/network_config.html +``` + +ps. 重启网络报错,需要解除service networking禁止 +```shell +systemctl unmask service networking +service networking restart +``` + +HOST挂载binder驱动,树莓派嵌入式镜像自带了binder,可以直接挂载 +```shell +mkdir /dev/binderfs +mount -t binder binder /dev/binderfs +``` + +由于需要使用binder能力,关闭selinux +```shell +setenforce 0 +``` + +在host中启动isulad服务,在后台运行即可 +``` +isulad & +``` + +下载软总线镜像 +```shell +cd /home; wget xxxxxx +PS.待补充链接 +``` + +使用isula加载软总线镜像 +```shell +isula import /home/softbus.xz softbus +``` + +查看加载的镜像ID +```shell +isula images +``` + +参考查询到的IMAGE ID,以host网络、特权模式启动并进入软总线容器,映射binder路径及软总线端口 +``` +isula run -it --privileged --net=host --name=softbus -v /dev/binderfs/binder:/dev/binder -p 5684:5684/udp 2edfcbc18543 bash +``` + +## 以下操作均在容器中进行 + +在容器中写SN号,注意此SN号是该设备标识,需要与其他设备不一致,建议使用本身IP +```shell +echo 192.168.8.115 > /etc/SN +``` + +启动软总线 +```shell +/system/bin/start_services.sh all +``` + +启动客户端,客户端也可以自己按软总线接口编写,容器内置的二进制用于调试 +```shell +/system/bin/softbus_client +``` + +打开所有session连接 +``` +openA +``` + +发送消息给所有session +``` +sendA "hello world" +``` + +可以看到对端client收到了hello world字符串,至此设备间软总线通信OK + + +PS. 如果想在其他环境使用自己修改后的镜像,可以在**宿主机**执行以下命令导出镜像文件 +``` +isula export -o [导出镜像保存目录] [镜像名称] +``` -- Gitee