LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-19-2010, 02:49 PM   #1
kerneluser
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
When are insmod and mknod not enough?


I'm trying to install an open source driver BADDRV on Suse 11, x64 system.

What I have done:
installed kernel source. make. insmod ./BADDRV.ko

On Redhat 5, this just works and I can run the user program that calls open(/dev/BADDRV) and its ioctls.

On Suse 11 there is no entry in /dev so I add mknod /dev/BADDRV c 0 0
The user open(/dev/BADDRV) fails with errno 6.

(I also tried mknod /dev/BADDRV c 244 0, per suggestion of dmesg. No difference.)


There is an rpm provided with the driver. Installing the rpm on Suse 11 works and then the user program works. The only problem with the rpm is that it requires kernel source to be installed, which I can't ask of my customer base.


What else should I do after mknod?
--------

After a reboot dmesg suggested mknod /dev/BADDRV c 248 0. Which works.

So let me change my question. What is this magic number and can I fix it or is it system dependent? Can a bash install script know it and install the driver?

Last edited by kerneluser; 01-19-2010 at 03:26 PM. Reason: new data
 
Old 01-19-2010, 03:23 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 164Reputation: 164
Tear the rpm apart and find out what all operations it's performing. It's just a renamed tar.gz file with specific extras included in consistent places.
 
Old 01-19-2010, 03:26 PM   #3
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,331
Blog Entries: 55

Rep: Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529Reputation: 3529
...else if the kernel source needs to be installed only to build the LKM, maybe you could prefab the LKM if you have a staging machine or VM guest with the exact same kernel and userland version setup similar to that of the client?
 
Old 01-21-2010, 03:21 PM   #4
kerneluser
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Original Poster
Rep: Reputation: 0
Thumbs up

Quote:
Originally Posted by rweaver View Post
Tear the rpm apart and find out what all operations it's performing. It's just a renamed tar.gz file with specific extras included in consistent places.
thanks rweaver.

The RPM uses the dynamic major device number. If I use the major number from a terminal prompt or bash script, the driver installs properly and the user application works.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
using mknod jiml8 Linux - Software 2 07-22-2007 05:26 PM
Device drivers : How to insmod and mknod through an application program? shendeswanand Linux - Newbie 0 02-08-2006 12:28 PM
mknod Basel Linux From Scratch 1 09-03-2005 03:13 PM
mknod Infinite_Pizza Linux - Software 2 04-14-2005 09:59 PM
mknod watashiwaotaku7 Linux - Software 1 01-23-2003 11:11 PM


All times are GMT -5. The time now is 04:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration