Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
UDEV Primer for 2.6 Kernel
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3, 4  Next  
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1598
Location: U.S.A.

PostPosted: Thu Dec 18, 2003 1:36 am    Post subject: UDEV Primer for 2.6 Kernel Reply with quote

Started a tutorial called UDEV Primer for 2.6 Kernel.

Also have a thread at https://forums.gentoo.org/viewtopic.php?t=115096 Called 'Got udev working, now what'

Trying to see how much we can learn about this baby.
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
Elm0
Apprentice
Apprentice


Joined: 24 Nov 2002
Posts: 281
Location: UK

PostPosted: Thu Dec 18, 2003 4:06 pm    Post subject: Reply with quote

Useful, thanks. Think i'm going to stick with devfs for now though, as it seems to work perfectly. Maybe when udev is stable I will go over.
Back to top
View user's profile Send private message
discomfitor
l33t
l33t


Joined: 21 Feb 2003
Posts: 927
Location: None

PostPosted: Thu Dec 18, 2003 8:24 pm    Post subject: Reply with quote

everything is working great! thanks!
_________________
There is no substitute for experience.
Imperfection indicates a lack of effort.
Back to top
View user's profile Send private message
funkmankey
Guru
Guru


Joined: 06 Mar 2003
Posts: 304
Location: CH

PostPosted: Fri Dec 19, 2003 6:09 am    Post subject: Reply with quote

NB: there is also a very nice script called "snddevices" in the alsa-driver package, which will re-make all of the nodes in /dev for alsa.

test11-mm1+ udev-009 + sysfsutils-0.3.0 + snddevices, working just fine now. (udev-009 would not compile against sysfsutils-0.4.0...)
_________________
I've got the brain, I'm insane, you can't stop the power
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1598
Location: U.S.A.

PostPosted: Fri Dec 19, 2003 10:56 am    Post subject: Reply with quote

Must depend on what kernel you install. Some say you shouldn't have to install alsa-driver because in kernel now. Mine refused to install it because 'alsa' was in there kernel.

There is a script I ran before putting /dev in ramfs called 'alsaconf' that created the devices. After udev started mounting /dev in ramfs even it wouldn't create the devices anymore.
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
funkmankey
Guru
Guru


Joined: 06 Mar 2003
Posts: 304
Location: CH

PostPosted: Fri Dec 19, 2003 4:23 pm    Post subject: Reply with quote

oh no, I didn't actually install alsa-driver. ^_^
I'd just fetched the tarball for it so I could swipe the snddevices script out of it.

snddevices was in fact able to create the devices after udev had put /dev into ramfs, I never tried alsaconf.

now I just need to figure out if the scsi_id patch to udev-009 is what's breaking it vs. sysfsutils 0.4.0, or what.
_________________
I've got the brain, I'm insane, you can't stop the power
Back to top
View user's profile Send private message
MathFreak
Apprentice
Apprentice


Joined: 07 Jul 2002
Posts: 217
Location: Bethlehem, PA

PostPosted: Fri Dec 19, 2003 6:06 pm    Post subject: Reply with quote

Thanks a lot. I'm setting this up right now. One very minor request, though, in your guide you say to change yourname to something else. Could you put it in a color other than red for those folks (like me) who are red-green color blind? I can still find it, but it might be a bit easier. It's really not a big deal, though.
Back to top
View user's profile Send private message
timmfin
Guru
Guru


Joined: 04 Sep 2002
Posts: 336
Location: Maryland, USA

PostPosted: Fri Dec 19, 2003 6:31 pm    Post subject: Reply with quote

Should those devices be mknoded -m 660 so that the group has read and write permisions on them?

Tim
Back to top
View user's profile Send private message
danbond_98
n00b
n00b


Joined: 23 Aug 2003
Posts: 8
Location: Exeter, UK

PostPosted: Fri Dec 19, 2003 6:45 pm    Post subject: Reply with quote

couldn't get udev-009 to compile so got 008 instead which worked fine. thanx for the guide, nice and easy for even a fairly new user like me.
Back to top
View user's profile Send private message
MathFreak
Apprentice
Apprentice


Joined: 07 Jul 2002
Posts: 217
Location: Bethlehem, PA

PostPosted: Fri Dec 19, 2003 7:35 pm    Post subject: Reply with quote

Unfortunately, I can't get my computer to boot using udev. I followed the instructions precisely, but I get an error message saying that it can't open an initial console. The only thing I changed from my current, working kernel is to remove devfs support. Here is my kernel config udev stuff. Even my line in grub.conf is the same, except for the kernel it points to. I've also tried both with and without "gentoo=nodevfs", but I still can't get it to boot.
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1598
Location: U.S.A.

PostPosted: Fri Dec 19, 2003 9:12 pm    Post subject: Reply with quote

MathFreak wrote:
Could you put it in a color other than red for those folks (like me) who are red-green color blind?


How bout Dark Blue? See if that is OK. If so: 8)


timmfin wrote:
Should those devices be mknoded -m 660 so that the group has read and write permisions on them?


I did miss a couple items, aloadC0 and aloadSEQ, which have put in now. As far as 660, instead of 600. You raise a valid point. Maybe it is just my system, but except for the ones listed and the ones I did wrong (amixer#) they are 600. Hmmm, I will go over the list from before udev I have and do a little more reading. For now if you want just use edit and replace all the 600 with 660 if you want. Does anyone else have a system where they are 660? Or a thought on the subject. I can really say why they are for root only, but everything seems to be working. See next post below!

MathFreak Looks like your using a different kernel than me. But did you put in /etc/fstab: none /dev/pts devpts defaults 0 0
and the most important:
mkdir /sys
then add to /etc/fstab: none /sys sysfs defaults 0 0
The way I gather is that you don't even get to the login screen? Correct? If so can you boot with the liveCD and see what /var/log/messages or syslog says on the root partition?


Just got back from LOTR so will look in a few hours on the 660 vs 600.
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
discomfitor
l33t
l33t


Joined: 21 Feb 2003
Posts: 927
Location: None

PostPosted: Fri Dec 19, 2003 11:36 pm    Post subject: Reply with quote

If it can't open an initial console, it's because either you don't have ptsfs support in your kernel, or you didn't add the line to your fstab.
_________________
There is no substitute for experience.
Imperfection indicates a lack of effort.
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1598
Location: U.S.A.

PostPosted: Fri Dec 19, 2003 11:50 pm    Post subject: Reply with quote

I looked at his config and remember seeing it in the kernel. That is why I suspect not adding to fstab (which is in the tutorial).
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
MathFreak
Apprentice
Apprentice


Joined: 07 Jul 2002
Posts: 217
Location: Bethlehem, PA

PostPosted: Sat Dec 20, 2003 12:16 am    Post subject: Reply with quote

I have this line in my fstab
Code:
none            /dev/pts    devpts      defaults        0 0
which works just fine with a devfs kernel. Btw, I'm using the just released 2.6.0 kernel, but I was running into this same problem on one of the pre-release versions. I'll check the logs in a little bit.
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1598
Location: U.S.A.

PostPosted: Sat Dec 20, 2003 12:40 am    Post subject: Reply with quote

On my system I am the owner of most of the devices for audio with udev mounted.

Am not sure where it decides though. It doesn't appear that udev.permissions is being used. For example:

/etc/udev/udev.permissions
sg*:root:disk:0660

ls -l /dev/sg*
crw-rw---- 1 decibels root 21, 0 Dec 13 22:53 /dev/sg0

On this one looks like the permissions is setup correctly via udev.permissions, but you would think that it would be think the group would be root:disk and not decibels:root

Another example:
/etc/udev/udev.permissions
mixer*:root:audio:0660

ls -l /dev/mixer*
crw------- 1 decibels audio 14, 0 Dec 13 22:53 /dev/mixer

But on this one only for the group audio does it look like it comes from udev.permissions.

Then to further complicate things. Changed the script to chmod all the devices created to 660. Rebooted and back to 600. Though something wrong, so did it again. Watched /dev/snd it changed them all to 660. Rebooted and back to 600.

So, not sure who is setting the permissions at this time. Anyone?
But it doesn't appear that the script set to 600 is hurting anything so will leave as is unless someone can prove otherwise. Just like with the baselayout, some things don't appear to be in place for udev yet and it would appear that /etc/udev/files is one of them.
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
MathFreak
Apprentice
Apprentice


Joined: 07 Jul 2002
Posts: 217
Location: Bethlehem, PA

PostPosted: Sat Dec 20, 2003 2:09 am    Post subject: Reply with quote

Okay, I checked my logs, but nothing gets put into them. Oh, and Decibels, thanks for changing the color. Sorry for whining. It really is a great guide.

EDIT: Alright, I just looked at the bootup message more carefully and I don't get a message about mounting sysfs or mounting /dev. Is this supposed to happen before the init process or during it? When I use devfs I get message saying its mounting /dev right before init starts.


Last edited by MathFreak on Sat Dec 20, 2003 11:47 am; edited 1 time in total
Back to top
View user's profile Send private message
uglyman
Apprentice
Apprentice


Joined: 21 Apr 2002
Posts: 216
Location: Seattle, WA USA

PostPosted: Sat Dec 20, 2003 6:53 am    Post subject: alsa trick Reply with quote

hey guys great guide! thanks for the help.

got a little trick for you if you hit the same snag as me.

Some posts above talk about snddevices that comes with alsa-driver. I wanted to try this but didn't seem to have it anymore (or alsa-driver at all!) so I just did emerge alsa-driver. It complains about not being compatable with 2.6 and exits with an error. The good news is that it doesn't do this until the package has been downloaded and unpacked. I am sure there is an easier way to do that but I am no portage wizard. I tried emerge --fetchonly but couldn't figure out if/where to find the package. Anyway with my lazy method, you wait for the error (it doesn't take long). Then you go to /var/tmp/portage/alsa-driver1.0-rc2/work/alsa-driver-1.0.0rc2/ and look in that dir (your ver might be different if you are not ~arch (unlikely at this point :D ) .

the script snddevices is located there. The problem is I ran it
Code:
./snddevices
and I got a whole bunch of errors from chown that root.root is not a valid user.

I popped the script open in vi to take a look, at the top we see:
Code:
if [ "`grep -w -E "^audio" /etc/group`x" != x ]; then
  PERM=660
  OWNER=root.root
fi


change this so that
Code:
OWNER=:audio

and run the script. If all went well it should change the group of all the sound related /dev stuff to audio. This way if your user is in your audio group you shouldn't have any problem with alsamixer etc etc. Not sure yet if this holds after reboot. (I think it does) if not it could be placed in /etc/conf.d/local.start

later and thanks for the info!
-uglyman
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2526
Location: Denmark

PostPosted: Sat Dec 20, 2003 8:14 am    Post subject: Reply with quote

i cant compile udev ....

Code:

make[1]: Entering directory `/var/tmp/portage/udev-009/work/udev-009/extras/scsi_id'
gcc -march=athlon-xp -O2 -pipe -fomit-frame-pointer -fstack-protector -pipe -Wall -Wshadow -Wstric                               t-prototypes -Wmissing-prototypes -Wmissing-declarations  -fomit-frame-pointer -D_GNU_SOURCE -I/us                               r/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/include -I/var/tmp/portage/udev-009/work/udev-009/libsysfs -                               DSCSI_ID_VERSION=\"0.2\"  -Wall   -c -o scsi_id.o scsi_id.c
scsi_id.c: In function `get_major_minor':
scsi_id.c:161: too few arguments to function `sysfs_open_class_device'
scsi_id.c: In function `scsi_id':
scsi_id.c:711: too few arguments to function `sysfs_open_class_device'
make[1]: *** [scsi_id.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/udev-009/work/udev-009/extras/scsi_id'
make: *** [all] Error 2

!!! ERROR: sys-fs/udev-009 failed.
!!! Function src_compile, Line 66, Exitcode 2
!!! (no error message)


anyone can make sense of this ?
_________________
linux: #232767
Back to top
View user's profile Send private message
aquadog
n00b
n00b


Joined: 28 Dec 2002
Posts: 28
Location: Johannesburg, South Africa

PostPosted: Sat Dec 20, 2003 8:58 am    Post subject: Reply with quote

here's why :

https://bugs.gentoo.org/show_bug.cgi?id=36083
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2526
Location: Denmark

PostPosted: Sat Dec 20, 2003 9:10 am    Post subject: Reply with quote

alright, that worked.
thx.
_________________
linux: #232767
Back to top
View user's profile Send private message
ikaro
Advocate
Advocate


Joined: 14 Jul 2003
Posts: 2526
Location: Denmark

PostPosted: Sat Dec 20, 2003 9:37 pm    Post subject: Reply with quote

well first ive posted on the wrong palce becuse there are about 10 treads about udev so i got confused, sorry about that.

my question is here:
https://forums.gentoo.org/viewtopic.php?p=721498#721498

a snapshot from my bot log is here :
http://ikaro.homepage.dk/log.png

anyone knows whats missing ?

thx
_________________
linux: #232767
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1598
Location: U.S.A.

PostPosted: Sat Dec 20, 2003 9:42 pm    Post subject: Reply with quote

Actually already answered on the other place. This "Documentation, Tips & Tricks" isn't really suppose to be a support forum. It mentions it at the beginning. :wink:
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1598
Location: U.S.A.

PostPosted: Sun Dec 21, 2003 2:59 pm    Post subject: Reply with quote

If anyone read the guide earlier there was a change made, it should really affect anyone though. It isn't necessary to add a line in fstab for devpts anymore. ikaro found that out and tested it myself. Didn't see any errors or problems with it in or out, so leaving it in shouldn't be a problem either.

Without the line in fstab:
Code:
bash-2.05b$ ls -l /dev/pts
total 0
crw-------    1 decibels    tty      136,   0 Dec 21 08:56 0
crw-------    1 decibels    tty      136,   1 Dec 21 08:56 1
crw-------    1 decibels    tty      136,   2 Dec 21 08:56 2
crw-------    1 decibels    tty      136,   3 Dec 21 08:56 3


This has been a public service announcement. :)
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
charlieg
Advocate
Advocate


Joined: 30 Jul 2002
Posts: 2149
Location: Manchester UK

PostPosted: Mon Feb 02, 2004 1:30 am    Post subject: Reply with quote

How accurate is this guide now that udev0015 is out and the latest nvidia drivers have some form of sysfs integration?
_________________
Want Free games?
Free Gamer - open source games list & commentary

Open source web-enabled rich UI platform: Vexi
Back to top
View user's profile Send private message
Decibels
Veteran
Veteran


Joined: 16 Aug 2002
Posts: 1598
Location: U.S.A.

PostPosted: Mon Feb 02, 2004 2:05 am    Post subject: Reply with quote

Probably still relevent, coupled with the main post in Other Things Gentoo:
https://forums.gentoo.org/viewtopic.php?t=115096&highlight=
I have been doing other things and keeping a watch on the post above, but haven't really noticed anything yet that makes me feel the need to change it yet.

Have updated it a few times already. Mainly the only thing your seeing now is added capability of udev. I can run a complete udev system. Some things don't work though, like my scanner. When someone points out something not needed in the guide any longer I make a change. If you see something let me know.

Could probably take lot of items out of the script on there. That is probably the only thing so far. That just goes with what said earlier about added capability of udev as it's coming along.
_________________
Support bacteria – they’re the only culture some people have.”

– Steven Wright
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum