2.我选定目录linux-2.6.35.14/drive/usb/(假设:KERNELDIR = linux-2.6.35.14/drive/usb/),将usb拷贝到KERNEL下。
3.cd $(KERNELDIR )/usb, 创建Makefile
vim Makefile
添加如下内容:
obj-$(CONFIG_RALINK_USB) +=usb_drive.o
4.创建Kconfig
vim Kconfig
添加如下内容:
config RALINK_USB
tristate "usb drive module" //* 编译到内核,M 以模块 ,如果不想以模块,则可以 bool “usb drive module”“”
help
Enable example usb drive module.
5.修改顶层目录(KERNELDIR )下Makefile
vim /Makefile
在末尾添加入下内容:
obj-$(CONFIG_RALINK_USB)+= usb/
6.修改顶层目录(KERNELDIR )下Kconfig
vim /Kconfig
在末尾添加入下内容:
source "drivers/usb/usb/Kconfig"
7.配置内核
#make menuconfig
#make dep
Kernel setting -> Device Drivers->USB support->usb drive module
前面选上,即按y "*"
8. 重新编译内核
# make