Commit Graph

15 Commits

Author SHA1 Message Date
Jens Rehsack db4376ed64 udev-extraconf: introduce multiple blacklist files for more complex setups
In cases where a target image wants prevent the recovery partition is mounted
automatically, but the recovery partition identifier moves with the device
(internal flash, sd card, usb stick, ...), device/machine dependend extra
blacklists might be desired.

The grep utility prints the file name for each match when there is more
than one file to search. Add -h to suppress the prefixing of file names
on output.

(From OE-Core rev: 95fced137a46dc98863fe5af7be5cbce708602f2)

Signed-off-by: Jens Rehsack <sno@netbsd.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-01-06 15:27:34 +00:00
Yasir-Khan 0cd5af0272 udev-extraconf: Unmount SD card after ejection
Adds udev rule to unmount SD card partitions in case of improper
ejection from card reader.

When SD card is ejected from card reader without being unmounted
first, kernel does not generate a REMOVE event, instead it
generates a CHANGE event(only if polling is enabled
/sys/module/block/parameters/events_dfl_poll_msecs) and we don't
have any udev rule in automount.rules to handle this event,so
partitions never get unmounted. Unmounting of partitions can be
done if udev rules handle this CHANGE event.

(From OE-Core rev: 140d188b3665f914396834168feeff6ffcb64d76)

Signed-off-by: Abbas Raza <Abbas_Raza@mentor.com>
Signed-off-by: Yasir-Khan <yasir_khan@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-08-15 18:21:50 +01:00
Chen Qi 1899511918 udev-extraconf: fix the misuse of /run/media
The error was introduced by the following commit.

  acfe3014d41de5e87cdbc58d0396349c6b9c3ffd
  udev-extraconf: update mount.sh to use /run/media instead of /media

It accidently replaced 'device/media' by 'device/run/media' which causes
error for live images to be unable to boot up correctly, complaining
"Cannot find rootfs.img in /media/*".

This patch fixes the above problem.

(From OE-Core rev: 62ae16c40252f39ba28e072218d67f47b26b3535)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-05-20 14:53:12 +01:00
Denys Dmytriyenko 20ded0a263 udev-extraconf: update mount.sh to use /run/media instead of /media
This is done to work around the issue of auto-mounting block devices
(i.e. SD cards) when root filesystem is still in read-only mode and
creating /media/<device> mount-points by udev is not possible. That
is due to udev (/etc/rcS.d/S03udev) getting started earlier than
checkroot (/etc/rcS.d/S10checkroot.sh) gets a chance to re-mount the
rootfs as read-write.

Although, canonical FHS specifies /media/<device> as a mount point
for removable media devices, the latest 2.3 version was released in
2004 and since then FreeDesktop/udisks and other tools adopted the
new /run/media/<user>/<device> location. That was done to overcome
read-only rootfs limitation, since /run is usually a tmpfs mounted
partition, plus avoid name-clash between users.

For our embedded systems environment we assume single-user operation
and hence simplify mount point to just /run/media/<device>. But for
proper per-user mounting to /run/media/<user>/<device>, some sort of
session management is required along with the tool like udisks, that
is out of scope of this simple udev-based auto-mounting.

(From OE-Core rev: acfe3014d41de5e87cdbc58d0396349c6b9c3ffd)

Signed-off-by: Denys Dmytriyenko <denys@ti.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2014-04-25 17:19:20 +01:00
Chen Qi 96eff4c25d mount.sh: automount cdrom device even if no ID_FS_TYPE available
This script was modified to check whether $ID_FS_TYPE is empty before
automount, however, for cdrom devices on qemu, the ID_FS_TYPE is not
set, yet the device should be mounted. Otherwise, when booting an iso
image with runqemu, the boot process hangs at 'waiting for removable
media'.

This patch fixes this problem by first checking whether the block device
is a cdrom.

[YOCTO #4487]

(From OE-Core rev: 2df21a3b27543df912a3ce05bef2415fae13cb7c)

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-09-10 22:58:33 +01:00
Hongxu Jia 565956f82f udev-extraconf: allow users in disk group to write vfat filesystem
If filesystem type is vfat, change the ownership group to 'disk', and grant it
with  w/r/x permissions.

The user which belongs to 'disk' group could write the storage.

[YOCTO #4004]

(From OE-Core rev: eeed0cebebc945bf62b29336b9df8e2c0a975538)

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-18 21:23:45 +01:00
Jackie Huang 8e10031d9d udev-extraconf: blacklist /dev/dm-*
Do not mount /dev/dm-* by default via udev, this is the default
behavior for most distos and WRLinux4.x.

This resolved a problem with the sanity test failing due to seeing
the error while attempting to mount new logical volumes without fs.

(From OE-Core rev: 9a6cf08afd81c95abf13e6cf5e43bb8cd777edd9)

Signed-off-by: Xin Ouyang <Xin.Ouyang@windriver.com>
Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-07-05 15:34:21 +01:00
Otavio Salvador 6a7aa9cac2 udev-extraconf: Avoid mounting unknown filesystems
Depending on kernel version used, the system can hung when trying to
mount the extended partition (not the logical one) as it is a holder
for other partitions and does not have a filesystem in it.

To avoid this to happen we just mount partitions when these are using
known filesystems so it does not try to mount a partition for an
unsupported filesystem.

Reported-by: Vladan Jovanovic <vladan.jovanovic@gmail.com>
Reported-by: Leonardo Sandoval Gonzalez <b42214@freescale.com>
(From OE-Core rev: 895c9685a7f95dc84786213f945895a504a16254)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Tested-by: Vladan Jovanovic <vladan.jovanovic@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-28 12:12:20 +01:00
Saul Wold 52ac480974 udev-extraconf: Add -o silent to auto mount for mount.util-linux
This will silence some of the noisy output from mount.util-linux and the kernel
when trying to automount filesystems or devices. Busybox does not accept the silent
option, it uses a loud option instead.

[YOCTO #3935]

(From OE-Core rev: be218292ee3f05afe47545aa8e1625452e0cd614)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-13 23:54:19 +01:00
Darren Hart 530b3b3cd4 udev-extraconf: Add rule adding input devices to input group
Fixes [YOCTO 4164](2/3)

Add all /dev/input/* devices to the input group with g+rw.  This is
needed for rootless X without adding a security hole by making the
device o+rw.

(From OE-Core rev: 66c9b46f987f3e4f1f9b7b11d1ae157897454f07)

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
Cc: Saul Wold <sgw@linux.intel.com>
Cc: Radu Moisan <radu.moisan@intel.com>
Cc: Ross Burton <ross.burton@intel.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-04 14:04:42 +01:00
Andy Ross e281bb3e35 udev-extraconf: Don't mount root filesystem under /media
The mount.sh handler attempts to prevent already-mounted filesystems
from being mounted as dynamic/removable "/media".  But it misses the
case where the kernel has mounted the root filesystem (e.g. with
"root=/dev/sda1").  In that situation, /proc/mounts has a device name
of "/dev/root" instead of the proper $DEVNAME string exposed by udev.
So we must also test the root filesystem device number vs. the
$MAJOR/$MINOR udev tells us.

(From OE-Core rev: 3543d0db691e82098c1da7bf12f43e0c57551a3d)

Signed-off-by: Andy Ross <andy.ross@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-27 09:47:08 +01:00
Martin Jansa 94c259e0c1 udev-extraconf: change LICENSE to MIT
* Original recipe added by RP in fc128ab1e4
  was saying GPL (later GPLv2)
* COPYING.GPL was added to reflect that
* Meta-oe has similar recipe with MIT license and even more scripts, so lets
  change LICENSE here too
* Most code was derived from the meta-oe version or added to OE arguably
  under MIT and the MIT license makes most sense here

(From OE-Core rev: 54a4a0b42d4515260841229d69f9cc43485bcb78)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-04 14:08:36 +01:00
Martin Jansa 0cc01a67f1 udev-extraconf: Merge with udev-extra-rules from meta-oe
* Move parts of local.rules from udev to udev-extraconf
* Move mount.sh and network.sh to udev-extraconf along with rule fragments
* Add mount.blacklist to CONFFILES
* Change PV to 1.0 and bump PR to provide upgrade path from meta-oe's udev-extra-rules
  including RREPLACE/RPROVIDES/RCONFLICTS trio

(From OE-Core rev: 0ca3a7823e97c4e4af6e89d852f98d29ed6193d7)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-09-04 14:08:35 +01:00
Otavio Salvador 005b67f282 udev-extraconf: move mount.blacklist to udev-extraconf dir
(From OE-Core rev: bb7644b1e59fcffd0944b4f408dd90cfae7aa7a0)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-03 12:14:27 +00:00
Qing He f3fa12b976 udev-extraconf: add license info
Signed-off-by: Qing He <qing.he@intel.com>
2010-12-10 22:01:33 -08:00