LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   manual insmod of usbcore, uhci and usb-storage works. Why not on boot? (https://www.linuxquestions.org/questions/linux-newbie-8/manual-insmod-of-usbcore-uhci-and-usb-storage-works-why-not-on-boot-676361/)

LinuxTexan 10-14-2008 05:33 PM

manual insmod of usbcore, uhci and usb-storage works. Why not on boot?
 
I have updated the kernel from 2.6.7 to 2.6.22 to solve an issue. The issue is fixed but now my USB memory stick will not mount. I did an lsmod and found none of the USB drivers were there any more.

I manually installed the usbcore.ko, uhci-hcd.ko and usb-storage.ko modules and the mount worked. I edited the rc.sysinit to put these in the boot process since they weren't there. I don't know how the previous kernel was working without loading the modules but the mount always worked.

Now, every time I boot, usbcore and uhci-hcd are loaded at boot. But usb-storage refuses to load at boot. The mount then fails. Manually installing the module after boot does work.

What am I doing wrong?

Bruce Hill 10-15-2008 01:12 AM

Welcome to LQ!

How did you upgrade the kernel?

Why did you not get the latest stable (2.6.27),
or why did you get 2.6.22?

Why did you not build USB support into the kernel?

Did you consider using an initrd image to load them?

What Linux distribution are you using?

LinuxTexan 10-15-2008 07:51 AM

All good questions. The target system is an embedded computer with limited space. The manufacturer used a "custom modified" version of linux originally based on slackware 9.1 with kernel 2.6.7. The person(s) who developed it then left that company so the support is non-existant.

My development system has 2.6.22.15 (PCLinuxOS) on it and has been very stable so I used the same version on this. I might upgrade it later but right now I'm trying to get the embedded system to work. I didn't need the additional hassle of trying to get my development system upgraded since gcc is on it. Part of the issue has been getting things to run on the embedded system when I can't build code on it due to limited space. Building on another system with the same kernel works OK.

The manufacturer provided a config file that their documentation says to use. I didn't want to modify it. The original kernel must have it built in since I don't see any modules installed. Don't know why it built as modules so I need to verify the config file for that. Newbie here.

I haven't used initrd before. I'll look into that as well as building USB in.

Thanks. Any other ideas?

LinuxTexan 10-15-2008 08:42 AM

I found the problem. The scsi_mod and sd_mod modules were not being installed. Evidently, performing insmod on the USB modules pulled them in manually. Don't know how (or care at this point).

Adding these two modules prior to the USB modules in rc.sysint worked.

Maybe I'll be able to do this 'linux' thing after all. My confidence has been kind of low...

shariefbe 12-08-2008 09:24 PM

Hello LinuxTexan,
Good one...can you tell me how you get that usbcore.ko module?i too not having this same..but i dont know what to do....i copied the /drivers/usb/core file and i compiled but i am getting the below thing..but i didnt get .ko file....

sharief@sharief-desktop:~/Desktop/drivers/core$ make
make -C /lib/modules/2.6.26/build M=/home/sharief/Desktop/drivers/core modules
make[1]: Entering directory `/home/sharief/Desktop/kernelroot/linux2/linux-2.6.26'
Building modules, stage 2.
MODPOST 0 modules
make[1]: Leaving directory `/home/sharief/Desktop/kernelroot/linux2/linux-2.6.26'
sharief@sharief-desktop:~/Desktop/drivers/core$


Help me what to do....

LinuxTexan 12-09-2008 09:40 AM

I'm not sure on that one. You should find the .ko file under /lib/modules/'kernelrevnum'/kernel/drivers/usb/core where 'kernelrevnum is 2.6.... It is usually the only file there. If it's missing then your .config file probably doesn't have the usb options enabled when the kernel was built. Rebuilding the kernel with the proper options should recreate the file.

Good luck.

shariefbe 12-09-2008 11:48 AM

Actually i disabled the usb option when i build the kernel....tis is for college project...now i have to make the usb to work...so i copied the /drivers/usb/core file and i compiled...but i didnt get .ko file..thats what i am asking..i didnt get any source...searching from last month....can you help me

LinuxTexan 12-10-2008 07:36 AM

The source is in the kernel. Look in the directory where you placed the source when you built the kernel (most people use /usr/src or similar). The file should be there in a directory structure similar to the /lib/modules path. You will have to figure out the make commands for it.

It's probably simpler and less error prone to rebuild the kernel with USB active.

shariefbe 12-10-2008 11:05 AM

yes i already done that..but i didnt find the solution...i will post my "Makefile" below...kindly refer that i suggest me plz...

sharief@sharief-desktop:~/Desktop/drivers/core$ cat Makefile
#
# Makefile for USB Core files and filesystem
#


usbcore-objs := usb.o hub.o hcd.o urb.o message.o driver.o \
config.o file.o buffer.o sysfs.o endpoint.o \
devio.o notify.o generic.o quirks.o

ifeq ($(CONFIG_PCI),y)
usbcore-objs += hcd-pci.o
endif

ifeq ($(CONFIG_USB_DEVICEFS),y)
usbcore-objs += inode.o devices.o
endif

obj-$(CONFIG_USB) += usbcore.o

ifeq ($(CONFIG_USB_DEBUG),y)
EXTRA_CFLAGS += -DDEBUG
endif

all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

clean:
make -C /lib/modules/$(shell uname
-r)/build M=$(PWD) clean
sharief@sharief-desktop:~/Desktop/drivers/core$


All times are GMT -5. The time now is 03:37 PM.