eudev: Remove udev-cache
RFC PATCH v2 1/1 eudev: Remove udev-cache
As udev depends on devtmpfs, I think it is not necessary to maintain a cache anymore as device nodes are created automatically by the kernel. It could even lead to problems, when the cache overwrites existing device nodes or populates device nodes when no device exists.
But I'm not sure if this change could have some consequences I don't see, therefore a RFC.
Changes in v2:
Added missing signed-off-by
Oliver Stäbler (1):
eudev: Remove udev-cache
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
Signature · 1 line
2.13.0
RFC PATCH v2 1/1 eudev: Remove udev-cache
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 <[email protected]>
--- 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
meta/recipes-core/udev/eudev/init +0 -49
@@ -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 <<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
meta/recipes-core/udev/eudev/udev-cache deleted +0 -75
75 lines not on this page · raw message
meta/recipes-core/udev/eudev/udev-cache.default deleted +0 -5
@@ -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"
meta/recipes-core/udev/eudev_3.2.2.bb +2 -18
@@ -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"
Signature · 1 line
2.13.0