Commit Graph

29 Commits

Author SHA1 Message Date
Nitin A Kamble b925c752c0 udev: avoid autosuspend of USB input devices
Some of the external USB devices has internal USB hub, which
make them look like "fixed" rather than "removable". And USB
autosuspend does not work with some of these devices resulting
in inoperable pointing device.

Now the code detect these false "fixed" devices by looking at their
parents.  If any of their parent is "removable", then USB autosuspend
is not enabled for that device, which keeps the pointing device
functional.

Fixes bug:
[YOCTO #5166]

(From OE-Core rev: d74a0ecdbc85a482cab6e7eae8dcb48185d44d84)

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
Signed-off-by: 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-09-17 14:35:17 +01:00
Chen Qi 11660bc1c6 udev: remove implicit dependency on initscripts
At some point, the udev was modified to source the functions from
initscripts or lsbinitscripts. This dependency is actually not needed.
If we use udev in a system where initscripts from oe-core is not available,
there will be errors.

This patch fixes this problem by removing the implicit dependency.

[YOCTO #4882]
[YOCTO #4103]

(From OE-Core rev: 72d6825c24f4c3e4a7a907cf0a09e2e8f7720ae8)

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>
2013-08-16 11:14:35 +01:00
Chen Qi 28786ec6cc udev-cache: take a read-only rootfs into consideration
In case of a read-only rootfs, we skip the process of generating
udev cache, as the data cannot be persisted between reboots.

However, it's possbile that the $DEVCACHE (default to /etc/dev.tar)
exists in a read-only rootfs, no matter how it's generated or installed.
In such situation, we try to use $DEVCACHE if possible.

Besides the basic changes in the logic of udev cache handling,
this patch also adds code to output more information if the udev
cache is not used and VERBOSE enabled.

This patch also changes the readfile function to readfiles function
so that it could handle more than one file at once.

(From OE-Core rev: 4ec1266e7e1aacdb9d3d0fc5cd6307b60df1731e)

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>
2013-07-02 22:23:47 +01:00
Alex Olson d85a997f2c udev: only use devtmpfs for udev
Fix for bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=4632
Since udev 172, the 'mknod' logic was removed from udev. Yocto Dylan
is now using udev 182. This means /dev is now required to be a
devtmpfs filesystem (maintained by the kernel).    If the root
filesystem is a ramdisk,  the kernel's auto-mount of /dev doesn't
activate since there is no rootfs to actually mount...  The bug causes
an unusable system as /dev doesn't contain even basic nodes required
to even get a login prompt.

The Yocto  udev/init script mounts tmpfs if it does not detect tmpfs
or devtmpfs mounted at /dev.  This appears to be  outdated logic that
is no longer correct. I believe the Yocto udev init script should be
checking and mounting only 'devtmpfs' on dev.

(From OE-Core rev: 31ab19ab69bc6504df01cac7ee0670ca78d247ab)

Signed-off-by: Alex Olson <alex.olson+yocto@gmail.com>

[YOCTO #4632]

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-06-28 09:14:05 +01:00
Chen Qi 9d68aa5e35 udev-cache: fix to use udev-cache correctly
Previouly, the udev-cache has no real effect even if it's installed
into the system. The key problem here is that at first boot, the
/etc/dev.tar is not present, thus resulting /dev/shm/udev.cache not
created on first boot even if udev-cache is enabled.

This patch fixes this problem. The /dev/shm/udev.cache will be created
if necessary, that is, on first boot or when some part of the system is
changed. In the latter case, the udev cache may not be valid.

[YOCTO #4738]

(From OE-Core rev: 84e0ec2e677fb0236a38478372cdd75797cf5a2e)

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>
2013-06-25 17:44:56 +01:00
Jonathan Liu cd19f768cf udev: do not create symbolic link from /run to /var/run
The /run directory is now a tmpfs with /var/run as a symbolic link
pointing to /run.

(From OE-Core rev: 691593177aa78a56ce138f1041872bebca2aa056)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-29 22:07:57 +01:00
Jonathan Liu 90b4d3d06d udev: do not create /var/volatile/run in init script
Previously in udev init, /var/volatile/run had to be created after
mounting all tmpfs filesystems so that udevd can write to /var/run
(a symbolic link to /var/volatile/run). This is because udev is
started before populate-volatile.sh.

Now that /var/run is a symbolic link to /run (a tmpfs filesystem),
/var/volatile/run doesn't need to be created anymore.

(From OE-Core rev: d557f6615701c9f2f461a10c30de1d9572424266)

Signed-off-by: Jonathan Liu <net147@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-29 22:07:57 +01:00
Chen Qi cab467dfd7 udev: create /var/volatile/tmp to avoid dead link
If it's not first boot, /tmp has already been symlinked to /var/volatile/tmp.
But the udev service starts before populate-volatile.sh starts. This leads to
a dead link at /tmp. As a result, trying to create any file under /tmp will
fail.

If a USB is plugged in before the populate-volatile.sh script starts, the
/tmp/.automount-$name file will not be created correctly. As a result, when
the USB is unplugged, the /media/$name directory is not removed.

So we create /var/volatile/tmp directory in the udev script to avoid this dead
link problem.

[YOCTO #3404]

(From OE-Core rev: 2f93c8466ca146c965585ea38210ddb5fb5754bd)

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>
2013-04-28 12:12:21 +01:00
Ross Burton f6ae64553d udev: remove explicit path to udevadm
(From OE-Core rev: cc0f22cd1e93cc25647add1a3339e150572e4fce)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-18 00:37:57 +01:00
Saul Wold b378cb7560 udev: Update initscript to check for devtmpfs
This is needed because the udev_182 now requires devtmpfs and will not work correctly
with out, so ensure that the kernel contains devtmpfs by checking /proc/filesystems.

[YOCTO #4125]

(From OE-Core rev: 4f85bb5254b3f4a9db8b419947d4bde424ce9617)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-13 23:49:28 +01:00
Saul Wold 307e860860 udev: fix init script for the location of udevd
Ensure we can update the script base don the location of the udevd installation

(From OE-Core rev: 25ff5960e41b9d7c62b05a08dd77cf11390962a1)

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-04-09 18:09:14 +01:00
Ross Burton f76d4b3549 udev: move /run volatile entry to udev instead of initscripts
initscripts is generally installed on systemd-using images, but because it
specifies that /run is a symlink to /var/run managed by volatiles it totally
breaks systemd by copying/deleting /run from underneath systemd.  Deleting
sockets mid-boot doesn't leave systemd in a happy place.

As this volatile reference of /run was introduced by udev 182, move it's
reference to the udev recipe.  This way it will never be present on systemd
images, as systemd manages /run as a tmpfs itself.

(From OE-Core rev: 5b0257e318340c2d6c8d3b0c3fa32272d6e9526b)

Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-03-26 22:43:05 +00:00
Andrei Gherzan bee0b38726 udev: Modify init script to use the correct path of udevadm
udevadm is installed in /usr/bin not in /usr/sbin. Init script modified
accordingly.

(From OE-Core rev: b8ba1e3db44d2443e0071d4923101280151ccd03)

Signed-off-by: Andrei Gherzan <andrei@gherzan.ro>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-11 14:32:18 +00:00
Jesse Zhang a38e4d91cf udev: Add start/stop/status/restart support to init script
[ CQID: WIND00388860 ]

Add the ability to use "stop", "start", "restart" and "status"
with the udev initscript.

(From OE-Core rev: bc6193824ec3eb1f3c590a93ccb79c8588b74412)

Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-02-08 14:50:38 +00:00
Johan Hovold 632fefd108 udev: fix failed /dev/shm mount
Since commit commit fbec192f6bc4 ("udev: Ensure tmpfs are mounted and
volatile/run exists") all tmpfs-entries in fstab are mounted before udev
starts using mount -a. If /dev/shm is among those entries, that mount
will fail as the mount point has not yet been created:

   Starting udev
   mount: mounting tmpfs on /dev/shm failed: No such file or directory
   udevd[474]: starting version 182

Fix by restoring the old way of mounting /dev and mounting the
remaining tmpfs-entries only after /dev/shm has been created.

Also make sure that any errors are supressed for these tmpfs-mounts.
Should any mount point not yet be present, that mount will be retried
later during the boot process.

(From OE-Core rev: f2ce905a92a2b5ff0a434249dc8468e3ee36aa63)

Signed-off-by: Johan Hovold <johan.hovold@lundinova.se>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-12-19 17:55:00 +00:00
Richard Purdie 4801ed7915 udev: Ensure tmpfs are mounted and volatile/run exists
There is a race with udev where eiher the run directory can get replaced
during bootup leading to ude errors, or if the tmpfs was mounted and
populate-volatiles hasn't run, udev won't start at all.

This ensures that any tmpfs get mounted before udev starts and that the
default volatiles/run directory at least exists, fixing the races
and boot time errors caused after the recent udev upgrade.

(From OE-Core rev: fbec192f6bc41a335ede85843ba22a89d13501ab)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-30 11:06:38 +00:00
Alexandru DAMIAN 4d7b2d2944 udev: upgrade to 182
This is the final upgrade of udev. Futher upgrades will only
come in conjunction with systemd.

The v4l1 removal patch is deprecated as the bug is fixed inside udev.
There is a new patch fixing the path for default sh interpreter.
New debug binaries are generated, and udev.inc is modified to package
those correctly.
The install locations changed for udevd and udevadm, so the scripts
are updated accordingly.

(From OE-Core rev: 3cbe52b94c4d559a037347ac419fafee5af84fe6)

(From OE-Core rev: 8fc73baecf1b21b1a3e7eff478e25d2a7cae2879)

Signed-off-by: Alexandru DAMIAN <alexandru.damian@intel.com>

Conflicts:

	meta/recipes-core/udev/udev_164.bb

sgw - Fixed up DEPENDS += and added some OECONF options that where in the
meta-oe version and make sense to be included.

Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-10-25 17:50:19 +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
Jesse Zhang 9eea1ebe3e udev: don't mount with -o sync
mount.sh mounts all partitions with -o sync, which is bad for system
performance.

(From OE-Core rev: d49cf73754150b50a911d326aaa666f5da78855c)

Signed-off-by: Jesse Zhang <sen.zhang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 13:19:21 +01:00
Khem Raj 734e1a9197 udev: Fix build with eglibc 2.16
Include sys/resource.h to get definition of
PRIO_PROCESS

(From OE-Core rev: 6b74c8edac0a4a468741ab7cc4ecef74314d2043)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-17 10:54:00 +01:00
Robert P. J. Day ef6e25a8dc pcmcia-cs: Remove references to long-deprecated pcmcia-cs.
pcmciautils is the appropriate PCMCIA package these days.

(From OE-Core rev: 5066f7e9750253bc4678f2884e15f0333e60932b)

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-04 17:40:31 +01:00
Andreas Oberritter e867a99d97 udev-164: fixup "don't hardcode path to pidof"
* Remove -e shell option, because pidof may return nonzero.

(From OE-Core rev: b35c5e83d9f2e63917c2604046fb1a6d70a2a524)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-13 11:45:11 +00:00
Andreas Oberritter 62a2a41194 udev-164: don't hardcode path to pidof
* pidof lives in /bin, search it in $PATH.
* Assume pidof's presence.

(From OE-Core rev: 2f9ac0a10f7d1e3144622a5dff5aa6787fcee534)

Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-03-08 11:55:33 -08:00
Otavio Salvador ac62f06e09 udev: improve udev-cache robustness
* allow udev-cache to be disabled at runtime (using
   /etc/default/udev-cache);

 * make cache invalidated if kernel, bootparams or device list
   changes;

(From OE-Core rev: 22b72b23653736436f10d394de36201c32630d5d)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-02-02 16:55:32 +00:00
Otavio Salvador 8178e63649 udev: ensure /dev/pts and /dev/shm does exists
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-06 12:11:33 +00:00
Otavio Salvador 53efd43855 udev: use 'echo' instead of 'echo -n' in init script
Avoid using two stage progress output to avoid text garbage during
parallel boot.

(From OE-Core rev: 7b3912883acaf4539d5d9cb974330778b6c85340)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-05 11:24:48 +00:00
Otavio Salvador b5d6121bbb udev: skip mounting /dev on tmpfs if it is on devtmpfs
(From OE-Core rev: 08b2bb292ec9da38e399fe4fe00da5cc0ee0ea4c)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-03 12:14:28 +00:00
Otavio Salvador d97d07c5ef udev: use tabs for init script (no code changes)
(From OE-Core rev: d6b7ff13a64c6ff2aa8d1ee089733c9aada539a9)

Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-01-03 12:14:28 +00:00
Otavio Salvador e412dbf6cd udev: reorganize files of 164 version
We merged both files and udev-164 directory onto a single directory
and renamed udev-new.inc onto udev.inc as we have a single version of
udev now.

(From OE-Core rev: abde2a045a39a70a6247a7ae591a131120ab8ed3)

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