LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 694|回复: 3

升级位2.6内核后很多模块加载不了

[复制链接]
发表于 2004-7-10 02:09:31 | 显示全部楼层 |阅读模式
偶以前在Debian/testing 、kernel 2.4-18-bf2.4 用debian的推荐方法(http://www.desktop-linux.net/debkernel.htm)编译过一次2.6-6内核(),用apt-get install module-init-tools 安装 module-init-tools 3.0,但是编译失败。于是采用 The Guide of Upgrading to linux kernel 2.6.x (http://www.linuxforum.net/forum/ ... mp;o=all&fpart=)
编译内核2.6-7。安装module-init-tools之前,在用源代码编译module-init-tools之前忘了执行apt-get install module-init-tools- 原来安装的module-init-tools的deb包,虽然是编译成功,并且在新内核下我机上的硬件(U盘,usb打印机,康宝,声卡等)均正常,但在2.4内核下执行lsmod,modprobe等命令时出错:
#lsmod
Kernel requires old lsmod, but couldn't run lsmod.old: Too many levels of symbolic links
(我安装module-init-tools时有执行make moveold等)
怀疑有两个module-init-tools,于是有弄了一阵,主要安装/删除module-init-tools 0.9.8/3.0,modutils bf2.4-48/2.4.26,弄了一阵在2.6和2.4内核下可以使用lsmod,modprobe命令了,但是:
1. 在2.4 2.6下U盘不能使用,我执行 modprobe usbcore,usb-storage,uhci-hcd,ohci-hcd,ehci-hcd均没有用。
2. 打印机也不能用了,modprobe printer (2.4内核) modprobe usblp(2.6内核)都没有用:
"Unable to open USB device "usb:/dev/usb/lp0": No such device" [gimp-print]
3.  2.6 下可以执行modprobe ide-scsi,执行 cdrecord -scanbus,能看到我的combo设备,可刻录盘,但不可以mount CD-ROM 和 DVD 。在 2.4下康宝工作情况如以前(因为没有UDF模块,故不能看DVD)

这么多问题,均与模块配置有关。 《The Guide of Upgrading to linux kernel 2.6.x 》 一文给出了Redhat 下面的解决方法,但对debian不适用。有哪位大虾能对这些问题给点提示?
谢谢!
发表于 2004-7-10 17:34:06 | 显示全部楼层
由于2.4和2.6内核的模块名不兼容,所以,你只能选择其中一个。
 楼主| 发表于 2004-7-10 18:17:49 | 显示全部楼层
今天又搞了一下,现在问题是主要是在2.6.7下usb接口的U盘和打印机都不能用。在2.4下则正常。
下面是相关的信息:
[Gimp-cups打印]
"Unable to open USB device "usb:/dev/usb/lp0": No such device"
#dmesg | grep usb
usbcore: registered new driver usbfs
usbcore: registered new driver hub
usbcore: registered new driver usb-storage
usb 1-1: new full speed USB device using address 2
usb-storage: USB Mass Storage device detected
usb-storage: altsetting is 0, id_index is 120
usb-storage: -- associate_dev
usb-storage: Transport: Bulk
usb-storage: Protocol: Transparent SCSI
usb-storage: Endpoints: In: 0xd72c6e14 Out: 0xd72c6e28 Int: 0xd72c6e3c (Period 255)
usb-storage: usb_stor_control_msg: rq=fe rqtype=a1 value=0000 index=00 len=1
usb-storage: GetMaxLUN command result is 1, data is 0
usb-storage: *** thread sleeping.
usb-storage: queuecommand called
usb-storage: *** thread awakened.
usb-storage: Command INQUIRY (6 bytes)
usb-storage:  12 00 00 00 24 00
usb-storage: Bulk Command S 0x43425355 T 0x3 L 36 F 128 Trg 0 LUN 0 CL 6
usb-storage: usb_stor_bulk_transfer_buf: xfer 31 bytes
usb-storage: Status code 0; transferred 31/31
usb-storage: -- transfer complete
usb-storage: Bulk command transfer result=0
#dmesg | grep USB
Jackie:/tmp# cat dmesg.USB
Initializing USB Mass Storage driver...
USB Mass Storage support registered.
USB Universal Host Controller Interface driver v2.2
uhci_hcd 0000:00:1f.2: Intel Corp. 82801BA/BAM USB (Hub #1)
uhci_hcd 0000:00:1f.2: new USB bus registered, assigned bus number 1
hub 1-0:1.0: USB hub found
uhci_hcd 0000:00:1f.4: Intel Corp. 82801BA/BAM USB (Hub #2)
uhci_hcd 0000:00:1f.4: new USB bus registered, assigned bus number 2
hub 2-0:1.0: USB hub found
usb 1-1: new full speed USB device using address 2
usb-storage: USB Mass Storage device detected
scsi1 : SCSI emulation for USB Mass Storage devices
ohci_hcd: 2004 Feb 02 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI)

可以modprobe usbcore,usb-storage,usblp,ohci-hcd,uhci-hcd,ehci-hcd模块,不过都好象没什么作用
 楼主| 发表于 2004-7-11 01:14:12 | 显示全部楼层
终于搞定了U盘和打印机:
主要步骤有:
1. apt-get install modutils module-init-tools,
2. 建立 /etc/modules-2.6.7,内容为
# /etc/modules-2.6.7: kernel modules to load at boot time.

i810_audio
#usbcore
#usblp
ide-scsi
#usb-storage #最好不要加它,否则启动过程很慢
uhci-hcd
ohci-hcd
#ehci-hcd
ntfs
vfat
#sr_mod
#udf
#firmware_class
nls_cp936
#nls_utf8
fbcon #zhcon需要
font
3.在2.4下执行/sbin/generate-modprobe.conf /etc/modprobe.conf
4.修改/etc/init.d/下的 module-init-tools和modutils:
#! /bin/sh
# /etc/init.d/modutils: loads the appropriate modules in `boot'.


PATH="/sbin:/bin"

[ -f /proc/ksyms ] || [ -f /proc/kallsyms ] || exit 0
[ -e /sbin/depmod ] || exit 0

if touch /lib/modules/$(uname -r)/modules.dep 2>/dev/null; then
echo -n "Calculating module dependencies... "
depmod -a -q
echo "done."
else
echo "Not calculating module dependencies: /lib/modules/$(uname -r) is read only."
fi

# Loop over every line in /etc/modules.
echo -n 'Loading modules: '

#luosj**************
ETC_MODULES="/etc/modules-$(uname -r)"
[ -f $ETC_MODULES ] || ETC_MODULES=/etc/modules

echo 'ETC_MODULES=$ETC_MODULES' >> /tmp/tmp.out;

(cat $ETC_MODULES; echo) | # make sure there is a LF at the end
while read module args
do
case "$module" in
\#*|"") continue ;;
esac
echo -n "$module "
modprobe $module $args
done
echo

#
# Just in case a sysadmin prefers generic symbolic links in
# /lib/modules/boot for boot time modules we will load these modules
#
if [ -n "`modprobe -l -t boot`" ]
then
modprobe -a -t boot \*
fi
exit 0

对module-init-tools类似的修改。
4.在/etc/modprob.conf中增加
alias usb-controller uhci-hcd
alias usb-controller1 ohci-hcd

希望对象我那样莱鸟级的Debianers有用。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表