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 Thu 28 Aug 2014, 11:22
All times are UTC - 4
 Forum index » Advanced Topics » Puppy Projects
pUPnGO 2012
Moderators: Flash, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 15 of 27 [398 Posts]   Goto page: Previous 1, 2, 3, ..., 13, 14, 15, 16, 17, ..., 25, 26, 27 Next
Author Message
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Wed 23 Jan 2013, 15:20    Post subject:  

PANZERKOPF: Never got mdev working...tried you scripts (deactivated udevd in init), run rc.mdev afterlogin. Had to add groups disk, uucp, cdrom and video. Then only minor warnings running mdev -s or rc.mdev.
But no drivers loaded afterwards...
When to launch rc.mdev? Do you need additional scripts/setup?

Btw. diethotplug is an other close to udevd replacement.
Back to top
View user's profile Send private message Visit poster's website 
PANZERKOPF

Joined: 16 Dec 2009
Posts: 280
Location: Earth

PostPosted: Wed 23 Jan 2013, 18:22    Post subject:  

goingnuts wrote:
PANZERKOPF: Never got mdev working...tried you scripts (deactivated udevd in init), run rc.mdev afterlogin. Had to add groups disk, uucp, cdrom and video. Then only minor warnings running mdev -s or rc.mdev.
But no drivers loaded afterwards...
When to launch rc.mdev? Do you need additional scripts/setup?

Weird....
Usually mdev must be launched after mounting sysfs and proc.
Maybe Your busybox has different configuration?
Above code is a part of my system initscript. Attached tarball contains this script and
busybox configuration file.
sysinit.tar.gz
Description 
gz

 Download 
Filename  sysinit.tar.gz 
Filesize  3.6 KB 
Downloaded  119 Time(s) 

_________________
SUUM CUIQUE.
Back to top
View user's profile Send private message 
Ibidem

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

PostPosted: Wed 23 Jan 2013, 20:54    Post subject:  

Looking at the mdev scripts, I see a couple things...
1. mdev.conf is missing this section (from examples/mdev_fat.conf in the busybox source):
Code:
# Syntax:
# [-]devicename_regex user:group mode [>|=path] [@|$|*cmd args...]
#
# =: move, >: move and create a symlink
# @|$|*: run $cmd on delete, @cmd on create, *cmd on both

# support module loading on hotplug
$MODALIAS=.*   root:root 660 @modprobe "$MODALIAS"

This is what handles hotplug module loading, which is important.

2. Most of the mknod stuff is unneeded with a proper mdev.conf.
I know /dev/{console,full,null,zero,urandom,random} are automatically created, even with mdev.conf absent.

3. sysctl -w kernel.hotplug=/sbin/mdev allows use wthout mounting /proc

4. Alpine uses/used something like:
Code:
find /sys -name modalias |xargs sort -u |xargs modprobe -a -b

to load modules for devices that aren't hotplugged. This should really speed things up.
And to coldplug USB devices, you may need this:
Code:

   # mdev -s will not create /dev/usb[1-9] devices with recent kernels
   # so we trigger hotplug events for usb for now
   for i in $(find /sys/devices -name 'usb[0-9]*'); do
      [ -e $i/uevent ] && echo add > $i/uevent
   done


Alpine's stuff is at:
http://git.alpinelinux.org/cgit/aports/tree/main/busybox-initscripts
Back to top
View user's profile Send private message 
greengeek

Joined: 20 Jul 2010
Posts: 2496
Location: New Zealand

PostPosted: Thu 24 Jan 2013, 02:31    Post subject:  

PANZERKOPF wrote:
Attached tarball contains this script and
busybox configuration file.
The rc.shutdown is very much simpler than some of the puppy shutdown scripts I have been looking at recently. Where would you use this? Is it taken from another distro or would it work in a cutdown puppy?
Back to top
View user's profile Send private message 
PANZERKOPF

Joined: 16 Dec 2009
Posts: 280
Location: Earth

PostPosted: Thu 24 Jan 2013, 09:57    Post subject:  

Ibidem wrote:
Looking at the mdev scripts, I see a couple things...
1. mdev.conf is missing this section (from examples/mdev_fat.conf in the busybox source):
Code:
# Syntax:
# [-]devicename_regex user:group mode [>|=path] [@|$|*cmd args...]
#
# =: move, >: move and create a symlink
# @|$|*: run $cmd on delete, @cmd on create, *cmd on both

# support module loading on hotplug
$MODALIAS=.*   root:root 660 @modprobe "$MODALIAS"

This is what handles hotplug module loading, which is important.

We can use above trick as well as making script for particular event (see /lib/mdev/usbdev for example).

Ibidem wrote:

4. Alpine uses/used something like:
Code:
find /sys -name modalias |xargs sort -u |xargs modprobe -a -b

to load modules for devices that aren't hotplugged. This should really speed things up.
And to coldplug USB devices, you may need this:
Code:

   # mdev -s will not create /dev/usb[1-9] devices with recent kernels
   # so we trigger hotplug events for usb for now
   for i in $(find /sys/devices -name 'usb[0-9]*'); do
      [ -e $i/uevent ] && echo add > $i/uevent
   done



I learned Alpine scripts before making my one. That script unfortunately cannot detect
all devices plugged in my test boxes (like Broadcom wireless card).
Some devices hasnt modalias file in /sys directory but has uevent with modalias string inside.
Also, my version based on "pure shell", no grep, find, xargs etc. That is not important but
should be faster (IMHO) Smile

_________________
SUUM CUIQUE.
Back to top
View user's profile Send private message 
PANZERKOPF

Joined: 16 Dec 2009
Posts: 280
Location: Earth

PostPosted: Thu 24 Jan 2013, 10:27    Post subject:  

greengeek wrote:
The rc.shutdown is very much simpler than some of the puppy shutdown scripts I have been looking at recently. Where would you use this? Is it taken from another distro or would it work in a cutdown puppy?

I use this in my own "pocket Linux", most things are written from scratch but some ideas
and functions were borrowed from other projects.

_________________
SUUM CUIQUE.
Back to top
View user's profile Send private message 
Ibidem

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

PostPosted: Fri 25 Jan 2013, 02:39    Post subject:  

PANZERKOPF wrote:

Ibidem wrote:

4. Alpine uses/used something like:
Code:
find /sys -name modalias |xargs sort -u |xargs modprobe -a -b

to load modules for devices that aren't hotplugged. This should really speed things up.
And to coldplug USB devices, you may need this:
Code:

   # mdev -s will not create /dev/usb[1-9] devices with recent kernels
   # so we trigger hotplug events for usb for now
   for i in $(find /sys/devices -name 'usb[0-9]*'); do
      [ -e $i/uevent ] && echo add > $i/uevent
   done



I learned Alpine scripts before making my one. That script unfortunately cannot detect
all devices plugged in my test boxes (like Broadcom wireless card).
Some devices hasnt modalias file in /sys directory but has uevent with modalias string inside.
Also, my version based on "pure shell", no grep, find, xargs etc. That is not important but
should be faster (IMHO) Smile

A loop to load modules will probably be slower than loading all at once: you may save the time of invoking find/grep/xargs once, but you pay by reading each file serially and invoking modprobe once per module.
Plus, a for loop has some inherent overhead.

I timed the different methods with modprobe converted to an echo:
Anyway, here's an attempt to handle that case; there is some overhead to parsing the uevent files.
Brute force with find @ 0.39 seconds:
Code:
find /sys/devices -name uevent | xargs grep -h MODALIAS 2>/dev/null |cut -d = -f 2


Your way @0.14 seconds (goes down by half without the second /sys/bus/*):
Code:
#!/bin/sh

#is there really a reason to try twice?
for ONEBUS in /sys/bus/* /sys/bus/*; do
    for ONEDEVICE in ${ONEBUS}/devices/*; do
   [ -r ${ONEDEVICE}/uevent ] || continue
   while read ONEUEVENTSTR; do
       case $ONEUEVENTSTR in
      MODALIAS=*)
          echo ${ONEUEVENTSTR#MODALIAS=} 2>/dev/null
      ;;
      *)
          continue
      ;;
       esac
   done < ${ONEDEVICE}/uevent
    done
done


And a mix @0.035 seconds:
Code:
grep -h MODALIAS /sys/bus/*/devices/*/uevent 2>/dev/null |cut -d = -f 2


The "official" method is more like
Code:
find /sys -name uevent -exec echo add > {} \;

but, that would likely have even worse performance (for every entry, a context switch to kernel mode and exec mdev in user mode, then exec modprobe if needed)

Each testcase outputs a list of module aliases.
Back to top
View user's profile Send private message 
Ibidem

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

PostPosted: Sun 27 Jan 2013, 03:16    Post subject:  

goingnuts wrote:
PANZERKOPF: Never got mdev working...tried you scripts (deactivated udevd in init), run rc.mdev afterlogin. Had to add groups disk, uucp, cdrom and video. Then only minor warnings running mdev -s or rc.mdev.
But no drivers loaded afterwards...
When to launch rc.mdev? Do you need additional scripts/setup?

Btw. diethotplug is an other close to udevd replacement.


FYI: diethotplug is from 2002; you might want hotplug2.
Then there's mdev and ndev, and Busybox hotplug, and eudev, and probably a few other systems...
But udev/eudev provide one thing the other solutions don't: they can enumerate devices, which is what Xorg wants them for.
Back to top
View user's profile Send private message 
PANZERKOPF

Joined: 16 Dec 2009
Posts: 280
Location: Earth

PostPosted: Mon 28 Jan 2013, 12:38    Post subject:  

Ibidem wrote:

But udev/eudev provide one thing the other solutions don't: they can enumerate devices, which is what Xorg wants them for.

Yes, latest Xorg servers need udev but as I know, It can be configured/compiled without udev.

_________________
SUUM CUIQUE.
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Mon 28 Jan 2013, 15:47    Post subject:  

PANZERKOPF & Ibidem: Thanks for all your input! I guess I stick with udev-124 as its quite small and it works for me. Cant get BB mdev working, diethotplug is fast but lacks some features, hotplug2 seems to favor glibc-dynamic linking and eudev needs Autoconf version 2.68 or higher and I do not want to upgrade now...

And the udevd seems to work on kernel from P216, P412, P431 & P525 without recompile.

Revisited the static build of tcl/tk 8.5 to get attached 3 games running (bubbles.tcl CrystalsBattle.tcl gemgame.tcl) where the first & last will be known from Puppy3...quite addictive...
3_tcl_games.tar.gz
Description  3 classic tcl games
gz

 Download 
Filename  3_tcl_games.tar.gz 
Filesize  27.39 KB 
Downloaded  105 Time(s) 

Last edited by goingnuts on Mon 28 Jan 2013, 16:03; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2236

PostPosted: Mon 28 Jan 2013, 15:53    Post subject:  

Excuse me for asking - a while back there was discussion here based on the output of strace, where it seemed that the dynamic linker was looking in many strange places for libs (like /lib/tls, etc) before finally looking in just /lib, /usr/lib, etc. does anyone remember the discussion and could redirect me to it. If this is true, I'd like to do something about it by patching glibc to skip all those locations...
Back to top
View user's profile Send private message 
goingnuts

Joined: 07 Dec 2008
Posts: 780

PostPosted: Mon 28 Jan 2013, 16:06    Post subject:  

amigo: Its here
Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4345

PostPosted: Tue 29 Jan 2013, 01:34    Post subject:  

Is it glibc issue or is it picking up library paths from the build environment with gcc?
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Ibidem

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

PostPosted: Tue 29 Jan 2013, 02:18    Post subject:  

technosaurus wrote:
Is it glibc issue or is it picking up library paths from the build environment with gcc?

I think it's glibc ld.so
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2236

PostPosted: Tue 29 Jan 2013, 11:09    Post subject:  

I'm pretty sure it's ld-x.xx.so (whatever ld-linux.so.2 links to). the question is where do we find where that list is being composed in the linker code?
techno, "library paths from the build environment with gcc", do you mean during the build of glibc or the program in question?

Or maybe it's just strace's own output?
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 15 of 27 [398 Posts]   Goto page: Previous 1, 2, 3, ..., 13, 14, 15, 16, 17, ..., 25, 26, 27 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Puppy Projects
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.1097s ][ Queries: 13 (0.0108s) ][ GZIP on ]