Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


Problem: Installed 6.x - USB media not working (ARM6)
#11
We could switch to another auto-mounter for example udevil or udisks2, but we have to determine whether they provide the same capabilities as udisks-glue.

1. Auto-mount USB storage devices by disk label to /media
2. Support the following file systems: vfat, ntfs, exfat, hfsplus, ext2, ext3, ext4
3. Run scripts after mount and unmount and pass the mount point name to the scripts. Below is an example from disks-glue.conf of running scripts.

Code:
match vfatdisks {
    automount = true
    automount_options = {noexec,nodev,noatime,nodiratime,'dmask=0022','fmask=0022'}
    post_mount_command = '/var/www/command/util.sh smbadd "%mount_point"'
    post_unmount_command = '/var/www/command/util.sh smbrem "%mount_point"'
}

Other options include:

1. Continue with udisks-glue on arm7 and use udevil, udisks2, etc on arm6
2. Try to debug and fix udisks-glue on arm6

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#12
@Tim Curtis

It would seem option 2 would work in the short term, especially if we could buddy-up with other ARMv6 projects facing the same issue (assuming there are any). From the long-term perspective, though, it feels like we'd be throwing good money after bad.

Option 1 makes me feel uncomfortable: riding two horses at once creates interesting support issues (but then so did udisks-glue with ARMv6 vs ARMv7!)

The udisks2 and udevil projects both sound interesting. Of the two, doesn't udisk2 seem more mainstream? AIUI udisk2 picked up the mantle from udisks and would still need something like udiskie or devmon (from udevil) to replace the udisks-glue functionality. (Here I'm just skimming from https://wiki.archlinux.org/index.php/Udisks)

As exciting as the technical prospects are, with the fall term about to start at the local high school where I mentor I don't think I should commit to doing enough homework to be able to evaluate the approaches competently.

Regards,
Kent
Reply
#13
udisks2+udiskie looks like a viable option since udiskie supports running commands based on specific events. Maybe someone will test and report back.

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#14
(08-27-2019, 05:53 PM)Tim Curtis Wrote: udisks2+udiskie looks like a viable option since udiskie supports running commands based on specific events. Maybe someone will test and report back.

-Tim

I'm happy to spend some time getting udisks2+udiskie up and running, but my experience level with these sorts of thing is probably just sufficient enough to find a bunch of terminal commands to copy and paste to get something bolted on and barely working, but not necessarily good enough to provide you with much useful information after the fact...

but I can still record what I'm doing and we'll see how we go (the situation is hopefully not as dire as I'm making out.)  Blush

just a couple of questions to get me started:

1. in terms of "running commands" can all the functionality we're looking to replicate be found in the disks-glue.conf file or are there more processes going on elsewhere under the hood? (in line with what I said before, I have some experience configuring desktop linux systems, but have no idea really how moode is configured).

2. seems to me it would be a good idea to remove/clean-up udisks-glue first to avoid any interference from it, but just wondering if you could let me know how to do that effectively, just to make sure a) I get it all and b) give us some kind of known/consistent reference point. 

Cheers
Reply
#15
Hi,

2. Comment out the launch line in /etc/rc.local. This will prevent udisks-glue from being run.

1. Yes, it's all in the udisks-glue conf file.

- the list of file systems
- the command thats called after a successful mount
- the command thats called after a successful un-mount

Those commands add or remove a Samba share point.

So prolly something like:
sudo apt-get install udisks2
sudo apt-get install udiskie

Then figure out the settings in the udiskie conf file.

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#16
(08-28-2019, 12:02 AM)Tim Curtis Wrote: Hi,

2. Comment out the launch line in /etc/rc.local. This will prevent udisks-glue from being run.

1. Yes, it's all in the udisks-glue conf file.

- the list of file systems
- the command thats called after a successful mount
- the command thats called after a successful un-mount

Those commands add or remove a Samba share point.

So prolly something like:
sudo apt-get install udisks2
sudo apt-get install udiskie

Then figure out the settings in the udiskie conf file.

-Tim

I've had a little bit of time to try a few things out with this and I'm just going to list a few findings.

1. My syslog is still full of udisks-part-id SEGV's, but udiskie successfully auto-mounts drives.

2. It doesn't appear that we have all the command running options we need to port the udisks-glue funtionality. Here is the basic configuration file I've made:

Code:
program_options:
udisks_version: 2
automount:      true
notify_command: "/var/www/command/util.sh smbadd {mount_path}"

device_config:
- id_type: ntfs
 ignore:  false
 options: [noexec,nodev,noatime,nodiratime,'dmask=0022','fmask=0022']

which seems to pass the mounting options OK, but the issue is that notify_command is only available in the program options, and I'm not sure if you can trigger a different event for a mount event vs an umount event. The example in the manual:

Code:
notify_command: "zenity --info --text '{event}: {device_presentation}'"
   # [string|list] Set command to be executed on any device event.
   # This is specified like `password_prompt`.

man page here: https://raw.githubusercontent.com/coldfi...skie.8.txt

so unless you can somehow use that event attribute to perform one command over another I'm not sure. I don't know what the event/labels are. I suppose you could do something like:

Code:
notify_command: "/var/www/command/util.sh smbaddrem {mount_path} {event}"

and deal with it later on, but not sure otherwise.

3. The other problem is that MPD is not working. /etc/rc.local looks like this:

Code:
#!/bin/sh -e

SQLDB=/var/local/www/db/moode-sqlite3.db

# set cpu govenor
RESULT=$(sqlite3 $SQLDB "select value from cfg_system where param='cpugov'")
echo "$RESULT" | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor

#/usr/bin/udisks-glue --config=/etc/udisks-glue.conf > /dev/null 2>&1
/usr/bin/udiskie --config=/home/pi/.config/udiskie/config.yml > /dev/null 2>&1
/var/www/command/worker.php > /dev/null 2>&1

exit 0

if I comment out my udiskie line and uncomment the udisks-glue line MPD works like normal, but if I boot like this it doesn't appear to run at all, I get an openMPDSock() failed notification and lib-config: Connection to MPD failed and no log - so I haven't been able to test if that samba share point command has worked or not.

so there's some information for you anyway.
Reply
#17
Great, thanks.

In /etc.rc.local, udiskie might be running in the foreground and thus worker.php is never executed.

Try adding an ampersand to the end of the launch string which will cause it to run in the background.
Code:
/usr/bin/udiskie --config=/home/pi/.config/udiskie/config.yml > /dev/null 2>&1 &

To  stop udisks from running disable the service. Replace "disable" with "enable" to have it automatically start after reboot.
Code:
sudo systemctl disable udisks

sudo reboot
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#18
Hi,

Just a brief update.

I have a working udisks2 + udiskie configuration but unfortunately when inserting a USB stick containing an ISO image it crashes the OS. It should auto mount boot and roofs to /media.

It could be some sort of udiskie config setting but I can't figure it out.

I'll post a recipe sometime next week and maybe after some field testing a solution will be found.

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#19
Hi,

Update #2.

I have a working udevil + devmon solution. This config is simpler that udiskie and so it would be my choice for ARM6. The OS crash mentioned in earlier post is external to either of the auto-mount solutions. It only occurred on a Pi-1B. No issues on a Zero W.

I think what I'm going to explore is an option to choose which USB auto-mounter to use. This would allow keeping the nice disks-glue auto-mounter as the default while still providing a solution for arm6 :-)

I'm not sure I'll be able to slip this into upcoming 6.2.0 update though.

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#20
(09-01-2019, 09:52 PM)Tim Curtis Wrote: I think what I'm going to explore is an option to choose which USB auto-mounter to use. This would allow keeping the nice disks-glue auto-mounter as the default while still providing a solution for arm6 :-)

Great, thanks.
Reply


Forum Jump: