官方的debian系统,未开启ashmem_linux,binder_linux和PSI
所以我们需要手动开启,
如下,是我使用的方法
安装编译工具
sudo apt-get update
sudo apt-get install -y git device-tree-compiler libncurses5 libncurses5-dev build-essential libssl-dev mtools bc python dosfstools bison flex rsync u-boot-tools
拉取源码
mkdir ~/rk3588-sdk && cd ~/rk3588-sdk
git clone -b linux-5.10-gen-rkr3.4 https://github.com/radxa/kernel.git --depth=1
git clone -b master https://github.com/radxa/rkbin.git --depth=1
git clone -b debian https://github.com/radxa/build.git --depth=1
配置编译选项,
cd ~/rk3588-sdk
cd kernel
make rockchip_linux_defconfig
make menuconfig
接下来就会弹出一个会话框,
Device Drivers -> Android -> Android Drivers勾上,弹出来binder ipc driver勾上,binderfs filesystem也勾上,这样binder模块就编译进去了。然后回到上一级,去Staging Drivers里面,进入Android,把Enable the Anonymous Shared Memory Subsystem也勾上,这样ashmem也搞定了。
回到最上一级,General Setup -> CPU/Task time and stats accounting -> Pressure stall information tracking,也勾上
选好之后,按TAB切换最下面的选项,先save然后exit就可以执行下一步命令了,保存配置
make savedefconfig
cp defconfig arch/arm64/configs/rockchip_linux_defconfig
接下来就是编译内核,
cd ~/rk3588-sdk
sudo ./build/mk-kernel.sh rk3588-rock-5b
打包内核(请注意,下面命令的一个参数,代表的是小版本号)
sudo ./build/pack-kernel.sh -d rockchip_linux_defconfig -r 39
cd ~/rk3588-sdk/out/packages
sudo dpkg -i linux-image-5.10.110-39-rockchip-g0a544b8c7_5.10.110-39-rockchip_arm64.deb
sudo dpkg -i linux-image-5.10.110-39-rockchip-g0a544b8c7-dbg_5.10.110-39-rockchip_arm64.deb
重启
docker run -itd --rm --privileged \
--pull always \
-v /mmc/zcg1:/data \
-v /dev/net/tun:/dev/tun \
-v /dev/mali0:/dev/mali0 \
-p 5555:5555 \
--name dobox1 \
registry.cn-hangzhou.aliyuncs.com/whsyf/dobox:rk3588-202303011