udevil/README

350 lines
11 KiB
Plaintext
Raw Normal View History

2013-12-09 22:05:47 +08:00
README for udevil v0.4.3+
2012-05-23 01:52:47 +08:00
2013-04-06 02:06:44 +08:00
Homepage:
2013-12-05 04:17:47 +08:00
http://ignorantguru.github.io/udevil/
2013-04-06 02:06:44 +08:00
Downloads:
https://github.com/IgnorantGuru/udevil/tree/pkg
2013-12-05 04:17:47 +08:00
Official Forum (for udevil & SpaceFM):
https://sourceforge.net/p/spacefm/discussion/general/
2012-05-23 01:52:47 +08:00
CONTENTS
DESCRIPTION
PACKAGES
INSTALLER
BUILD
BUILD NEXT
CREATE DEB PACKAGE
POST INSTALL
Kernel Polling
Networks and Files
NTFS-3G
Set SUID
systemd Service
2012-05-23 01:52:47 +08:00
ENABLE KERNEL POLLING
UNINSTALL
2013-02-14 21:16:17 +08:00
TRANSLATE
2012-05-23 01:52:47 +08:00
LICENSE
DESCRIPTION
2012-06-16 03:07:22 +08:00
Mounts and unmounts removable devices and networks without a password (set
2012-05-23 01:52:47 +08:00
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.
2012-05-23 01:52:47 +08:00
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
2013-02-02 01:31:08 +08:00
Find or add packages, forum threads, and other info for your distro:
https://github.com/IgnorantGuru/spacefm/wiki/Distros
2012-05-23 01:52:47 +08:00
2013-02-02 01:31:08 +08:00
For other distros:
See INSTALLER below
2012-05-23 01:52:47 +08:00
NOTE: See POST INSTALL section below for post-installation steps.
INSTALLER
A self-extracting installer is available (udevil-x.x.x-installer.sh):
2013-12-05 04:17:47 +08:00
https://github.com/IgnorantGuru/udevil/tree/pkg
2012-05-23 01:52:47 +08:00
(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
2012-06-16 03:07:22 +08:00
Also recommended for network support: cifs-utils curlftpfs sshfs
Also recommended if using devmon: eject spacefm|zenity
2012-06-16 03:07:22 +08:00
2012-05-23 01:52:47 +08:00
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
2012-05-23 01:52:47 +08:00
make
sudo make install
# Remove Temporary Files
cd / && rm -rf /tmp/udevil-build
NOTES:
2012-05-23 01:52:47 +08:00
* 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/devmon@.service
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.
2012-05-23 01:52:47 +08:00
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:
2012-05-23 01:52:47 +08:00
# 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
2012-05-23 01:52:47 +08:00
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'.
2012-06-16 03:07:22 +08:00
2) Use these commands to download and extract the udevil tarball (be sure
to USE A TMP BUILD PATH THAT DOES NOT CONTAIN SPACES):
2012-05-23 01:52:47 +08:00
2012-06-16 03:07:22 +08:00
mkdir /tmp/udevil-build && cd /tmp/udevil-build # no spaces in path
2012-05-23 01:52:47 +08:00
# 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)
2012-05-23 01:52:47 +08:00
dpkg-buildpackage -b -uc
cd .. && rm -rf IgnorantGuru-udevil-* udevil.tar.gz
5) To install the package you built:
2012-05-23 01:52:47 +08:00
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.
2012-06-16 03:07:22 +08:00
Networks and Files
------------------
By default, /etc/udevil/udevil.conf is set to allow only local fileystems
2013-02-14 06:48:53 +08:00
and ISO files to be mounted, with mounting of networks disallowed. To
2012-06-16 03:07:22 +08:00
allow networks and files to be mounted, in /etc/udevil/udevil.conf set:
allowed_types = $KNOWN_FILESYSTEMS, file, cifs, nfs, curlftpfs, sshfs, davfs
2012-06-16 03:07:22 +08:00
You may also need to install curlftpfs or ftpfs (ftp://), cifs or smbfs
(smb://), sshfs (ssh://), and davfs2 (http://).
2012-06-16 03:07:22 +08:00
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
2012-05-23 01:52:47 +08:00
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>
2012-05-23 01:52:47 +08:00
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.
2013-12-23 23:35:49 +08:00
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.
2012-05-23 01:52:47 +08:00
2013-12-23 23:35:49 +08:00
TO DETERMINE IF KERNEL POLLING IS ENABLED:
2012-05-23 01:52:47 +08:00
cat /sys/module/block/parameters/events_dfl_poll_msecs
cat /sys/block/sr0/events_poll_msecs
2013-12-23 23:35:49 +08:00
If you get 0 or -1 from both of those commands, kernel polling may be
disabled.
2012-05-23 01:52:47 +08:00
2013-12-23 23:35:49 +08:00
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):
2012-05-23 01:52:47 +08:00
2012-08-16 00:28:06 +08:00
echo 2000 > /sys/module/block/parameters/events_dfl_poll_msecs
2012-05-23 01:52:47 +08:00
2013-12-23 23:35:49 +08:00
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.
2012-05-23 01:52:47 +08:00
2013-12-23 23:35:49 +08:00
OR pass this option to the kernel boot command line in grub:
2012-08-16 00:28:06 +08:00
block.events_dfl_poll_msecs=2000
2013-12-23 23:35:49 +08:00
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...
2012-08-16 00:28:06 +08:00
2013-12-23 23:35:49 +08:00
TO ENABLE KERNEL POLLING TEMPORARILY AND IMMEDIATELY, enable common
polling for the block module:
2012-08-16 00:28:06 +08:00
sudo bash -c 'echo 2000 > /sys/module/block/parameters/events_dfl_poll_msecs'
2013-12-23 23:35:49 +08:00
OR you can enable polling just for a single device like this (/dev/sr0
in this example):
2012-05-23 01:52:47 +08:00
sudo bash -c 'echo 2000 > /sys/block/sr0/events_poll_msecs'
2013-12-23 23:35:49 +08:00
This change should be immediate - media will be detected. However, the
above change will be lost when you reboot.
2012-05-23 01:52:47 +08:00
References:
http://www.mail-archive.com/lfs-dev@linuxfromscratch.org/msg15714.html
http://blogs.gentoo.org/mgorny/2011/06/20/uam-can-now-mount-cds-and-dvds/
https://bugs.archlinux.org/task/25609
2013-12-23 23:35:49 +08:00
http://unix.stackexchange.com/questions/38582/
2012-05-23 01:52:47 +08:00
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
2013-02-14 21:16:17 +08:00
TRANSLATE
2012-05-23 01:52:47 +08:00
2013-02-14 21:16:17 +08:00
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
2012-05-23 01:52:47 +08:00
LICENSE
udevil - Copyright (C) 2015 GPL3+
2012-05-23 01:52:47 +08:00
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.