[gentoo-user] [OT] - a couple of mknod questions

2003-09-09 Thread Mark Knecht
Hi,
   I'm looking at a very small problem on my new Gentoo kernel where I get
the message while booting

modprobe: can't locate module /dev/rtc

   From googling around it appears that the recommended solution to this
(comment if you disagree) is to compile enhanced rtc support into my kernel
(it's not in there right now) AND to create /dev/rtc using the mknod command
with a major number 10 and a minor number 135.

   It may be that I don't really need to create the

QUESTION 1: Is this correct?

mknod /dev/rtc 10 135

Or do I need to add the c option since it says make a 'character' special
file?

mknod /dev/rtc c 10 135

QUESTION 2: Is there a way to see the major and minor numbers, along with
the type of device an existing character or block special file is once it
exists in /dev? I cannot find the sort of intuitive 'lsnod' command. How
does one make sure that the major minor numbers don't trample on each other?

Thanks in advance,
Mark



--
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] [OT] - a couple of mknod questions

2003-09-09 Thread Marshal Newrock
On Tue, 9 Sep 2003, Mark Knecht wrote:

 Hi,
I'm looking at a very small problem on my new Gentoo kernel where I get
 the message while booting

 modprobe: can't locate module /dev/rtc

From googling around it appears that the recommended solution to this
 (comment if you disagree) is to compile enhanced rtc support into my kernel
 (it's not in there right now) AND to create /dev/rtc using the mknod command
 with a major number 10 and a minor number 135.

It may be that I don't really need to create the

 QUESTION 1: Is this correct?

 mknod /dev/rtc 10 135

 Or do I need to add the c option since it says make a 'character' special
 file?

 mknod /dev/rtc c 10 135

You have the command written correctly the second time.  However, as
Gentoo defaults to using devfs, you shouldn't have to manually create a
/dev entry.  But you still have the options of: 1) Compile enhanced RTC
support into your kernel (or as module), 2) find what wants enhanced RTC
support and don't use it, or 3) ignore the error.

 QUESTION 2: Is there a way to see the major and minor numbers, along with
 the type of device an existing character or block special file is once it
 exists in /dev? I cannot find the sort of intuitive 'lsnod' command. How
 does one make sure that the major minor numbers don't trample on each other?

It's simpler than you think.  'ls -l /dev' shows you what it is.  The
first letter of the permissions is b for block device, c for character
device, or l for symlink.  If it's a symlink, then you have to look at
what it links to.  But then, you'll see two numbers (a, b) in the size
field.  This is the major, minor numbers.

And if you want to create a device that doesn't exist but don't know its
numbers, everything is listed in /usr/src/linux/Documentation/devices.txt
(or wherever you have your kernel sources).

-- 
Marshal Newrock, unemployed Linux user in Lansing, MI
Caution: Product will be hot after heating


--
[EMAIL PROTECTED] mailing list



Re: [gentoo-user] [OT] - a couple of mknod questions

2003-09-09 Thread Mark Knecht
On Tue, 2003-09-09 at 15:13, Marshal Newrock wrote:
 
  Or do I need to add the c option since it says make a 'character' special
  file?
 
  mknod /dev/rtc c 10 135
 
 You have the command written correctly the second time.  However, as
 Gentoo defaults to using devfs, you shouldn't have to manually create a
 /dev entry.  But you still have the options of: 1) Compile enhanced RTC
 support into your kernel (or as module), 2) find what wants enhanced RTC
 support and don't use it, or 3) ignore the error.

Thank you Marshal. This would probably explain why my last kernel (for
which I somehow lost the .config file...) didn't have the problem. If I
compiled in enhanced rtc support the last time, then Gentoo would have
created whatever it needed in terms of /dev/rtc and there was no
complaint. If that's the case, then I'll first do a new kernel and see
if the messages just go away.

(And I'll stick a copy of my .config on another machine as a back up...)

 
  QUESTION 2: Is there a way to see the major and minor numbers, along with
  the type of device an existing character or block special file is once it
  exists in /dev? I cannot find the sort of intuitive 'lsnod' command. How
  does one make sure that the major minor numbers don't trample on each other?
 
 It's simpler than you think.  'ls -l /dev' shows you what it is.  The
 first letter of the permissions is b for block device, c for character
 device, or l for symlink.  If it's a symlink, then you have to look at
 what it links to.  But then, you'll see two numbers (a, b) in the size
 field.  This is the major, minor numbers.
crw-r--r--1 root root   1,   9 Dec 31  1969 urandom

So this is a character special device, major number 1, minor number 9

which matches the info in devices.txt:

 1 charMemory devices
1 = /dev/mem  Physical memory access
SNIP
9 = /dev/urandom  Faster, less secure random number gen.

Thanks!
Mark



--
[EMAIL PROTECTED] mailing list