Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sun 20 Apr 2014, 06:35
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
populating /dev from /sys
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 3 [40 Posts]   Goto page: Previous 1, 2, 3 Next
Author Message
amigo

Joined: 02 Apr 2007
Posts: 2169

PostPosted: Tue 14 May 2013, 04:37    Post subject:  

Have you ever looked at the old shell-based hotplug implementation? It provides hooks for most hardware subsystems.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3860
Location: Kiel,Germany

PostPosted: Tue 14 May 2013, 06:09    Post subject:  

http://archive.debian.net/sarge/all/hotplug/filelist
I have installed that into one Macpup 4 installation together with reconfigured hal and e17 shows the plugged in drives at boot time, but hotplugged drives don't get updated .
Have made a sleep loop into xwin for pidof rc.services . Takes 30 seconds for /etc/init.d/hotplug on 2GHz CPU to finish .
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4134

PostPosted: Tue 14 May 2013, 18:12    Post subject:  

@Karl, You may need to manually add the name of your hotplug executable (with full path) to /proc/sys/kernel/hotplug
after the cold plug part of init just add a line like
echo /path/to/hotplug > /proc/sys/kernel/hotplug


I looked through the hotplug scripts, (no wonder it was replaced). I'm pretty sure we can get a 5-10x speed improvement over those (sed? really?) and use the newer hotplug mechanisms. If it is still too slow, it would be easy to rewrite the common case in <100 lines of C since it just passes env variables.

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3860
Location: Kiel,Germany

PostPosted: Tue 14 May 2013, 20:53    Post subject:  

Code:
#!/bin/ash
PATH="${PATH}:/usr/local/bin:/usr/X11/bin"
echo "HOTPLUG EVENT TRIGGERED
`date`
$*
">>/tmp/photplug.log
#find /sys -path "*${*}*" >>/tmp/photplug.log
export DISPLAY=':0.0'
exec  xmessage "HOTPLUG EVENT TRIGGERED"

as a start Very Happy

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:02 GMT-8 2013
usb

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:02 GMT-8 2013
usb

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:02 GMT-8 2013
scsi

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:02 GMT-8 2013
scsi_host

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:02 GMT-8 2013
usb_device

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:07 GMT-8 2013
scsi

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:07 GMT-8 2013
scsi

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:07 GMT-8 2013
scsi_device

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:07 GMT-8 2013
scsi

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:07 GMT-8 2013
scsi_disk

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:07 GMT-8 2013
block

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:07 GMT-8 2013
bdi

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:07 GMT-8 2013
block

HOTPLUG EVENT TRIGGERED
Wed May 15 01:48:07 GMT-8 2013
block


for a usb pen drive 4GB
# probepart2.07 -m -d/dev/sdc
/dev/sdc1|ext3|1946
/dev/sdc2|ntfs|1961
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4134

PostPosted: Tue 14 May 2013, 21:51    Post subject:  

Karl Godt wrote:
as a start Very Happy

here is a script that people can run to help me in supporting their devices:

Code:
#!/bin/ash
echo "---------- $@ --------------" >> "$HOME/hotplug.log"
/usr/bin/env >> "$HOME/hotplug.log"


just insert your device(s) and let it settle, remove and gzip the hotplug.log in your home directory (/root on puppy) and post it here

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Ibidem

Joined: 25 May 2010
Posts: 430
Location: State of Jefferson

PostPosted: Wed 15 May 2013, 04:10    Post subject:  

There are uevent files that don't contain all variables.
But it seems this is duplicating what mdev does in C already.

http://lists.busybox.net/pipermail/uclibc/attachments/20080327/974e6fcc/attachment.diff
The mknod patch for uclibc.

A char device is any device read as a stream (byte at a time); a block device is read block at a time (usu. 512-1024 bytes); usually this means block device == disk, char device == tty or similar.
Back to top
View user's profile Send private message 
Karl Godt


Joined: 20 Jun 2010
Posts: 3860
Location: Kiel,Germany

PostPosted: Wed 15 May 2013, 05:06    Post subject:  

Here you are :
Code:
#!/bin/ash

eval `env`
[ "$ACTION" = remove ] && SUFFIX=rem || SUFFIX=add
echo "---------- $@ --------------
`env`

`dmesg|tail`
">> "$HOME/hotplug.${SUFFIX}.log"

Modded the code a tiny bit. Hope you don't mind.
Kernel is Drake Puppy 0.3
# uname -r
2.6.39
BB is
# busybox |head -n1
BusyBox v1.17.2 (2011-05-01 08:45:38 GMT-Cool multi-call binary.
hotplug.log.d.tar.bz2
Description  two folders : add and remove. hope i have removed in correct reverse order.
bz2

 Download 
Filename  hotplug.log.d.tar.bz2 
Filesize  8.45 KB 
Downloaded  126 Time(s) 
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3860
Location: Kiel,Germany

PostPosted: Wed 15 May 2013, 05:14    Post subject:  

Quote:
Karl Godt wrote:
as a start Very Happy

YEP, hundreds of xmessages can be annoying , but to detect single events by mount or kill, it is quite useful .
Back to top
View user's profile Send private message Visit poster's website 
Iguleder


Joined: 11 Aug 2009
Posts: 1775
Location: Israel, somewhere in the beautiful desert

PostPosted: Wed 15 May 2013, 05:50    Post subject:  

What about devtmpfs? Newer udev versions (AFAIK, 17x and above) require this feature and udev no longer creates device nodes.

The kernel already has that information (major, minor numbers and device names), so why don't you just let it create those device nodes on its own? Idea

Sounds more efficient and smaller (in terms of binary size) to me. Just mount a devtmpfs file system and you're done - this can be done from the initramfs and it is guaranteed that /dev will be populated correctly.

_________________
My homepage
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
ICQ Number 
Karl Godt


Joined: 20 Jun 2010
Posts: 3860
Location: Kiel,Germany

PostPosted: Wed 15 May 2013, 07:00    Post subject:  

Must say that I have enabled that in some kernels and all of a sudden the USB Modem disconnected and reconnected with ttyUSB0 becomming ttyUSB1 .

But have encountered that too on standard configurations afterwards .

Devtmpfs kernel feature can be enabled without automatically letting the kernel mounting it .
This lead to empty /dev directory at shutdown.
Normal kernels had no nodes there afterwards .
Tiny point to watch out for in full installations .

Otherwise devtmpfs is OK for me.

udev-140 works for me . Dunno what's that hype all about upgrade .
Back to top
View user's profile Send private message Visit poster's website 
Iguleder


Joined: 11 Aug 2009
Posts: 1775
Location: Israel, somewhere in the beautiful desert

PostPosted: Wed 15 May 2013, 07:06    Post subject:  

Karl Godt wrote:
Devtmpfs kernel feature can be enabled without automatically letting the kernel mounting it .
This lead to empty /dev directory at shutdown.


You described both the problem and the solution here ... just mount that devtmpfs from the init script! Evil or Very Mad

Karl Godt wrote:
Normal kernels had no nodes there afterwards .
Tiny point to watch out for in full installations .


I see no difference between full installations, frugal ones or any other hypothetical installation. The init script stays the same, just mount devtmpfs before doing things specific to the installation type used.

Karl Godt wrote:
udev-140 works for me . Dunno what's that hype all about upgrade .


Windows 1.0 works great on my brand new UEFI, 64-bit ARMv8 laptop. I run it inside VirtualBox, on top of Xen, inside QEMU, inside Bochs, in a Fedora chroot. NOT

EDIT: forgot to mention - devtmpfs is pretty standard. If you don't have it in your kernel, that's probably because you insist on using an ancient kernel, so that's your problem already. You're trying to force things to work, because you decided not to have the clean solution isn't available. 21st century versions of X, recent versions of udev and Wayland and more stuff won't work on such a kernel - if you solve this problem, I guess figuring out some dirty hack for creating device nodes won't be an issue for you Laughing

_________________
My homepage
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
ICQ Number 
jamesbond

Joined: 26 Feb 2007
Posts: 1876
Location: The Blue Marble

PostPosted: Wed 15 May 2013, 07:11    Post subject:  

Iguleder wrote:
What about devtmpfs?

If I read correctly technosaurus wants to do this inside his lxc container (or chroot jail, or whatever), and probably creating the nodes also in a controlled manner (not just for all devices).
If it is for the main system I agree we should all switch to devtmpfs.

_________________
Fatdog64, Slacko and Puppeee user. Puppy user since 2.13
Back to top
View user's profile Send private message 
Iguleder


Joined: 11 Aug 2009
Posts: 1775
Location: Israel, somewhere in the beautiful desert

PostPosted: Wed 15 May 2013, 07:15    Post subject:  

jamesbond wrote:
... (not just for all devices).


Why not?

_________________
My homepage
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
ICQ Number 
Karl Godt


Joined: 20 Jun 2010
Posts: 3860
Location: Kiel,Germany

PostPosted: Wed 15 May 2013, 07:15    Post subject:  

udev-140 works with kernel 3.5 - NO FEAR !
Back to top
View user's profile Send private message Visit poster's website 
Iguleder


Joined: 11 Aug 2009
Posts: 1775
Location: Israel, somewhere in the beautiful desert

PostPosted: Wed 15 May 2013, 07:20    Post subject:  

Of course it does - it creates all device nodes on its own (e.g if a device node is not there already, it creates it).

Once you upgrade udev (to something more recent than 2009, to make it possible to use a modern graphics stack), it won't.

_________________
My homepage
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
ICQ Number 
Display posts from previous:   Sort by:   
Page 2 of 3 [40 Posts]   Goto page: Previous 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
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
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0734s ][ Queries: 12 (0.0048s) ][ GZIP on ]