随身WIFI编译Debian USB-CDC驱动
文章目录
WIFI棒子编译USB-CDC驱动
编译内核
克隆代码
git clone --depth 1 git@github.com:OpenStick/linux.git linux-openstick
cd linux-openstick
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
make msm8916_defconfig
make deb-pkg
启用cdc
在菜单中开启即可
make menuconfig
编译
make -j16
生成boot.img
ufi001c为例
mkdir ../android-boot
cp arch/arm64/boot/dts/qcom/msm8916-handsome-openstick-ufi001c.dtb ../android-boot
cp arch/arm64/boot/Image.gz ../android-boot
mkbootimg \
--base 0x80000000 \
--kernel_offset 0x00080000 \
--ramdisk_offset 0x02000000 \
--tags_offset 0x01e00000 \
--pagesize 2048 \
--second_offset 0x00f00000 \
--ramdisk initrd.img-5.15.0-handsomekernel+ \
--cmdline "earlycon root=PARTUUID=a7ab80e8-e9d1-e8cd-f157-93f69b1d141e console=ttyMSM0,115200 no_framebuffer=true rw"\
--kernel kernel-dtb -o boot.img
卸载原内核
查看内核
dpkg --get-selections | grep linux-image
linux-image-5.15.0-handsomekernel+
linux-headers-5.15.0-handsomekernel+
linux-image-5.18.0-msm8916mainline+
linux-headers-5.18.0-handsomekernel+
卸载
apt remove "linux-image-5.15.0-handsomekernel+"
apt remove "linux-headers-5.15.0-handsomekernel+"
安装内核
先将编译的两个deb拷贝到设备上. scp/winscp/wget随便怎么弄到WIFI棒子上.
linux-headers-5.15.0-handsomekernel+_5.15.0-handsomekernel+-10.00.Custom_arm64.deb
linux-image-5.15.0-handsomekernel+_5.15.0-handsomekernel+-10.00.Custom_arm64.deb
然后 apt install 两个deb路径进行安装.
测试
安装后要重启.
lsmod | grep acm
lsof | grep ACM
dmesg | grep 'cdc'
ls /dev/ttyASM0
参考
https://techie-s.work/posts/2022/07/openstick-msm8916/
http://blog.chinaunix.net/uid-20647570-id-217736.html
https://www.kancloud.cn/handsomehacker/openstick/2637565
https://www.shuzhiduo.com/A/MyJx1vbX5n/