# Driver manager **Repository Path**: respate/driver-manager ## Basic Information - **Project Name**: Driver manager - **Description**: 驱动管理工具 ---By respate - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-06-08 - **Last Updated**: 2022-09-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Linux Driver Manager ## 一、简介 此工具用于管理驱动代码,编译成ko模块,快速调试。具有一下特点: - 1.可配置多个soc平台 - 2.管理多个驱动代码 - 3.支持简易测试app管理 - 4.配置简易快捷 ## 二、快速上手 ### 1.代码下载 ```shell mkdir linux-driver git clone git@gitee.com:respate/driver-manager.git mv driver-manager manager cd manager ``` ### 2.初始化仓库 到manager目录下,执行mk初始化当前工程。有两种模式可以选择: - 1.copy : 将所有配置文件&demo拷贝到上层目录 - 2.link :将配置文件与demo 通过软连接的方式到上层目录 ```shell ./mk while init working directory: chose copy or link drivers and config to ../ Dir chose ["c" or "l"]: ``` link 与 copy模式区别: link模式下,所有新增的驱动代码都还是在manager目录,即还是使用当前仓库提交代码。而copy模式下,需要在manager上层目录重新初始化一个仓库,并将manager添加为子仓库。代码也提交在父仓库中,保持manager为核心代码不动,便于优化。 ### 3.添加配置平台 ```shell cd ../configs cp demo.mk xxxx.mk vim xxxx.mk ``` 修改新增的xxxx.mk配置项,主要修改项为内核源码树与GCC ```makefile # *内核源码树 路径 export BOAROD_TOP_DIR="" #内核源码树绝对路径&&编译过的内核 # *GCC交叉编译链 路径配置 export BSP_CROSS_COMPILE="" # 驱动 交叉编译工具绝对路径 export APP_CROSS_COMPILE="" # app 交叉编译工具绝对路径 # *SOC 架构 arm arm64 export ARCH=arm64 ####### 以上是必配项 以下是选配项 ####### export WIN_NFS_DIR="" # NFS 绝对路径(自动拷贝到NFS,用于开发板挂载NFS 方便ko拷贝与验证) ``` ### 4.选择编译平台与驱动 在父目录执行 ./mk -i 即可选择驱动平台 ```shell ./mk -i config list: 1.demo 2.xxxx Which would you like? [1-2]: ``` 在父目录执行 ./mk -d 即可选择要编译的驱动 ```shell ./mk -d All drivers: 1.demo 2.demo2 chose drivers[1-2]: ``` 如果已选择了编译平台,直接到drivers的某一驱动目录直接执行 mk,也能直接编译当前文件下的驱动。 ### 5.其它 ```shell ./mk -h ^_^ (x86)this is shell for make module....... --By Respate(2019-9-11) QQ:2085827949 get TAR_DRV_DIR:1.1-demo2 Usage: ./mk [OPTION]... [OPTION]: -i,--init For chose build config. -d,--driver For chose driver dir. -b,--bulid For build module drivers. -c,--clean For clean files. -dc,--distclean For distclean files. -h,--help For get helping. ```