LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation
User Name
Password
Slackware - Installation This forum is for the discussion of installation issues with Slackware.

Notices


Reply
  Search this Thread
Old 12-17-2014, 08:48 AM   #1
gearheadgeek
Member
 
Registered: Aug 2007
Posts: 30

Rep: Reputation: 0
Is life without udev possible?


I'm not really a luddite - it is just that udev does nothing useful in my application and instead causes problems. Pat implies it it possible "with some tweaks". Does anyone know what those tweaks might be?
 
Old 12-17-2014, 08:51 AM   #2
genss
Member
 
Registered: Nov 2013
Posts: 744

Rep: Reputation: Disabled
get a ps2 keyboard and try it out
 
1 members found this post helpful.
Old 12-17-2014, 09:37 AM   #3
gearheadgeek
Member
 
Registered: Aug 2007
Posts: 30

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by genss View Post
get a ps2 keyboard and try it out
Huh? I don't follow. My application does not use a keyboard.
 
Old 12-17-2014, 09:58 AM   #4
genss
Member
 
Registered: Nov 2013
Posts: 744

Rep: Reputation: Disabled
the kernel itself makes most of the needed nodes in /dev

of the things that it doesn't here's what i got so far
what you look for depends on what your program needs

#/dev/X0R -> null
ln -s /proc/kcore /dev/core
ln -s /proc/self/fd /dev/fd
ln -s /input/mice /dev/mouse
#/dev/rtc -> rtc0
ln -s /proc/self/fd/2 /dev/stderr
ln -s /proc/self/fd/0 /dev/stdin
ln -s /proc/self/fd/1 /dev/stdout
(the two hashed i haven't looked at yet)

then there are modules for devices, something like

Code:
for i in /sys/block/*/device/modalias /sys/bus/*/devices/*/device/modalias /sys/bus/*/devices/*/device/modalias /sys/class/*/*/device/modalias
  do
    if [ -f $i ]
    then
      #echo "modprobe `cat $i`"
      modprobe `cat $i`
    fi
  done
to make nodes for block devices

Code:
for i in /sys/block/*/dev
  do
    if [ -f $i ]
    then
      MAJOR_MINOR=`sed 's/:*:/\ /' < $i`
      DEVNAME=`echo $i | sed -e 's@/dev@@' -e 's@.*/@@'`
      #echo `echo $i | cut -d \/ -f 4`
      #echo "mknod /dev/$DEVNAME b $MAJOR_MINOR"
      mknod /dev/$DEVNAME b $MAJOR_MINOR
    fi
  done
  
for i in /sys/block/*/*/dev
  do
    if [ -f $i ]
    then
      MAJOR_MINOR=`sed 's/:*:/\ /' < $i`
      DEVNAME=`echo $i | sed -e 's@/dev@@' -e 's@.*/@@'`
      #echo `echo $i | cut -d \/ -f 4`
      #echo "mknod /dev/$DEVNAME b $MAJOR_MINOR"
      mknod /dev/$DEVNAME b $MAJOR_MINOR
    fi
  done

maybe some more things, idk


PS i didn't put char devices as some have special directories in /dev

Last edited by genss; 12-17-2014 at 10:13 AM.
 
1 members found this post helpful.
Old 12-17-2014, 11:16 AM   #5
gearheadgeek
Member
 
Registered: Aug 2007
Posts: 30

Original Poster
Rep: Reputation: 0
What is wrong with the /dev that you have to install to boot with before tmpsysfs overlays it? My application is static and uses no modules. I need to add to /dev for a touch screen, which, of course, doesn't work. Maybe I could learn udev rules but since the touch stuff lives outside the kernel, I don't think udev can help. In any case, not using udev is easier than learning how to make rules. I did an install without udev but tmpsysfs is still laid on top of /dev.
 
Old 12-17-2014, 11:29 AM   #6
genss
Member
 
Registered: Nov 2013
Posts: 744

Rep: Reputation: Disabled
/dev is a special kind of virtual fs, devfs
the kernel populates most of it automatically

what rules do you need ?
what are you doing anyway ?
do you use usb ?
do you know how to use modprobe and mknod ?
 
Old 12-17-2014, 12:38 PM   #7
gearheadgeek
Member
 
Registered: Aug 2007
Posts: 30

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by genss View Post
/dev is a special kind of virtual fs, devfs
the kernel populates most of it automatically
I assumed as much, but the question is, what is wrong with the static version that gets hidden by devfs?
Quote:
what rules do you need ?
If I don't have udev, I don't need rules. What I need is a /dev entry for a touch screen that the kernel does know know about or understand.
Quote:
what are you doing anyway ?
Embedded systems.
Quote:
do you use usb ?
Yes, but that does not require udev.
Quote:
do you know how to use modprobe and mknod ?
Yes, but I don't use modprobe to because I compile all necessary pieces into the kernel and using mknod on tmpdevfs does not work.

I have been using Slack since 4.0, but these provisions to make desktop users lives easier are beginning to get in the way.

Last edited by gearheadgeek; 12-17-2014 at 01:04 PM.
 
Old 12-17-2014, 04:11 PM   #8
genss
Member
 
Registered: Nov 2013
Posts: 744

Rep: Reputation: Disabled
all devices in /dev are nodes
before they were all made at boot, that lead to problems with some corner cases (not just desktop ones)
GKH decided it should be done by a userspace app (after HAL was hotplug then udev), despite other UNIX-es solving that problems properly

example of a /dev node:

bash-4.3# ls -l /dev/usbmon0
crw------- 1 root root 250, 0 Pro 17 15:14 /dev/usbmon0

c means it's a character device
250 is the major node number
0 is the minor node number

so to make this node i would run
mknod /dev/usbmon0 c 250 0
(system call is almost the same)

to find out that numbers you would look into sysfs's /sys/class/usbmon/usbmon0/dev file (or the uevent file)
bash-4.3# cat /sys/class/usbmon/usbmon0/dev
250:0


from what i know; (the documentation is non existent, as is usually the case with Kay Sievers and gang)
there are no static versions for dynamic devices, just for one of a kind ones
nothing that the kernel puts in devtmpfs gets replaced


so if all you need is the dev node, that should be easy to make at boot
bdw openwrt has it's own udev-like version, and hotplug is good documentation/example

Last edited by genss; 12-17-2014 at 04:12 PM.
 
1 members found this post helpful.
Old 12-17-2014, 04:29 PM   #9
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
You don't need udev to have a functioning system, but it helps with hardware. Without udev you'll have to use mknod to statically assign device nodes in /dev manually, and rely on the kernel hotplugging system.
 
Old 12-17-2014, 10:16 PM   #10
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
You can replace udev with:

1) eudev

2) mdev from busybox

3) hotplug from openwrt

Usually Udev gets event from kernel on device installation and udev creates neccessary device nodes in /dev

And devtmpfs doesn't handles it well.

Or you can create static device nodes on /dev directory itself. Only if devices don't get changed in each instance.
 
Old 12-18-2014, 12:03 AM   #11
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,068

Rep: Reputation: Disabled
For your embedded system, mdev is the way to go. Just in case you didn't come across it yet, see also OpenEmbedded
and of course BusyBox.
 
Old 12-19-2014, 07:03 AM   #12
gearheadgeek
Member
 
Registered: Aug 2007
Posts: 30

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by genss View Post
all devices in /dev are nodes
GKH decided it should be done by a userspace app (after HAL was hotplug then udev), despite other UNIX-es solving that problems properly
I have too much else to do to keep up with kernel development so I missed that. I have been using 2.6 kernels recently and this is my first go with a 3.x series. I can't find anything anywhere that explains tmpdevfs or how to use it.
Quote:
example of a /dev node:

bash-4.3# ls -l /dev/usbmon0
crw------- 1 root root 250, 0 Pro 17 15:14 /dev/usbmon0
As I mentioned, I have been using Slack in embedded since 4.0 (or maybe it was 3.4) so I actually do understand device nodes know how to make them.
 
Old 12-19-2014, 07:09 AM   #13
gearheadgeek
Member
 
Registered: Aug 2007
Posts: 30

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ReaperX7 View Post
You don't need udev to have a functioning system, but it helps with hardware.
You are right, it is possible. I worked it out and have it running. Thing is, I don't need (or want) help with hardware. That is the point.
Quote:
Without udev you'll have to use mknod to statically assign device nodes in /dev manually, and rely on the kernel hotplugging system.
I have learned in my 35 years of embedded that Murhpy always wins. Something WILL go wrong. So the approach is to keep things as simple as possible. Adding an unneeded hotplug system just to have device nodes that work just as well statically is tempting Murphy to screw around with you. If I need a device node, I can make it.
 
Old 12-19-2014, 07:12 AM   #14
gearheadgeek
Member
 
Registered: Aug 2007
Posts: 30

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by veerain View Post
You can replace udev with:

1) eudev

2) mdev from busybox

3) hotplug from openwrt

Usually Udev gets event from kernel on device installation and udev creates neccessary device nodes in /dev

And devtmpfs doesn't handles it well.

Or you can create static device nodes on /dev directory itself. Only if devices don't get changed in each instance.
Thanks, but I have been using Slack in embedded successfully since long before busybox. *nix has worked fine with static device nodes for the whole time. Hot plugging is not useful to me and only represents another potential failure point.
 
Old 12-19-2014, 08:56 AM   #15
veerain
Senior Member
 
Registered: Mar 2005
Location: Earth bound to Helios
Distribution: Custom
Posts: 2,524

Rep: Reputation: 319Reputation: 319Reputation: 319Reputation: 319
Quote:
Originally Posted by gearheadgeek View Post
I have too much else to do to keep up with kernel development so I missed that. I have been using 2.6 kernels recently and this is my first go with a 3.x series. I can't find anything anywhere that explains tmpdevfs or how to use it.

As I mentioned, I have been using Slack in embedded since 4.0 (or maybe it was 3.4) so I actually do understand device nodes know how to make them.
To use devtmpfs all you have to do is:

mount -t devtmpfs devtmpfs /dev

/dev may be empty beforehand if you like.
 
  


Reply



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
[SOLVED] udev and dbus - using the notivy-send command in a script started by udev markush Slackware 2 10-14-2012 09:26 AM
UDEV: Unable to run a command line interface script after USB automount using udev mohamr2 Linux - Embedded & Single-board computer 8 08-16-2011 10:39 AM
LXer: Downgrade udev 157->151 on opensuse 11.3 to bring back to life Xen 4.0 (2.6.34-12-xen) LXer Syndicated Linux News 0 07-26-2010 08:50 PM
UDEV - SBLive(emu10k) - Mandriva hangs at UDEV during boot.....still! Grrr. peterlowrie Linux - Hardware 2 05-23-2010 06:37 PM
LXer: How Half Life could save your life LXer Syndicated Linux News 0 02-05-2009 12:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - Installation

All times are GMT -5. The time now is 01:34 AM.

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
Open Source Consulting | Domain Registration