summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/udev/udev/init
Commit message (Collapse)AuthorAgeFilesLines
* eudev: Replaces udev with eudev for compatibility when using sysvinit on ↵Alejandro Hernandez2016-03-021-142/+0
| | | | | | | | | | | | | | | | | | | newer kernels udev has started to fail on new kernels (4.4), due to being deprecated in favor of systemd's udev implementation. To maintain a sysvinit alternative we also need to provide an alternative to udev. Eudev is a fork of systemds udev, this new eudev recipe provides upstream udev 220 funcitonality. - Removes patches that dont apply anymore - ToDo: eudev-ptest? [YOCTO #8998] (From OE-Core rev: a22797f7c37a865420837b5c29b270f73ee4c6ce) Signed-off-by: Alejandro Hernandez <alejandro.hernandez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev-cache: avoid using '-L' for statChen Qi2015-01-291-1/+1
| | | | | | | | | | | | | | | | | stat command from stat package doesn't support '-L' option, so avoid using it to get rid of boot errors like below. Populating dev cache stat: invalid option -- 'L' Usage: stat [-l] [-f] [-s] [-v] [-h] [-t] [-c format] file1 [file2 ...] [YOCTO #7210] (From OE-Core rev: 4ef8cc01906833847386fd441d87a89cbdda7e25) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev-cache: invalidate on rules.d changesRichard Tollerton2014-12-191-0/+6
| | | | | | | | | | | | | | | Presently, the cache is not regenerated if udev rules are modified, which may cause the cache to preserve an old configuration. To fix, include the size, mtime, and filename of all udev rules in the system configuration. This change requires `stat`. If busybox supplies stat, CONFIG_FEATURE_STAT_FORMAT must be enabled. (From OE-Core rev: 8847e33b12171a21b7c7e1241198080ad9ef9284) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev-cache: always warn on console if invalidatedRichard Tollerton2014-12-191-3/+1
| | | | | | | | | | | Failure to use the udev cache is a significant enough impact to the boot time (possibly seconds) that it should always be reported on the console, regardless of the VERBOSE setting. (From OE-Core rev: 9e588bbf9477d57f0a46d92ce11f8f891115496c) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev-cache: Clean up message when cache is invalidatedRichard Tollerton2014-12-191-4/+7
| | | | | | | | | | | Replace a bunch of echo's with a single cat<<EOF. Take this opportunity to more clearly communicate what is going on with the cache and what files are being looked at. (From OE-Core rev: d768772a1259d3659d0424c39e65eeb3443af86c) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev-cache: refactor sysconf generationRichard Tollerton2014-12-191-4/+11
| | | | | | | | | | | | | | The current system configuration needs to be generated both inside udev (to compare against the cached system configuration) and udev-cache (to regenerate the cached system configuration). Use a single function definition for this task, duplicated across both initscripts. This also allows administrators to modify it for machine-specific requirements. (From OE-Core rev: 34957afcfe663eed4f5ebec0891a84467e67a48d) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev-cache: don't generate sysconf twiceRichard Tollerton2014-12-191-1/+4
| | | | | | | | | | | | The udev initscript signals udev-cache to run by generating a new sysconf; but udev-cache now overwrites that with its own copy. To eliminate the needless sysconf generating in udev, we instead trigger udev-cache to run by touching a new file $DEVCACHE_REGEN. (From OE-Core rev: 8d2325be2d03086b7e5a02618edb05b19fbcdc48) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev-cache: replace readfiles() with cmpRichard Tollerton2014-12-191-22/+7
| | | | | | | | | | | | | | | | | | | | | Currently, udev-cache system configurations are compared as shell string variables, read into memory with the readfiles() function. This is more complex, and significantly (27-41%) slower, than comparing them using `cmp`. (Performance was verified on both Cortex-A9 and Intel Nehalem systems.) So just use cmp. This requires a few other small changes: exclude /proc/atags from CMP_FILE_LIST if it doesn't exist to avoid errors in `cat` and `cmp`. `cmp -q` doesn't exist in busybox, so instead, redirect output to /dev/null. (From OE-Core rev: e8ea6a29ed3ab9892a3bc7ee8249f10688c0af29) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev: fix uevent-helper disableJohan Hovold2014-11-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | Make sure that /proc/sys/kernel/hotplug exists before trying to disable the uevent-helper mechanism. Since kernel commit 86d56134f1b6 ("kobject: Make support for uevent_helper optional.") the kernel can be built without uevent-helper support. In this case /proc/sys/kernel/hotplug does not exist and the current sysvinit script fails with /etc/rcS.d/S04udev: line 132: can't create /proc/sys/kernel/hotplug: nonexistent directory when trying to disable the uevent-helper mechanism during boot. Note that a single NULL-character has always been sufficient to disable. (From OE-Core rev: f7b8445f2e89ad0a59c2859f9eb26855769f1070) Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev-cache: parametrize sysconf file pathsRichard Tollerton2014-08-231-4/+6
| | | | | | | | | | | | The udev-cache facility uses files that represent system states, to ensure that the cache tarball is valid to apply. These paths were hardcoded in several places; collect them into SYSCONF_CACHED and SYSCONF_TMP. (From OE-Core rev: f4fcb237da0d1013005e9a0bb2381cfeb4c5316c) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev-cache: Don't ignore error messages from cache extractRichard Tollerton2014-08-231-1/+1
| | | | | | | | | | | | | Previous changes should obviate all known spurious errors coming out of tar. Since real extraction failures can and will occur, stop redirecting stdout/stderr to /dev/null. Take this opportunity to also remove an unnecessary subshell. (From OE-Core rev: 09089962be353280201ba3899fd5ef9cc3c0ba32) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev-cache: strip timestamps on extractRichard Tollerton2014-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | Under normal udev operation, device nodes are obviously timestamped based on the system time at current boot. However, when using udev-cache, they are timestamped from a previous boot. The existence of machines lacking RTCs makes this more than a cosmetic issue: if the current time is set further on in the boot, so that the system time is still 1970 by the time the cache is extracted, tar will print a timestamp warning for every extracted file (potentially hundreds of them). To fix, use -m on extract. If using busybox `tar`, this commit requires CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y. (From OE-Core rev: b31f8f1f053cdfa9428e3f667c05e7e2c600061e) Signed-off-by: Richard Tollerton <rich.tollerton@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev: fix /var/volatile/tmp permissionsRiku Voipio2014-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Mariadb postinstall will fail with: ERROR: 1 Can't create/write to file '/tmp/#sql_a2a_0.MAI' (Errcode: 13) 140814 8:14:06 [ERROR] Aborting /tmp is a link to /var/volatile/tmp, set as: drwxr-xr-x 3 root root 60 Aug 14 08:07 . populate-volatiles.sh does not create the directory or set permissions, because it already exists: Checking for -/var/volatile/tmp-. Creating directory -/var/volatile/tmp-. Target already exists. Skipping. Traced the creation to the initfile in udev. Create with -m 1755 to be sure. With this patch applied, mysql postinst succeeds and creates the neccesary user tables. (From OE-Core rev: 5743c7632ac9c33051f6fca60f5507d3808e8e3a) Signed-off-by: Riku Voipio <riku.voipio@linaro.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev: update init script for conditional probing of platform busDenys Dmytriyenko2014-06-251-1/+6
| | | | | | | | | | | | | | | | | Make probing of "platform" bus conditional based on PROBE_PLATFORM_BUS variable from /etc/default/udev-cache on subsequent boots when udev cache is used. PROBE_PLATFORM_BUS has to be set to "yes" in order to force probing on every boot, otherwise it uses the old default behaviour of probing it just the first time. This is helpful on modern SoCs where most of the low level peripheral drivers are registered on the platform bus and need to be probed to load the necessary modules and enable the connected buses and subsystems. (From OE-Core rev: 70a695735e0a7d14448f2f5a9986bfe105210a91) Signed-off-by: Denys Dmytriyenko <denys@ti.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* sysvinit: adjust boot sequence and remove hack from udevChen Qi2013-11-081-1/+3
| | | | | | | | | | | | | | | | | | | | | Adjust the boot sequence in sysvinit based systems. The mountall.sh (mounting the local file system) needs to be started before udev and bootlogd. This patch makes mountall.sh start before udev and removes the hack of mounting tmpfs in the udev init script. This patch also adds some comments to the udev init script to make it clear why we create the '/var/volatile/tmp' directory. [YOCTO #5273] (From OE-Core rev: f6a9df6b7cd411b52e71022b8f7bf8bda6395649) 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>
* udev: remove implicit dependency on initscriptsChen Qi2013-08-161-4/+12
| | | | | | | | | | | | | | | | | | 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>
* udev-cache: take a read-only rootfs into considerationChen Qi2013-07-021-22/+32
| | | | | | | | | | | | | | | | | | | | | | 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>
* udev: only use devtmpfs for udevAlex Olson2013-06-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | 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>
* udev-cache: fix to use udev-cache correctlyChen Qi2013-06-251-1/+5
| | | | | | | | | | | | | | | | | | | 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>
* udev: do not create /var/volatile/run in init scriptJonathan Liu2013-05-291-1/+0
| | | | | | | | | | | | | | | | 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>
* udev: create /var/volatile/tmp to avoid dead linkChen Qi2013-04-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
* udev: remove explicit path to udevadmRoss Burton2013-04-181-5/+5
| | | | | | | (From OE-Core rev: cc0f22cd1e93cc25647add1a3339e150572e4fce) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev: Update initscript to check for devtmpfsSaul Wold2013-04-131-0/+8
| | | | | | | | | | | | 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>
* udev: fix init script for the location of udevdSaul Wold2013-04-091-2/+2
| | | | | | | | | 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>
* udev: Modify init script to use the correct path of udevadmAndrei Gherzan2013-02-111-5/+5
| | | | | | | | | | 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>
* udev: Add start/stop/status/restart support to init scriptJesse Zhang2013-02-081-49/+64
| | | | | | | | | | | | | | [ 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>
* udev: fix failed /dev/shm mountJohan Hovold2012-12-191-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* udev: Ensure tmpfs are mounted and volatile/run existsRichard Purdie2012-10-301-3/+2
| | | | | | | | | | | | | | 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>
* udev: upgrade to 182Alexandru DAMIAN2012-10-251-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* udev-164: fixup "don't hardcode path to pidof"Andreas Oberritter2012-03-131-1/+1
| | | | | | | | | * 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>
* udev-164: don't hardcode path to pidofAndreas Oberritter2012-03-081-4/+2
| | | | | | | | | | * 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>
* udev: improve udev-cache robustnessOtavio Salvador2012-02-021-3/+30
| | | | | | | | | | | | | * 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>
* udev: ensure /dev/pts and /dev/shm does existsOtavio Salvador2012-01-061-2/+3
| | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev: use 'echo' instead of 'echo -n' in init scriptOtavio Salvador2012-01-051-2/+1
| | | | | | | | | | 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>
* udev: skip mounting /dev on tmpfs if it is on devtmpfsOtavio Salvador2012-01-031-1/+1
| | | | | | | (From OE-Core rev: 08b2bb292ec9da38e399fe4fe00da5cc0ee0ea4c) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev: use tabs for init script (no code changes)Otavio Salvador2012-01-031-19/+19
| | | | | | | (From OE-Core rev: d6b7ff13a64c6ff2aa8d1ee089733c9aada539a9) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* udev: reorganize files of 164 versionOtavio Salvador2012-01-031-0/+59
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>