diff options
author | Matthias Schwarzott <zzam@gentoo.org> | 2009-04-17 07:21:27 +0000 |
---|---|---|
committer | Matthias Schwarzott <zzam@gentoo.org> | 2009-04-17 07:21:27 +0000 |
commit | 76d60bce57372f987af4f8154b0cc3128a4d2d88 (patch) | |
tree | 440528dc76b0d6e20239dc93df2ff742a29e5b95 /sys-fs/udev | |
parent | Restore accidentally dropped ~hppa keyword as reported by jer bug #266459 (diff) | |
download | gentoo-2-76d60bce57372f987af4f8154b0cc3128a4d2d88.tar.gz gentoo-2-76d60bce57372f987af4f8154b0cc3128a4d2d88.tar.bz2 gentoo-2-76d60bce57372f987af4f8154b0cc3128a4d2d88.zip |
Remove all buggy old versions.
(Portage version: 2.1.6.11/cvs/Linux i686)
Diffstat (limited to 'sys-fs/udev')
35 files changed, 20 insertions, 6509 deletions
diff --git a/sys-fs/udev/ChangeLog b/sys-fs/udev/ChangeLog index 39f12cbe5b21..4358538192a2 100644 --- a/sys-fs/udev/ChangeLog +++ b/sys-fs/udev/ChangeLog @@ -1,6 +1,25 @@ # ChangeLog for sys-fs/udev # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.458 2009/04/16 08:58:23 zzam Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/ChangeLog,v 1.459 2009/04/17 07:21:26 zzam Exp $ + + 17 Apr 2009; Matthias Schwarzott <zzam@gentoo.org> + -files/udev-125-cdrom-autoclose-bug.diff, + -files/udev-125-rules-update.diff, -files/udev-start-126.sh, + -files/udev-stop-126.sh, -files/udev-postmount-130-r2.initd, + -files/udev-133-rules-update.diff, + -files/udev-133-silence-physdev-warnings.diff, -files/udev-start-133.sh, + -files/udev-135-fix-capi.diff, -files/udev-135-fix-dri-perms.diff, + -files/udev-135-r2.confd, -files/udev-135-r2.initd, + -files/udev-dev-tarball-135-r2.initd, -files/udev-mount-135-r2.initd, + -files/udev-postmount-135-r2.initd, -files/udev-start-135-r2.sh, + -files/udev-stop-135-r2.sh, -files/udev-135-r3.confd, + -files/udev-mount-135-r3.initd, -files/udev-start-135-r3.sh, + -files/udev-135-rules-update.diff, -files/udev-fix-udevinfo-in-doc.diff, + -udev-122-r1.ebuild, -udev-125-r2.ebuild, -udev-130-r1.ebuild, + -udev-133.ebuild, -udev-135.ebuild, -udev-135-r1.ebuild, + -udev-135-r2.ebuild, -udev-135-r3.ebuild, -udev-135-r4.ebuild, + -udev-138.ebuild, -udev-139.ebuild, -udev-140.ebuild: + Remove all buggy old versions. *udev-124-r2 (16 Apr 2009) diff --git a/sys-fs/udev/files/udev-125-cdrom-autoclose-bug.diff b/sys-fs/udev/files/udev-125-cdrom-autoclose-bug.diff deleted file mode 100644 index f61bad33a539..000000000000 --- a/sys-fs/udev/files/udev-125-cdrom-autoclose-bug.diff +++ /dev/null @@ -1,27 +0,0 @@ -commit f755fd5657b619fd27160ad202fc5d773d096e9c -Author: Kay Sievers <kay.sievers@vrfy.org> -Date: Sat Aug 2 10:26:48 2008 +0200 - - rules: run vol_id on opticals only if media is found - - Opening an optical drive device node without O_NONBLOCK autocloses the - tray, we run vol_id on every media change by kernel emitted "change" - events, which can make it hard to change the media when the tray closes - immediatey again.:) We check for cdrom_id to indicate an existing track, - if no media is found, we will not open the device with vol_id. - - Thanks to Christian Krause and DavidZ for debugging and testing. - -diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules -index 5ae0c7f..097e864 100644 ---- a/rules/rules.d/60-persistent-storage.rules -+++ b/rules/rules.d/60-persistent-storage.rules -@@ -52,6 +52,8 @@ ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PA - - # skip unpartitioned removable media devices from drivers which do not send "change" events - ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end" -+# skip optical drives without media -+ENV{DEVTYPE}=="disk", KERNEL=="sr*", ENV{ID_CDROM_MEDIA_TRACK_COUNT}!="?*", GOTO="persistent_storage_end" - - # import filesystem metadata - IMPORT{program}="vol_id --export $tempnode" diff --git a/sys-fs/udev/files/udev-125-rules-update.diff b/sys-fs/udev/files/udev-125-rules-update.diff deleted file mode 100644 index a063ce745a71..000000000000 --- a/sys-fs/udev/files/udev-125-rules-update.diff +++ /dev/null @@ -1,13 +0,0 @@ -Index: udev-git/rules/gentoo/65-permissions.rules -=================================================================== ---- udev-git.orig/rules/gentoo/65-permissions.rules -+++ udev-git/rules/gentoo/65-permissions.rules -@@ -15,7 +15,7 @@ KERNEL=="st[0-9]*|nst[0-9]*|ht[0-9]*|nht - SUBSYSTEMS=="scsi", KERNEL=="sg[0-9]*", ATTRS{type}=="[18]", GROUP="tape", MODE="660" - - # dialout devices --KERNEL=="ippp*|isdn*|dcbri*|capi*", GROUP="uucp" -+KERNEL=="ippp*|isdn*|dcbri*|capi*|rfcomm*|ttyACM[0-9]*", GROUP="uucp" - KERNEL=="pilot", GROUP="uucp" - - # sound devices (sound=alsa, snd=oss) diff --git a/sys-fs/udev/files/udev-133-rules-update.diff b/sys-fs/udev/files/udev-133-rules-update.diff deleted file mode 100644 index 2861a83225f6..000000000000 --- a/sys-fs/udev/files/udev-133-rules-update.diff +++ /dev/null @@ -1,70 +0,0 @@ -diff --git a/rules/gentoo/30-kernel-compat.rules b/rules/gentoo/30-kernel-compat.rules -index 1f767df..d07e7fa 100644 ---- a/rules/gentoo/30-kernel-compat.rules -+++ b/rules/gentoo/30-kernel-compat.rules -@@ -1,9 +1,17 @@ - # do not edit this file, it will be overwritten on update - --ACTION!="add", GOTO="kernel_compat_end" -+ACTION!="add|change", GOTO="kernel_compat_end" -+ -+# -+# rules to workaround bad sysfs timing -+# -+ -+ACTION!="add", GOTO="kernel_compat_wait_end" - - # workarounds needed to synchronize with sysfs -+# needed for kernels < v2.6.18-rc1 - DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus" -+SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt" - - # needed for kernels <2.6.16 - SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" -@@ -11,13 +19,29 @@ SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" - # needed for kernels <2.6.17 - SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*", WAIT_FOR_SYSFS="device/driver" - -+LABEL="kernel_compat_wait_end" - -+# -+# naming device rules -+# - -+# old style usb sysfs devices - # needed for kernels <2.6.22 - SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", NAME="%c", GROUP="usb", MODE="0664" - -+# /sys/class/block will export this -+# needed for kernels <2.6.25-rc1 -+SUBSYSTEM!="block", GOTO="block_devtype_end" -+ENV{DEVTYPE}!="?*", ATTR{range}=="?*", ENV{DEVTYPE}="disk" -+ENV{DEVTYPE}!="?*", ATTR{start}=="?*", ENV{DEVTYPE}="partition" -+LABEL="block_devtype_end" - - -+# -+# module loading rules -+# -+ACTION!="add", GOTO="kernel_compat_end" -+ - # this driver is broken and should not be loaded automatically - # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=398962 - # needed for kernels <2.6.21 -@@ -26,6 +50,11 @@ SUBSYSTEM=="platform", ENV{MODALIAS}=="i82365", ENV{MODALIAS}="" - # No need for more code, as MODALIAS is present - ENV{MODALIAS}=="?*", GOTO="kernel_compat_end" - -+# needed for kernel <2.6.27-rc5 -+# acpi will do on newer kernels -+SUBSYSTEM=="pnp", DRIVER!="?*", \ -+ RUN{ignore_error}+="/bin/sh -c '/sbin/modprobe -a $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'" -+ - # needed for kernels <2.6.22 - SUBSYSTEM!="scsi_device", GOTO="kernel_compat_end" - -@@ -44,4 +73,3 @@ SUBSYSTEM!="scsi_device", GOTO="kernel_compat_end" - - LABEL="kernel_compat_end" - -- diff --git a/sys-fs/udev/files/udev-133-silence-physdev-warnings.diff b/sys-fs/udev/files/udev-133-silence-physdev-warnings.diff deleted file mode 100644 index 1ae1c56b79b2..000000000000 --- a/sys-fs/udev/files/udev-133-silence-physdev-warnings.diff +++ /dev/null @@ -1,42 +0,0 @@ -commit ae2d346642aee4fab33c88708627bcf5b0cb317d -Author: Kay Sievers <kay.sievers@vrfy.org> -Date: Mon Nov 24 21:24:04 2008 +0100 - - silence PHYSDEV* warning for WAIT_FOR* rules - -diff --git a/udev/udev-rules.c b/udev/udev-rules.c -index df9fc78..afd2e88 100644 ---- a/udev/udev-rules.c -+++ b/udev/udev-rules.c -@@ -1135,6 +1135,7 @@ static int add_rule(struct udev_rules *rules, char *line, - char *linepos; - char *attr; - int physdev = 0; -+ int waitfor = 0; - struct rule_tmp rule_tmp; - - memset(&rule_tmp, 0x00, sizeof(struct rule_tmp)); -@@ -1395,6 +1396,7 @@ static int add_rule(struct udev_rules *rules, char *line, - if (strcasecmp(key, "WAIT_FOR") == 0 || strcasecmp(key, "WAIT_FOR_SYSFS") == 0) { - rule_add_key(&rule_tmp, TK_M_WAITFOR, 0, value, NULL); - valid = 1; -+ waitfor = 1; - continue; - } - -@@ -1544,11 +1546,11 @@ static int add_rule(struct udev_rules *rules, char *line, - err(rules->udev, "unknown key '%s' in %s:%u\n", key, filename, lineno); - } - -- if (physdev) -- err(rules->udev, "PHYSDEV* values are deprecated and not available on recent kernels, \n" -- "please fix it in %s:%u", filename, lineno); -+ if (physdev && !waitfor) -+ err(rules->udev, "PHYSDEV* values are deprecated and not available on recent kernels, " -+ "please fix it in %s:%u\n", filename, lineno); - -- /* skip line if not any valid key was found */ -+ /* skip line if no valid key was found */ - if (!valid) - goto invalid; - diff --git a/sys-fs/udev/files/udev-135-fix-capi.diff b/sys-fs/udev/files/udev-135-fix-capi.diff deleted file mode 100644 index ec5bc29bb84c..000000000000 --- a/sys-fs/udev/files/udev-135-fix-capi.diff +++ /dev/null @@ -1,29 +0,0 @@ -commit 1ac8fad8e56097cf8e08a0a17f044309317cb50f -Author: Kay Sievers <kay.sievers@vrfy.org> -Date: Wed Dec 3 01:32:00 2008 +0100 - - rules: fix isdn rules - - On Tue, Dec 2, 2008 at 21:07, Matthias Schwarzott <zzam@gentoo.org> wrote: - > It seems that the rules related to capi devices are not correct: - > - > KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" - > KERNEL=="capi*", NAME="capi/%n" - > - > Changing the second rule to match only on KERNEL=="capi[0-9]*" is reported to - > make it work. - > So I can only guess that the problem is the second rule overwriting the NAME - > set by the first one. - -diff --git a/rules/packages/40-isdn.rules b/rules/packages/40-isdn.rules -index f2bc34e..8a4686f 100644 ---- a/rules/packages/40-isdn.rules -+++ b/rules/packages/40-isdn.rules -@@ -1,5 +1,4 @@ - # do not edit this file, it will be overwritten on update - --SUBSYSTEM=="capi", GROUP="uucp" --KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" --KERNEL=="capi*", NAME="capi/%n" -+SUBSYSTEM=="capi", KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20", GROUP="uucp" -+SUBSYSTEM=="tty", KERNEL=="capi[0-9]*", NAME="capi/%n" diff --git a/sys-fs/udev/files/udev-135-fix-dri-perms.diff b/sys-fs/udev/files/udev-135-fix-dri-perms.diff deleted file mode 100644 index dd9d31a3a27f..000000000000 --- a/sys-fs/udev/files/udev-135-fix-dri-perms.diff +++ /dev/null @@ -1,20 +0,0 @@ -commit 66d9b44f8302efe383ada6a52d8431655614bf76 -Author: Kay Sievers <kay.sievers@vrfy.org> -Date: Thu Jan 15 17:06:14 2009 +0100 - - rules: add drm devices to group "video" - - https://bugs.launchpad.net/bugs/317430 - -diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules -index 7730f0d..95d82d7 100644 ---- a/rules/rules.d/50-udev-default.rules -+++ b/rules/rules.d/50-udev-default.rules -@@ -38,6 +38,7 @@ KERNEL=="card[0-9]*", NAME="dri/%k" - KERNEL=="pmu", GROUP="video" - KERNEL=="nvidia*|nvidiactl*", GROUP="video" - SUBSYSTEM=="graphics", GROUP="video" -+SUBSYSTEM=="drm", GROUP="video" - - # DVB (video) - SUBSYSTEM=="dvb", ENV{DVB_ADAPTER_NUM}=="?*", NAME="dvb/adapter$env{DVB_ADAPTER_NUM}/$env{DVB_DEVICE_TYPE}$env{DVB_DEVICE_NUM}", GROUP="video" diff --git a/sys-fs/udev/files/udev-135-r2.confd b/sys-fs/udev/files/udev-135-r2.confd deleted file mode 100644 index d26a4f67eed3..000000000000 --- a/sys-fs/udev/files/udev-135-r2.confd +++ /dev/null @@ -1,16 +0,0 @@ -# /etc/conf.d/udev: config file for udev - -# We discourage to disable persistent-net!! -# this may lead to random interface naming - -# Disable adding new rules for persistent-net -persistent_net_disable="no" - -# Set to "yes" if you want to save /dev to a tarball on shutdown -# and restore it on startup. This is useful if you have a lot of -# custom device nodes that udev does not handle/know about. -# -# As this option is fragile, we recommend you -# to create your devices in /lib/udev/devices. -# These will be copied to /dev on boot. -#rc_device_tarball="NO" diff --git a/sys-fs/udev/files/udev-135-r2.initd b/sys-fs/udev/files/udev-135-r2.initd deleted file mode 100644 index 7bad67f15187..000000000000 --- a/sys-fs/udev/files/udev-135-r2.initd +++ /dev/null @@ -1,209 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -description="Run udevd and create the device-nodes" - -[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf -. /lib/udev/shell-compat.sh - -rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}} - -depend() -{ - if [ -f /etc/init.d/sysfs ]; then - # require new enough openrc with sysinit being extra runlevel - # on linux we just check if sysfs init-script exists - # this is to silence out ugly warnings about not-existing sysfs script - provide dev - need sysfs udev-mount udev-dev-tarball - before checkfs fsck - - # udev does not work inside vservers - keyword novserver - fi -} - -cleanup() -{ - # fail more gracely and not leave udevd running - start-stop-daemon --stop --exec /sbin/udevd - exit 1 -} - -disable_hotplug_agent() -{ - if [ -e /proc/sys/kernel/hotplug ]; then - echo "" >/proc/sys/kernel/hotplug - fi -} - -root_link() -{ - /lib/udev/write_root_link_rule -} - -persistent_net_switch() -{ - # this function disables rules files - # by creating new files with the same name - # in a temp rules directory with higher priority - local d=/dev/.udev/rules.d - if yesno "${persistent_net_disable:-no}"; then - mkdir -p "$d" - echo "# This file disables persistent-net due to /etc/conf.d/udev" \ - > "$d"/75-persistent-net-generator.rules - fi -} - -start_udevd() -{ - # load unix domain sockets if built as module, Bug #221253 - if [ -e /proc/modules ] ; then - modprobe -q unix 2>/dev/null - fi - ebegin "Starting udevd" - start-stop-daemon --start --exec /sbin/udevd -- --daemon - eend $? -} - -# populate /dev with devices already found by the kernel -populate_dev() -{ - if get_bootparam "nocoldplug" ; then - rc_coldplug="NO" - ewarn "Skipping udev coldplug as requested in kernel cmdline" - fi - - ebegin "Populating /dev with existing devices through uevents" - if yesno "${rc_coldplug}"; then - udevadm trigger - else - # Do not run any init-scripts, Bug #206518 - udevadm control --env do_not_run_plug_service=1 - - # only create device nodes - udevadm trigger --attr-match=dev - - # run persistent-net stuff, bug 191466 - udevadm trigger --subsystem-match=net - fi - eend $? - - ebegin "Waiting for uevents to be processed" - udevadm settle --timeout=60 - eend $? - - udevadm control --env do_not_run_plug_service= - return 0 -} - -display_hotplugged_services() { - local svcfile= svc= services= - for svcfile in "${RC_SVCDIR}"/hotplugged/*; do - svc="${svcfile##*/}" - [ -x "${svcfile}" ] || continue - - # do not display this - better: do only inject it later :) - [ "$svc" = "udev-postmount" ] && continue - - services="${services} ${svc}" - done - [ -n "${services}" ] && einfo "Device initiated services:${HILITE}${services}${NORMAL}" -} - -inject_postmount_initd() { - if ! mark_service_hotplugged udev-postmount; then - IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1 - fi - #einfo "Injected udev-postmount service" -} - -check_persistent_net() -{ - # check if there are problems with persistent-net - local syspath= devs= problem=false - for syspath in /sys/class/net/*_rename*; do - if [ -d "${syspath}" ]; then - devs="${devs} ${syspath##*/}" - problem=true - fi - done - - ${problem} || return 0 - - eerror "UDEV: Your system has a problem assigning persistent names" - eerror "to these network interfaces: ${devs}" - - einfo "Checking persistent-net rules:" - # the sed-expression lists all duplicate lines - # from the input, like "uniq -d" does, but uniq - # is installed into /usr/bin and not available at boot. - dups=$( - RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules' - . /lib/udev/rule_generator.functions - find_all_rules 'NAME=' '.*' | \ - tr ' ' '\n' | \ - sort | \ - sed '$!N; s/^\(.*\)\n\1$/\1/; t; D' - ) - if [ -n "${dups}" ]; then - ewarn "The rules create multiple entries assigning these names:" - eindent - ewarn "${dups}" - eoutdent - else - ewarn "Found no duplicate names in persistent-net rules," - ewarn "there must be some other problem!" - fi - return 1 -} - -check_udev_works() -{ - # should exist on every system, else udev failed - if [ ! -e /dev/zero ]; then - eerror "Assuming udev failed somewhere, as /dev/zero does not exist." - return 1 - fi - return 0 -} - -start() -{ - # do not run this on old baselayout where udev-addon gets loaded - if [ ! -f /etc/init.d/sysfs ]; then - eerror "The $SVCNAME init-script is written for baselayout-2!" - eerror "Please do not use it with baselayout-1!". - return 1 - fi - - _start - - display_hotplugged_services - - inject_postmount_initd -} - -_start() -{ - root_link - persistent_net_switch - - disable_hotplug_agent - start_udevd || cleanup - populate_dev || cleanup - - check_persistent_net - - check_udev_works || cleanup - - return 0 -} - -stop() { - ebegin "Stopping udevd" - start-stop-daemon --stop --exec /sbin/udevd - eend $? -} - diff --git a/sys-fs/udev/files/udev-135-r3.confd b/sys-fs/udev/files/udev-135-r3.confd deleted file mode 100644 index 4abfa911674d..000000000000 --- a/sys-fs/udev/files/udev-135-r3.confd +++ /dev/null @@ -1,27 +0,0 @@ -# /etc/conf.d/udev: config file for udev - -# We discourage to disable persistent-net!! -# this may lead to random interface naming - -# Disable adding new rules for persistent-net -persistent_net_disable="no" - -# Set to "yes" if you want to save /dev to a tarball on shutdown -# and restore it on startup. This is useful if you have a lot of -# custom device nodes that udev does not handle/know about. -# -# As this option is fragile, we recommend you -# to create your devices in /lib/udev/devices. -# These will be copied to /dev on boot. -#rc_device_tarball="NO" - -# udev can trigger coldplug events which cause services to start and -# kernel modules to be loaded. -# Services are deferred to start in the boot runlevel. -# Set rc_coldplug="NO" if you don't want this. -# If you want module coldplugging but not coldplugging of services then you -# can disable service coldplugging in baselayout/openrc config files. -# The setting is named different in different versions. -# in /etc/rc.conf: rc_hotplug="!*" or -# in /etc/conf.d/rc: rc_plug_services="!*" -#rc_coldplug="YES" diff --git a/sys-fs/udev/files/udev-135-rules-update.diff b/sys-fs/udev/files/udev-135-rules-update.diff deleted file mode 100644 index b28d26a29b7c..000000000000 --- a/sys-fs/udev/files/udev-135-rules-update.diff +++ /dev/null @@ -1,14 +0,0 @@ -Index: udev-git/rules/gentoo/40-gentoo.rules -=================================================================== ---- udev-git.orig/rules/gentoo/40-gentoo.rules -+++ udev-git/rules/gentoo/40-gentoo.rules -@@ -1,9 +1,5 @@ - # do not edit this file, it will be overwritten on update - --# capi devices --KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" --KERNEL=="capi*", NAME="capi/%n" -- - # old devfs path, removing this could break systems - # Bug 195839 - KERNEL=="md[0-9]*", SYMLINK+="md/%n" diff --git a/sys-fs/udev/files/udev-dev-tarball-135-r2.initd b/sys-fs/udev/files/udev-dev-tarball-135-r2.initd deleted file mode 100755 index 2cdce4ff226b..000000000000 --- a/sys-fs/udev/files/udev-dev-tarball-135-r2.initd +++ /dev/null @@ -1,95 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -description="Maintain a tarball of not udev managed device nodes" -[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev - -rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}} -device_tarball=/lib/udev/state/devices.tar.bz2 - -depend() { - if [ -f /etc/init.d/sysfs ]; then - need udev-mount - fi -} - -start() -{ - _start -} - -_start() { - if yesno "${rc_device_tarball}" && \ - [ -s "${device_tarball}" ] - then - ebegin "Populating /dev with saved device nodes" - tar -jxpf "${device_tarball}" -C /dev - eend $? - fi -} - -stop() { - if [ -e /dev/.devfsd ] || [ ! -e /dev/.udev ] || [ ! -z "${CDBOOT}" ] || \ - ! yesno "${rc_device_tarball}" || \ - ! touch "${device_tarball}" 2>/dev/null - then - return 0 - fi - - ebegin "Saving device nodes" - # Handle our temp files - save_tmp_base=/tmp/udev.savedevices."$$" - devices_udev="${save_tmp_base}"/devices.udev - devices_real="${save_tmp_base}"/devices.real - devices_totar="${save_tmp_base}"/devices.totar - device_tmp_tarball="${save_tmp_base}"/devices - - rm -rf "${save_tmp_base}" - mkdir "${save_tmp_base}" - touch "${devices_udev}" "${devices_real}" \ - "${devices_totar}" "${device_tmp_tarball}" - - if [ -f "${devices_udev}" -a -f "${devices_real}" -a \ - -f "${devices_totar}" -a -f "${device_tmp_tarball}" ] - then - cd /dev - # Find all devices, but ignore .udev directory - find . -xdev -type b -or -type c -or -type l | \ - cut -d/ -f2- | \ - grep -v ^\\.udev >"${devices_real}" - - # Figure out what udev created - udevadm info --export-db | sed -ne 's,^[SN]: \(.*\),\1,p' >"${devices_udev}" - # These ones we also do not want in there - for x in MAKEDEV core fd initctl pts shm stderr stdin stdout root; do - echo "${x}" >> "${devices_udev}" - done - if [ -d /lib/udev/devices ]; then - cd /lib/udev/devices - find . -xdev -type b -or -type c -or -type l | \ - cut -d/ -f2- >> "${devices_udev}" - cd /dev - fi - - fgrep -x -v -f "${devices_udev}" "${devices_real}" > "${devices_totar}" - - # Now only tarball those not created by udev if we have any - if [ -s "${devices_totar}" ]; then - # we dont want to descend into mounted filesystems (e.g. devpts) - # looking up username may involve NIS/network - # and net may be down - tar --one-file-system --numeric-owner \ - -jcpf "${device_tmp_tarball}" -T "${devices_totar}" - mv -f "${device_tmp_tarball}" "${device_tarball}" - else - rm -f "${device_tarball}" - fi - eend 0 - else - eend 1 "Could not create temporary files!" - fi - - rm -rf "${save_tmp_base}" -} - diff --git a/sys-fs/udev/files/udev-fix-udevinfo-in-doc.diff b/sys-fs/udev/files/udev-fix-udevinfo-in-doc.diff deleted file mode 100644 index cf9716ee34d9..000000000000 --- a/sys-fs/udev/files/udev-fix-udevinfo-in-doc.diff +++ /dev/null @@ -1,135 +0,0 @@ -commit 04f2a4fb6eded359cc8be1ba4ce33d7f7db6919f -Author: Miklos Vajna <vmiklos@frugalware.org> -Date: Fri Jan 23 03:55:24 2009 +0100 - - doc: writing udev rules - refer to 'udevadm info' instead of 'udevinfo' - - Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> - -diff --git a/docs/writing_udev_rules/index.html b/docs/writing_udev_rules/index.html -index 5fedb3f..ca4fb9d 100644 ---- a/docs/writing_udev_rules/index.html -+++ b/docs/writing_udev_rules/index.html -@@ -52,7 +52,7 @@ The most recent version of this document can always be found at: <br /> - <li>Finding suitable information from sysfs - <ul> - <li><a href="#sysfstree">The sysfs tree</a></li> -- <li><a href="#udevinfo">udevinfo</a></li> -+ <li><a href="#udevadm">udevadm info</a></li> - <li><a href="#sysfsalt">Alternative methods</a></li> - </ul> - </li> -@@ -429,15 +429,15 @@ In a udev rule, I could use ATTR{size}=="234441648" to identify this disk. As ud - Although this serves as a useful introduction as to the structure of sysfs and exactly how udev matches values, manually trawling through sysfs is both time consuming and unnecessary. - </p> - --<a name="udevinfo"></a> --<h3>udevinfo</h3> -+<a name="udevadm"></a> -+<h3>udevadm info</h3> - - <p> --Enter <em>udevinfo</em>, which is probably the most straightforward tool you can use to construct rules. All you need to know is the sysfs device path of the device in question. A trimmed example is shown below: -+Enter <em>udevadm info</em>, which is probably the most straightforward tool you can use to construct rules. All you need to know is the sysfs device path of the device in question. A trimmed example is shown below: - </p> - - <blockquote><pre> --# udevinfo -a -p /sys/block/sda -+# udevadm info -a -p /sys/block/sda - - <span class="green"> looking at device '/block/sda': - KERNEL=="sda" -@@ -476,7 +476,7 @@ Enter <em>udevinfo</em>, which is probably the most straightforward tool you can - </pre></blockquote> - - <p> --As you can see, udevinfo simply produces a list of attributes you can use as-is as match keys in your udev rules. From the above example, I could produce (e.g.) either of the following two rules for this device: -+As you can see, udevadm info simply produces a list of attributes you can use as-is as match keys in your udev rules. From the above example, I could produce (e.g.) either of the following two rules for this device: - </p> - - <blockquote><pre> -@@ -495,24 +495,24 @@ You are usually provided with a large number of attributes, and you must pick a - </p> - - <p> --Observe the effects of hierarchy in the udevinfo output. The <span class="green">green</span> section corresponding to the device in question uses the standard match keys such as KERNEL and ATTR. The <span class="blue">blue</span> and <span class="maroon">maroon</span> sections corresponding to parent devices use the parent-traversing variants such as SUBSYSTEMS and ATTRS. This is why the complexity introduced by the hierarchical structure is actually quite easy to deal with, just be sure to use the exact values that udevinfo suggests. -+Observe the effects of hierarchy in the udevadm info output. The <span class="green">green</span> section corresponding to the device in question uses the standard match keys such as KERNEL and ATTR. The <span class="blue">blue</span> and <span class="maroon">maroon</span> sections corresponding to parent devices use the parent-traversing variants such as SUBSYSTEMS and ATTRS. This is why the complexity introduced by the hierarchical structure is actually quite easy to deal with, just be sure to use the exact values that udevadm info suggests. - </p> - - <p> --Another point to note is that it is common for text attributes to appear in the udevinfo output to be padded with spaces (e.g. see ST3120827AS above). In your rules, you can either specify the extra spaces, or you can cut them off as I have done. -+Another point to note is that it is common for text attributes to appear in the udevadm info output to be padded with spaces (e.g. see ST3120827AS above). In your rules, you can either specify the extra spaces, or you can cut them off as I have done. - </p> - - <p> --The only complication with using udevinfo is that you are required to know the top-level device path (/sys/block/sda in the example above). This is not always obvious. However, as you are generally writing rules for device nodes which already exist, you can use udevinfo to look up the device path for you: -+The only complication with using udevadm info is that you are required to know the top-level device path (/sys/block/sda in the example above). This is not always obvious. However, as you are generally writing rules for device nodes which already exist, you can use udevadm info to look up the device path for you: - </p> - --<blockquote><pre># udevinfo -a -p $(udevinfo -q path -n /dev/sda)</pre></blockquote> -+<blockquote><pre># udevadm info -a -p $(udevadm info -q path -n /dev/sda)</pre></blockquote> - - <a name="sysfsalt"></a> - <h3>Alternative methods</h3> - - <p> --Although udevinfo is almost certainly the most straightforward way of listing the exact attributes you can build rules from, some users are happier with other tools. Utilities such as <a href="http://www.kroah.com/linux/usb/">usbview</a> display a similar set of information, most of which can be used in rules. -+Although udevadm info is almost certainly the most straightforward way of listing the exact attributes you can build rules from, some users are happier with other tools. Utilities such as <a href="http://www.kroah.com/linux/usb/">usbview</a> display a similar set of information, most of which can be used in rules. - </p> - - <h2>Advanced topics</h2> -@@ -659,11 +659,11 @@ For example, the rule below sets the group ownership on my hard disk node, and e - <h3>USB Printer</h3> - - <p> --I power on my printer, and it is assigned device node <em>/dev/lp0</em>. Not satisfied with such a bland name, I decide to use udevinfo to aid me in writing a rule which will provide an alternative name: -+I power on my printer, and it is assigned device node <em>/dev/lp0</em>. Not satisfied with such a bland name, I decide to use udevadm info to aid me in writing a rule which will provide an alternative name: - </p> - - <blockquote><pre> --# udevinfo -a -p $(udevinfo -q path -n /dev/lp0) -+# udevadm info -a -p $(udevadm info -q path -n /dev/lp0) - looking at device '/class/usb/lp0': - KERNEL=="lp0" - SUBSYSTEM=="usb" -@@ -695,7 +695,7 @@ Not all cameras work in this way: some of them use a non-storage protocol such a - </p> - - <p> --A common complication with USB camera devices is that they usually identify themselves as a disk with a single partition, in this case <em>/dev/sdb</em> with <em>/dev/sdb1</em>. The sdb node is useless to me, but sdb1 is interesting - this is the one I want to mount. There is a problem here that because sysfs is chained, the useful attributes which udevinfo produces for /dev/sdb1 are identical to the ones for /dev/sdb. This results in your rule potentially matching <u>both</u> the raw disk and the partition, which is not what you want, your rule should be <b>specific</b>. -+A common complication with USB camera devices is that they usually identify themselves as a disk with a single partition, in this case <em>/dev/sdb</em> with <em>/dev/sdb1</em>. The sdb node is useless to me, but sdb1 is interesting - this is the one I want to mount. There is a problem here that because sysfs is chained, the useful attributes which udevadm info produces for /dev/sdb1 are identical to the ones for /dev/sdb. This results in your rule potentially matching <u>both</u> the raw disk and the partition, which is not what you want, your rule should be <b>specific</b>. - </p> - - <p> -@@ -703,7 +703,7 @@ To get around this, you simply need to think about what differs between sdb and - </p> - - <blockquote><pre> --# udevinfo -a -p $(udevinfo -q path -n /dev/sdb1) -+# udevadm info -a -p $(udevadm info -q path -n /dev/sdb1) - looking at device '/block/sdb/sdb1': - KERNEL=="sdb1" - SUBSYSTEM=="block" -@@ -781,7 +781,7 @@ These devices work as USB-serial devices, so by default, you only get the <em>tt - <blockquote><pre>SUBSYSTEMS=="usb", ATTRS{product}=="Palm Handheld", KERNEL=="ttyUSB*", SYMLINK+="pilot"</pre></blockquote> - - <p> --Note that the product string seems to vary from product to product, so make sure that you check (using udevinfo) which one applies to you. -+Note that the product string seems to vary from product to product, so make sure that you check (using udevadm info) which one applies to you. - </p> - - <a name="example-cdrom"></a> -@@ -808,11 +808,11 @@ Even though they are referenced by names, network interfaces typically do not ha - </p> - - <p> --It makes sense to simply match the MAC address of your interface in the rule, as this is unique. However, make sure that you use the <em>exact</em> MAC address as shown as udevinfo, because if you do not match the case exactly, your rule will not work. -+It makes sense to simply match the MAC address of your interface in the rule, as this is unique. However, make sure that you use the <em>exact</em> MAC address as shown as udevadm info, because if you do not match the case exactly, your rule will not work. - </p> - - <blockquote><pre> --# udevinfo -a -p /sys/class/net/eth0 -+# udevadm info -a -p /sys/class/net/eth0 - looking at class device '/sys/class/net/eth0': - KERNEL=="eth0" - ATTR{address}=="00:52:8b:d5:04:48" diff --git a/sys-fs/udev/files/udev-mount-135-r2.initd b/sys-fs/udev/files/udev-mount-135-r2.initd deleted file mode 100755 index 0c4d04633276..000000000000 --- a/sys-fs/udev/files/udev-mount-135-r2.initd +++ /dev/null @@ -1,107 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -description="Mount tmpfs on /dev" -[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev - -# get_KV and others -. /lib/udev/shell-compat.sh - -# FIXME -# Instead of this script testing kernel version, udev itself should -# Maybe something like udevd --test || exit $? -check_kernel() -{ - if [ $(get_KV) -lt $(KV_to_int '2.6.15') ]; then - eerror "Your kernel is too old to work with this version of udev." - eerror "Current udev only supports Linux kernel 2.6.15 and newer." - return 1 - fi - if [ $(get_KV) -lt $(KV_to_int '2.6.18') ]; then - ewarn "You need at least Linux kernel 2.6.18 for reliable operation of udev." - fi - return 0 -} - - -mount_dev_directory() -{ - # No options are processed here as they should all be in /etc/fstab - ebegin "Mounting /dev" - if fstabinfo --quiet /dev; then - mount -n /dev - else - # Some devices require exec, Bug #92921 - mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" udev /dev - fi - eend $? -} - -seed_dev() -{ - # Seed /dev with some things that we know we need - - # creating /dev/console, /dev/tty and /dev/tty1 to be able to write - # to $CONSOLE with/without bootsplash before udevd creates it - [ -c /dev/console ] || mknod /dev/console c 5 1 - [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1 - [ -c /dev/tty ] || mknod /dev/tty c 5 0 - - # udevd will dup its stdin/stdout/stderr to /dev/null - # and we do not want a file which gets buffered in ram - [ -c /dev/null ] || mknod /dev/null c 1 3 - - # copy over any persistant things - if [ -d /lib/udev/devices ]; then - cp -RPp /lib/udev/devices/* /dev 2>/dev/null - fi - - # Not provided by sysfs but needed - ln -snf /proc/self/fd /dev/fd - ln -snf fd/0 /dev/stdin - ln -snf fd/1 /dev/stdout - ln -snf fd/2 /dev/stderr - [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core - - # Create problematic directories - mkdir -p /dev/pts /dev/shm - return 0 -} - - -start() -{ - # do not run this on too old baselayout - udev-addon is already loaded! - if [ ! -f /etc/init.d/sysfs ]; then - eerror "The $SVCNAME init-script is written for baselayout-2!" - eerror "Please do not use it with baselayout-1!". - return 1 - fi - - _start -} - -_start() -{ - check_kernel || return 1 - mount_dev_directory || return 1 - - # Selinux lovin; /selinux should be mounted by selinux-patched init - if [ -x /sbin/restorecon -a -c /selinux/null ]; then - restorecon /dev > /selinux/null - fi - - # make sure it exists - mkdir -p /dev/.udev - - # FIXME: Is this needed with openrc? - # Create a file so that our rc system knows it's still in sysinit. - # Existance means init scripts will not directly run. - # rc will remove the file when done with sysinit. - touch /dev/.rcsysinit - - seed_dev - - return 0 -} diff --git a/sys-fs/udev/files/udev-mount-135-r3.initd b/sys-fs/udev/files/udev-mount-135-r3.initd deleted file mode 100755 index 84bed6a48a09..000000000000 --- a/sys-fs/udev/files/udev-mount-135-r3.initd +++ /dev/null @@ -1,101 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -description="Mount tmpfs on /dev" -[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev - -# get_KV and others -. /lib/udev/shell-compat.sh - -# FIXME -# Instead of this script testing kernel version, udev itself should -# Maybe something like udevd --test || exit $? -check_kernel() -{ - if [ $(get_KV) -lt $(KV_to_int '2.6.15') ]; then - eerror "Your kernel is too old to work with this version of udev." - eerror "Current udev only supports Linux kernel 2.6.15 and newer." - return 1 - fi - if [ $(get_KV) -lt $(KV_to_int '2.6.18') ]; then - ewarn "You need at least Linux kernel 2.6.18 for reliable operation of udev." - fi - return 0 -} - - -mount_dev_directory() -{ - # No options are processed here as they should all be in /etc/fstab - ebegin "Mounting /dev" - if fstabinfo --quiet /dev; then - mount -n /dev - else - # Some devices require exec, Bug #92921 - mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" udev /dev - fi - eend $? -} - -seed_dev() -{ - # Seed /dev with some things that we know we need - - # creating /dev/console, /dev/tty and /dev/tty1 to be able to write - # to $CONSOLE with/without bootsplash before udevd creates it - [ -c /dev/console ] || mknod /dev/console c 5 1 - [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1 - [ -c /dev/tty ] || mknod /dev/tty c 5 0 - - # udevd will dup its stdin/stdout/stderr to /dev/null - # and we do not want a file which gets buffered in ram - [ -c /dev/null ] || mknod /dev/null c 1 3 - - # copy over any persistant things - if [ -d /lib/udev/devices ]; then - cp -RPp /lib/udev/devices/* /dev 2>/dev/null - fi - - # Not provided by sysfs but needed - ln -snf /proc/self/fd /dev/fd - ln -snf fd/0 /dev/stdin - ln -snf fd/1 /dev/stdout - ln -snf fd/2 /dev/stderr - [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core - - # Create problematic directories - mkdir -p /dev/pts /dev/shm - return 0 -} - - -start() -{ - # do not run this on too old baselayout - udev-addon is already loaded! - if [ ! -f /etc/init.d/sysfs ]; then - eerror "The $SVCNAME init-script is written for baselayout-2!" - eerror "Please do not use it with baselayout-1!". - return 1 - fi - - _start -} - -_start() -{ - check_kernel || return 1 - mount_dev_directory || return 1 - - # Selinux lovin; /selinux should be mounted by selinux-patched init - if [ -x /sbin/restorecon -a -c /selinux/null ]; then - restorecon /dev > /selinux/null - fi - - # make sure it exists - mkdir -p /dev/.udev - - seed_dev - - return 0 -} diff --git a/sys-fs/udev/files/udev-postmount-130-r2.initd b/sys-fs/udev/files/udev-postmount-130-r2.initd deleted file mode 100755 index a19e11b0a63a..000000000000 --- a/sys-fs/udev/files/udev-postmount-130-r2.initd +++ /dev/null @@ -1,25 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/files/udev-postmount-130-r2.initd,v 1.1 2008/10/28 21:59:05 zzam Exp $ - -depend() { - need localmount -} - -start() { - # check if this system uses udev - [ -d /dev/.udev/ ] || return 0 - - einfo "udev postmount cleanup" - - # store persistent-rules that got created while booting - # when / was still read-only - /lib/udev/move_tmp_persistent_rules.sh -} - -stop() { - : -} - -# vim:ts=4 diff --git a/sys-fs/udev/files/udev-postmount-135-r2.initd b/sys-fs/udev/files/udev-postmount-135-r2.initd deleted file mode 100755 index bde1f59d159f..000000000000 --- a/sys-fs/udev/files/udev-postmount-135-r2.initd +++ /dev/null @@ -1,23 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/files/udev-postmount-135-r2.initd,v 1.1 2008/12/19 22:40:58 zzam Exp $ - -depend() { - need localmount -} - -start() { - # check if this system uses udev - [ -d /dev/.udev/ ] || return 0 - - # store persistent-rules that got created while booting - # when / was still read-only - /lib/udev/move_tmp_persistent_rules.sh -} - -stop() { - : -} - -# vim:ts=4 diff --git a/sys-fs/udev/files/udev-start-126.sh b/sys-fs/udev/files/udev-start-126.sh deleted file mode 100644 index 12641340e942..000000000000 --- a/sys-fs/udev/files/udev-start-126.sh +++ /dev/null @@ -1,239 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf -. /lib/udev/shell-compat.sh - -rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}} -rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}} - -cleanup() -{ - # fail more gracely and not leave udevd running - start-stop-daemon --stop --exec /sbin/udevd - exit 1 -} - -# FIXME -# Instead of this script testing kernel version, udev itself should -# Maybe something like udevd --test || exit $? -check_kernel() -{ - if [ $(get_KV) -lt $(KV_to_int '2.6.15') ]; then - eerror "Your kernel is too old to work with this version of udev." - eerror "Current udev only supports Linux kernel 2.6.15 and newer." - return 1 - fi - if [ $(get_KV) -lt $(KV_to_int '2.6.18') ]; then - ewarn "You need at least Linux kernel 2.6.18 for reliable operation of udev." - fi - return 0 -} - - -mount_dev_directory() -{ - # No options are processed here as they should all be in /etc/fstab - ebegin "Mounting /dev" - if fstabinfo --quiet /dev; then - mount -n /dev - else - # Some devices require exec, Bug #92921 - mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" udev /dev - fi - eend $? -} - -unpack_device_tarball() -{ - local device_tarball=/lib/udev/state/devices.tar.bz2 - if yesno "${rc_device_tarball}" && \ - [ -s "${device_tarball}" ] - then - ebegin "Populating /dev with saved device nodes" - tar -jxpf "${device_tarball}" -C /dev - eend $? - fi -} - -seed_dev() -{ - # Seed /dev with some things that we know we need - - # creating /dev/console and /dev/tty1 to be able to write - # to $CONSOLE with/without bootsplash before udevd creates it - [ -c /dev/console ] || mknod /dev/console c 5 1 - [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1 - - # udevd will dup its stdin/stdout/stderr to /dev/null - # and we do not want a file which gets buffered in ram - [ -c /dev/null ] || mknod /dev/null c 1 3 - - # copy over any persistant things - if [ -d /lib/udev/devices ]; then - cp -RPp /lib/udev/devices/* /dev 2>/dev/null - fi - - # Not provided by sysfs but needed - ln -snf /proc/self/fd /dev/fd - ln -snf fd/0 /dev/stdin - ln -snf fd/1 /dev/stdout - ln -snf fd/2 /dev/stderr - [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core - - # Create problematic directories - mkdir -p /dev/pts /dev/shm - return 0 -} - -disable_hotplug_agent() -{ - if [ -e /proc/sys/kernel/hotplug ]; then - echo "" >/proc/sys/kernel/hotplug - fi -} - -root_link() -{ - /lib/udev/write_root_link_rule -} - -start_udevd() -{ - # load unix domain sockets if built as module, Bug #221253 - if [ -e /proc/modules ] ; then - modprobe -q unix 2>/dev/null - fi - ebegin "Starting udevd" - start-stop-daemon --start --exec /sbin/udevd -- --daemon - eend $? -} - -# populate /dev with devices already found by the kernel -populate_dev() -{ - if get_bootparam "nocoldplug" ; then - rc_coldplug="NO" - ewarn "Skipping udev coldplug as requested in kernel cmdline" - fi - - ebegin "Populating /dev with existing devices through uevents" - if yesno "${rc_coldplug}"; then - udevadm trigger - else - # Do not run any init-scripts, Bug #206518 - udevadm control --env do_not_run_plug_service=1 - - # only create device nodes - udevadm trigger --attr-match=dev - - # run persistent-net stuff, bug 191466 - udevadm trigger --subsystem-match=net - fi - eend $? - - ebegin "Waiting for uevents to be processed" - udevadm settle --timeout=60 - eend $? - - udevadm control --env do_not_run_plug_service= - return 0 -} - -compat_volume_nodes() -{ - # Only do this for baselayout-1* - if [ ! -e /lib/librc.so ]; then - - # Create nodes that udev can't - [ -x /sbin/lvm ] && \ - /sbin/lvm vgscan -P --mknodes --ignorelockingfailure &>/dev/null - # Running evms_activate on a LiveCD causes lots of headaches - [ -z "${CDBOOT}" -a -x /sbin/evms_activate ] && \ - /sbin/evms_activate -q &>/dev/null - fi -} - -check_persistent_net() -{ - # check if there are problems with persistent-net - local syspath= devs= problem=false - for syspath in /sys/class/net/*_rename*; do - if [ -d "${syspath}" ]; then - devs="${devs} ${syspath##*/}" - problem=true - fi - done - - ${problem} || return 0 - - eerror "UDEV: Your system has a problem assigning persistent names" - eerror "to these network interfaces: ${devs}" - - einfo "Checking persistent-net rules:" - # the sed-expression lists all duplicate lines - # from the input, like "uniq -d" does, but uniq - # is installed into /usr/bin and not available at boot. - dups=$( - RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules' - . /lib/udev/rule_generator.functions - find_all_rules 'NAME=' '.*' | \ - tr ' ' '\n' | \ - sort | \ - sed '$!N; s/^\(.*\)\n\1$/\1/; t; D' - ) - if [ -n "${dups}" ]; then - ewarn "The rules create multiple entries assigning these names:" - eindent - ewarn "${dups}" - eoutdent - else - ewarn "Found no duplicate names in persistent-net rules," - ewarn "there must be some other problem!" - fi - return 1 -} - -check_udev_works() -{ - # should exist on every system, else udev failed - if [ ! -e /dev/zero ]; then - eerror "Assuming udev failed somewhere, as /dev/zero does not exist." - return 1 - fi - return 0 -} - - - -check_kernel || cleanup -mount_dev_directory || cleanup - -# Create a file so that our rc system knows it's still in sysinit. -# Existance means init scripts will not directly run. -# rc will remove the file when done with sysinit. -touch /dev/.rcsysinit - -# Selinux lovin; /selinux should be mounted by selinux-patched init -if [ -x /sbin/restorecon -a -c /selinux/null ]; then - restorecon /dev > /selinux/null -fi - -unpack_device_tarball -seed_dev -root_link -disable_hotplug_agent - -start_udevd || cleanup -populate_dev || cleanup - -compat_volume_nodes -check_persistent_net - -# trigger executing initscript when /etc is writable -IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1 - -check_udev_works || cleanup - -# udev started successfully -exit 0 diff --git a/sys-fs/udev/files/udev-start-133.sh b/sys-fs/udev/files/udev-start-133.sh deleted file mode 100644 index 24a4d9ef8098..000000000000 --- a/sys-fs/udev/files/udev-start-133.sh +++ /dev/null @@ -1,254 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -[ -e /etc/udev/udev.conf ] && . /etc/udev/udev.conf -[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev -. /lib/udev/shell-compat.sh - -rc_coldplug=${rc_coldplug:-${RC_COLDPLUG:-YES}} -rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}} - -cleanup() -{ - # fail more gracely and not leave udevd running - start-stop-daemon --stop --exec /sbin/udevd - exit 1 -} - -# FIXME -# Instead of this script testing kernel version, udev itself should -# Maybe something like udevd --test || exit $? -check_kernel() -{ - if [ $(get_KV) -lt $(KV_to_int '2.6.15') ]; then - eerror "Your kernel is too old to work with this version of udev." - eerror "Current udev only supports Linux kernel 2.6.15 and newer." - return 1 - fi - if [ $(get_KV) -lt $(KV_to_int '2.6.18') ]; then - ewarn "You need at least Linux kernel 2.6.18 for reliable operation of udev." - fi - return 0 -} - - -mount_dev_directory() -{ - # No options are processed here as they should all be in /etc/fstab - ebegin "Mounting /dev" - if fstabinfo --quiet /dev; then - mount -n /dev - else - # Some devices require exec, Bug #92921 - mount -n -t tmpfs -o "exec,nosuid,mode=0755,size=10M" udev /dev - fi - eend $? -} - -unpack_device_tarball() -{ - local device_tarball=/lib/udev/state/devices.tar.bz2 - if yesno "${rc_device_tarball}" && \ - [ -s "${device_tarball}" ] - then - ebegin "Populating /dev with saved device nodes" - tar -jxpf "${device_tarball}" -C /dev - eend $? - fi -} - -seed_dev() -{ - # Seed /dev with some things that we know we need - - # creating /dev/console and /dev/tty1 to be able to write - # to $CONSOLE with/without bootsplash before udevd creates it - [ -c /dev/console ] || mknod /dev/console c 5 1 - [ -c /dev/tty1 ] || mknod /dev/tty1 c 4 1 - - # udevd will dup its stdin/stdout/stderr to /dev/null - # and we do not want a file which gets buffered in ram - [ -c /dev/null ] || mknod /dev/null c 1 3 - - # copy over any persistant things - if [ -d /lib/udev/devices ]; then - cp -RPp /lib/udev/devices/* /dev 2>/dev/null - fi - - # Not provided by sysfs but needed - ln -snf /proc/self/fd /dev/fd - ln -snf fd/0 /dev/stdin - ln -snf fd/1 /dev/stdout - ln -snf fd/2 /dev/stderr - [ -e /proc/kcore ] && ln -snf /proc/kcore /dev/core - - # Create problematic directories - mkdir -p /dev/pts /dev/shm - return 0 -} - -disable_hotplug_agent() -{ - if [ -e /proc/sys/kernel/hotplug ]; then - echo "" >/proc/sys/kernel/hotplug - fi -} - -root_link() -{ - /lib/udev/write_root_link_rule -} - -persistent_net_switch() -{ - # this function disables rules files - # by creating new files with the same name - # in a temp rules directory with higher priority - local d=/dev/.udev/rules.d - if yesno "${persistent_net_disable:-no}"; then - mkdir -p "$d" - echo "# This file disables persistent-net due to /etc/conf.d/udev" \ - > "$d"/75-persistent-net-generator.rules - fi -} - -start_udevd() -{ - # load unix domain sockets if built as module, Bug #221253 - if [ -e /proc/modules ] ; then - modprobe -q unix 2>/dev/null - fi - ebegin "Starting udevd" - start-stop-daemon --start --exec /sbin/udevd -- --daemon - eend $? -} - -# populate /dev with devices already found by the kernel -populate_dev() -{ - if get_bootparam "nocoldplug" ; then - rc_coldplug="NO" - ewarn "Skipping udev coldplug as requested in kernel cmdline" - fi - - ebegin "Populating /dev with existing devices through uevents" - if yesno "${rc_coldplug}"; then - udevadm trigger - else - # Do not run any init-scripts, Bug #206518 - udevadm control --env do_not_run_plug_service=1 - - # only create device nodes - udevadm trigger --attr-match=dev - - # run persistent-net stuff, bug 191466 - udevadm trigger --subsystem-match=net - fi - eend $? - - ebegin "Waiting for uevents to be processed" - udevadm settle --timeout=60 - eend $? - - udevadm control --env do_not_run_plug_service= - return 0 -} - -compat_volume_nodes() -{ - # Only do this for baselayout-1* - if [ ! -e /lib/librc.so ]; then - - # Create nodes that udev can't - [ -x /sbin/lvm ] && \ - /sbin/lvm vgscan -P --mknodes --ignorelockingfailure &>/dev/null - # Running evms_activate on a LiveCD causes lots of headaches - [ -z "${CDBOOT}" -a -x /sbin/evms_activate ] && \ - /sbin/evms_activate -q &>/dev/null - fi -} - -check_persistent_net() -{ - # check if there are problems with persistent-net - local syspath= devs= problem=false - for syspath in /sys/class/net/*_rename*; do - if [ -d "${syspath}" ]; then - devs="${devs} ${syspath##*/}" - problem=true - fi - done - - ${problem} || return 0 - - eerror "UDEV: Your system has a problem assigning persistent names" - eerror "to these network interfaces: ${devs}" - - einfo "Checking persistent-net rules:" - # the sed-expression lists all duplicate lines - # from the input, like "uniq -d" does, but uniq - # is installed into /usr/bin and not available at boot. - dups=$( - RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules' - . /lib/udev/rule_generator.functions - find_all_rules 'NAME=' '.*' | \ - tr ' ' '\n' | \ - sort | \ - sed '$!N; s/^\(.*\)\n\1$/\1/; t; D' - ) - if [ -n "${dups}" ]; then - ewarn "The rules create multiple entries assigning these names:" - eindent - ewarn "${dups}" - eoutdent - else - ewarn "Found no duplicate names in persistent-net rules," - ewarn "there must be some other problem!" - fi - return 1 -} - -check_udev_works() -{ - # should exist on every system, else udev failed - if [ ! -e /dev/zero ]; then - eerror "Assuming udev failed somewhere, as /dev/zero does not exist." - return 1 - fi - return 0 -} - - - -check_kernel || cleanup -mount_dev_directory || cleanup - -# Create a file so that our rc system knows it's still in sysinit. -# Existance means init scripts will not directly run. -# rc will remove the file when done with sysinit. -touch /dev/.rcsysinit - -# Selinux lovin; /selinux should be mounted by selinux-patched init -if [ -x /sbin/restorecon -a -c /selinux/null ]; then - restorecon /dev > /selinux/null -fi - -unpack_device_tarball -seed_dev -root_link -persistent_net_switch -disable_hotplug_agent - -start_udevd || cleanup -populate_dev || cleanup - -compat_volume_nodes -check_persistent_net - -# trigger executing initscript when /etc is writable -IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1 - -check_udev_works || cleanup - -# udev started successfully -exit 0 diff --git a/sys-fs/udev/files/udev-start-135-r2.sh b/sys-fs/udev/files/udev-start-135-r2.sh deleted file mode 100644 index ecda790dc9d4..000000000000 --- a/sys-fs/udev/files/udev-start-135-r2.sh +++ /dev/null @@ -1,45 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev - -. /lib/udev/shell-compat.sh - -compat_volume_nodes() -{ - # Only do this for baselayout-1* - if [ ! -e /lib/librc.so ]; then - - # Create nodes that udev can't - [ -x /sbin/lvm ] && \ - /sbin/lvm vgscan -P --mknodes --ignorelockingfailure &>/dev/null - # Running evms_activate on a LiveCD causes lots of headaches - [ -z "${CDBOOT}" -a -x /sbin/evms_activate ] && \ - /sbin/evms_activate -q &>/dev/null - fi -} - -start_initd() -{ - ( - . /etc/init.d/"$1" - _start - ) -} - -# mount tmpfs on /dev -start_initd udev-mount || exit 1 - -# load device tarball -start_initd udev-dev-tarball - -# run udevd -start_initd udev || exit 1 - -compat_volume_nodes - -# inject into boot runlevel -IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1 - -# udev started successfully -exit 0 diff --git a/sys-fs/udev/files/udev-start-135-r3.sh b/sys-fs/udev/files/udev-start-135-r3.sh deleted file mode 100644 index 84de1628a534..000000000000 --- a/sys-fs/udev/files/udev-start-135-r3.sh +++ /dev/null @@ -1,54 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -[ -e /etc/conf.d/udev ] && . /etc/conf.d/udev - -. /lib/udev/shell-compat.sh - -compat_volume_nodes() -{ - # Only do this for baselayout-1* - # This check is likely to get false positives due to some multilib stuff, - # but that should not matter, as this can only happen on old openrc versions - # no longer available as ebuilds. - if [ ! -e /lib/librc.so ]; then - - # Create nodes that udev can't - [ -x /sbin/lvm ] && \ - /sbin/lvm vgscan -P --mknodes --ignorelockingfailure &>/dev/null - # Running evms_activate on a LiveCD causes lots of headaches - [ -z "${CDBOOT}" -a -x /sbin/evms_activate ] && \ - /sbin/evms_activate -q &>/dev/null - fi -} - -start_initd() -{ - ( - . /etc/init.d/"$1" - _start - ) -} - -# mount tmpfs on /dev -start_initd udev-mount || exit 1 - -# Create a file so that our rc system knows it's still in sysinit. -# Existance means init scripts will not directly run. -# rc will remove the file when done with sysinit. -# this is no longer needed as of openrc-0.4.0 -touch /dev/.rcsysinit - -# load device tarball -start_initd udev-dev-tarball - -# run udevd -start_initd udev || exit 1 - -compat_volume_nodes - -# inject into boot runlevel -IN_HOTPLUG=1 /etc/init.d/udev-postmount start >/dev/null 2>&1 - -# udev started successfully -exit 0 diff --git a/sys-fs/udev/files/udev-stop-126.sh b/sys-fs/udev/files/udev-stop-126.sh deleted file mode 100755 index 081b7150fab8..000000000000 --- a/sys-fs/udev/files/udev-stop-126.sh +++ /dev/null @@ -1,71 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -/lib/udev/move_tmp_persistent_rules.sh - -. /lib/udev/shell-compat.sh - -device_tarball=/lib/udev/state/devices.tar.bz2 - -rc_device_tarball=${rc_device_tarball:-${RC_DEVICE_TARBALL:-NO}} -if [ -e /dev/.devfsd ] || [ ! -e /dev/.udev ] || [ ! -z "${CDBOOT}" ] || \ - ! yesno "${rc_device_tarball}" || \ - ! touch "${device_tarball}" 2>/dev/null -then - exit 0 -fi - -ebegin "Saving device nodes" -# Handle our temp files -save_tmp_base=/tmp/udev.savedevices."$$" -devices_udev="${save_tmp_base}"/devices.udev -devices_real="${save_tmp_base}"/devices.real -devices_totar="${save_tmp_base}"/devices.totar -device_tmp_tarball="${save_tmp_base}"/devices - -rm -rf "${save_tmp_base}" -mkdir "${save_tmp_base}" -touch "${devices_udev}" "${devices_real}" \ -"${devices_totar}" "${device_tmp_tarball}" - -if [ -f "${devices_udev}" -a -f "${devices_real}" -a \ - -f "${devices_totar}" -a -f "${device_tmp_tarball}" ] -then - cd /dev - # Find all devices, but ignore .udev directory - find . -xdev -type b -or -type c -or -type l | \ - cut -d/ -f2- | \ - grep -v ^\\.udev >"${devices_real}" - - # Figure out what udev created - udevadm info --export-db | sed -ne 's,^[SN]: \(.*\),\1,p' >"${devices_udev}" - # These ones we also do not want in there - for x in MAKEDEV core fd initctl pts shm stderr stdin stdout root; do - echo "${x}" >> "${devices_udev}" - done - if [ -d /lib/udev/devices ]; then - cd /lib/udev/devices - find . -xdev -type b -or -type c -or -type l | \ - cut -d/ -f2- >> "${devices_udev}" - cd /dev - fi - - fgrep -x -v -f "${devices_udev}" "${devices_real}" > "${devices_totar}" - - # Now only tarball those not created by udev if we have any - if [ -s "${devices_totar}" ]; then - # we dont want to descend into mounted filesystems (e.g. devpts) - # looking up username may involve NIS/network - # and net may be down - tar --one-file-system --numeric-owner \ - -jcpf "${device_tmp_tarball}" -T "${devices_totar}" - mv -f "${device_tmp_tarball}" "${device_tarball}" - else - rm -f "${device_tarball}" - fi - eend 0 -else - eend 1 "Could not create temporary files!" -fi - -rm -rf "${save_tmp_base}" diff --git a/sys-fs/udev/files/udev-stop-135-r2.sh b/sys-fs/udev/files/udev-stop-135-r2.sh deleted file mode 100644 index 15e8d3db39eb..000000000000 --- a/sys-fs/udev/files/udev-stop-135-r2.sh +++ /dev/null @@ -1,13 +0,0 @@ -# Copyright 1999-2007 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 - -# for function yesno -. /lib/udev/shell-compat.sh - -# store device tarball -( - . /etc/init.d/udev-dev-tarball - stop -) - -exit 0 diff --git a/sys-fs/udev/udev-122-r1.ebuild b/sys-fs/udev/udev-122-r1.ebuild deleted file mode 100644 index f44716f68ae4..000000000000 --- a/sys-fs/udev/udev-122-r1.ebuild +++ /dev/null @@ -1,374 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-122-r1.ebuild,v 1.3 2008/11/28 12:51:54 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" -SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -DEPEND="selinux? ( sys-libs/libselinux )" -RDEPEND="!sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1" -RDEPEND="${DEPEND} ${RDEPEND} - >=sys-apps/baselayout-1.12.5" -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - myconf= - extras="extras/ata_id \ - extras/cdrom_id \ - extras/edd_id \ - extras/firmware \ - extras/floppy \ - extras/path_id \ - extras/scsi_id \ - extras/usb_id \ - extras/volume_id \ - extras/collect \ - extras/rule_generator" - - use selinux && myconf="${myconf} USE_SELINUX=true" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 && ${KV_MICRO} -ge 18 ]] - then - ok=1 - fi - - if [[ ${ok} == 0 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version 2.6.15!" - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version 2.6.18!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - unpack ${A} - - cd "${S}" - - # patches go here... - # Bug #223757, Bug #208578 - epatch "${FILESDIR}/${P}-rules-update.diff" - - # No need to clutter the logs ... - sed -ie '/^DEBUG/ c\DEBUG = false' Makefile - # Do not use optimization flags from the package - sed -ie 's|$(OPTIMIZATION)||g' Makefile - # Do not require xmlto to refresh manpages - sed -ie 's|$(MAN_PAGES)||g' Makefile - - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/etc/udev/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != db44f7e02100f57a555d48e2192c3f8d ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - die "50-udev-default.rules has been updated, please validate!" - fi - - sed_helper_dir \ - etc/udev/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev_rules_parse.c \ - udev_rules.c - - # Use correct multilib dir - sed -i extras/volume_id/lib/Makefile \ - -e "/ =/s-/lib-/$(get_libdir)-" -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - if [[ -z ${extras} ]]; then - eerror "Variable extras is unset!" - eerror "It seems you suffer from Bug #190994" - die "Variable extras is unset!" - fi - - # Not everyone has full $CHOST-{ld,ar,etc...} yet - local mycross="" - type -p ${CHOST}-ar && mycross=${CHOST}- - - emake \ - EXTRAS="${extras}" \ - libudevdir=${udev_helper_dir} \ - CROSS_COMPILE=${mycross} \ - OPTFLAGS="" \ - ${myconf} || die "compiling udev failed" -} - -src_install() { - into / - emake \ - DESTDIR="${D}" \ - libudevdir=${udev_helper_dir} \ - EXTRAS="${extras}" \ - ${myconf} \ - install || die "make install failed" - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-118-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - doexe "${FILESDIR}"/write_root_link_rule \ - || die "write_root_link_rule not installed properly" - newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # vol_id library (needed by mount and HAL) - into / - rm "${D}/$(get_libdir)"/libvolume_id.so* 2>/dev/null - dolib extras/volume_id/lib/*.so* || die "Failed installing libvolume_id.so" - into /usr - dolib extras/volume_id/lib/*.a || die "Failed installing libvolume_id.a" - - # handle static linking bug #4411 - rm -f "${D}/usr/$(get_libdir)/libvolume_id.so" - gen_usr_ldscript libvolume_id.so - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # Now installing rules - cd etc/udev - insinto /etc/udev/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - newins "${FILESDIR}"/udev-start-122-r1.sh udev-start.sh - newins "${FILESDIR}"/udev-stop-118-r2.sh udev-stop.sh - - # The udev-post init-script - newinitd "${FILESDIR}"/udev-postmount-initd-111-r2 udev-postmount - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog FAQ README TODO RELEASE-NOTES - dodoc docs/{overview,udev_vs_devfs} - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? -} - -pkg_postinst() { - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - if [[ ${ROOT} == / ]] - then - # check if root of init-process is identical to ours - if [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] - then - einfo "restarting udevd now." - if [[ -n $(pidof udevd) ]] - then - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - fi - /sbin/udevd --daemon - fi - fi - - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "as the helper apps udevinfo, udevtrigger, ... are now" - ewarn "only symlinks to udevadm." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-125-r2.ebuild b/sys-fs/udev/udev-125-r2.ebuild deleted file mode 100644 index 95f7aa301425..000000000000 --- a/sys-fs/udev/udev-125-r2.ebuild +++ /dev/null @@ -1,374 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-125-r2.ebuild,v 1.2 2008/11/28 12:51:54 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" -SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -DEPEND="selinux? ( sys-libs/libselinux )" -RDEPEND="!sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1" -RDEPEND="${DEPEND} ${RDEPEND} - >=sys-apps/baselayout-1.12.5" -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - myconf= - extras="extras/ata_id \ - extras/cdrom_id \ - extras/edd_id \ - extras/firmware \ - extras/floppy \ - extras/path_id \ - extras/scsi_id \ - extras/usb_id \ - extras/volume_id \ - extras/collect \ - extras/rule_generator" - - use selinux && myconf="${myconf} USE_SELINUX=true" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 && ${KV_MICRO} -ge 18 ]] - then - ok=1 - fi - - if [[ ${ok} == 0 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version 2.6.15!" - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version 2.6.18!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - unpack ${A} - - cd "${S}" - - # patches go here... - # Bug #223757, Bug #208578 - epatch "${FILESDIR}/${PN}-125-rules-update.diff" - epatch "${FILESDIR}/${P}-cdrom-autoclose-bug.diff" - - # No need to clutter the logs ... - sed -ie '/^DEBUG/ c\DEBUG = false' Makefile - # Do not use optimization flags from the package - sed -ie 's|$(OPTIMIZATION)||g' Makefile - # Do not require xmlto to refresh manpages - sed -ie 's|$(MAN_PAGES)||g' Makefile - - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != 325338763c8d6a522cd26401d96b767f ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - die "50-udev-default.rules has been updated, please validate!" - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev_rules_parse.c \ - udev_rules.c - - # Use correct multilib dir - sed -i extras/volume_id/lib/Makefile \ - -e "/ =/s-/lib-/$(get_libdir)-" -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - if [[ -z ${extras} ]]; then - eerror "Variable extras is unset!" - eerror "It seems you suffer from Bug #190994" - die "Variable extras is unset!" - fi - - # Not everyone has full $CHOST-{ld,ar,etc...} yet - local mycross="" - type -p ${CHOST}-ar && mycross=${CHOST}- - - emake \ - EXTRAS="${extras}" \ - libudevdir=${udev_helper_dir} \ - CROSS_COMPILE=${mycross} \ - OPTFLAGS="" \ - ${myconf} || die "compiling udev failed" -} - -src_install() { - into / - emake \ - DESTDIR="${D}" \ - libudevdir=${udev_helper_dir} \ - EXTRAS="${extras}" \ - ${myconf} \ - install || die "make install failed" - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-118-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # vol_id library (needed by mount and HAL) - into / - rm "${D}/$(get_libdir)"/libvolume_id.so* 2>/dev/null - dolib extras/volume_id/lib/*.so* || die "Failed installing libvolume_id.so" - into /usr - dolib extras/volume_id/lib/*.a || die "Failed installing libvolume_id.a" - - # handle static linking bug #4411 - rm -f "${D}/usr/$(get_libdir)/libvolume_id.so" - gen_usr_ldscript libvolume_id.so - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # Now installing rules - cd "${S}"/rules - insinto /etc/udev/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - newins "${FILESDIR}"/udev-start-122-r1.sh udev-start.sh - newins "${FILESDIR}"/udev-stop-118-r2.sh udev-stop.sh - - # The udev-post init-script - newinitd "${FILESDIR}"/udev-postmount-initd-111-r2 udev-postmount - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog FAQ README TODO RELEASE-NOTES - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? -} - -pkg_postinst() { - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - if [[ ${ROOT} == / ]] - then - # check if root of init-process is identical to ours - if [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] - then - einfo "restarting udevd now." - if [[ -n $(pidof udevd) ]] - then - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - fi - /sbin/udevd --daemon - fi - fi - - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "as the helper apps udevinfo, udevtrigger, ... are now" - ewarn "only symlinks to udevadm." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-130-r1.ebuild b/sys-fs/udev/udev-130-r1.ebuild deleted file mode 100644 index 5ef180831ce0..000000000000 --- a/sys-fs/udev/udev-130-r1.ebuild +++ /dev/null @@ -1,332 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-130-r1.ebuild,v 1.2 2008/11/28 12:51:54 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator autotools - -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" -SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -DEPEND="selinux? ( sys-libs/libselinux )" -RDEPEND="!sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1" -RDEPEND="${DEPEND} ${RDEPEND} - >=sys-apps/baselayout-1.12.5" -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 && ${KV_MICRO} -ge 18 ]] - then - ok=1 - fi - - if [[ ${ok} == 0 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version 2.6.15!" - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version 2.6.18!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - unpack ${A} - - cd "${S}" - - # patches go here... - - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != 6c0547dfba7807da6f2987fd6aa74d4c ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - die "50-udev-default.rules has been updated, please validate!" - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev/udev_rules_parse.c \ - udev/udev_rules.c \ - $(find -name "Makefile.*") - - # fix version of volume_id lib - sed -e 's/-version-info/-version-number/' -i extras/volume_id/lib/Makefile.am - - eautoreconf -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - econf \ - --prefix=/usr \ - --sysconfdir=/etc \ - --exec-prefix= \ - --with-libdir-name=$(get_libdir) \ - --disable-debug \ - --disable-logging \ - $(use_with selinux) - - emake || die "compiling udev failed" -} - -src_install() { - into / - emake DESTDIR="${D}" install || die "make install failed" - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules - insinto "${udev_helper_dir}"/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - newins "${FILESDIR}"/udev-start-126.sh udev-start.sh - newins "${FILESDIR}"/udev-stop-126.sh udev-stop.sh - - # The udev-post init-script - newinitd "${FILESDIR}"/udev-postmount-initd-111-r2 udev-postmount - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog README TODO || die "failed installing docs" - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? -} - -pkg_postinst() { - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - if [[ ${ROOT} == / ]] - then - # check if root of init-process is identical to ours - if [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] - then - einfo "restarting udevd now." - if [[ -n $(pidof udevd) ]] - then - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - fi - /sbin/udevd --daemon - fi - fi - - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "and your scripts changed to use it,as it replaces the" - ewarn "old helper apps udevinfo, udevtrigger, ..." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-133.ebuild b/sys-fs/udev/udev-133.ebuild deleted file mode 100644 index efc2fbedd7dc..000000000000 --- a/sys-fs/udev/udev-133.ebuild +++ /dev/null @@ -1,437 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-133.ebuild,v 1.6 2008/11/28 12:51:54 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" -SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -DEPEND="selinux? ( sys-libs/libselinux )" -RDEPEND="!sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1" -RDEPEND="${DEPEND} ${RDEPEND} - >=sys-apps/baselayout-1.12.5" -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local min_micro=15 min_micro_reliable=19 - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] - then - if [[ ${KV_MICRO} -ge ${min_micro_reliable} ]]; then - ok=2 - elif [[ ${KV_MICRO} -ge ${min_micro} ]]; then - ok=1 - fi - fi - - if [[ ${ok} -lt 1 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version 2.6.${min_micro}!" - fi - if [[ ${ok} -lt 2 ]]; then - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version 2.6.${min_micro_reliable}!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - unpack ${A} - - cd "${S}" - - # patches go here... - epatch "${FILESDIR}/${P}-silence-physdev-warnings.diff" - epatch "${FILESDIR}/${P}-rules-update.diff" - - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != da85d0a38ca61adc8714856a503bc8e8 ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - die "50-udev-default.rules has been updated, please validate!" - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev/udev-util.c \ - udev/udev-rules.c \ - udev/udevd.c || die "sed failed" -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - econf \ - --prefix=/usr \ - --sysconfdir=/etc \ - --exec-prefix= \ - --with-libdir-name=$(get_libdir) \ - --enable-logging \ - $(use_with selinux) - - emake || die "compiling udev failed" -} - -src_install() { - into / - emake DESTDIR="${D}" install || die "make install failed" - if [[ "$(get_libdir)" != "lib" ]]; then - # we can not just rename /lib to /lib64, because - # make install creates /lib64 and /lib - mkdir -p "${D}/$(get_libdir)" - mv "${D}"/lib/* "${D}/$(get_libdir)/" - rmdir "${D}"/lib - fi - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules - insinto "${udev_helper_dir}"/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - newins "${FILESDIR}"/udev-start-133.sh udev-start.sh - newins "${FILESDIR}"/udev-stop-126.sh udev-stop.sh - - # The udev-post init-script - newinitd "${FILESDIR}"/udev-postmount-130-r2.initd udev-postmount - - # init-script for >=openrc-0.3.1, Bug #240984 - newinitd "${FILESDIR}/udev.initd" udev - - # config file for init-script and start-addon - newconfd "${FILESDIR}/udev.confd" udev - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog README TODO || die "failed installing docs" - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? - - has_version "<${CATEGORY}/${PN}-133" - previous_less_than_133=$? -} - -# enable udev init-script, else system will no longer boot -# after update to openrc-0.3.1, Bug #240984 -enable_udev_init_script() { - local result=msg - - if [[ -e "${ROOT}"/etc/runlevels/sysinit/udev ]] - then - # already enabled - result=enabled - elif has_version ">=sys-apps/openrc-0.3.1" - then - # openrc without addon calls - no idea what to do, so just print msg - result=msg - else - local rc_devices= - if has_version "sys-apps/openrc"; then - # openrc with udev addon calls - rc_devices=$(source ${ROOT}/etc/rc.conf; echo $rc_devices) - [[ -z "$rc_devices" ]] && rc_devices=auto - else - # old baselayout - rc_devices=$(source ${ROOT}/etc/conf.d/rc; echo $RC_DEVICES) - fi - - case ${rc_devices} in - auto|udev) result=add ;; - esac - fi - - case "$result" in - enabled) - einfo "udev init-script is already enabled, nothing to do." - ;; - add) - # enable udev init-script for new openrc - elog "Auto adding udev init script to the sysinit runlevel" - mkdir -p "${ROOT}"/etc/runlevels/sysinit - ln -sf /etc/init.d/udev "${ROOT}"/etc/runlevels/sysinit - ;; - msg) - ewarn - ewarn "You need to add the udev init script to the runlevel sysinit," - ewarn "else your system will not be able to boot" - ewarn "after updating to >=openrc-0.3.1" - ewarn "Run this to enable udev for >=openrc-0.3.1:" - ewarn "\trc-update add udev sysinit" - ewarn - ;; - esac -} - -fix_old_persistent_net_rules() { - local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules - [[ -f ${rules} ]] || return - - elog - elog "Updating persistent-net rules file" - - # Change ATTRS to ATTR matches, Bug #246927 - sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" - - # Add KERNEL matches if missing, Bug #246849 - sed -ri \ - -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ - "${rules}" -} - -# See Bug #129204 for a discussion about restarting udevd -restart_udevd() { - # need to merge to our system - [[ ${ROOT} = / ]] || return - - # check if root of init-process is identical to ours (not in chroot) - [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return - - # abort if there is no udevd running - [[ -n $(pidof udevd) ]] || return - - # abort if no /dev/.udev exists - [[ -e /dev/.udev ]] || return - - elog - elog "restarting udevd now." - - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - - /sbin/udevd --daemon -} - -pkg_postinst() { - fix_old_persistent_net_rules - - restart_udevd - - if [[ $previous_less_than_133 = 0 ]] - then - enable_udev_init_script - fi - - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - ewarn - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "and your scripts changed to use it,as it replaces the" - ewarn "old helper apps udevinfo, udevtrigger, ..." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-135-r1.ebuild b/sys-fs/udev/udev-135-r1.ebuild deleted file mode 100644 index eb23c38989ea..000000000000 --- a/sys-fs/udev/udev-135-r1.ebuild +++ /dev/null @@ -1,438 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-135-r1.ebuild,v 1.1 2008/12/03 15:31:11 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" -SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -DEPEND="selinux? ( sys-libs/libselinux )" -RDEPEND="!sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1" -RDEPEND="${DEPEND} ${RDEPEND} - >=sys-apps/baselayout-1.12.5" -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local min_micro=15 min_micro_reliable=19 - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] - then - if [[ ${KV_MICRO} -ge ${min_micro_reliable} ]]; then - ok=2 - elif [[ ${KV_MICRO} -ge ${min_micro} ]]; then - ok=1 - fi - fi - - if [[ ${ok} -lt 1 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version 2.6.${min_micro}!" - fi - if [[ ${ok} -lt 2 ]]; then - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version 2.6.${min_micro_reliable}!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - unpack ${A} - - cd "${S}" - - # patches go here... - epatch "${FILESDIR}/${P}-fix-capi.diff" - epatch "${FILESDIR}/${P}-rules-update.diff" - - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != 1425ecb365439f74b9aa2242f0503f1e ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - die "50-udev-default.rules has been updated, please validate!" - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev/udev-util.c \ - udev/udev-rules.c \ - udev/udevd.c || die "sed failed" -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - econf \ - --prefix=/usr \ - --sysconfdir=/etc \ - --exec-prefix= \ - --with-libdir-name=$(get_libdir) \ - --enable-logging \ - $(use_with selinux) - - emake || die "compiling udev failed" -} - -src_install() { - into / - emake DESTDIR="${D}" install || die "make install failed" - if [[ "$(get_libdir)" != "lib" ]]; then - # we can not just rename /lib to /lib64, because - # make install creates /lib64 and /lib - mkdir -p "${D}/$(get_libdir)" - mv "${D}"/lib/* "${D}/$(get_libdir)/" - rmdir "${D}"/lib - fi - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules - insinto "${udev_helper_dir}"/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - doins packages/40-isdn.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - newins "${FILESDIR}"/udev-start-133.sh udev-start.sh - newins "${FILESDIR}"/udev-stop-126.sh udev-stop.sh - - # The udev-post init-script - newinitd "${FILESDIR}"/udev-postmount-130-r2.initd udev-postmount - - # init-script for >=openrc-0.3.1, Bug #240984 - newinitd "${FILESDIR}/udev.initd" udev - - # config file for init-script and start-addon - newconfd "${FILESDIR}/udev.confd" udev - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog README TODO || die "failed installing docs" - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? - - has_version "<${CATEGORY}/${PN}-133" - previous_less_than_133=$? -} - -# enable udev init-script, else system will no longer boot -# after update to openrc-0.3.1, Bug #240984 -enable_udev_init_script() { - local result=msg - - if [[ -e "${ROOT}"/etc/runlevels/sysinit/udev ]] - then - # already enabled - result=enabled - elif has_version ">=sys-apps/openrc-0.3.1" - then - # openrc without addon calls - no idea what to do, so just print msg - result=msg - else - local rc_devices= - if has_version "sys-apps/openrc"; then - # openrc with udev addon calls - rc_devices=$(source ${ROOT}/etc/rc.conf; echo $rc_devices) - [[ -z "$rc_devices" ]] && rc_devices=auto - else - # old baselayout - rc_devices=$(source ${ROOT}/etc/conf.d/rc; echo $RC_DEVICES) - fi - - case ${rc_devices} in - auto|udev) result=add ;; - esac - fi - - case "$result" in - enabled) - einfo "udev init-script is already enabled, nothing to do." - ;; - add) - # enable udev init-script for new openrc - elog "Auto adding udev init script to the sysinit runlevel" - mkdir -p "${ROOT}"/etc/runlevels/sysinit - ln -sf /etc/init.d/udev "${ROOT}"/etc/runlevels/sysinit - ;; - msg) - ewarn - ewarn "You need to add the udev init script to the runlevel sysinit," - ewarn "else your system will not be able to boot" - ewarn "after updating to >=openrc-0.3.1" - ewarn "Run this to enable udev for >=openrc-0.3.1:" - ewarn "\trc-update add udev sysinit" - ewarn - ;; - esac -} - -fix_old_persistent_net_rules() { - local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules - [[ -f ${rules} ]] || return - - elog - elog "Updating persistent-net rules file" - - # Change ATTRS to ATTR matches, Bug #246927 - sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" - - # Add KERNEL matches if missing, Bug #246849 - sed -ri \ - -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ - "${rules}" -} - -# See Bug #129204 for a discussion about restarting udevd -restart_udevd() { - # need to merge to our system - [[ ${ROOT} = / ]] || return - - # check if root of init-process is identical to ours (not in chroot) - [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return - - # abort if there is no udevd running - [[ -n $(pidof udevd) ]] || return - - # abort if no /dev/.udev exists - [[ -e /dev/.udev ]] || return - - elog - elog "restarting udevd now." - - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - - /sbin/udevd --daemon -} - -pkg_postinst() { - fix_old_persistent_net_rules - - restart_udevd - - if [[ $previous_less_than_133 = 0 ]] - then - enable_udev_init_script - fi - - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - ewarn - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "and your scripts changed to use it,as it replaces the" - ewarn "old helper apps udevinfo, udevtrigger, ..." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-135-r2.ebuild b/sys-fs/udev/udev-135-r2.ebuild deleted file mode 100644 index 9172696f77f4..000000000000 --- a/sys-fs/udev/udev-135-r2.ebuild +++ /dev/null @@ -1,392 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-135-r2.ebuild,v 1.2 2008/12/19 22:40:58 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" -SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -DEPEND="selinux? ( sys-libs/libselinux )" -RDEPEND="!sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1" -RDEPEND="${DEPEND} ${RDEPEND} - >=sys-apps/baselayout-1.12.5" -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local min_micro=15 min_micro_reliable=19 - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] - then - if [[ ${KV_MICRO} -ge ${min_micro_reliable} ]]; then - ok=2 - elif [[ ${KV_MICRO} -ge ${min_micro} ]]; then - ok=1 - fi - fi - - if [[ ${ok} -lt 1 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version 2.6.${min_micro}!" - fi - if [[ ${ok} -lt 2 ]]; then - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version 2.6.${min_micro_reliable}!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - unpack ${A} - - cd "${S}" - - # patches go here... - epatch "${FILESDIR}/${P}-fix-capi.diff" - epatch "${FILESDIR}/${P}-rules-update.diff" - - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != 1425ecb365439f74b9aa2242f0503f1e ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - die "50-udev-default.rules has been updated, please validate!" - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev/udev-util.c \ - udev/udev-rules.c \ - udev/udevd.c || die "sed failed" -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - econf \ - --prefix=/usr \ - --sysconfdir=/etc \ - --exec-prefix= \ - --with-libdir-name=$(get_libdir) \ - --enable-logging \ - $(use_with selinux) - - emake || die "compiling udev failed" -} - -src_install() { - into / - emake DESTDIR="${D}" install || die "make install failed" - if [[ "$(get_libdir)" != "lib" ]]; then - # we can not just rename /lib to /lib64, because - # make install creates /lib64 and /lib - mkdir -p "${D}/$(get_libdir)" - mv "${D}"/lib/* "${D}/$(get_libdir)/" - rmdir "${D}"/lib - fi - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules - insinto "${udev_helper_dir}"/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - doins packages/40-isdn.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - newins "${FILESDIR}"/udev-start-135-r2.sh udev-start.sh - newins "${FILESDIR}"/udev-stop-135-r2.sh udev-stop.sh - - # The udev-post init-script - newinitd "${FILESDIR}"/udev-postmount-135-r2.initd udev-postmount - - # init-scripts for >=openrc-0.3.1, Bug #240984 - newinitd "${FILESDIR}/udev-135-r2.initd" udev - newinitd "${FILESDIR}/udev-mount-135-r2.initd" udev-mount - newinitd "${FILESDIR}/udev-dev-tarball-135-r2.initd" udev-dev-tarball - - # config file for init-script and start-addon - newconfd "${FILESDIR}/udev-135-r2.confd" udev - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog README TODO || die "failed installing docs" - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? -} - -fix_old_persistent_net_rules() { - local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules - [[ -f ${rules} ]] || return - - elog - elog "Updating persistent-net rules file" - - # Change ATTRS to ATTR matches, Bug #246927 - sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" - - # Add KERNEL matches if missing, Bug #246849 - sed -ri \ - -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ - "${rules}" -} - -# See Bug #129204 for a discussion about restarting udevd -restart_udevd() { - # need to merge to our system - [[ ${ROOT} = / ]] || return - - # check if root of init-process is identical to ours (not in chroot) - [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return - - # abort if there is no udevd running - [[ -n $(pidof udevd) ]] || return - - # abort if no /dev/.udev exists - [[ -e /dev/.udev ]] || return - - elog - elog "restarting udevd now." - - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - - /sbin/udevd --daemon -} - -pkg_postinst() { - fix_old_persistent_net_rules - - restart_udevd - - if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] - then - ewarn - ewarn "You need to add the udev init script to the runlevel sysinit," - ewarn "else your system will not be able to boot" - ewarn "after updating to >=openrc-0.4.0" - ewarn "Run this to enable udev for >=openrc-0.4.0:" - ewarn "\trc-update add udev sysinit" - ewarn - fi - - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - ewarn - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "and your scripts changed to use it,as it replaces the" - ewarn "old helper apps udevinfo, udevtrigger, ..." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-135-r3.ebuild b/sys-fs/udev/udev-135-r3.ebuild deleted file mode 100644 index 2183c4720e8d..000000000000 --- a/sys-fs/udev/udev-135-r3.ebuild +++ /dev/null @@ -1,392 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-135-r3.ebuild,v 1.1 2008/12/27 23:03:52 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" -SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -DEPEND="selinux? ( sys-libs/libselinux )" -RDEPEND="!sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1" -RDEPEND="${DEPEND} ${RDEPEND} - >=sys-apps/baselayout-1.12.5" -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local min_micro=15 min_micro_reliable=19 - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] - then - if [[ ${KV_MICRO} -ge ${min_micro_reliable} ]]; then - ok=2 - elif [[ ${KV_MICRO} -ge ${min_micro} ]]; then - ok=1 - fi - fi - - if [[ ${ok} -lt 1 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version 2.6.${min_micro}!" - fi - if [[ ${ok} -lt 2 ]]; then - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version 2.6.${min_micro_reliable}!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - unpack ${A} - - cd "${S}" - - # patches go here... - epatch "${FILESDIR}/${P}-fix-capi.diff" - epatch "${FILESDIR}/${P}-rules-update.diff" - - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != 1425ecb365439f74b9aa2242f0503f1e ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - die "50-udev-default.rules has been updated, please validate!" - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev/udev-util.c \ - udev/udev-rules.c \ - udev/udevd.c || die "sed failed" -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - econf \ - --prefix=/usr \ - --sysconfdir=/etc \ - --exec-prefix= \ - --with-libdir-name=$(get_libdir) \ - --enable-logging \ - $(use_with selinux) - - emake || die "compiling udev failed" -} - -src_install() { - into / - emake DESTDIR="${D}" install || die "make install failed" - if [[ "$(get_libdir)" != "lib" ]]; then - # we can not just rename /lib to /lib64, because - # make install creates /lib64 and /lib - mkdir -p "${D}/$(get_libdir)" - mv "${D}"/lib/* "${D}/$(get_libdir)/" - rmdir "${D}"/lib - fi - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules - insinto "${udev_helper_dir}"/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - doins packages/40-isdn.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - newins "${FILESDIR}"/udev-start-135-r3.sh udev-start.sh - newins "${FILESDIR}"/udev-stop-135-r2.sh udev-stop.sh - - # The udev-post init-script - newinitd "${FILESDIR}"/udev-postmount-135-r2.initd udev-postmount - - # init-scripts for >=openrc-0.3.1, Bug #240984 - newinitd "${FILESDIR}/udev-135-r2.initd" udev - newinitd "${FILESDIR}/udev-mount-135-r3.initd" udev-mount - newinitd "${FILESDIR}/udev-dev-tarball-135-r2.initd" udev-dev-tarball - - # config file for init-script and start-addon - newconfd "${FILESDIR}/udev-135-r3.confd" udev - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog README TODO || die "failed installing docs" - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? -} - -fix_old_persistent_net_rules() { - local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules - [[ -f ${rules} ]] || return - - elog - elog "Updating persistent-net rules file" - - # Change ATTRS to ATTR matches, Bug #246927 - sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" - - # Add KERNEL matches if missing, Bug #246849 - sed -ri \ - -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ - "${rules}" -} - -# See Bug #129204 for a discussion about restarting udevd -restart_udevd() { - # need to merge to our system - [[ ${ROOT} = / ]] || return - - # check if root of init-process is identical to ours (not in chroot) - [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return - - # abort if there is no udevd running - [[ -n $(pidof udevd) ]] || return - - # abort if no /dev/.udev exists - [[ -e /dev/.udev ]] || return - - elog - elog "restarting udevd now." - - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - - /sbin/udevd --daemon -} - -pkg_postinst() { - fix_old_persistent_net_rules - - restart_udevd - - if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] - then - ewarn - ewarn "You need to add the udev init script to the runlevel sysinit," - ewarn "else your system will not be able to boot" - ewarn "after updating to >=openrc-0.4.0" - ewarn "Run this to enable udev for >=openrc-0.4.0:" - ewarn "\trc-update add udev sysinit" - ewarn - fi - - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - ewarn - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "and your scripts changed to use it,as it replaces the" - ewarn "old helper apps udevinfo, udevtrigger, ..." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-135-r4.ebuild b/sys-fs/udev/udev-135-r4.ebuild deleted file mode 100644 index 5182debe1c1e..000000000000 --- a/sys-fs/udev/udev-135-r4.ebuild +++ /dev/null @@ -1,394 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-135-r4.ebuild,v 1.4 2009/02/20 17:59:17 jer Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" -SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -DEPEND="selinux? ( sys-libs/libselinux )" -RDEPEND="!sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1" -RDEPEND="${DEPEND} ${RDEPEND} - >=sys-apps/baselayout-1.12.5" -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local min_micro=15 min_micro_reliable=19 - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] - then - if [[ ${KV_MICRO} -ge ${min_micro_reliable} ]]; then - ok=2 - elif [[ ${KV_MICRO} -ge ${min_micro} ]]; then - ok=1 - fi - fi - - if [[ ${ok} -lt 1 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version 2.6.${min_micro}!" - fi - if [[ ${ok} -lt 2 ]]; then - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version 2.6.${min_micro_reliable}!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - unpack ${A} - - cd "${S}" - - # patches go here... - epatch "${FILESDIR}/${P}-fix-capi.diff" - epatch "${FILESDIR}/${P}-rules-update.diff" - epatch "${FILESDIR}/${P}-fix-dri-perms.diff" - epatch "${FILESDIR}/${PN}-fix-udevinfo-in-doc.diff" - - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != b48b1e3ad3663f119ab3ccaf01bb657c ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - die "50-udev-default.rules has been updated, please validate!" - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev/udev-util.c \ - udev/udev-rules.c \ - udev/udevd.c || die "sed failed" -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - econf \ - --prefix=/usr \ - --sysconfdir=/etc \ - --exec-prefix= \ - --with-libdir-name=$(get_libdir) \ - --enable-logging \ - $(use_with selinux) - - emake || die "compiling udev failed" -} - -src_install() { - into / - emake DESTDIR="${D}" install || die "make install failed" - if [[ "$(get_libdir)" != "lib" ]]; then - # we can not just rename /lib to /lib64, because - # make install creates /lib64 and /lib - mkdir -p "${D}/$(get_libdir)" - mv "${D}"/lib/* "${D}/$(get_libdir)/" - rmdir "${D}"/lib - fi - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules - insinto "${udev_helper_dir}"/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - doins packages/40-isdn.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - newins "${FILESDIR}"/udev-start-135-r3.sh udev-start.sh - newins "${FILESDIR}"/udev-stop-135-r2.sh udev-stop.sh - - # The udev-post init-script - newinitd "${FILESDIR}"/udev-postmount-135-r2.initd udev-postmount - - # init-scripts for >=openrc-0.3.1, Bug #240984 - newinitd "${FILESDIR}/udev-135-r2.initd" udev - newinitd "${FILESDIR}/udev-mount-135-r3.initd" udev-mount - newinitd "${FILESDIR}/udev-dev-tarball-135-r2.initd" udev-dev-tarball - - # config file for init-script and start-addon - newconfd "${FILESDIR}/udev-135-r3.confd" udev - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog README TODO || die "failed installing docs" - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? -} - -fix_old_persistent_net_rules() { - local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules - [[ -f ${rules} ]] || return - - elog - elog "Updating persistent-net rules file" - - # Change ATTRS to ATTR matches, Bug #246927 - sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" - - # Add KERNEL matches if missing, Bug #246849 - sed -ri \ - -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ - "${rules}" -} - -# See Bug #129204 for a discussion about restarting udevd -restart_udevd() { - # need to merge to our system - [[ ${ROOT} = / ]] || return - - # check if root of init-process is identical to ours (not in chroot) - [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return - - # abort if there is no udevd running - [[ -n $(pidof udevd) ]] || return - - # abort if no /dev/.udev exists - [[ -e /dev/.udev ]] || return - - elog - elog "restarting udevd now." - - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - - /sbin/udevd --daemon -} - -pkg_postinst() { - fix_old_persistent_net_rules - - restart_udevd - - if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] - then - ewarn - ewarn "You need to add the udev init script to the runlevel sysinit," - ewarn "else your system will not be able to boot" - ewarn "after updating to >=openrc-0.4.0" - ewarn "Run this to enable udev for >=openrc-0.4.0:" - ewarn "\trc-update add udev sysinit" - ewarn - fi - - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - ewarn - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "and your scripts changed to use it,as it replaces the" - ewarn "old helper apps udevinfo, udevtrigger, ..." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-135.ebuild b/sys-fs/udev/udev-135.ebuild deleted file mode 100644 index 6a7cfe309064..000000000000 --- a/sys-fs/udev/udev-135.ebuild +++ /dev/null @@ -1,435 +0,0 @@ -# Copyright 1999-2008 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-135.ebuild,v 1.1 2008/12/02 12:58:38 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" -SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -DEPEND="selinux? ( sys-libs/libselinux )" -RDEPEND="!sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1" -RDEPEND="${DEPEND} ${RDEPEND} - >=sys-apps/baselayout-1.12.5" -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local min_micro=15 min_micro_reliable=19 - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] - then - if [[ ${KV_MICRO} -ge ${min_micro_reliable} ]]; then - ok=2 - elif [[ ${KV_MICRO} -ge ${min_micro} ]]; then - ok=1 - fi - fi - - if [[ ${ok} -lt 1 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version 2.6.${min_micro}!" - fi - if [[ ${ok} -lt 2 ]]; then - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version 2.6.${min_micro_reliable}!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - unpack ${A} - - cd "${S}" - - # patches go here... - - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != 1425ecb365439f74b9aa2242f0503f1e ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - die "50-udev-default.rules has been updated, please validate!" - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev/udev-util.c \ - udev/udev-rules.c \ - udev/udevd.c || die "sed failed" -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - econf \ - --prefix=/usr \ - --sysconfdir=/etc \ - --exec-prefix= \ - --with-libdir-name=$(get_libdir) \ - --enable-logging \ - $(use_with selinux) - - emake || die "compiling udev failed" -} - -src_install() { - into / - emake DESTDIR="${D}" install || die "make install failed" - if [[ "$(get_libdir)" != "lib" ]]; then - # we can not just rename /lib to /lib64, because - # make install creates /lib64 and /lib - mkdir -p "${D}/$(get_libdir)" - mv "${D}"/lib/* "${D}/$(get_libdir)/" - rmdir "${D}"/lib - fi - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - newexe "${FILESDIR}"/shell-compat-118-r3.sh shell-compat.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules - insinto "${udev_helper_dir}"/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - newins "${FILESDIR}"/udev-start-133.sh udev-start.sh - newins "${FILESDIR}"/udev-stop-126.sh udev-stop.sh - - # The udev-post init-script - newinitd "${FILESDIR}"/udev-postmount-130-r2.initd udev-postmount - - # init-script for >=openrc-0.3.1, Bug #240984 - newinitd "${FILESDIR}/udev.initd" udev - - # config file for init-script and start-addon - newconfd "${FILESDIR}/udev.confd" udev - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog README TODO || die "failed installing docs" - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? - - has_version "<${CATEGORY}/${PN}-133" - previous_less_than_133=$? -} - -# enable udev init-script, else system will no longer boot -# after update to openrc-0.3.1, Bug #240984 -enable_udev_init_script() { - local result=msg - - if [[ -e "${ROOT}"/etc/runlevels/sysinit/udev ]] - then - # already enabled - result=enabled - elif has_version ">=sys-apps/openrc-0.3.1" - then - # openrc without addon calls - no idea what to do, so just print msg - result=msg - else - local rc_devices= - if has_version "sys-apps/openrc"; then - # openrc with udev addon calls - rc_devices=$(source ${ROOT}/etc/rc.conf; echo $rc_devices) - [[ -z "$rc_devices" ]] && rc_devices=auto - else - # old baselayout - rc_devices=$(source ${ROOT}/etc/conf.d/rc; echo $RC_DEVICES) - fi - - case ${rc_devices} in - auto|udev) result=add ;; - esac - fi - - case "$result" in - enabled) - einfo "udev init-script is already enabled, nothing to do." - ;; - add) - # enable udev init-script for new openrc - elog "Auto adding udev init script to the sysinit runlevel" - mkdir -p "${ROOT}"/etc/runlevels/sysinit - ln -sf /etc/init.d/udev "${ROOT}"/etc/runlevels/sysinit - ;; - msg) - ewarn - ewarn "You need to add the udev init script to the runlevel sysinit," - ewarn "else your system will not be able to boot" - ewarn "after updating to >=openrc-0.3.1" - ewarn "Run this to enable udev for >=openrc-0.3.1:" - ewarn "\trc-update add udev sysinit" - ewarn - ;; - esac -} - -fix_old_persistent_net_rules() { - local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules - [[ -f ${rules} ]] || return - - elog - elog "Updating persistent-net rules file" - - # Change ATTRS to ATTR matches, Bug #246927 - sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" - - # Add KERNEL matches if missing, Bug #246849 - sed -ri \ - -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ - "${rules}" -} - -# See Bug #129204 for a discussion about restarting udevd -restart_udevd() { - # need to merge to our system - [[ ${ROOT} = / ]] || return - - # check if root of init-process is identical to ours (not in chroot) - [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return - - # abort if there is no udevd running - [[ -n $(pidof udevd) ]] || return - - # abort if no /dev/.udev exists - [[ -e /dev/.udev ]] || return - - elog - elog "restarting udevd now." - - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - - /sbin/udevd --daemon -} - -pkg_postinst() { - fix_old_persistent_net_rules - - restart_udevd - - if [[ $previous_less_than_133 = 0 ]] - then - enable_udev_init_script - fi - - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - ewarn - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "and your scripts changed to use it,as it replaces the" - ewarn "old helper apps udevinfo, udevtrigger, ..." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-138.ebuild b/sys-fs/udev/udev-138.ebuild deleted file mode 100644 index 46fd0aa6ebc1..000000000000 --- a/sys-fs/udev/udev-138.ebuild +++ /dev/null @@ -1,437 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-138.ebuild,v 1.1 2009/02/19 08:41:34 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -if [[ ${PV} == "9999" ]]; then - EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git" - EGIT_BRANCH="master" - inherit git autotools -else - SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" -fi -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -COMMON_DEPEND="selinux? ( sys-libs/libselinux )" - -if [[ ${PV} == "9999" ]]; then - # for documentation processing with xsltproc - DEPEND="${COMMON_DEPEND} - app-text/docbook-xsl-stylesheets - app-text/docbook-xml-dtd" -else - DEPEND="${COMMON_DEPEND}" -fi - -RDEPEND="${COMMON_DEPEND} - !sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1 - >=sys-apps/baselayout-1.12.5" - -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local KV_min_micro=15 KV_min_micro_reliable=22 - KV_min=2.6.${KV_min_micro} - KV_min_reliable=2.6.${KV_min_micro_reliable} - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] - then - if [[ ${KV_MICRO} -ge ${KV_min_micro_reliable} ]]; then - ok=2 - elif [[ ${KV_MICRO} -ge ${KV_min_micro} ]]; then - ok=1 - fi - fi - - if [[ ${ok} -lt 1 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version ${KV_min}!" - fi - if [[ ${ok} -lt 2 ]]; then - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version ${KV_min_reliable}!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - if [[ ${PV} == "9999" ]] ; then - git_src_unpack - else - unpack ${A} - fi - - cd "${S}" - - # patches go here... - - # change rules back to group uucp instead of dialout for now - sed -e 's/GROUP="dialout"/GROUP="uucp"/' \ - -i rules/{rules.d,packages,gentoo}/*.rules \ - || die "failed to change group dialout to uucp" - - if [[ ${PV} != 9999 ]]; then - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != 980aeafcd2f2d057945cf3ddf2ae884e ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - eerror "md5sum=${MD5}" - die "50-udev-default.rules has been updated, please validate!" - fi - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev/udev-util.c \ - udev/udev-rules.c \ - udev/udevd.c || die "sed failed" - - if [[ ${PV} == 9999 ]]; then - eautoreconf - fi -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - econf \ - --prefix=/usr \ - --sysconfdir=/etc \ - --exec-prefix= \ - --with-libdir-name=$(get_libdir) \ - --enable-logging \ - $(use_with selinux) - - emake || die "compiling udev failed" -} - -src_install() { - local scriptdir="${FILESDIR}/136" - - into / - emake DESTDIR="${D}" install || die "make install failed" - if [[ "$(get_libdir)" != "lib" ]]; then - # we can not just rename /lib to /lib64, because - # make install creates /lib64 and /lib - mkdir -p "${D}/$(get_libdir)" - mv "${D}"/lib/* "${D}/$(get_libdir)/" - rmdir "${D}"/lib - fi - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - - doexe "${scriptdir}"/shell-compat-KV.sh \ - || die "shell-compat.sh not installed properly" - doexe "${scriptdir}"/shell-compat-addon.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules - insinto "${udev_helper_dir}"/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - doins packages/40-isdn.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - doins "${scriptdir}"/udev-start.sh \ - || die "udev-start.sh not installed properly" - doins "${scriptdir}"/udev-stop.sh \ - || die "udev-stop.sh not installed properly" - - local init - # udev-postmount and init-scripts for >=openrc-0.3.1, Bug #240984 - for init in udev udev-mount udev-dev-tarball udev-postmount; do - newinitd "${scriptdir}/${init}.initd" "${init}" \ - || die "initscript ${init} not installed properly" - done - - # insert minimum kernel versions - sed -e "s/%KV_MIN%/${KV_min}/" \ - -e "s/%KV_MIN_RELIABLE%/${KV_min_reliable}/" \ - -i "${D}"/etc/init.d/udev-mount - - # config file for init-script and start-addon - newconfd "${scriptdir}/udev.confd" udev \ - || die "config file not installed properly" - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog README TODO || die "failed installing docs" - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? -} - -fix_old_persistent_net_rules() { - local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules - [[ -f ${rules} ]] || return - - elog - elog "Updating persistent-net rules file" - - # Change ATTRS to ATTR matches, Bug #246927 - sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" - - # Add KERNEL matches if missing, Bug #246849 - sed -ri \ - -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ - "${rules}" -} - -# See Bug #129204 for a discussion about restarting udevd -restart_udevd() { - # need to merge to our system - [[ ${ROOT} = / ]] || return - - # check if root of init-process is identical to ours (not in chroot) - [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return - - # abort if there is no udevd running - [[ -n $(pidof udevd) ]] || return - - # abort if no /dev/.udev exists - [[ -e /dev/.udev ]] || return - - elog - elog "restarting udevd now." - - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - - /sbin/udevd --daemon -} - -pkg_postinst() { - fix_old_persistent_net_rules - - restart_udevd - - if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] - then - ewarn - ewarn "You need to add the udev init script to the runlevel sysinit," - ewarn "else your system will not be able to boot" - ewarn "after updating to >=openrc-0.4.0" - ewarn "Run this to enable udev for >=openrc-0.4.0:" - ewarn "\trc-update add udev sysinit" - ewarn - fi - - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - ewarn - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "and your scripts changed to use it,as it replaces the" - ewarn "old helper apps udevinfo, udevtrigger, ..." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-139.ebuild b/sys-fs/udev/udev-139.ebuild deleted file mode 100644 index 3daf17747a77..000000000000 --- a/sys-fs/udev/udev-139.ebuild +++ /dev/null @@ -1,437 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-139.ebuild,v 1.1 2009/02/26 22:52:10 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -if [[ ${PV} == "9999" ]]; then - EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git" - EGIT_BRANCH="master" - inherit git autotools -else - SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" -fi -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -COMMON_DEPEND="selinux? ( sys-libs/libselinux )" - -if [[ ${PV} == "9999" ]]; then - # for documentation processing with xsltproc - DEPEND="${COMMON_DEPEND} - app-text/docbook-xsl-stylesheets - app-text/docbook-xml-dtd" -else - DEPEND="${COMMON_DEPEND}" -fi - -RDEPEND="${COMMON_DEPEND} - !sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1 - >=sys-apps/baselayout-1.12.5" - -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local KV_min_micro=15 KV_min_micro_reliable=22 - KV_min=2.6.${KV_min_micro} - KV_min_reliable=2.6.${KV_min_micro_reliable} - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] - then - if [[ ${KV_MICRO} -ge ${KV_min_micro_reliable} ]]; then - ok=2 - elif [[ ${KV_MICRO} -ge ${KV_min_micro} ]]; then - ok=1 - fi - fi - - if [[ ${ok} -lt 1 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version ${KV_min}!" - fi - if [[ ${ok} -lt 2 ]]; then - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version ${KV_min_reliable}!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - if [[ ${PV} == "9999" ]] ; then - git_src_unpack - else - unpack ${A} - fi - - cd "${S}" - - # patches go here... - - # change rules back to group uucp instead of dialout for now - sed -e 's/GROUP="dialout"/GROUP="uucp"/' \ - -i rules/{rules.d,packages,gentoo}/*.rules \ - || die "failed to change group dialout to uucp" - - if [[ ${PV} != 9999 ]]; then - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != 980aeafcd2f2d057945cf3ddf2ae884e ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - eerror "md5sum=${MD5}" - die "50-udev-default.rules has been updated, please validate!" - fi - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev/udev-util.c \ - udev/udev-rules.c \ - udev/udevd.c || die "sed failed" - - if [[ ${PV} == 9999 ]]; then - eautoreconf - fi -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - econf \ - --prefix=/usr \ - --sysconfdir=/etc \ - --exec-prefix= \ - --with-libdir-name=$(get_libdir) \ - --enable-logging \ - $(use_with selinux) - - emake || die "compiling udev failed" -} - -src_install() { - local scriptdir="${FILESDIR}/136" - - into / - emake DESTDIR="${D}" install || die "make install failed" - if [[ "$(get_libdir)" != "lib" ]]; then - # we can not just rename /lib to /lib64, because - # make install creates /lib64 and /lib - mkdir -p "${D}/$(get_libdir)" - mv "${D}"/lib/* "${D}/$(get_libdir)/" - rmdir "${D}"/lib - fi - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - - doexe "${scriptdir}"/shell-compat-KV.sh \ - || die "shell-compat.sh not installed properly" - doexe "${scriptdir}"/shell-compat-addon.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules - insinto "${udev_helper_dir}"/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - doins packages/40-isdn.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - doins "${scriptdir}"/udev-start.sh \ - || die "udev-start.sh not installed properly" - doins "${scriptdir}"/udev-stop.sh \ - || die "udev-stop.sh not installed properly" - - local init - # udev-postmount and init-scripts for >=openrc-0.3.1, Bug #240984 - for init in udev udev-mount udev-dev-tarball udev-postmount; do - newinitd "${scriptdir}/${init}.initd" "${init}" \ - || die "initscript ${init} not installed properly" - done - - # insert minimum kernel versions - sed -e "s/%KV_MIN%/${KV_min}/" \ - -e "s/%KV_MIN_RELIABLE%/${KV_min_reliable}/" \ - -i "${D}"/etc/init.d/udev-mount - - # config file for init-script and start-addon - newconfd "${scriptdir}/udev.confd" udev \ - || die "config file not installed properly" - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog README TODO || die "failed installing docs" - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? -} - -fix_old_persistent_net_rules() { - local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules - [[ -f ${rules} ]] || return - - elog - elog "Updating persistent-net rules file" - - # Change ATTRS to ATTR matches, Bug #246927 - sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" - - # Add KERNEL matches if missing, Bug #246849 - sed -ri \ - -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ - "${rules}" -} - -# See Bug #129204 for a discussion about restarting udevd -restart_udevd() { - # need to merge to our system - [[ ${ROOT} = / ]] || return - - # check if root of init-process is identical to ours (not in chroot) - [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return - - # abort if there is no udevd running - [[ -n $(pidof udevd) ]] || return - - # abort if no /dev/.udev exists - [[ -e /dev/.udev ]] || return - - elog - elog "restarting udevd now." - - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - - /sbin/udevd --daemon -} - -pkg_postinst() { - fix_old_persistent_net_rules - - restart_udevd - - if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] - then - ewarn - ewarn "You need to add the udev init script to the runlevel sysinit," - ewarn "else your system will not be able to boot" - ewarn "after updating to >=openrc-0.4.0" - ewarn "Run this to enable udev for >=openrc-0.4.0:" - ewarn "\trc-update add udev sysinit" - ewarn - fi - - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - ewarn - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "and your scripts changed to use it,as it replaces the" - ewarn "old helper apps udevinfo, udevtrigger, ..." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} diff --git a/sys-fs/udev/udev-140.ebuild b/sys-fs/udev/udev-140.ebuild deleted file mode 100644 index 31a5e6e50fbf..000000000000 --- a/sys-fs/udev/udev-140.ebuild +++ /dev/null @@ -1,437 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-140.ebuild,v 1.1 2009/03/14 08:18:48 zzam Exp $ - -inherit eutils flag-o-matic multilib toolchain-funcs versionator - -if [[ ${PV} == "9999" ]]; then - EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git" - EGIT_BRANCH="master" - inherit git autotools -else - SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2" -fi -DESCRIPTION="Linux dynamic and persistent device naming support (aka userspace devfs)" -HOMEPAGE="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html" - -LICENSE="GPL-2" -SLOT="0" -KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86" -IUSE="selinux" - -COMMON_DEPEND="selinux? ( sys-libs/libselinux )" - -if [[ ${PV} == "9999" ]]; then - # for documentation processing with xsltproc - DEPEND="${COMMON_DEPEND} - app-text/docbook-xsl-stylesheets - app-text/docbook-xml-dtd" -else - DEPEND="${COMMON_DEPEND}" -fi - -RDEPEND="${COMMON_DEPEND} - !sys-apps/coldplug - !<sys-fs/device-mapper-1.02.19-r1 - >=sys-apps/baselayout-1.12.5" - -# We need the lib/rcscripts/addon support -PROVIDE="virtual/dev-manager" - -pkg_setup() { - udev_helper_dir="/$(get_libdir)/udev" - - # comparing kernel version without linux-info.eclass to not pull - # virtual/linux-sources - - local KV=$(uname -r) - local KV_MAJOR=$(get_major_version ${KV}) - local KV_MINOR=$(get_version_component_range 2 ${KV}) - local KV_MICRO=$(get_version_component_range 3 ${KV}) - - local KV_min_micro=15 KV_min_micro_reliable=22 - KV_min=2.6.${KV_min_micro} - KV_min_reliable=2.6.${KV_min_micro_reliable} - - local ok=0 - if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]] - then - if [[ ${KV_MICRO} -ge ${KV_min_micro_reliable} ]]; then - ok=2 - elif [[ ${KV_MICRO} -ge ${KV_min_micro} ]]; then - ok=1 - fi - fi - - if [[ ${ok} -lt 1 ]] - then - ewarn - ewarn "${P} does not support Linux kernel before version ${KV_min}!" - fi - if [[ ${ok} -lt 2 ]]; then - ewarn "If you want to use udev reliable you should update" - ewarn "to at least kernel version ${KV_min_reliable}!" - ewarn - ebeep - fi -} - -sed_helper_dir() { - sed -e "s#/lib/udev#${udev_helper_dir}#" -i "$@" -} - -src_unpack() { - if [[ ${PV} == "9999" ]] ; then - git_src_unpack - else - unpack ${A} - fi - - cd "${S}" - - # patches go here... - - # change rules back to group uucp instead of dialout for now - sed -e 's/GROUP="dialout"/GROUP="uucp"/' \ - -i rules/{rules.d,packages,gentoo}/*.rules \ - || die "failed to change group dialout to uucp" - - if [[ ${PV} != 9999 ]]; then - # Make sure there is no sudden changes to upstream rules file - # (more for my own needs than anything else ...) - MD5=$(md5sum < "${S}/rules/rules.d/50-udev-default.rules") - MD5=${MD5/ -/} - if [[ ${MD5} != 5c12d80f1daf00529e56af455bc20ced ]] - then - echo - eerror "50-udev-default.rules has been updated, please validate!" - eerror "md5sum=${MD5}" - die "50-udev-default.rules has been updated, please validate!" - fi - fi - - sed_helper_dir \ - rules/rules.d/50-udev-default.rules \ - extras/rule_generator/write_*_rules \ - udev/udev-util.c \ - udev/udev-rules.c \ - udev/udevd.c || die "sed failed" - - if [[ ${PV} == 9999 ]]; then - eautoreconf - fi -} - -src_compile() { - filter-flags -fprefetch-loop-arrays - - econf \ - --prefix=/usr \ - --sysconfdir=/etc \ - --exec-prefix= \ - --with-libdir-name=$(get_libdir) \ - --enable-logging \ - $(use_with selinux) - - emake || die "compiling udev failed" -} - -src_install() { - local scriptdir="${FILESDIR}/136" - - into / - emake DESTDIR="${D}" install || die "make install failed" - if [[ "$(get_libdir)" != "lib" ]]; then - # we can not just rename /lib to /lib64, because - # make install creates /lib64 and /lib - mkdir -p "${D}/$(get_libdir)" - mv "${D}"/lib/* "${D}/$(get_libdir)/" - rmdir "${D}"/lib - fi - - exeinto "${udev_helper_dir}" - newexe "${FILESDIR}"/net-130-r1.sh net.sh || die "net.sh not installed properly" - newexe "${FILESDIR}"/move_tmp_persistent_rules-112-r1.sh move_tmp_persistent_rules.sh \ - || die "move_tmp_persistent_rules.sh not installed properly" - newexe "${FILESDIR}"/write_root_link_rule-125 write_root_link_rule \ - || die "write_root_link_rule not installed properly" - - doexe "${scriptdir}"/shell-compat-KV.sh \ - || die "shell-compat.sh not installed properly" - doexe "${scriptdir}"/shell-compat-addon.sh \ - || die "shell-compat.sh not installed properly" - - keepdir "${udev_helper_dir}"/state - keepdir "${udev_helper_dir}"/devices - - # create symlinks for these utilities to /sbin - # where multipath-tools expect them to be (Bug #168588) - dosym "..${udev_helper_dir}/vol_id" /sbin/vol_id - dosym "..${udev_helper_dir}/scsi_id" /sbin/scsi_id - - # Add gentoo stuff to udev.conf - echo "# If you need to change mount-options, do it in /etc/fstab" \ - >> "${D}"/etc/udev/udev.conf - - # let the dir exist at least - keepdir /etc/udev/rules.d - - # Now installing rules - cd "${S}"/rules - insinto "${udev_helper_dir}"/rules.d/ - - # Our rules files - doins gentoo/??-*.rules - doins packages/40-alsa.rules - doins packages/40-isdn.rules - - # Adding arch specific rules - if [[ -f packages/40-${ARCH}.rules ]] - then - doins "packages/40-${ARCH}.rules" - fi - cd "${S}" - - # our udev hooks into the rc system - insinto /$(get_libdir)/rcscripts/addons - doins "${scriptdir}"/udev-start.sh \ - || die "udev-start.sh not installed properly" - doins "${scriptdir}"/udev-stop.sh \ - || die "udev-stop.sh not installed properly" - - local init - # udev-postmount and init-scripts for >=openrc-0.3.1, Bug #240984 - for init in udev udev-mount udev-dev-tarball udev-postmount; do - newinitd "${scriptdir}/${init}.initd" "${init}" \ - || die "initscript ${init} not installed properly" - done - - # insert minimum kernel versions - sed -e "s/%KV_MIN%/${KV_min}/" \ - -e "s/%KV_MIN_RELIABLE%/${KV_min_reliable}/" \ - -i "${D}"/etc/init.d/udev-mount - - # config file for init-script and start-addon - newconfd "${scriptdir}/udev.confd" udev \ - || die "config file not installed properly" - - insinto /etc/modprobe.d - newins "${FILESDIR}"/blacklist-110 blacklist - doins "${FILESDIR}"/pnp-aliases - - # convert /lib/udev to real used dir - sed_helper_dir \ - "${D}/$(get_libdir)"/rcscripts/addons/*.sh \ - "${D}"/etc/init.d/udev* \ - "${D}"/etc/modprobe.d/* - - # documentation - dodoc ChangeLog README TODO || die "failed installing docs" - - cd docs/writing_udev_rules - mv index.html writing_udev_rules.html - dohtml *.html - - cd "${S}" - - newdoc extras/volume_id/README README_volume_id - - echo "CONFIG_PROTECT_MASK=\"/etc/udev/rules.d\"" > 20udev - doenvd 20udev -} - -pkg_preinst() { - if [[ -d ${ROOT}/lib/udev-state ]] - then - mv -f "${ROOT}"/lib/udev-state/* "${D}"/lib/udev/state/ - rm -r "${ROOT}"/lib/udev-state - fi - - if [[ -f ${ROOT}/etc/udev/udev.config && - ! -f ${ROOT}/etc/udev/udev.rules ]] - then - mv -f "${ROOT}"/etc/udev/udev.config "${ROOT}"/etc/udev/udev.rules - fi - - # delete the old udev.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/udev.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug - fi - - # delete the old wait_for_sysfs.hotplug symlink if it is present - if [[ -h ${ROOT}/etc/hotplug.d/default/10-udev.hotplug ]] - then - rm -f "${ROOT}"/etc/hotplug.d/default/10-udev.hotplug - fi - - # is there a stale coldplug initscript? (CONFIG_PROTECT leaves it behind) - coldplug_stale="" - if [[ -f ${ROOT}/etc/init.d/coldplug ]] - then - coldplug_stale="1" - fi - - has_version "=${CATEGORY}/${PN}-103-r3" - previous_equal_to_103_r3=$? - - has_version "<${CATEGORY}/${PN}-104-r5" - previous_less_than_104_r5=$? - - has_version "<${CATEGORY}/${PN}-106-r5" - previous_less_than_106_r5=$? - - has_version "<${CATEGORY}/${PN}-113" - previous_less_than_113=$? -} - -fix_old_persistent_net_rules() { - local rules=${ROOT}/etc/udev/rules.d/70-persistent-net.rules - [[ -f ${rules} ]] || return - - elog - elog "Updating persistent-net rules file" - - # Change ATTRS to ATTR matches, Bug #246927 - sed -i -e 's/ATTRS{/ATTR{/g' "${rules}" - - # Add KERNEL matches if missing, Bug #246849 - sed -ri \ - -e '/KERNEL/ ! { s/NAME="(eth|wlan|ath)([0-9]+)"/KERNEL=="\1*", NAME="\1\2"/}' \ - "${rules}" -} - -# See Bug #129204 for a discussion about restarting udevd -restart_udevd() { - # need to merge to our system - [[ ${ROOT} = / ]] || return - - # check if root of init-process is identical to ours (not in chroot) - [[ -r /proc/1/root && /proc/1/root/ -ef /proc/self/root/ ]] || return - - # abort if there is no udevd running - [[ -n $(pidof udevd) ]] || return - - # abort if no /dev/.udev exists - [[ -e /dev/.udev ]] || return - - elog - elog "restarting udevd now." - - killall -15 udevd &>/dev/null - sleep 1 - killall -9 udevd &>/dev/null - - /sbin/udevd --daemon -} - -pkg_postinst() { - fix_old_persistent_net_rules - - restart_udevd - - if [[ -e "${ROOT}"/etc/runlevels/sysinit && ! -e "${ROOT}"/etc/runlevels/sysinit/udev ]] - then - ewarn - ewarn "You need to add the udev init script to the runlevel sysinit," - ewarn "else your system will not be able to boot" - ewarn "after updating to >=openrc-0.4.0" - ewarn "Run this to enable udev for >=openrc-0.4.0:" - ewarn "\trc-update add udev sysinit" - ewarn - fi - - # people want reminders, I'll give them reminders. Odds are they will - # just ignore them anyway... - - if [[ ${coldplug_stale} == 1 ]] - then - ewarn "A stale coldplug init script found. You should run:" - ewarn - ewarn " rc-update del coldplug" - ewarn " rm -f /etc/init.d/coldplug" - ewarn - ewarn "udev now provides its own coldplug functionality." - fi - - # delete 40-scsi-hotplug.rules - all integrated in 50-udev.rules - if [[ $previous_equal_to_103_r3 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/40-scsi-hotplug.rules ]] - then - ewarn "Deleting stray 40-scsi-hotplug.rules" - ewarn "installed by sys-fs/udev-103-r3" - rm -f "${ROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules - fi - - # Removing some device-nodes we thought we need some time ago - if [[ -d ${ROOT}/lib/udev/devices ]] - then - rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom} - fi - - # Removing some old file - if [[ $previous_less_than_104_r5 = 0 ]] - then - rm -f "${ROOT}"/etc/dev.d/net/hotplug.dev - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/net 2>/dev/null - fi - - if [[ $previous_less_than_106_r5 = 0 ]] && - [[ -e ${ROOT}/etc/udev/rules.d/95-net.rules ]] - then - rm -f "${ROOT}"/etc/udev/rules.d/95-net.rules - fi - - # Try to remove /etc/dev.d as that is obsolete - if [[ -d ${ROOT}/etc/dev.d ]] - then - rmdir --ignore-fail-on-non-empty "${ROOT}"/etc/dev.d/default "${ROOT}"/etc/dev.d 2>/dev/null - if [[ -d ${ROOT}/etc/dev.d ]] - then - ewarn "You still have the directory /etc/dev.d on your system." - ewarn "This is no longer used by udev and can be removed." - fi - fi - - # 64-device-mapper.rules now gets installed by sys-fs/device-mapper - # remove it if user don't has sys-fs/device-mapper installed - if [[ $previous_less_than_113 = 0 ]] && - [[ -f ${ROOT}/etc/udev/rules.d/64-device-mapper.rules ]] && - ! has_version sys-fs/device-mapper - then - rm -f "${ROOT}"/etc/udev/rules.d/64-device-mapper.rules - einfo "Removed unneeded file 64-device-mapper.rules" - fi - - # requested in Bug #225033: - elog - elog "persistent-net does assigning fixed names to network devices." - elog "If you have problems with the persistent-net rules," - elog "just delete the rules file" - elog "\trm ${ROOT}etc/udev/rules.d/70-persistent-net.rules" - elog "and then reboot." - elog - elog "This may however number your devices in a different way than they are now." - - ewarn - ewarn "If you build an initramfs including udev, then please" - ewarn "make sure that the /sbin/udevadm binary gets included," - ewarn "and your scripts changed to use it,as it replaces the" - ewarn "old helper apps udevinfo, udevtrigger, ..." - - ewarn - ewarn "mount options for directory /dev are no longer" - ewarn "set in /etc/udev/udev.conf, but in /etc/fstab" - ewarn "as for other directories." - - elog - elog "For more information on udev on Gentoo, writing udev rules, and" - elog " fixing known issues visit:" - elog " http://www.gentoo.org/doc/en/udev-guide.xml" -} |