diff options
Diffstat (limited to 'meta/recipes-core/udev')
46 files changed, 898 insertions, 2617 deletions
diff --git a/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch b/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch new file mode 100644 index 0000000000..fe2ba5328d --- /dev/null +++ b/meta/recipes-core/udev/eudev/0014-Revert-rules-remove-firmware-loading-rules.patch @@ -0,0 +1,28 @@ +From 4f0a722489154da99e7f6b3051afde984eed2f74 Mon Sep 17 00:00:00 2001 +From: Jonathan Liu <net147@gmail.com> +Date: Thu, 19 Mar 2015 15:01:29 +1100 +Subject: [PATCH] Revert "rules: remove firmware loading rules" + +This reverts commit 70e7d754ddb356fb1a2942b262f8cee9650e2a19. +Userspace firmware loading support is needed for Linux < 3.7. + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Jonathan Liu <net147@gmail.com> +--- + rules/50-firmware.rules | 3 +++ + 1 file changed, 3 insertions(+) + create mode 100644 rules/50-firmware.rules + +diff --git a/rules/50-firmware.rules b/rules/50-firmware.rules +new file mode 100644 +index 0000000..f0ae684 +--- /dev/null ++++ b/rules/50-firmware.rules +@@ -0,0 +1,3 @@ ++# do not edit this file, it will be overwritten on update ++ ++SUBSYSTEM=="firmware", ACTION=="add", RUN{builtin}="firmware" +-- +2.3.3 + diff --git a/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch b/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch new file mode 100644 index 0000000000..db333e9376 --- /dev/null +++ b/meta/recipes-core/udev/eudev/Revert-udev-remove-userspace-firmware-loading-suppor.patch @@ -0,0 +1,364 @@ +From e415372cc7a2f52e70e1cfa8c6c1f633b411355d Mon Sep 17 00:00:00 2001 +From: Lauren Post <lauren.post@nxp.com> +Date: Wed, 8 Jun 2016 06:51:56 -0500 +Subject: [PATCH] Revert "udev: remove userspace firmware loading support" + +This reverts commit 3b717594600fa717cdf9bcfd0c7c1b703b245482. + +Conflicts: + configure.ac + src/udev/udevd.c + +Upstream-Status: Inappropriate [OE specific] + +Signed-off-by: Lauren Post <lauren.post@nxp.com> +--- + configure.ac | 39 +++++++++- + rules/Makefile.am | 5 ++ + src/udev/Makefile.am | 10 +++ + src/udev/udev-builtin-firmware.c | 154 +++++++++++++++++++++++++++++++++++++++ + src/udev/udev-builtin.c | 3 + + src/udev/udev.h | 6 ++ + src/udev/udevd.c | 13 ++++ + 7 files changed, 227 insertions(+), 3 deletions(-) + create mode 100644 src/udev/udev-builtin-firmware.c + +diff --git a/configure.ac b/configure.ac +index 8691891..65028c2 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -238,9 +238,42 @@ AC_CHECK_DECL([unshare], + [#include <sched.h>]) + + # ------------------------------------------------------------------------------ +-AC_PATH_TOOL(GPERF, gperf) +-if test -z "$GPERF" ; then +- AC_MSG_ERROR([*** gperf not found]) ++AC_ARG_WITH(firmware-path, ++ AS_HELP_STRING([--with-firmware-path=DIR[[[:DIR[...]]]]], ++ [Firmware search path (default=ROOTPREFIX/lib/firmware/updates:ROOTPREFIX/lib/firmware)]), ++ [], [with_firmware_path="$rootprefix/lib/firmware/updates:$rootprefix/lib/firmware"]) ++OLD_IFS=$IFS ++IFS=: ++for i in $with_firmware_path; do ++ if test "x${FIRMWARE_PATH}" = "x"; then ++ FIRMWARE_PATH="\\\"${i}/\\\"" ++ else ++ FIRMWARE_PATH="${FIRMWARE_PATH}, \\\"${i}/\\\"" ++ fi ++done ++IFS=$OLD_IFS ++AC_SUBST(FIRMWARE_PATH) ++AS_IF([test "x${FIRMWARE_PATH}" != "x"], [ AC_DEFINE(HAVE_FIRMWARE, 1, [Define if FIRMWARE is available]) ]) ++AM_CONDITIONAL(ENABLE_FIRMWARE, [test "x${FIRMWARE_PATH}" != "x"]) ++ ++# ------------------------------------------------------------------------------ ++AC_ARG_ENABLE([gudev], ++ AS_HELP_STRING([--disable-gudev], [disable Gobject libudev support @<:@default=enabled@:>@]), ++ [], [enable_gudev=yes]) ++AS_IF([test "x$enable_gudev" = "xyes"], [ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.22.0 gobject-2.0 >= 2.22.0]) ]) ++AM_CONDITIONAL([ENABLE_GUDEV], [test "x$enable_gudev" = "xyes"]) ++ ++# ------------------------------------------------------------------------------ ++AC_ARG_ENABLE([keymap], ++ AS_HELP_STRING([--disable-keymap], [disable keymap fixup support @<:@default=enabled@:>@]), ++ [], [enable_keymap=yes]) ++ ++if test "x$enable_keymap" = "xyes"; then ++ AC_PATH_TOOL(GPERF, gperf) ++ if test -z "$GPERF" ; then ++ AC_MSG_ERROR([*** gperf not found]) ++ fi ++ AC_DEFINE([ENABLE_KEYMAP], [1], [Define if we are enabling rule generator]) + fi + + # ------------------------------------------------------------------------------ +diff --git a/rules/Makefile.am b/rules/Makefile.am +index 24c099c..d714ae3 100644 +--- a/rules/Makefile.am ++++ b/rules/Makefile.am +@@ -22,6 +22,11 @@ dist_udevrules_DATA += \ + 80-net-name-slot.rules + endif + ++if ENABLE_FIRMWARE ++dist_udevrules_DATA += \ ++ 50-firmware.rules ++endif ++ + if HAVE_BLKID + dist_udevrules_DATA += \ + 60-persistent-storage.rules +diff --git a/src/udev/Makefile.am b/src/udev/Makefile.am +index 401af01..742fbc8 100644 +--- a/src/udev/Makefile.am ++++ b/src/udev/Makefile.am +@@ -53,12 +53,18 @@ libudev_core_la_SOURCES = \ + udev-ctrl.c \ + udev-builtin.c \ + udev-builtin-btrfs.c \ ++ udev-builtin-firmware.c \ + udev-builtin-hwdb.c \ + udev-builtin-input_id.c \ + udev-builtin-net_id.c \ + udev-builtin-path_id.c \ + udev-builtin-usb_id.c + ++if ENABLE_FIRMWARE ++libudev_core_la_SOURCES += \ ++ udev-builtin-firmware.c ++endif ++ + include_HEADERS = \ + udev.h + +@@ -86,6 +92,10 @@ libudev_core_la_LIBADD += \ + $(KMOD_LIBS) + endif + ++libudev_core_la_CPPFLAGS = \ ++ $(AM_CPPFLAGS) \ ++ -DFIRMWARE_PATH="$(FIRMWARE_PATH)" ++ + # + # Extras + # +diff --git a/src/udev/udev-builtin-firmware.c b/src/udev/udev-builtin-firmware.c +new file mode 100644 +index 0000000..bd8c2fb +--- /dev/null ++++ b/src/udev/udev-builtin-firmware.c +@@ -0,0 +1,154 @@ ++/* ++ * firmware - Kernel firmware loader ++ * ++ * Copyright (C) 2009 Piter Punk <piterpunk@slackware.com> ++ * Copyright (C) 2009-2011 Kay Sievers <kay@vrfy.org> ++ * ++ * 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 2 of the ++ * License, or (at your option) any later version. ++ * ++ * 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:* ++ */ ++ ++#include <unistd.h> ++#include <stdlib.h> ++#include <string.h> ++#include <stdio.h> ++#include <getopt.h> ++#include <errno.h> ++#include <stdbool.h> ++#include <sys/utsname.h> ++#include <sys/stat.h> ++ ++#include "udev.h" ++ ++static bool set_loading(struct udev *udev, char *loadpath, const char *state) { ++ FILE *ldfile; ++ ++ ldfile = fopen(loadpath, "we"); ++ if (ldfile == NULL) { ++ log_error("error: can not open '%s'", loadpath); ++ return false; ++ }; ++ fprintf(ldfile, "%s\n", state); ++ fclose(ldfile); ++ return true; ++} ++ ++static bool copy_firmware(struct udev *udev, const char *source, const char *target, size_t size) { ++ char *buf; ++ FILE *fsource = NULL, *ftarget = NULL; ++ bool ret = false; ++ ++ buf = malloc(size); ++ if (buf == NULL) { ++ log_error("No memory available to load firmware file"); ++ return false; ++ } ++ ++ log_debug("writing '%s' (%zi) to '%s'", source, size, target); ++ ++ fsource = fopen(source, "re"); ++ if (fsource == NULL) ++ goto exit; ++ ftarget = fopen(target, "we"); ++ if (ftarget == NULL) ++ goto exit; ++ if (fread(buf, size, 1, fsource) != 1) ++ goto exit; ++ if (fwrite(buf, size, 1, ftarget) == 1) ++ ret = true; ++exit: ++ if (ftarget != NULL) ++ fclose(ftarget); ++ if (fsource != NULL) ++ fclose(fsource); ++ free(buf); ++ return ret; ++} ++ ++static int builtin_firmware(struct udev_device *dev, int argc, char *argv[], bool test) { ++ struct udev *udev = udev_device_get_udev(dev); ++ static const char *searchpath[] = { FIRMWARE_PATH }; ++ char loadpath[UTIL_PATH_SIZE]; ++ char datapath[UTIL_PATH_SIZE]; ++ char fwpath[UTIL_PATH_SIZE]; ++ const char *firmware; ++ FILE *fwfile = NULL; ++ struct utsname kernel; ++ struct stat statbuf; ++ unsigned int i; ++ int rc = EXIT_SUCCESS; ++ ++ firmware = udev_device_get_property_value(dev, "FIRMWARE"); ++ if (firmware == NULL) { ++ log_error("firmware parameter missing"); ++ rc = EXIT_FAILURE; ++ goto exit; ++ } ++ ++ /* lookup firmware file */ ++ uname(&kernel); ++ for (i = 0; i < ELEMENTSOF(searchpath); i++) { ++ strscpyl(fwpath, sizeof(fwpath), searchpath[i], kernel.release, "/", firmware, NULL); ++ fwfile = fopen(fwpath, "re"); ++ if (fwfile != NULL) ++ break; ++ ++ strscpyl(fwpath, sizeof(fwpath), searchpath[i], firmware, NULL); ++ fwfile = fopen(fwpath, "re"); ++ if (fwfile != NULL) ++ break; ++ } ++ ++ strscpyl(loadpath, sizeof(loadpath), udev_device_get_syspath(dev), "/loading", NULL); ++ ++ if (fwfile == NULL) { ++ log_debug("did not find firmware file '%s'", firmware); ++ rc = EXIT_FAILURE; ++ /* ++ * Do not cancel the request in the initrd, the real root might have ++ * the firmware file and the 'coldplug' run in the real root will find ++ * this pending request and fulfill or cancel it. ++ * */ ++ if (!in_initrd()) ++ set_loading(udev, loadpath, "-1"); ++ goto exit; ++ } ++ ++ if (stat(fwpath, &statbuf) < 0 || statbuf.st_size == 0) { ++ if (!in_initrd()) ++ set_loading(udev, loadpath, "-1"); ++ rc = EXIT_FAILURE; ++ goto exit; ++ } ++ ++ if (!set_loading(udev, loadpath, "1")) ++ goto exit; ++ ++ strscpyl(datapath, sizeof(datapath), udev_device_get_syspath(dev), "/data", NULL); ++ if (!copy_firmware(udev, fwpath, datapath, statbuf.st_size)) { ++ log_error("error sending firmware '%s' to device", firmware); ++ set_loading(udev, loadpath, "-1"); ++ rc = EXIT_FAILURE; ++ goto exit; ++ }; ++ ++ set_loading(udev, loadpath, "0"); ++exit: ++ if (fwfile) ++ fclose(fwfile); ++ return rc; ++} ++ ++const struct udev_builtin udev_builtin_firmware = { ++ .name = "firmware", ++ .cmd = builtin_firmware, ++ .help = "kernel firmware loader", ++ .run_once = true, ++}; +diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c +index 74b3bdc..3657106 100644 +--- a/src/udev/udev-builtin.c ++++ b/src/udev/udev-builtin.c +@@ -34,6 +34,9 @@ static const struct udev_builtin *builtins[] = { + [UDEV_BUILTIN_BLKID] = &udev_builtin_blkid, + #endif + [UDEV_BUILTIN_BTRFS] = &udev_builtin_btrfs, ++#ifdef HAVE_FIRMWARE ++ [UDEV_BUILTIN_FIRMWARE] = &udev_builtin_firmware, ++#endif + [UDEV_BUILTIN_HWDB] = &udev_builtin_hwdb, + [UDEV_BUILTIN_INPUT_ID] = &udev_builtin_input_id, + [UDEV_BUILTIN_KEYBOARD] = &udev_builtin_keyboard, +diff --git a/src/udev/udev.h b/src/udev/udev.h +index 198cb2c..01a1e9c 100644 +--- a/src/udev/udev.h ++++ b/src/udev/udev.h +@@ -149,6 +149,9 @@ enum udev_builtin_cmd { + UDEV_BUILTIN_BLKID, + #endif + UDEV_BUILTIN_BTRFS, ++#ifdef HAVE_FIRMWARE ++ UDEV_BUILTIN_FIRMWARE, ++#endif + UDEV_BUILTIN_HWDB, + UDEV_BUILTIN_INPUT_ID, + UDEV_BUILTIN_KEYBOARD, +@@ -173,6 +176,9 @@ struct udev_builtin { + extern const struct udev_builtin udev_builtin_blkid; + #endif + extern const struct udev_builtin udev_builtin_btrfs; ++#ifdef HAVE_FIRMWARE ++extern const struct udev_builtin udev_builtin_firmware; ++#endif + extern const struct udev_builtin udev_builtin_hwdb; + extern const struct udev_builtin udev_builtin_input_id; + extern const struct udev_builtin udev_builtin_keyboard; +diff --git a/src/udev/udevd.c b/src/udev/udevd.c +index b1de97a..35655d8 100644 +--- a/src/udev/udevd.c ++++ b/src/udev/udevd.c +@@ -101,6 +101,9 @@ struct event { + bool is_block; + usec_t start_usec; + bool warned; ++#ifdef HAVE_FIRMWARE ++ bool nodelay; ++#endif + }; + + static inline struct event *node_to_event(struct udev_list_node *node) { +@@ -491,6 +494,10 @@ static int event_queue_insert(struct udev_device *dev) { + event->devnum = udev_device_get_devnum(dev); + event->is_block = streq("block", udev_device_get_subsystem(dev)); + event->ifindex = udev_device_get_ifindex(dev); ++#ifdef HAVE_FIRMWARE ++ if (streq(udev_device_get_subsystem(dev), "firmware")) ++ event->nodelay = true; ++#endif + + log_debug("seq %llu queued, '%s' '%s'", udev_device_get_seqnum(dev), + udev_device_get_action(dev), udev_device_get_subsystem(dev)); +@@ -566,6 +573,12 @@ static bool is_devpath_busy(struct event *event) { + return true; + } + ++#ifdef HAVE_FIRMWARE ++ /* allow to bypass the dependency tracking */ ++ if (event->nodelay) ++ continue; ++#endif ++ + /* parent device event found */ + if (event->devpath[common] == '/') { + event->delaying_seqnum = loop_event->seqnum; +-- +1.9.1 + diff --git a/meta/recipes-core/udev/files/devfs-udev.rules b/meta/recipes-core/udev/eudev/devfs-udev.rules index 0ba1ad4e7f..0ba1ad4e7f 100644 --- a/meta/recipes-core/udev/files/devfs-udev.rules +++ b/meta/recipes-core/udev/eudev/devfs-udev.rules diff --git a/meta/recipes-core/udev/eudev/init b/meta/recipes-core/udev/eudev/init new file mode 100644 index 0000000000..0ab028b391 --- /dev/null +++ b/meta/recipes-core/udev/eudev/init @@ -0,0 +1,142 @@ +#!/bin/sh + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +SYSCONF_CACHED="/etc/udev/cache.data" +SYSCONF_TMP="/dev/shm/udev.cache" +DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen + +# A list of files which are used as a criteria to judge whether the udev cache could be reused. +CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices" +[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags" + +# List of files whose metadata (size/mtime/name) will be included in cached +# system state. +META_FILE_LIST="lib/udev/rules.d/* etc/udev/rules.d/*" + +# Command to compute system configuration. +sysconf_cmd () { + cat -- $CMP_FILE_LIST + stat -c '%s %Y %n' -- $META_FILE_LIST | awk -F/ '{print $1 " " $NF;}' +} + +[ -f /etc/default/udev-cache ] && . /etc/default/udev-cache +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf +[ -f /etc/default/rcS ] && . /etc/default/rcS + +kill_udevd () { + pid=`pidof -x udevd` + [ -n "$pid" ] && kill $pid +} + +case "$1" in + start) + export ACTION=add + # propagate /dev from /sys + echo "Starting udev" + + # Check for requireed devtmpfs before trying to start udev and + # mount a no-existant fs. + if ! grep -q devtmpfs /proc/filesystems + then + echo "Missing devtmpfs, which is required for udev to run"; + echo "Halting..." + halt + fi + # mount the devtmpfs on /dev, if not already done + LANG=C awk '$2 == "/dev" && ($3 == "devtmpfs") { exit 1 }' /proc/mounts && { + mount -n -o mode=0755 -t devtmpfs none "/dev" + } + [ -e /dev/pts ] || mkdir -m 0755 /dev/pts + [ -e /dev/shm ] || mkdir -m 1777 /dev/shm + # the automount rule for udev needs /tmp directory available, as /tmp is a symlink + # to /var/tmp which in turn is a symlink to /var/volatile/tmp, we need to make sure + # /var/volatile/tmp directory to be available. + mkdir -m 1777 -p /var/volatile/tmp + + # Cache handling. + if [ "$DEVCACHE" != "" ]; then + if [ -e $DEVCACHE ]; then + sysconf_cmd > "$SYSCONF_TMP" + if cmp $SYSCONF_CACHED $SYSCONF_TMP >/dev/null; then + tar xmf $DEVCACHE -C / -m + not_first_boot=1 + [ "$VERBOSE" != "no" ] && echo "udev: using cache file $DEVCACHE" + [ -e $SYSCONF_TMP ] && rm -f "$SYSCONF_TMP" + [ -e "$DEVCACHE_REGEN" ] && rm -f "$DEVCACHE_REGEN" + else + # Output detailed reason why the cached /dev is not used + cat <<EOF +udev: Not using udev cache because of changes detected in the following files: +udev: $CMP_FILE_LIST +udev: $META_FILE_LIST +udev: The udev cache will be regenerated. To identify the detected changes, +udev: compare the cached sysconf at $SYSCONF_CACHED +udev: against the current sysconf at $SYSCONF_TMP +EOF + touch "$DEVCACHE_REGEN" + fi + else + if [ "$ROOTFS_READ_ONLY" != "yes" ]; then + # If rootfs is not read-only, it's possible that a new udev cache would be generated; + # otherwise, we do not bother to read files. + touch "$DEVCACHE_REGEN" + fi + fi + fi + + # make_extra_nodes + kill_udevd > "/dev/null" 2>&1 + + # trigger the sorted events + [ -e /proc/sys/kernel/hotplug ] && echo -e '\000' >/proc/sys/kernel/hotplug + @UDEVD@ -d + + udevadm control --env=STARTUP=1 + if [ "$not_first_boot" != "" ];then + if [ "$PROBE_PLATFORM_BUS" != "yes" ]; then + PLATFORM_BUS_NOMATCH="--subsystem-nomatch=platform" + else + PLATFORM_BUS_NOMATCH="" + fi + udevadm trigger --action=add --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux $PLATFORM_BUS_NOMATCH + (udevadm settle --timeout=3; udevadm control --env=STARTUP=)& + else + udevadm trigger --action=add + udevadm settle + fi + ;; + stop) + echo "Stopping udevd" + start-stop-daemon --stop --name udevd --quiet + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + status) + pid=`pidof -x udevd` + if [ -n "$pid" ]; then + echo "udevd (pid $pid) is running ..." + else + echo "udevd is stopped" + fi + ;; + *) + echo "Usage: $0 {start|stop|status|restart}" + exit 1 +esac +exit 0 diff --git a/meta/recipes-core/udev/files/links.conf b/meta/recipes-core/udev/eudev/links.conf index 8fff922db6..8fff922db6 100644 --- a/meta/recipes-core/udev/files/links.conf +++ b/meta/recipes-core/udev/eudev/links.conf diff --git a/meta/recipes-core/udev/eudev/local.rules b/meta/recipes-core/udev/eudev/local.rules new file mode 100644 index 0000000000..d502cdd6ba --- /dev/null +++ b/meta/recipes-core/udev/eudev/local.rules @@ -0,0 +1,19 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# Create a symlink to any touchscreen input device +# Trigger based on input type, that the evbit (-e) has EV_SYN and EV_ABS, +# has an EV_ABS value (-a) which is used for touchscreen type devices. +SUBSYSTEM=="input", KERNEL=="event[0-9]*", ENV{ID_INPUT_TOUCHSCREEN}=="1", SYMLINK+="input/touchscreen0" diff --git a/meta/recipes-core/udev/udev-145/permissions.rules b/meta/recipes-core/udev/eudev/permissions.rules index 205b733292..205b733292 100644 --- a/meta/recipes-core/udev/udev-145/permissions.rules +++ b/meta/recipes-core/udev/eudev/permissions.rules diff --git a/meta/recipes-core/udev/udev-145/run.rules b/meta/recipes-core/udev/eudev/run.rules index 75d71375bb..75d71375bb 100644 --- a/meta/recipes-core/udev/udev-145/run.rules +++ b/meta/recipes-core/udev/eudev/run.rules diff --git a/meta/recipes-core/udev/eudev/udev-cache b/meta/recipes-core/udev/eudev/udev-cache new file mode 100644 index 0000000000..dcfff1cb45 --- /dev/null +++ b/meta/recipes-core/udev/eudev/udev-cache @@ -0,0 +1,75 @@ +#!/bin/sh -e + +### BEGIN INIT INFO +# Provides: udev-cache +# Required-Start: mountall +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: cache /dev to speedup the udev next boot +### END INIT INFO + +export TZ=/etc/localtime + +[ -r /proc/mounts ] || exit 1 +[ -x @UDEVD@ ] || exit 1 +[ -d /sys/class ] || exit 1 + +[ -f /etc/default/rcS ] && . /etc/default/rcS +DEVCACHE_TMP="/dev/shm/udev-cache-tmp.tar" +SYSCONF_CACHED="/etc/udev/cache.data" +SYSCONF_TMP="/dev/shm/udev.cache" +DEVCACHE_REGEN="/dev/shm/udev-regen" # create to request cache regen + +# A list of files which are used as a criteria to judge whether the udev cache could be reused. +CMP_FILE_LIST="/proc/version /proc/cmdline /proc/devices" +[ -f /proc/atags ] && CMP_FILE_LIST="$CMP_FILE_LIST /proc/atags" + +# List of files whose metadata (size/mtime/name) will be included in cached +# system state. +META_FILE_LIST="lib/udev/rules.d/* etc/ud |
