Lighweight pup_event_frontend_d Replacement

Under development: PCMCIA, wireless, etc.
Message
Author
User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#16 Post by Karl Godt »

first snap as frontend?d renamed fronend?d.sh and part-what cp as /sbin/pup_event_frontgend_d, restarted new udevd, restarted X, plugged in sd card in usb-reader .

Nice. probably let it be as it is . Needs the add part of rc.sysinit to show internal drives I guess.
Attachments
part-what.jpg
(21.19 KiB) Downloaded 704 times
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#17 Post by Karl Godt »

myself wrote:Needs the add part of rc.sysinit to show internal drives I guess.
Nope,
did not work ( kernel 2.6.30.5 ) to trigger pdeskdrived which I think would be a good name for part-hotplug-handler to show all internal and external drives .

For now it is a partial drive handler .
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#18 Post by musher0 »

Hi, iguleder.

Where do these utilities go? Alternately, would a *.pet be useful?

Thanks in advance and best regards.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#19 Post by jamesbond »

Karl Godt wrote:
myself wrote:Needs the add part of rc.sysinit to show internal drives I guess.
Nope,
did not work ( kernel 2.6.30.5 ) to trigger pdeskdrived which I think would be a good name for part-hotplug-handler to show all internal and external drives .

For now it is a partial drive handler .
Run this after you run the handler. You should get all the internal drives displayed.

Code: Select all

for p in $(ls /sys/class/block | grep -Ev ^ram|^loop); do
udevadm trigger --action=add --sysname-match=$p
done
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#20 Post by Karl Godt »

142 complains about trigger: unrecognized option `--sysname-match='

what works is something like udevadm trigger /block/sda

Looking good so far . Just needs the Icons :)
Attachments
udevadm_trigger.jpg
(35.92 KiB) Downloaded 620 times

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#21 Post by jamesbond »

Karl Godt wrote:142 complains about trigger: unrecognized option `--sysname-match='
Your udev must be of an older version. I tried to google to find the equivalent options for older udev, but it seems that all those options have been eradicated. What is your udev version? Perhaps we can figure it out by looking at the source (assuming the source is still available from kernel.org).
what works is something like udevadm trigger /block/sda
That's not good because without the correct command line, udev will issue "change" event to *ALL* devices.
Looking good so far . Just needs the Icons :)
:)
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#22 Post by Karl Godt »

kernel.org became a scattered pile of dung since the attack some two years ago ( patch* es missing ) and now they out-source files as it seems .

From memory I knew there had been problems to compile udev between 140 and 150 on Pup-43* .

151 gives me

1) configure:12380: error: gperf is needed
2) --disable-extras > Package gobject-introspection-1.0 was not found in the pkg-config search path.
3) configure:12565: error: libacl not found
Your udev must be of an older version
142
That's not good
But funny ;)

Puppy Lupu 5 has udevd --version 124 as it seems. Still runs well also on my machines.
Just needs the Icons Smile
Turns out to be a horror. Since
<Path>/sbin/mount-and-open</Path>
is everywhere the same, rox's globicons file seems to pick one icon for mounted, mounted_boot and unmounted .
un 8)
«Give me GUI or Death» -- I give you [[Xx]term[inal]] [[Cc]on[s][ole]] .
Macpup user since 2010 on full installations.
People who want problems with Puppy boot frugal :P

User avatar
mavrothal
Posts: 3096
Joined: Mon 24 Aug 2009, 18:23

#23 Post by mavrothal »

Karl Godt wrote: 1) configure:12380: error: gperf is needed
2) --disable-extras > Package gobject-introspection-1.0 was not found in the pkg-config search path.
3) configure:12565: error: libacl not found
You can not compile udev with acl/xattr support in frugal installs.
Aufs does not support acl/xattr. You must have either a full puppy install (one of the reasons that BK usually compiles from full installs) or compile udev without acl support.
== [url=http://www.catb.org/esr/faqs/smart-questions.html]Here is how to solve your[/url] [url=https://www.chiark.greenend.org.uk/~sgtatham/bugs.html]Linux problems fast[/url] ==

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#24 Post by Iguleder »

musher0 wrote:Where do these utilities go? Alternately, would a *.pet be useful?
Just put everything in /usr/bin,

If I find the time, I'll fix the icon and placement issues, then make a PET.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

#25 Post by charlie6 »

Hi Iguleder,
(running wheez-3.5.2.5)
also thanks for your time doing all this, as also to other contributors !

I got a try on these part-hotplug-handler.tar.bz2 but it seems not yet solve the following:

Here using several USB memory plugs, and external hard disk disk, to save datas, lets call them sdb1, sdc1, sdd1 to 10. All plugged into a 4 ports USB hub.
Some daily used apps (textprocessor, spreadsheet, etc...) keep tracks of the recent used files.
I am using those trasks as hints to get a fast access to my datas.

Sometimes i have to unplug one of them - for instance sdc1 - (after having unmounted it... :wink: ), and aftrwds to plug another one, and aftrwds, to re-plugs the former.

This last one is no longer named sdc1, but sde1 instead. Sometimes all USB drive icons switch off, and redisplay whith names like sde1, sdf1, sdg1 ...

The only workaround to get back to sdb1, sdc1, sdd1 ... configuration is ... to shutdown the PC and reboot. Restart X does NOT help.

I have browsed across the forum since months (even years...) whithout finding how to fix this nor understanding what could explain this.

I figure out this is as if the initial USB keys names where stored somewhere ... without resetting upon unplugging.

Having installed and compiled part-hotplug-handler, a possible workaround i found:
when opened Rox file manager to /mnt, all mounted drives are displayed with a green dot.
Some already unplugged USB plugs still display with a green dot (YESSS ... :shock: ! ) as if they were currently plugged :shock: ! Right clicking on them and unmounting them result in a kind of reset of the , let's call it so, «usb-plugs-map».

Thanks again for any answer, Charlie

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#26 Post by Iguleder »

You'll have to configure udev, so it uses persistent device names. Take a look at /etc/udev.
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

#27 Post by charlie6 »

Thanks Iguleder,
Iguleder wrote:You'll have to configure udev, so it uses persistent device names. Take a look at /etc/udev.
how can one configure udev? Here /etc/udev is a folder which has udev.conf and udev.rules in it.

I again got a try using part-hotplug-handler putting it in /usr/bin (with pup_event_frontend_d just disabled).
Got the following comments in terminal:
./part-hotplug-handler seems hanging up till i do Ctrl-c to stop it.
./mount-and-open can't find /mnt/ in /etc/fstab or /etc/mtab
sh-3.00# ./part-hotplug-handler
^C
sh-3.00# ./part-hotplug-handler --help
^C
sh-3.00# ldd part-hotplug-handler
linux-gate.so.1 => (0xffffe000)
libudev.so.0 => /lib/libudev.so.0 (0xb7755000)
libc.so.6 => /lib/libc.so.6 (0xb7607000)
librt.so.1 => /lib/librt.so.1 (0xb75fd000)
/lib/ld-linux.so.2 (0xb7765000)
libpthread.so.0 => /lib/libpthread.so.0 (0xb75e4000)
sh-3.00# ./part-icon
sh-3.00# ./mount-and-open
BusyBox v1.19.3 (2011-11-09 07:34:50 WST) multi-call binary.

Usage: basename FILE [SUFFIX]

Strip directory path and .SUFFIX from FILE


mount: can't find /mnt/ in /etc/fstab or /etc/mtab
sh-3.00#
Moreover, or, as a consequence, i don't get any icon on desktop.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#28 Post by jamesbond »

Karl Godt wrote:
jamesbond wrote:Your udev must be of an older version
Karl wrote:142
You don't need to re-compile that, I just want to grab the source so I can see what options are provided by that particular version. Yes, your udev is way too old - 142 doesn't support triggering by device names (or any subset of devices, unless you already know what you're looking for - yuck!), so all you can do is to re-trigger the events like this:

Code: Select all

udevadm trigger --action=add
or may be try

Code: Select all

udevadm trigger --action=change
and see if Iggy's code works. From here, you need to add your own filter in part-icon so only relevant block devices got shown (e.g. no loops, no rams, no nbds, no other virtual block device stuff).
Karl wrote:
Just needs the Icons Smile
Turns out to be a horror. Since
<Path>/sbin/mount-and-open</Path>
is everywhere the same, rox's globicons file seems to pick one icon for mounted, mounted_boot and unmounted .
uncool :(
That can be fixed in many ways, we can create symlink, or we can create rox apps, etc, again the fix is in part-icon.

I will leave that as an exercise for the reader :twisted:
charlie6 wrote:I have browsed across the forum since months (even years...) whithout finding how to fix this nor understanding what could explain this.
This is old, but the principle is still the same: http://www.reactivated.net/writing_udev_rules.html.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#29 Post by Karl Godt »

http://lmgtfy.com/?q=udev-142
:mrgreen:

Neverteheless have compiled udev-151

./configure --bindir=/bin --sbindir=/sbin --libexecdir=/usr/libexec --sysconfdir=/etc --localstatedir=/var --libdir=/lib --includedir=/usr/include --datarootdir=/usr/share --disable-introspection

successfully on Macpup511 in frugal mode with aufs layerfs , which had libacl ( or 511 devx ) .

udev-151 has --sysname-match parameter :)

Will have to recompile it with --libexecdir=/etc/udev :? .

udev-130 series defaults to /usr/local :IIRC:
udev-140 series defaults to / with the --sysconfdir=/usr/etc :Quite Ok:
udev-150 series defaults to /usr :twisted:

Was always wondering about the
if [ $UDEVVER -gt 150 ];then
#100611 v151 is recommended for kernel 2.6.27+.
lines in rc.sysinit
and found only version 124p420, 136w5 and 167w5 in the quirky/wary/puppy repos on ibiblio .

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#30 Post by Iguleder »

Guys - I created a Git repository for this project and cleaned it up a bit. Pull requests are appreciated, as long as the coding style is fine and the changes are tested.

The handler process doesn't create desktop icons - it mounts and runs the file manager instead. This is a Puppy modification we'll have to add.

akash_rawal - it seems select() is needed. udev_monitor_receive_device() does not block.

EDIT: it's pretty cool! Install the code in the repository and put the following in your .jwmrc:

Code: Select all

<StartupCommand>part-hotplug-monitor</StartupCommand>
Automatic mounting and unmounting works perfectly, although it could be insecure (if regular users are allowed to mount and unmount).
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#31 Post by Iguleder »

Good news!

I wrote a handler which creates desktop icons and lets ROX-Filer automatically position them, so they appear right after the existing ones. See the screeny for an example. This handler uses Puppy-style icons which match the partition type and change once the partition is mounted. The sources are attached :)

It's possible to use Puppy's icon positioning algorithm but it's quite dirty and I like it more when icons are automatically arranged.

First impressions? :D
Attachments
part-hotplug-handler.tar.bz2
(18.16 KiB) Downloaded 343 times
screeny.png
(47.37 KiB) Downloaded 461 times
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

simargl

#32 Post by simargl »

.
Last edited by simargl on Sun 01 Sep 2013, 15:13, edited 1 time in total.

User avatar
charlie6
Posts: 1230
Joined: Mon 30 Jun 2008, 04:03
Location: Saint-Gérard / Walloon part of Belgium

#33 Post by charlie6 »

Hi Iguleder,
here impressions on wheezy-3.5.2.5
- have extracted the part-hotplug-handler.tar.bz2
- have compiled part-hotplug-monitor.c > got part-hotplug-monitor (just ran make)
- have copied + rendered them executable
part-hotplug-monitor
part-hotplug-handler
part-icon
to /usr/bin
- have made a symlink for part-hotplug-monitor pointing to /sbin where /sbin/pup_event_frontend_d is present
- have disabled the existing pup_event_frontend_d and renamed whatever anme;
- have renamed pup_event_frontend_d the symling part-hotplug-monitor

restarted X ... wait a rather long long time till X actually restarted ... and got X desktop displayed without any drive icon.

running ./sbin/part-hotplug-monitor in a console: part-hotplug-monitor seems hanging up as there is no comment and nothing happens...

have i missed something ...?
Charlie

User avatar
Iguleder
Posts: 2026
Joined: Tue 11 Aug 2009, 09:36
Location: Israel, somewhere in the beautiful desert
Contact:

#34 Post by Iguleder »

Yep, two things:
- It doesn't output anything.
- It still doesn't draw icons for existing partitions, only for newly added ones. :wink:
[url=http://dimakrasner.com/]My homepage[/url]
[url=https://github.com/dimkr]My GitHub profile[/url]

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#35 Post by jamesbond »

@charlie6
To display existing partitions you need to re-trigger udev. See my comment for Karl, in the previous page.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

Post Reply