From 048f4149b8438c521e8b65a3c96d850a9b4a3e5b Mon Sep 17 00:00:00 2001 From: Oliver Stäbler Date: Wed, 2 Aug 2017 11:37:10 +0200 Subject: eudev: Remove udev-cache MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As eudev requires devtmpfs it is not necessary to keep a cache anymore as the kernel handles entries in /dev itself. Signed-off-by: Oliver Stäbler Signed-off-by: Ross Burton --- meta/recipes-core/udev/eudev/init | 49 ---------------- meta/recipes-core/udev/eudev/udev-cache | 75 ------------------------- meta/recipes-core/udev/eudev/udev-cache.default | 5 -- meta/recipes-core/udev/eudev_3.2.2.bb | 20 +------ 4 files changed, 2 insertions(+), 147 deletions(-) delete mode 100644 meta/recipes-core/udev/eudev/udev-cache delete mode 100644 meta/recipes-core/udev/eudev/udev-cache.default (limited to 'meta/recipes-core/udev') diff --git a/meta/recipes-core/udev/eudev/init b/meta/recipes-core/udev/eudev/init index 0ab028b391..0455ade258 100644 --- a/meta/recipes-core/udev/eudev/init +++ b/meta/recipes-core/udev/eudev/init @@ -14,25 +14,7 @@ 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 @@ -66,37 +48,6 @@ case "$1" in # /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 < "/dev/null" 2>&1 diff --git a/meta/recipes-core/udev/eudev/udev-cache b/meta/recipes-core/udev/eudev/udev-cache deleted file mode 100644 index dcfff1cb45..0000000000 --- a/meta/recipes-core/udev/eudev/udev-cache +++ /dev/null @@ -1,75 +0,0 @@ -#!/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/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 - -if [ "$ROOTFS_READ_ONLY" = "yes" ]; then - [ "$VERBOSE" != "no" ] && echo "udev-cache: read-only rootfs, skip generating udev-cache" - exit 0 -fi - -[ "$DEVCACHE" != "" ] || exit 0 -[ "${VERBOSE}" == "no" ] || echo -n "udev-cache: checking for ${DEVCACHE_REGEN}... " -if ! [ -e "$DEVCACHE_REGEN" ]; then - [ "${VERBOSE}" == "no" ] || echo "not found." - exit 0 -fi -[ "${VERBOSE}" == "no" ] || echo "found." -echo "Populating dev cache" - -err_cleanup () { - echo "udev-cache: update failed!" - udevadm control --start-exec-queue - rm -f -- "$SYSCONF_TMP" "$DEVCACHE_TMP" "$DEVCACHE" "$SYSCONF_CACHED" -} - -( - set -e - trap 'err_cleanup' EXIT - udevadm control --stop-exec-queue - sysconf_cmd > "$SYSCONF_TMP" - find /dev -xdev \( -type b -o -type c -o -type l \) | cut -c 2- \ - | xargs tar cf "${DEVCACHE_TMP}" - gzip < "${DEVCACHE_TMP}" > "$DEVCACHE" - rm -f "${DEVCACHE_TMP}" - mv "$SYSCONF_TMP" "$SYSCONF_CACHED" - udevadm control --start-exec-queue - rm -f "$DEVCACHE_REGEN" - trap - EXIT -) & - -exit 0 diff --git a/meta/recipes-core/udev/eudev/udev-cache.default b/meta/recipes-core/udev/eudev/udev-cache.default deleted file mode 100644 index a3b732698d..0000000000 --- a/meta/recipes-core/udev/eudev/udev-cache.default +++ /dev/null @@ -1,5 +0,0 @@ -# Default for /etc/init.d/udev - -# Comment this out to disable device cache -DEVCACHE="/etc/udev-cache.tar.gz" -PROBE_PLATFORM_BUS="yes" diff --git a/meta/recipes-core/udev/eudev_3.2.2.bb b/meta/recipes-core/udev/eudev_3.2.2.bb index 78fef2c144..47d958bf6b 100644 --- a/meta/recipes-core/udev/eudev_3.2.2.bb +++ b/meta/recipes-core/udev/eudev_3.2.2.bb @@ -17,8 +17,6 @@ SRC_URI = "https://github.com/gentoo/${BPN}/archive/v${PV}.tar.gz;downloadfilena file://local.rules \ file://permissions.rules \ file://run.rules \ - file://udev-cache \ - file://udev-cache.default \ file://udev.rules \ " UPSTREAM_CHECK_URI = "https://github.com/gentoo/eudev/releases" @@ -40,14 +38,7 @@ PACKAGECONFIG[hwdb] = "--enable-hwdb,--disable-hwdb" do_install_append() { install -d ${D}${sysconfdir}/init.d install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev - install -m 0755 ${WORKDIR}/udev-cache ${D}${sysconfdir}/init.d/udev-cache sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev - sed -i s%@UDEVD@%${base_sbindir}/udevd% ${D}${sysconfdir}/init.d/udev-cache - - install -d ${D}${sysconfdir}/default - install -m 0755 ${WORKDIR}/udev-cache.default ${D}${sysconfdir}/default/udev-cache - - touch ${D}${sysconfdir}/udev/cache.data install -d ${D}${sysconfdir}/udev/rules.d install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules @@ -59,14 +50,10 @@ do_install_append() { rm -f ${D}${base_libdir}/udev/hid2hci } -INITSCRIPT_PACKAGES = "eudev udev-cache" -INITSCRIPT_NAME_eudev = "udev" -INITSCRIPT_PARAMS_eudev = "start 04 S ." -INITSCRIPT_NAME_udev-cache = "udev-cache" -INITSCRIPT_PARAMS_udev-cache = "start 36 S ." +INITSCRIPT_NAME = "udev" +INITSCRIPT_PARAMS = "start 04 S ." PACKAGES =+ "libudev" -PACKAGES =+ "udev-cache" PACKAGES =+ "eudev-hwdb" @@ -76,13 +63,10 @@ FILES_${PN}-dev = "${datadir}/pkgconfig/udev.pc \ ${includedir}/udev.h ${libdir}/libudev.la \ ${libdir}/libudev.a ${libdir}/pkgconfig/libudev.pc" FILES_libudev = "${base_libdir}/libudev.so.*" -FILES_udev-cache = "${sysconfdir}/init.d/udev-cache ${sysconfdir}/default/udev-cache" FILES_eudev-hwdb = "${sysconfdir}/udev/hwdb.d" RDEPENDS_eudev-hwdb += "eudev" -RRECOMMENDS_${PN} += "udev-cache" - RPROVIDES_${PN} = "hotplug udev" RPROVIDES_eudev-hwdb += "udev-hwdb" -- cgit 1.2.3-korg