ignorantguru / udevil Goto Github PK
View Code? Open in Web Editor NEWMount without password
Home Page: http://ignorantguru.github.com/udevil/
License: GNU General Public License v3.0
Mount without password
Home Page: http://ignorantguru.github.com/udevil/
License: GNU General Public License v3.0
README for udevil v0.4.4 Homepage: http://ignorantguru.github.io/udevil/ Downloads: https://github.com/IgnorantGuru/udevil/tree/pkg Official Forum (for udevil & SpaceFM): https://sourceforge.net/p/spacefm/discussion/general/ CONTENTS DESCRIPTION PACKAGES INSTALLER BUILD BUILD NEXT CREATE DEB PACKAGE POST INSTALL Kernel Polling Networks and Files NTFS-3G Set SUID systemd Service ENABLE KERNEL POLLING UNINSTALL TRANSLATE LICENSE DESCRIPTION Mounts and unmounts removable devices and networks without a password (set suid), shows device info, monitors device changes. Emulates mount's and udisks's command line usage and udisks v1's output. Includes the devmon automounting daemon. Run 'udevil --help' for usage. See /etc/udevil/udevil.conf for config. http://ignorantguru.github.com/udevil/udevil--help.html http://ignorantguru.github.com/udevil/udevil.conf.txt PACKAGES Find or add packages, forum threads, and other info for your distro: https://github.com/IgnorantGuru/spacefm/wiki/Distros For other distros: See INSTALLER below NOTE: See POST INSTALL section below for post-installation steps. INSTALLER A self-extracting installer is available (udevil-x.x.x-installer.sh): https://github.com/IgnorantGuru/udevil/tree/pkg (To save a file, click on its filename and click 'View Raw') The installer requires the build dependencies listed below in BUILD. If any dependencies are missing, examine the error, install missing packages, and try again. The installer MUST be run in a terminal. It automatically builds and installs. Run it like this: bash udevil-x.x.x-installer.sh or to see options: bash udevil-x.x.x-installer.sh --help To reinstall or upgrade, just run the latest installer again. NOTE: See POST INSTALL section below for post-installation steps. BUILD 1) Install required build dependencies (below are Debian package names - packages names on your distro may vary but should be similar): libglib2.0-0 libglib2.0-dev libudev0 (>=143) libudev-dev autotools-dev build-essential fakeroot intltool pkg-config Also recommended for network support: cifs-utils curlftpfs sshfs Also recommended if using devmon: eject spacefm|zenity configure will report anything missing when you run it as shown below. 2) Use these commands to download the udevil tarball and build: # Download & Extract mkdir /tmp/udevil-build && cd /tmp/udevil-build wget -O udevil.tar.gz https://github.com/IgnorantGuru/udevil/tarball/master tar xzf udevil.tar.gz cd IgnorantGuru-udevil-* # Build & Install ./configure --prefix=/usr make sudo make install # Remove Temporary Files cd / && rm -rf /tmp/udevil-build NOTES: * If configure reports missing dependencies, install them and run configure again before proceeding to make. * By default, systemd configuration files for devmon are installed to: /etc/conf.d/devmon /usr/lib/systemd/system/[email protected] To skip installation of these files, use configure option --disable-systemd In either case, systemd is NOT required. * See POST INSTALL section below for post-installation steps. BUILD NEXT The git 'next' branch of udevil is a work in progress which eventually becomes the next release version. To build from this branch, install the required build dependencies listed above in BUILD, then: # Download & Extract mkdir /tmp/udevil-next && cd /tmp/udevil-next wget -O udevil-next.tar.gz https://github.com/IgnorantGuru/udevil/tarball/next tar xzf udevil-next.tar.gz cd IgnorantGuru-udevil-* # Build, & Install ./configure --prefix=/usr make sudo make install # Remove Temporary Files cd / && rm -rf /tmp/udevil-next CREATE DEB PACKAGE To build a deb file of udevil on your Debian-based distro: 1) Install build dependencies (see BUILD section above) plus 'debhelper'. 2) Use these commands to download and extract the udevil tarball (be sure to USE A TMP BUILD PATH THAT DOES NOT CONTAIN SPACES): mkdir /tmp/udevil-build && cd /tmp/udevil-build # no spaces in path # Note: you can change "master" to "next" if you want the next branch: wget -O udevil.tar.gz https://github.com/IgnorantGuru/udevil/tarball/master tar xzf udevil.tar.gz cd IgnorantGuru-udevil-* 3) Move the distros/debian directory into the source directory: mv distros/debian . 4) Build package: (the package files will appear in the parent directory) dpkg-buildpackage -b -uc cd .. && rm -rf IgnorantGuru-udevil-* udevil.tar.gz 5) To install the package you built: dpkg -i udevil*.deb POST INSTALL Kernel Polling -------------- You may need to enable kernel polling for device media to be detected by udevil. See ENABLE KERNEL POLLING section below. Networks and Files ------------------ By default, /etc/udevil/udevil.conf is set to allow only local fileystems and ISO files to be mounted, with mounting of networks disallowed. To allow networks and files to be mounted, in /etc/udevil/udevil.conf set: allowed_types = $KNOWN_FILESYSTEMS, file, cifs, nfs, curlftpfs, sshfs, davfs You may also need to install curlftpfs or ftpfs (ftp://), cifs or smbfs (smb://), sshfs (ssh://), and davfs2 (http://). NTFS-3G ------- If local ntfs filesystems aren't mounted writable, you may need to configure your system to mount ntfs with ntfs-3g (on some distros this is already done). For example: sudo ln -s /sbin/mount.ntfs-3g /sbin/mount.ntfs # OR if mount.ntfs-3g is located in /usr/bin: sudo ln -s /usr/bin/mount.ntfs-3g /usr/bin/mount.ntfs Set SUID -------- After installing udevil, /usr/bin/udevil should have the suid bit already set. If not, set it like this: sudo chown root:root /usr/bin/udevil sudo chmod u+s,go-s,ugo+x /usr/bin/udevil ls -l /usr/bin/udevil -rwsr-xr-x 1 root root 226625 May 22 08:13 /usr/bin/udevil OR, to restrict execution of udevil to the 'plugdev' group only: sudo chown root:plugdev /usr/bin/udevil sudo chmod u+s,go-s,o-x /usr/bin/udevil ls -l /usr/bin/udevil -rwsr-xr-- 1 root plugdev 226625 May 22 08:13 /usr/bin/udevil OR, if you don't want to use udevil for mounting, you can unset suid: sudo chown root:root /usr/bin/udevil sudo chmod ugo-s,ugo+x /usr/bin/udevil ls -l /usr/bin/udevil -rwxr-xr-x 1 root root 226625 May 22 08:13 /usr/bin/udevil You can also limit users and groups by editing /etc/udevil/udevil.conf systemd Service --------------- To start devmon as a systemd service: systemctl start devmon@<user> ENABLE KERNEL POLLING You may need to enable kernel polling for device media to be detected by udevil. For example, if you insert a CD and udevil's monitor command doesn't report a change to the device, or udevil doesn't see a filesystem on the device, this is a symptom that kernel polling is not enabled. Kernel polling is a newer feature of the Linux kernel and udev, so some distros don't yet have it enabled by default. To use kernel polling, your Linux kernel may need to be 2.6.38 or newer, and udev may need to be version 173 or newer. TO DETERMINE IF KERNEL POLLING IS ENABLED: cat /sys/module/block/parameters/events_dfl_poll_msecs cat /sys/block/sr0/events_poll_msecs If you get 0 or -1 from both of those commands, kernel polling may be disabled. TO ENABLE KERNEL POLLING PERMANENTLY (survives a reboot), add the following command to your /etc/rc.local file (anywhere before the 'exit' line in that file): echo 2000 > /sys/module/block/parameters/events_dfl_poll_msecs Any number between 2000 and 5000 (milliseconds) should be reasonable - the higher 5000 means poll every 5 seconds, which is less overhead but a little slower. OR pass this option to the kernel boot command line in grub: block.events_dfl_poll_msecs=2000 OR add a udev rule to enable kernel polling on removable devices: echo 'ACTION=="add", ATTR{removable}=="1", \ ATTR{events_poll_msecs}=="-1", ATTR{events_poll_msecs}="2000"' \ > /etc/udev/rules.d/61-removable-storage-polling.rules A reboot will be required for the above changes to take effect, or... TO ENABLE KERNEL POLLING TEMPORARILY AND IMMEDIATELY, enable common polling for the block module: sudo bash -c 'echo 2000 > /sys/module/block/parameters/events_dfl_poll_msecs' OR you can enable polling just for a single device like this (/dev/sr0 in this example): sudo bash -c 'echo 2000 > /sys/block/sr0/events_poll_msecs' This change should be immediate - media will be detected. However, the above change will be lost when you reboot. References: http://www.mail-archive.com/[email protected]/msg15714.html http://blogs.gentoo.org/mgorny/2011/06/20/uam-can-now-mount-cds-and-dvds/ https://bugs.archlinux.org/task/25609 http://unix.stackexchange.com/questions/38582/ UNINSTALL If you installed from a package, use your package manager to remove udevil. Otherwise, extract the tarball and enter the directory containing configure: # first run configure with your original options if needed: ./configure sudo make uninstall # Note: /etc/udevil/ is not automatically removed TRANSLATE To help translate udevil please visit: https://github.com/IgnorantGuru/spacefm/wiki/Translate At Transifex: https://www.transifex.com/projects/p/udevil/ Just sign up for a free Transifex account. For instructions visit: http://help.transifex.com/intro/translating.html#translating LICENSE udevil - Copyright (C) 2015 GPL3+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. USE AT YOUR OWN RISK. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. See COPYING file.
Received elsewhere:
I've been playing with samba shares and can't get spacefm to ask for username and password.
After typing smb://192.168.1.100/homes into location bar, it asks for some password, but fails with same error I get if type wrong pass on mount command.
Password:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
[ Finished ] Press Enter to close
noatime and utf8 should be removed from udevil.conf for cifs because it won't recognise those options on mount.
https://bbs.archlinux.org/viewtopic.php?pid=1119602#p1119602
I've tried looking for a manpage, the conf, and the rest, but I can't find something that explains exactly where a device will end up mounted.
Say I use udevil to mount /dev/sr0, then to mount /dev/sdb1 (removable USB). Are both going to be mounted to /media? Do I have to pre-create /media/something for each? Will it create them? If so, what will it create? UUIDs? Volume Labels? /media/dev-sr0 /media/dev-sdb1? What if I have two optical drives? Do I have to have them all in /etc/fstab (which ordinary users normally don't have access rights to?
From the "usage" which is just the help dump:
EXAMPLES:
udevil mount /dev/sdd1
udevil mount -o ro,noatime /dev/sdd1
OK, so it mounts /dev/sdd1. Where? The default config says somewhere under /media, but where under /media? I can specify where, but not if I want automounting. Nor does it say that it will or will not create /media/sdd1 if it doesn't exist if I do so.
The application is for a CLI only raspberry pi - I'm hoping to do a raspian deb package and use udevil, but I'm unlikely to use SpaceFM - which might handle it all in a way I can ignore everything when using it, but if it creates /run/media/whomeverIam/really-long-uuid123412o95u83958293409293478203unrelatedtothedevice and I have to decode it, it will be less useful.
What I really want to do is to have a /mnt directory, and for every /dev/sr* and /dev/sd[a-z][1-8], mount (maybe automatically) on /mnt/sd[a-z][1-8], 1 to 1. And something similar and simple for network links. I don't think that is what will happen by default, nor do I see a way in the conf file to achieve this. Extra but unnecessary would be to add symlinks to/from UUIDs and/or Volume Labels.
I can run it and find out what it appears to do, and see if I can get it to do what I want, but this should be something documented somewhere easy to find and understand the exact behavior. And on the manpage (is it really that stub or did I miss something)
By default attempting to mount an exfat volume through SpaceFM results in the following error:
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
FUSE exfat 1.0.1
I haven't looked at the code but a quick investigation suggests udevil creates the '/media//.udevil-mount-point' file inside the directory to mount over. As this is harmless, in order to get the volume to mount I:
After saving, the next mount attempt worked.
I am trying to use Devmon (started by systemd on ArchlinuxARM(RasPi)) to automatically start services on mount of an external USB drive. This drive is usually plugged in at boot, causing devmon to ignore the --exec-on-label statement.
Replugging the drive when the devmon daemon is already running results in the script getting executed.
Is this intended behaviour?
If yes, would it be possible to add an option to also execute on initial mounts caused by the devmon daemon starting up?
cat /etc/conf.d/devmon
ARGS="--exec-on-label Anystore /home/pi/scripts/on_mount.sh"
I would like to request a Wildcard for allowed_media_dirs that also matches /.
The zsh shell has */ for this, so I would suggest either that or just **.
Adding this line (assuming most people's $DISPLAY is :0) will allow the zenity popups or notify-send commands to display properly.
--- /etc/systemd/system/[email protected] 2012-12-12 22:26:35.109264009 -0800
+++ /usr/lib/systemd/system/[email protected] 2012-12-12 12:03:27.000000000 -0800
@@ -4,7 +4,6 @@
[Service]
Type=simple
User=%i
-Environment=DISPLAY=:0
EnvironmentFile=/etc/conf.d/devmon
ExecStart=/usr/bin/devmon $ARGS
Thanks!
Scott
Followed the instructions in the readme and got this error on running dpkg-buildpackage:
Making check in po
make[2]: Entering directory /tmp/udevil-build/IgnorantGuru-udevil-b0e84cb/po' make[2]: *** No rule to make target
../src/realpath.c', needed by udevil.pot'. Stop. make[2]: Leaving directory
/tmp/udevil-build/IgnorantGuru-udevil-b0e84cb/po'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/tmp/udevil-build/IgnorantGuru-udevil-b0e84cb'
dh_auto_test: make -j1 check returned exit code 2
make: *** [build] Error 29
dpkg-buildpackage: error: debian/rules build gave error exit status 2
Hi,
I prepared Russian translation, see
https://gist.github.com/4045389
Currently udevil can not use IPv6 URLs:
$ ping6 ::1 PING ::1(::1) 56 data bytes 64 bytes from ::1: icmp_seq=1 ttl=64 time=0.030 ms 64 bytes from ::1: icmp_seq=2 ttl=64 time=0.051 ms ^C --- ::1 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 999ms rtt min/avg/max/mdev = 0.030/0.040/0.051/0.012 ms
$ udevil mount smb://[::1]/public udevil: trying cifs as guest mount error: could not resolve address for ::1: Unknown error udevil: trying with user=localusername mount error: could not resolve address for ::1: Unknown error
Is devmon able to automount network shares or is this feature planned?
I have udevil 0.4.3
When I run devmon --unmount-removable a box pops up saying
Unmounting /dev/sdc...
(This dialog will close when the devices are unmounted.)
Then the dialog goes away, but the device is not unmounted, because the device is busy. That's fine, but http://igurublog.wordpress.com/downloads/script-devmon/ says that "If an unmounting error occurs, a pop-up dialog will announce it." This dialog reporting the error is what I'm not seeing. Is there something else I need to do to get that error dialog to appear?
Thank you,
James Dietrich
I'm trying to create a NixOS package for udevil.
Nix works by installing everything to /nix/store then symlinking the "currently installed" software to the root directories like /bin, /etc, /share.
So a package should create directories like /nix/store/buildhash-udevil-version/etc
then Nix will symlink the files and folders in the store directory to /etc.
In order to do this, Nix adds the --prefix=/nix/store/buildhash-udevil-version/
option when running ./configure
.
Unfortunately, during the make install
step, udevil attempts to make the /etc/udevil
directory, even when a prefix is specified. This occurs in the Makefile for the /etc
directory (the install-data-hook
step).
Here is the Nix expression I am using to build the package:
{ stdenv, fetchurl, glib, udev, fakeroot, intltool, pkgconfig }:
stdenv.mkDerivation rec {
version = "0.4.3";
name = "udevil-${version}";
src = fetchurl {
url = "http://github.com/IgnorantGuru/udevil/archive/${version}.tar.gz";
sha256 = "02b2pk7z3ms8j6718jdprsi564pyfn7p03amc30q4wgqp922d7f4";
};
buildInputs = [ glib udev fakeroot intltool pkgconfig ];
preferLocalBuild = true;
meta = with stdenv.lib; {
description = "Mount without password";
longDescription = ''
Mounts and unmounts removable devices and networks without a password
(set suid), shows device info, monitors device changes. Emulates mount's
and udisks's command line usage and udisks v1's output. Includes the
devmon automounting daemon.
Run 'udevil --help' for usage. See /etc/udevil/udevil.conf for config.
http://ignorantguru.github.com/udevil/udevil--help.html
http://ignorantguru.github.com/udevil/udevil.conf.txt
'';
homepage = https://github.com/IgnorantGuru/udevil;
downloadPage = https://github.com/IgnorantGuru/udevil/releases;
license = licenses.gpl3Plus;
maintainers = [ maintainers.prikhi ];
platforms = platforms.linux;
};
}
And the output from configure/make:
installing `udevil-0.4.3'
these derivations will be built:
/nix/store/idfrwzn82sjwbs1sw8ppb5gzlhhc307r-udevil-0.4.3.drv
building path(s) `/nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3'
building /nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3
unpacking sources
unpacking source archive /nix/store/jfh7cnyz7zc1xmj6pjhb8r8xmzkrar4r-0.4.3.tar.gz
source root is udevil-0.4.3
patching sources
configuring
fixing libtool script ./ltmain.sh
configure flags: --disable-static --disable-dependency-tracking --prefix=/nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3
checking for a BSD-compatible install... /nix/store/581vm17nkn6g1hcq8gdvnmhkvn4msbsy-coreutils-8.23/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /nix/store/581vm17nkn6g1hcq8gdvnmhkvn4msbsy-coreutils-8.23/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether NLS is requested... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... none
checking for intltool >= 0.21... 0.50.2 found
checking for intltool-update... /nix/store/k6ahpblz2zm8252a990rp3wqxjx7vs85-intltool-0.50.2/bin/intltool-update
checking for intltool-merge... /nix/store/k6ahpblz2zm8252a990rp3wqxjx7vs85-intltool-0.50.2/bin/intltool-merge
checking for intltool-extract... /nix/store/k6ahpblz2zm8252a990rp3wqxjx7vs85-intltool-0.50.2/bin/intltool-extract
checking for xgettext... /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/xgettext
checking for msgmerge... /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgmerge
checking for msgfmt... /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt
checking for gmsgfmt... /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt
checking for perl... /nix/store/pxmj3a5lm13v9zqdclr18874r28iq606-perl-5.16.3/bin/perl
checking for perl >= 5.8.1... 5.16.3
checking for XML::Parser... ok
checking whether to enable maintainer-specific portions of Makefiles... no
checking for library containing strerror... none required
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /nix/store/a6jx7dzh299ap2rh3di57gh48jiy18zg-gnugrep-2.20/bin/grep
checking for egrep... /nix/store/a6jx7dzh299ap2rh3di57gh48jiy18zg-gnugrep-2.20/bin/grep -E
checking for ANSI C header files... yes
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for a sed that does not truncate output... /nix/store/kd8ab7h91rb7gwmmk4fml8778l8izd04-gnused-4.2.2/bin/sed
checking for fgrep... /nix/store/a6jx7dzh299ap2rh3di57gh48jiy18zg-gnugrep-2.20/bin/grep -F
checking for ld used by gcc... /nix/store/q547sj1apn6m7cqg6qlhlfw6v5viwwzi-gcc-wrapper-4.8.3/bin/ld
checking if the linker (/nix/store/q547sj1apn6m7cqg6qlhlfw6v5viwwzi-gcc-wrapper-4.8.3/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /nix/store/vi0wcqxwxqrrnmpm0mxbq84rgw7s16xw-binutils-2.23.1/bin/nm -B
checking the name lister (/nix/store/vi0wcqxwxqrrnmpm0mxbq84rgw7s16xw-binutils-2.23.1/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /nix/store/q547sj1apn6m7cqg6qlhlfw6v5viwwzi-gcc-wrapper-4.8.3/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /nix/store/vi0wcqxwxqrrnmpm0mxbq84rgw7s16xw-binutils-2.23.1/bin/nm -B output from gcc object... ok
checking for sysroot... no
./configure: line 7272: /usr/bin/file: No such file or directory
checking for mt... no
checking if : is a manifest tool... no
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/nix/store/q547sj1apn6m7cqg6qlhlfw6v5viwwzi-gcc-wrapper-4.8.3/bin/ld) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
checking whether /nix/store/q547sj1apn6m7cqg6qlhlfw6v5viwwzi-gcc-wrapper-4.8.3/bin/ld accepts --as-needed... yes
checking whether /nix/store/q547sj1apn6m7cqg6qlhlfw6v5viwwzi-gcc-wrapper-4.8.3/bin/ld accepts -O1... yes
checking whether /nix/store/q547sj1apn6m7cqg6qlhlfw6v5viwwzi-gcc-wrapper-4.8.3/bin/ld accepts -Bsymbolic-functions... yes
checking for pkg-config... /nix/store/5kjxj474bj02hg3w6vq6ps9yg7y5g8rk-pkg-config-0.28/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking for GLIB... yes
checking for LIBUDEV... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for LC_MESSAGES... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking for ngettext in libc... yes
checking for dgettext in libc... yes
checking for bind_textdomain_codeset... yes
checking for msgfmt... (cached) /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt
checking for dcgettext... yes
checking if msgfmt accepts -c... yes
checking for gmsgfmt... (cached) /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt
checking for xgettext... (cached) /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/xgettext
checking for catalogs to be installed... ru
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating po/Makefile.in
config.status: creating man/Makefile
config.status: creating etc/Makefile
config.status: creating src/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
config.status: executing default-1 commands
config.status: executing po/stamp-it commands
udevil....................................... : Version 0.4.3
Linux device support......................... : libudev
mount program................................ : /bin/mount
umount program............................... : /bin/umount
losetup program.............................. : /sbin/losetup
setfacl program.............................. : /usr/bin/setfacl
install devmon systemd service............... : yes
Installation Prefix.......................... : /nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3
The binary will be installed as /nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3/bin/udevil
Homepage: http://ignorantguru.github.com/udevil/
building
make flags: SHELL=/nix/store/kly624h55gf91frdhn8fjzi6xricgkzk-bash-4.2-p53/bin/bash
building config.h
building all
make all-recursive
make[1]: Entering directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3'
building all-recursive
Making all in etc
make[2]: Entering directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/etc'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/etc'
Making all in po
make[2]: Entering directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/po'
building de.gmo
file=`echo de | sed 's,.*/,,'`.gmo \
&& rm -f $file && /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt -o $file de.po
building es.gmo
file=`echo es | sed 's,.*/,,'`.gmo \
&& rm -f $file && /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt -o $file es.po
building fr.gmo
file=`echo fr | sed 's,.*/,,'`.gmo \
&& rm -f $file && /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt -o $file fr.po
building it.gmo
file=`echo it | sed 's,.*/,,'`.gmo \
&& rm -f $file && /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt -o $file it.po
building pl.gmo
file=`echo pl | sed 's,.*/,,'`.gmo \
&& rm -f $file && /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt -o $file pl.po
building pt_BR.gmo
file=`echo pt_BR | sed 's,.*/,,'`.gmo \
&& rm -f $file && /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt -o $file pt_BR.po
building ru.gmo
file=`echo ru | sed 's,.*/,,'`.gmo \
&& rm -f $file && /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt -o $file ru.po
building sv.gmo
file=`echo sv | sed 's,.*/,,'`.gmo \
&& rm -f $file && /nix/store/xcr79dff95kgd2bca4pnrhnvlih855md-gettext-0.18.2/bin/msgfmt -o $file sv.po
make[2]: Leaving directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/po'
Making all in src
make[2]: Entering directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/src'
building udevil-udevil.o
gcc -DHAVE_CONFIG_H -I. -I.. -DPACKAGE_LOCALE_DIR=\""/nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3/share/locale"\" -fstrict-aliasing -fmessage-length=0 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -I/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/include/glib-2.0 -I/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/lib/glib-2.0/include -I/nix/store/nxzp7kmxkyp55n8bx0b6lw40w4vcpnwq-systemd-217/include -Werror-implicit-function-declaration -g -O2 -c -o udevil-udevil.o `test -f 'udevil.c' || echo './'`udevil.c
building udevil-device-info.o
gcc -DHAVE_CONFIG_H -I. -I.. -DPACKAGE_LOCALE_DIR=\""/nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3/share/locale"\" -fstrict-aliasing -fmessage-length=0 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -I/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/include/glib-2.0 -I/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/lib/glib-2.0/include -I/nix/store/nxzp7kmxkyp55n8bx0b6lw40w4vcpnwq-systemd-217/include -Werror-implicit-function-declaration -g -O2 -c -o udevil-device-info.o `test -f 'device-info.c' || echo './'`device-info.c
building udevil-canonicalize.o
gcc -DHAVE_CONFIG_H -I. -I.. -DPACKAGE_LOCALE_DIR=\""/nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3/share/locale"\" -fstrict-aliasing -fmessage-length=0 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_REENTRANT -D_FILE_OFFSET_BITS=64 -I/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/include/glib-2.0 -I/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/lib/glib-2.0/include -I/nix/store/nxzp7kmxkyp55n8bx0b6lw40w4vcpnwq-systemd-217/include -Werror-implicit-function-declaration -g -O2 -c -o udevil-canonicalize.o `test -f 'canonicalize.c' || echo './'`canonicalize.c
building udevil
/nix/store/kly624h55gf91frdhn8fjzi6xricgkzk-bash-4.2-p53/bin/bash ../libtool --tag=CC --mode=link gcc -I/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/include/glib-2.0 -I/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/lib/glib-2.0/include -I/nix/store/nxzp7kmxkyp55n8bx0b6lw40w4vcpnwq-systemd-217/include -Werror-implicit-function-declaration -g -O2 -Wl,--as-needed -Wl,-O1 -Wl,-Bsymbolic-functions -o udevil udevil-udevil.o udevil-device-info.o udevil-canonicalize.o -L/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/lib -lglib-2.0 -L/nix/store/nxzp7kmxkyp55n8bx0b6lw40w4vcpnwq-systemd-217/lib -ludev
libtool: link: gcc -I/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/include/glib-2.0 -I/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/lib/glib-2.0/include -I/nix/store/nxzp7kmxkyp55n8bx0b6lw40w4vcpnwq-systemd-217/include -Werror-implicit-function-declaration -g -O2 -Wl,--as-needed -Wl,-O1 -Wl,-Bsymbolic-functions -o udevil udevil-udevil.o udevil-device-info.o udevil-canonicalize.o -L/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/lib /nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/lib/libglib-2.0.so -L/nix/store/nxzp7kmxkyp55n8bx0b6lw40w4vcpnwq-systemd-217/lib /nix/store/nxzp7kmxkyp55n8bx0b6lw40w4vcpnwq-systemd-217/lib/libudev.so -pthread -Wl,-rpath -Wl,/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/lib -Wl,-rpath -Wl,/nix/store/nxzp7kmxkyp55n8bx0b6lw40w4vcpnwq-systemd-217/lib -Wl,-rpath -Wl,/nix/store/2vfjv98il57s88qaqasjkh1jygbzi4xm-glib-2.42.1/lib -Wl,-rpath -Wl,/nix/store/nxzp7kmxkyp55n8bx0b6lw40w4vcpnwq-systemd-217/lib
make[2]: Leaving directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/src'
make[2]: Entering directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3'
building config.h
make[2]: Leaving directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3'
make[1]: Leaving directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3'
installing
install flags: install SHELL=/nix/store/kly624h55gf91frdhn8fjzi6xricgkzk-bash-4.2-p53/bin/bash gsettingsschemadir=/nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3/share/gsettings-schemas/udevil-0.4.3/glib-2.0/schemas/
building install-recursive
Making install in etc
make[1]: Entering directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/etc'
building install-am
make[2]: Entering directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/etc'
make[2]: Nothing to be done for `install-exec-am'.
building install-data-am
make install-data-hook
make[3]: Entering directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/etc'
building install-data-hook
test -d /etc/udevil || mkdir -p -- /etc/udevil
mkdir: cannot create directory '/etc/udevil': Permission denied
make[3]: *** [install-data-hook] Error 1
make[3]: Leaving directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/etc'
make[2]: *** [install-data-am] Error 2
make[2]: Leaving directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/etc'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/tmp/nix-build-udevil-0.4.3.drv-0/udevil-0.4.3/etc'
make: *** [install-recursive] Error 1
builder for `/nix/store/idfrwzn82sjwbs1sw8ppb5gzlhhc307r-udevil-0.4.3.drv' failed with exit code 2
error: build of `/nix/store/idfrwzn82sjwbs1sw8ppb5gzlhhc307r-udevil-0.4.3.drv' failed
You can see the correct path is set during the configure step:
Installation Prefix.......................... : /nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3
The binary will be installed as /nix/store/536pny4cdwf7jzx0xckcc0qc95g0wicc-udevil-0.4.3/bin/udevil
Ideally the Makefile in the /etc
sub-directory would also use this path, but for some reason this is not happening.
I forgot umount smbfs before shutdown my archlinux, shutdown process will stick on Unmounting Non-API Filesystems
for about 2 minutes. I found that rc.shutdown
stop network daemon before umount_all
. So is it possible udevil provide an option to umount all the network fs, that we can use it in rc.local.shutdown
to stop them before rc.shutdown
kill daemons.
I have a DVD with a disk label that happen to yield a mount point name that end with a space character after truncating. This result in that I cannot unmount using udevil as udevil trims away any trailing spaces from the path.
$ udevil mount /dev/sr0
Mounted /dev/sr0 at /media/name that ends with space
$ udevil umount /media/name\ that\ ends\ with\ space\
udevil: error 68: cannot stat '/media/name that ends with space'
$ udevil umount /dev/sr0
udevil: error 68: cannot stat '/media/name that ends with space'
The disk label in the above example is different from the actual disk label on my DVD.
Hello,
as title states, commit 'a34da033a3ee815248c38e060bace246837c1384' had erroneously overwritten 'ru.po' by 'pt_BR.po'. Please revert this particular change.
I came across a strange behavior -- when I mount, unmount and remount an .iso file as a normal user, everything is ok. The same with root user. When I mount it as a normal user and try to unmount it as root, everything seems to be fine, at least to the next mount action as a normal or root user of unmounted file.
I got an error:
udevil: denied 94: file /media/Server/iso/archlinux-2013.03.01-dual.iso is already mounted (or specify mount point)
I have specified "allowed_media_dirs = /media, /run/media/$USER" in /etc/udevil/udevil.conf . But there is no mount points in those locations.
When I try to switch users and mount an .iso file first as root and unmount it as a normal user, everything is ok, even the next mount of the .iso file.
I was using two instances of spacefm -- one with normal user privileges and the second with root.
After reboot, I typed from root:
Mounted /media/Server/iso/archlinux-2013.03.01-dual.iso at /media/archlinux-2013.03.01-dual.iso
udevil: success running umount as current user
udevil: denied 94: file /media/Server/iso/archlinux-2013.03.01-dual.iso is already mounted (or specify mount point)
Mounted /media/Server/iso/archlinux-2013.03.01-dual.iso at /media/test
udevil: success running umount as current user
Then, I tried with another .iso file:
Mounted /media/Server/iso/aptosid.iso at /media/aptosid.iso
udevil: success running umount as current user
udevil: denied 94: file /media/Server/iso/aptosid.iso is already mounted (or specify mount point)
So, it looks like I can mount a file only once. The second mount action gets the error because there is no mount point specified. So, I think that's why spacefm gets the error too.
This only exist with .iso files. Mounting a device is fine. And there is no other way but rebooting in order to make spacefm work again with .iso files.
Is this possible? I guess what makes it not work currently, is the fact that everything
is run as root. So ~root/.ssh/ is used, and the env SSH_AGENT_PID and SSH_AUTH_SOCK
are not inherited etc etc.
Hi, at work (Windows environment) I tried to mount a webdav share using SpaceFM (0.8.6). This exited with an error by lack of (my work) login data (name & password). Using a terminal, udevil (0.4.0) + mount worked fine, I got asked to give login and then password. These steps seem to be bypassed in SpaceFM context (because for this one would expect an input-dialog panel to provide the requested information and this does not happen) and the connection fails.
Have I missed something in setting this up??
Cheers,
Rob
PS After mounting the share using udevil from the terminal, SpaceFM presents the share without a problem.
Relevant config options:
allowed_types = ... file ...
llowed_devices = /dev/*
forbidden_devices =
allowed_files = *
forbidden_files =
allowed_options_file = ..., loop, ...
$ udevil mount -oloop some/image.img mount-point
losetup: /path/to/some/image.img: Warning: file does not fit into a 512-byte sector; the end of the file will be ignored.
Mounted /path/to/some/image.img at /path/to/mount-point
$ udevil umount mount-point
udevil: denied 86: '/dev/loop0' is not a permitted file
I also tried setting allowed_internal_devices_file = /dev/loop*, but that changed nothing.
Also, what's up with that losetup warning? I don't get this using mount as root.
The directory created when a dvd or cd is automounted is not removed when the disc is ejected using the eject button on the disk drive.
Using udevil 1.41 with spacefm 0.8.7 very sucessfully in alphaOS. I would like to add obdevicemenu but don't really want to add udisks to the mix. I've worked a bit at substituting udevil for udisks and the sticking point seems to be udevil support of the enumerate option, particularly --enumerate-device-files. Any suggestions or plans to support the enumerate option?
After some digging through old mail, i've decided to revive this idea:
Make udevil mounter app that accepts mount profiles (ini-style files) and integrates them in desktop experience.
Benefits: mount profile can contain certain mount options needed for specific network share.
By using external helper, umount command will redirect request to udevil.
This mechanism should work by adding uhelper=udevil mount option to mounts and adding /sbin/umount.udevil binary.
From umount man:
The syntax of external unmount helpers is:
/sbin/umount.suffix {directory|device} [-flnrv] [-t type.subtype]
where suffix is the filesystem type or a value from a "uhelper=" or
"helper=" mtab option. The -t option can be used for filesystems with
subtypes support (for example /sbin/mount.fuse -t fuse.sshfs).The uhelper= (unprivileged unmount helper) mount option can be used
when non-root users need to be able to unmount a mountpoint which is
not defined in /etc/fstab (e.g. devices mounted by udisk).The helper= mount option redirects all unmount requests to the
/sbin/umount.type helper independently of UID.
Options for helper (from umount.nfs help):
-f force unmount
-v verbose
-n Do not update /etc/mtab
-r remount
-l lazy unmount
So if user or something in the system decides to unmount udevil-controlled mountpoint with simple umount command, it would be actually unmounted with udevil (cleaning dir, etc).
In default config of udevil 0.4.2 release fmask=0133 option is not listed in allowed_options.
Filesystems which have fmask=0133 default option are not mountable by default.
Hi,
Could you please add support for mounting mtp devices through go-mtpfs.
https://github.com/hanwen/go-mtpfs
Other implemetations are painfully slow and unstable while go-mtpfs works perfectly with my android phone.
Currently I'm running script to automount with udev rule, but it would be nice to see phones and media players as devices in SpaceFM.
Thanks.
The need for reboot is slightly exaggerated.
Udev rules can be reloaded with:
udevadm control --reload
Therefore newly plugged in device will be set with correct polling interval.
Also one can trigger existing removable devices to be processed with new rule:
udevadm trigger --attr-match=removable=1 --action=add --verbose
Are there any plans to add WebDAV support (maybe via davfs2 or neon)?
when udisks2 mounts volume to /media/$USER/mountpoint, it sets restrictive permissions on /media/$USER:
$ getfacl /media/localuser/ getfacl: Removing leading '/' from absolute path names user::rwx user:localuser:r-x group::--- mask::r-x other::---
So only localuser and members of root group have access.
It would be great if udevil had some way to configure permissions of parent (e.g. $USER) component of mountpoint path.
Permissions of mountpoint itself usually depend on target filesystem or mount options, and in many cases can not be easily tweaked. But parent directory can be.
Hi,
I'm trying to mount a network drive at my university using
udevil mount smb:///USER:PSK@SERVER/USER$ LABEL
However, this fails when I input PSK directly. The reason seems to be that PSK is put in with quotes. So the command udevil uses call
ROOT: /bin/mount -v -t cifs -o nosuid,noexec,nodev,uid=1000,gid=100,user=USER,domain=DOMAIN,password="PSK" //SERVER/USER$ /media/LABEL
but
ROOT: /bin/mount -v -t cifs -o nosuid,noexec,nodev,uid=1000,gid=100,user=USER,domain=DOMAIN,password=PSK //SERVER/USER$ /media/LABEL
works (i.e. when I remove quotes from PSK).
From previous bug reports it seems this is a feature, but I'm not sure.
Thanks,
Ramsus
Hi!
On many occasions I leave the office forgetting about unmounting cifs resource.
Freezes happen when spacefm (or anything else) tries to access mounted, but physically unavailable network resource.
I know that unmount restriction for unavailable resources is a security feature, but there should be an optional override. Otherwise, sudo is the only option if you forgot to unmount a resource before disconnecting from network.
More, I suggest a configurable automatic action with timeout: if resource is unavailable for $TIME, unmount it.
Lintian says:
I: udevil: spelling-error-in-binary usr/bin/udevil priviledges privileges
N:
N: Lintian found a spelling error in the given binary. Lintian has a list
N: of common misspellings that it looks for. It does not have a dictionary
N: like a spelling checker does.
N:
N: If the string containing the spelling error is translated with the help
N: of gettext or a similar tool, please fix the error in the translations
N: as well as the English text to avoid making the translations fuzzy. With
N: gettext, for example, this means you should also fix the spelling
N: mistake in the corresponding msgids in the *.po files.
N:
N: You can often find the word in the source code by running:
N:
N: grep -rw
N:
N: This tag may produce false positives for words that contain non-ASCII
N: characters due to limitations in strings.
N:
N: Severity: minor, Certainty: wild-guess
N:
N: Check: binaries, Type: binary, udeb
N:
Patch for that: https://github.com/mati75/udevil/blob/master/debian/patches/fix-spelling-error.patch
The command
mount LABEL=backup /media/backup
Works but requires a password.
The command:
udevil mount LABEL=backup /media/backup
returns
udevil: error 40: cannot stat LABEL=backup: No such file or directory.
(there is a similar problem in spacefm, if you change the default mount command from "/usr/bin/udevil --verbose mount -o %o %v" to "/usr/bin/udevil --verbose mount -o %o %l" and then try and mount something you get - "udevil: error 40: cannot stat %: No such file or directory")
Perhaps it isn't meant to work with labels, Perhaps it is a bug, or perhaps I am doing something wrong?
Over to you.
Hi!
After some testing in environment with lots of flash drives and usb HDDs I had to edit udevil.conf to add fmask=0133 to vfat and ntfs default parameters.
Even though noexec is default, all files copied from mounted media are treated as executables which is not handy and not secure.
I suggest making fmask=0133 default for filesystems with no or poorly supported permissions, like vfat and ntfs.
Hello,
please find updated Russian translation in this gist:
https://gist.github.com/vp1981/7823347
This gist contains two files: 'master-ru.po' and 'next-ru.po'.
udevil mount "/home/user/VIDEO/a-takemht.iso"
udevil: error: cannot stat /home/user/VIDEO/a-takemht.iso: Value too large for defined data type
https://bbs.archlinux.org/viewtopic.php?pid=1106463#p1106463
See topic - from SpaceFM/udevil's perspective the user is expected to Remove the device, but this is not normal behaviour (the user expects to manually eject the drive and remove the media, and the OS/programs Just Know).
This means that tabs containing the previous disc's contents are not closed, and attempts to browse a newly-inserted disc on these tabs fail because udevil/spacefm considers the disc already mounted.
You can kill all these tabs then try again - then it seems the old media directory remains but the contents is from the new disc.
What's the reasoning behind this? The lines responsible are udevil.c:2224,2225.
The commit behind these lines suggests something about potential race conditions?
I am about to write a initscript for Gentoo's OpenRC init system to start devmon as non-root user at boot on a headless NAS. I would like to have USB flash drives and SD-Cards automatically mounted when plugged in, so that any user logged into the system is able to access them without the need of typing mount commands.
Therefore I added a new user for devmon:
useradd -c "added by me for devmon" -d "/dev/null" -g plugdev -M -N -r -s /sbin/nologin devmon
devmon is then started with user devmon and group plugdev. On Gentoo plugdev is the group that enables users to mount and use pluggable devices such as cameras and USB sticks.
Automatic mounting of removable storage devices works, but users in the group plugdev don't have write access:
ls -al /media/
total 24
drwxr-xr-x 3 root root 4096 3. Nov 23:25 .
drwxr-xr-x 21 root root 4096 10. Okt 01:26 ..
drwxr-xr-x 5 devmon plugdev 16384 1. Jan 1970 USB DISK
I see that umask, fmask & dmask are invalid mount options.
So, is there any way to provide write access to users that are in the group plugdev?
Hi :)
IgnorantGuru requested so I obey.
I am opening this to let you all know about a quick port I've made, so that you can use bashmount (which was designed for udisks) with udevil. The "port" was easy enough because udevil seem to mimic pretty well the udisks syntax and also the output format, which bashmount relies upon.
You can download the patch here:
http://www.jesgue.es/files/bashmount-udevil-1.6.2.7z
If you don't use gentoo, just pick the file under the "files/" directory, and ignore disregard the rest. The patch is for bashmount 1.6.2, and it needs udevil 0.4.2, because at that point was introduced the --enumerate-device-files parameter, which bashmount uses internally. Previous versions won't work!
Only pendrive related stuff has been tested, because my dvd drive has gone the way of the dodo. But I am willing to fix stuff if you report issues.
Thanks for reading, and I hope this is useful for someone.
Regards.
The udevil doc says that to enable kernel polling I will need udev-173 or later. The distro provides by default only udev-171-r8, which is obviously lover. Another options are -189..-194, but they require kmod and presumably some (significant?) changes in the booting process in the way which is unclear to me. I couldn't find any migration guide or some other reading to understand what to do. Does anybody uses kernel polling on Gentoo or derivatives?
As a continuation of #47 and in the light of upcoming protocol handlers in SpaceFM, I propose to add 'prepare' command to udevil.
Rationale: what if you want to mount something unsupported by udevil or SpaceFM to the standard mount path (/media/, /media/$USER/, /run/media/$USER, etc)? User can not create dirs in /media or /run/media. Udevil could help:
Running:
udevil prepare
(without further arguments) would ensure that directories listed in 'allowed_media_dirs' are created and have correct permissions set (including $USER components).
Running:
udevil prepare /media/my_mountpoint
would prepare a user-owned mountpoint (if allowed by 'allowed_media_dirs') to be further used in script or handler.
Also support arguments for 'clean'
Not every filesystem supports to be mount in non-empty location, so marking udevil mountpoint by placing file inside could not be an option.
udevil clean /media/my_mountpoint
could be used to safely remove empty dir.
While safe removing a usb hard drive is considered good practice, I found that only udisks --detach did the job. Neither eject -s nor right-clicking and Remove/Eject in the spacefm menu made the usb device sleep. hdparm -Y just turned my hard drive crazy.
I think safe removing is a quite important feature though. When udevil implements this, it will be the time I finally wipe udisks out of my computer :)
The command executed on unmount will replace %d
and %l
-the mount point and the label- using values from the latest mounted device, instead of the one being unmounted. The %f
-device path-, however, is correct.
Steps to reproduce
./devmon --exec-on-unmount "echo [%d] [%f] [%l]"
/dev/sdb1
, label is USB-A
, mount point is /media/USB-A
./dev/sdc1
, label is USB-B
, mount point is /media/USB-B
../devmon --unmount /media/USB-A
Obtained result
The following is printed:
[/media/USB-B] [/dev/sdb1] [USB-B]
Expected result
The following should be printed:
[/media/USB-A] [/dev/sdb1] [USB-A]
or even, maybe:
[] [/dev/sdb1] [USB-A]
given the fact that the mount point, at this moment, doesn't actually exist any more (however it might come handy for scripts running after devices are unmounted).
Currently the partition list is generated using
grep " sd[a-z0-9]*$" /proc/partitions
A small change to
grep " [ms]d[a-z0-9]*$" /proc/partitions
and a similar change to the sed string which follows would allow devmon to automount removable RAID devices as well (such as the one I'm now using for external backup).
This would be entirely safe in my opinion and not cause any change in behaviour unless the user sets "--internal" in /etc/conf.d/devmon and sets allowed_internal_devices in /etc/udevil/udevil.conf
Suppose we have this SMB: smb://example/ShareFolder .
If we mount this on an OSX machine, system will mount it on /Volume/ShareFolder.
In udevil, this ShareFolder is ignored(/media/smb-example
), but we have some metadata in our mount point name. How about we use this format for cifs/smb ?
/media/<share_folder>-<server_name>-smb
In this format, we type less characters to get tab completion, we still prevent share folders' name collision with metadata suffix.
EDIT Please close not an issue any more
aah its my distro TinyCoreLinux and maybe xz package, retried in Debian all is good
(Trivia) am attempting to build some tczs for TinyCore
Hi
0.3.5 gz file opens ok but I am getting the following error for 0.3.6
tar xvf udevil-0.3.6.tar.xz
xz: (stdin): File format not recognized
tar: Child returned status 1
tar: Error is not recoverable: exiting now
also I can use mc to look inside 0.3.5 but not .6
cheers
The 'noload' option cannot be passed to udevil, either through the configuration file or on the command line. It is necessary to prevent writing to ext3/4 when mounting read-only in the event of a dirty file system.
Using udevil 0.4.3-1
on Arch Linux and with fuse-exfat 1.0.1-1
, I am not able to mount an exfat formatted USB drive. This is the error message:
FUSE exfat 1.0.1
fuse: mountpoint is not empty
fuse: if you are sure this is safe, use the 'nonempty' mount option
zsh: exit 1 udevil mount /dev/sdb1
Trying to pass -o nonempty
to fuse does not work, because udevil
doesn't allow for that option.
Note, exfat-utils
is not sufficient for mounting, because there udevil
complains:
udevil mount /dev/sdb1
mount: unknown filesystem type 'exfat'
zsh: exit 32 udevil mount /dev/sdb1
Here is the udevil info
output for the partition I am trying to mount:
Showing information for /org/freedesktop/UDisks/devices/sdb1
native-path: /sys/devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.2/2-1.2:1.0/host9/target9:0:0/9:0:0:0/block/sdb/sdb1
device: 8:17
device-file: /dev/sdb1
presentation: /dev/sdb1
by-id: /dev/disk/by-id/usb-Corsair_Voyager_3.0_1101300000000653-0:0-part1
system internal: 0
removable: 1
has media: 1
is read only: 0
is mounted: 0
mount paths:
presentation hide: 0
presentation nopolicy: 0
presentation name:
presentation icon:
automount hint:
size: 32128336384
block size: 512
usage: filesystem
type: exfat
version: 1.0
uuid: 976D-58DE
label:
partition:
scheme: mbr
number: 1
type: 0x07
flags:
offset: 32256
alignment offset: 0
size: 32128336384
label:
uuid:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.