feat(sys-fs/udev) remove package as portage-stable has newer version

This commit is contained in:
Greg Kroah-Hartman 2013-07-11 22:25:17 -07:00
parent 07066716ba
commit 881cc03569
33 changed files with 0 additions and 2823 deletions

View File

@ -1,8 +0,0 @@
DIST udev-151-testsys.tar.bz2 137712 SHA256 727e2127e497cd0c41e27bda6f1e8e83831226f84c63e732fe78a64ed91a322e SHA512 0c6266578692c12c82cac391839a470f58cb11e70fec038924a5ddc3d9f85d35f3efd663e873594c5d2add9ed008cc4e290696908d9bb7a0974a906fbd60cf5b WHIRLPOOL 5f3f1e4631b09f9afbe6571af9ad484ef5fa1f944665f1885cf20a7b7d6b60d723ed8bd0842dfe8a77315921c9118c29794e16584997d997a7db38f7d9dd37a8
DIST udev-151.tar.bz2 509815 SHA256 d37a94e75b962182ce940e4a839f07b1c7024dbe7e4b870a120bf0fe9ed0d55d SHA512 9ec1859d50ddc7b03107bdc5cf1c08980442e2f2b10daad2ce9e55a2fcbd7a93270ea42bcccb2eeec50519b9e6bca303c2cb7f1da3084608a712afc7042b8173 WHIRLPOOL 8cfbf9068948a6c83431a4fba8a2d0e7fec93f13e7fd9b4d7e75f3600709eb1b3083c2a6d5fff135876f585dac29c06c185867b2f3605d0f718633172a218d0c
DIST udev-170.tar.bz2 598012 SHA256 7bcc634ed3f49456d8ea075a5c33febbfff70f65f1a4b8a88da1460f0d9dab7f SHA512 8b96b61d0d56c89a1fca40ec110fadb747aafc3281fd24665e20cd5e2d03a12e61e33db024514c4cabea06c077b84c94557de7fcffee929a3bed781254c28a6f WHIRLPOOL e77ae395dcb29343f1a8548fee343407ffd2a592bc96946f9036601909bb3b728977a5bb8b1d2c21d122645148c6d3facf4b5fd0bd67097b0ba3bce5c1447a28
DIST udev-171-gentoo-patchset-v1.tar.bz2 796 SHA256 9524e64068d67bb55ddad16dd36a27c3ef87323421254a5bfe2431693b1bc983 SHA512 d2eef776c3cc331b5df339e865838b67b70da01e10fa75c5cb0d45cff388adfa6af4dd36677eb05cee9936331445afadcd4158ed7d96f3499ce93d6ee1e3feb6 WHIRLPOOL d1451d2002263db7bd30baa2d126fcb3ffff6a4b310f8ebfea755760b3afbd3a76ab2aa0d16e1a88cff13567a153155720c4c16c1d4624dd2a4405b29dbb3997
DIST udev-171-testsys.tar.bz2 155001 SHA256 7383701b64701f58f16e0ddb19fe33b4eb53fac6fc6068bdcbff7e6325b79dcc SHA512 f3f537d771e36b87c71004f5576f7672ffeb815d0b5337bb6bbb6e842c32a28d1d92b4eb0ee2edc60c0b8bd576fc2f36e8b0ed16ec9c0cff9c216e04fb1438ad WHIRLPOOL 0ee66df2f52496d592d0dd3de7c628f6deee7f41c2d21e745f22d74e61c276e01cc6ba584c65b05d36c8a4fb14bc54e3e1a89b975751929b19e91458e3550253
DIST udev-171.tar.bz2 597937 SHA256 fed1e46074c1a16c828193ebd73b3940b7905cc7dcaeb0b3c720d4615210695e SHA512 dea189d79b195f8c10740507b11de2c2074442301ee52a0b2c62efa8663e1793c1a78b03b95510ba19bc93d4dcc497120fbf6bb5784878aa903973f76b92d42f WHIRLPOOL a93241b0f0645696e6a88ddb152c3ef8f2c73b5bf3591892384f180fc7abeb580c59642013480546eac00ad5028b1900ad35b88f6a27ad2d07792e9f34e59743
DIST udev-gentoo-scripts-v3.tar.bz2 9534 SHA256 4cae68974f15624f6387252e25cbcd1fcb67c7d4bf37c7cf08656843fcafbc2d SHA512 69cf1e16764b06e4e7b2604d864803c30365fc1f414c3246658c2e8caffffeda7e03ce177da48950d0302f98183d3eb5d12101b4c04ada2064cd72665a890a00 WHIRLPOOL c151940e171614890754c3506f7e9d7e57d769f7235398abc01ac20776fb914c4250f6e75722773063769e49760aa0d3380a941b348ed103878c678c97ddf055
DIST udev-gentoo-scripts-v4.tar.bz2 9927 SHA256 2724814aa07c357b7191969877b418f84d9d6c6e87315357fbddbb97b1d3b4c4 SHA512 0e391e441fcb4f89de085aee4e4c42667dafec34da7ced47137c17ec63e9f3d0e581672722e71a6758f4f272476d66a994e0e6d4b9c1532bb975e6d833f09310 WHIRLPOOL 1902d66adec0def9f648bf8f77e3f51c334aca7da0de5c2dfde17f3395e5aa43e231107c1291ff76594f813e1774fd96c97686d30ebaa01f14ced2efa19321f4

View File

@ -1,3 +0,0 @@
# Workaround the fact that udev 146 does not save udevdb entries for
# network devices that are not to be renamed. chromium-os:12387
SUBSYSTEM=="net", NAME="%k"

View File

@ -1,45 +0,0 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# provides get_KV and KV_to_int as not all openrc-versions installed via ebuild have these
cmd_exist()
{
type "$1" >/dev/null 2>&1
}
# does exist in baselayout-1
# does not exist in openrc, but is added by openrc-ebuild since some time
if ! cmd_exist KV_to_int; then
KV_to_int() {
[ -z $1 ] && return 1
local x=${1%%-*}
local KV_MAJOR=${x%%.*}
x=${x#*.}
local KV_MINOR=${x%%.*}
x=${x#*.}
local KV_MICRO=${x%%.*}
local KV_int=$((${KV_MAJOR} * 65536 + ${KV_MINOR} * 256 + ${KV_MICRO} ))
# We make version 2.2.0 the minimum version we will handle as
# a sanity check ... if its less, we fail ...
[ "${KV_int}" -lt 131584 ] && return 1
echo "${KV_int}"
}
fi
# same as KV_to_int
if ! cmd_exist get_KV; then
_RC_GET_KV_CACHE=""
get_KV() {
[ -z "${_RC_GET_KV_CACHE}" ] \
&& _RC_GET_KV_CACHE="$(uname -r)"
echo "$(KV_to_int "${_RC_GET_KV_CACHE}")"
return $?
}
fi

View File

@ -1,43 +0,0 @@
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# functions that may not be defined, but are used by the udev-start and udev-stop addon
# used by baselayout-1 and openrc before version 0.4.0
cmd_exist()
{
type "$1" >/dev/null 2>&1
}
# does not exist in baselayout-1, does exist in openrc
if ! cmd_exist yesno; then
yesno() {
[ -z "$1" ] && return 1
case "$1" in
yes|Yes|YES) return 0 ;;
esac
return 1
}
fi
# does not exist in baselayout-1, does exist in openrc
if ! cmd_exist fstabinfo; then
fstabinfo() {
[ "$1" = "--quiet" ] && shift
local dir="$1"
# only check RC_USE_FSTAB on baselayout-1
yesno "${RC_USE_FSTAB}" || return 1
# check if entry is in /etc/fstab
local ret=$(gawk 'BEGIN { found="false"; }
$1 ~ "^#" { next }
$2 == "'$dir'" { found="true"; }
END { print found; }
' /etc/fstab)
"${ret}"
}
fi

View File

@ -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}"
}

View File

@ -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 KV_to_int
. /lib/udev/shell-compat-KV.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 '%KV_MIN%') ]; then
eerror "Your kernel is too old to work with this version of udev."
eerror "Current udev only supports Linux kernel %KV_MIN% and newer."
return 1
fi
yesno "${unreliable_kernel_warning:-yes}" || return 0
if [ $(get_KV) -lt $(KV_to_int '%KV_MIN_RELIABLE%') ]; then
ewarn "You need at least Linux kernel %KV_MIN_RELIABLE% 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 -m 600 /dev/console c 5 1
[ -c /dev/tty1 ] || mknod -m 620 /dev/tty1 c 4 1
[ -c /dev/tty ] || mknod -m 666 /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 -m 666 /dev/null c 1 3
# so udev can add its start-message to dmesg
[ -c /dev/kmsg ] || mknod -m 660 /dev/kmsg c 1 11
# 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
}

View File

@ -1,31 +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/136/udev-postmount.initd,v 1.3 2009/02/23 16:30:53 zzam Exp $
depend() {
need localmount
}
dir_writeable()
{
mkdir "$1"/.test.$$ 2>/dev/null && rmdir "$1"/.test.$$
}
start() {
# check if this system uses udev
[ -d /dev/.udev/ ] || return 0
# only continue if rules-directory is writable
dir_writeable /etc/udev/rules.d || 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

View File

@ -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-addon.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

View File

@ -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-addon.sh
# store device tarball
(
. /etc/init.d/udev-dev-tarball
stop
)
exit 0

View File

@ -1,56 +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"
# Disable adding new rules for persistent-cd
# Disabling this will stop new cdrom devices to appear
# as /dev/{cdrom,cdrw,dvd,dvdrw}
persistent_cd_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"
# Expert options:
# Disable warning about unreliable kernel/udev combination
#unreliable_kernel_warning="no"
# Timeout in seconds to wait for processing of uevents at boot.
# There should be no need to change this.
#udev_settle_timeout="60"
# Run udevadmin monitor to get a log of all events
# in /dev/.udev/udevmonitor.log
#udev_monitor="YES"
# Keep udevmonitor running after populating /dev.
#udev_monitor_keep_running="no"
# Set cmdline options for udevmonitor.
# could be some of --env --kernel --udev
#udev_monitor_opts="--env"

View File

@ -1,244 +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
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
if yesno "${rc_device_tarball:-no}"; then
need sysfs udev-mount udev-dev-tarball
else
need sysfs udev-mount
fi
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
}
rules_disable_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 bname="$1" onoff="$2"
if yesno "${onoff}"; then
mkdir -p "$d"
echo "# This file disables ${bname} due to /etc/conf.d/udev" \
> "${d}/${bname}"
else
rm -f "${d}/${bname}"
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=${udev_settle_timeout:-60}
eend $?
udevadm control --env do_not_run_plug_service=
return 0
}
# for debugging
start_udevmonitor()
{
yesno "${udev_monitor:-no}" || return 0
udevmonitor_log=/dev/.udev/udevmonitor.log
udevmonitor_pid=/dev/.udev/udevmonitor.pid
einfo "udev: Running udevadm monitor ${udev_monitor_opts} to get a log of all events"
start-stop-daemon --start --stdout "${udevmonitor_log}" \
--make-pidfile --pidfile "${udevmonitor_pid}" \
--background --exec /sbin/udevadm -- monitor ${udev_monitor_opts}
}
stop_udevmonitor()
{
yesno "${udev_monitor:-no}" || return 0
if yesno "${udev_monitor_keep_running:-no}"; then
ewarn "udev: udevmonitor is still running and writing into ${udevmonitor_log}"
else
einfo "udev: Stopping udevmonitor: Log is in ${udevmonitor_log}"
start-stop-daemon --stop --pidfile "${udevmonitor_pid}" --exec /sbin/udevadm
fi
}
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
rules_disable_switch 75-persistent-net-generator.rules "${persistent_net_disable:-no}"
rules_disable_switch 75-cd-aliases-generator.rules ${persistent_cd_disable:-no}
disable_hotplug_agent
start_udevd || cleanup
start_udevmonitor
populate_dev || cleanup
check_persistent_net
check_udev_works || cleanup
stop_udevmonitor
return 0
}
stop() {
ebegin "Stopping udevd"
start-stop-daemon --stop --exec /sbin/udevd
eend $?
}

View File

@ -1,2 +0,0 @@
# compat_firmware-class requests, copies files into the kernel
SUBSYSTEM=="compat_firmware", ACTION=="add", RUN+="compat_firmware.sh"

View File

@ -1,29 +0,0 @@
# This file lists modules which will not be loaded by udev,
# not at coldplugging and not on hotplug events.
# Add your own entries to this file
# in the format "blacklist <name of module>"
# Some examples:
# evbug is a debug tool and should be loaded explicitly
blacklist evbug
# Autoloading eth1394 most of the time re-orders your network
# interfaces, and with buggy kernel 2.6.21, udev persistent-net
# is not able to rename these devices, so you get eth?_rename devices
# plus an exceeded 30sec boot timeout
blacklist eth1394
# You probably want this to not get the console beep loud on every tab :)
#blacklist pcspkr
# these drivers are very simple, the HID drivers are usually preferred
#blacklist usbmouse
#blacklist usbkbd
# Sometimes loading a framebuffer driver at boot gets the console black
#install pci:v*d*sv*sd*bc03sc*i* /bin/true
# hplip and cups 1.4+ use raw USB devices, so it requires usblp not be loaded
#blacklist usblp

View File

@ -1,35 +0,0 @@
#!/bin/sh -e
# This is ported from Ubuntu but ubuntu uses these directories which
# other distributions don't care about:
# FIRMWARE_DIRS="/lib/firmware/updates/$(uname -r) /lib/firmware/updates \
# /lib/firmware/$(uname -r) /lib/firmware"
# If your distribution looks for firmware in other directories
# feel free to extend this and add your own directory here.
#
FIRMWARE_DIRS="/lib/firmware"
err() {
echo "$@" >&2
logger -t "${0##*/}[$$]" "$@" 2>/dev/null || true
}
if [ ! -e /sys$DEVPATH/loading ]; then
err "udev firmware loader misses sysfs directory"
exit 1
fi
for DIR in $FIRMWARE_DIRS; do
[ -e "$DIR/$FIRMWARE" ] || continue
echo 1 > /sys$DEVPATH/loading
cat "$DIR/$FIRMWARE" > /sys$DEVPATH/data
echo 0 > /sys$DEVPATH/loading
exit 0
done
echo -1 > /sys$DEVPATH/loading
err "Cannot find firmware file '$FIRMWARE'"
mkdir -p /dev/.udev/firmware-missing
file=$(echo "$FIRMWARE" | sed 's:/:\\x2f:g')
ln -s -f "$DEVPATH" /dev/.udev/firmware-missing/$file
exit 1

View File

@ -1,25 +0,0 @@
#!/bin/sh
# Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
. /etc/init.d/functions.sh
# store persistent-rules that got created while booting
# when / was still read-only
store_persistent_rules() {
local file dest
for file in /dev/.udev/tmp-rules--*; do
dest=${file##*tmp-rules--}
[ "$dest" = '*' ] && break
type=${dest##70-persistent-}
type=${type%%.rules}
ebegin "Saving udev persistent ${type} rules to /etc/udev/rules.d"
cat "$file" >> /etc/udev/rules.d/"$dest" && rm -f "$file"
eend $? "Failed moving persistent rules!"
done
}
store_persistent_rules
# vim:ts=4

View File

@ -1,34 +0,0 @@
#!/bin/sh
#
# net.sh: udev external RUN script
#
# Copyright 2007 Roy Marples <uberlord@gentoo.org>
# Distributed under the terms of the GNU General Public License v2
IFACE=$1
ACTION=$2
SCRIPT=/etc/init.d/net.$IFACE
# ignore interfaces that are registered after being "up" (?)
case ${IFACE} in
ppp*|ippp*|isdn*|plip*|lo*|irda*|dummy*|ipsec*|tun*|tap*|br*)
exit 0 ;;
esac
# stop here if coldplug is disabled, Bug #206518
if [ "${do_not_run_plug_service}" = 1 ]; then
exit 0
fi
if [ ! -x "${SCRIPT}" ] ; then
#do not flood log with messages, bug #205687
#logger -t udev-net.sh "${SCRIPT}: does not exist or is not executable"
exit 1
fi
# If we're stopping then sleep for a bit in-case a daemon is monitoring
# the interface. This to try and ensure we stop after they do.
[ "${ACTION}" == "stop" ] && sleep 2
IN_HOTPLUG=1 "${SCRIPT}" --quiet "${ACTION}"

View File

@ -1,17 +0,0 @@
# /etc/modprobe.d/pnp-aliases
#
# These aliases are used by this udev-rule:
# SUBSYSTEM=="pnp", ENV{MODALIAS}!="?*", RUN+="/bin/sh -c '/sbin/modprobe -a $$(while read id; do echo pnp:d$$id; done < /sys$devpath/id)'"
#
# They should help to autoload drivers used by various pnp-devices
# (if not blacklisted somewhere else)
#
alias pnp:dPNP0510 irtty-sir
alias pnp:dPNP0511 irtty-sir
alias pnp:dPNP0700 floppy
alias pnp:dPNP0800 pcspkr
alias pnp:dPNP0b00 rtc
alias pnp:dPNP0303 atkbd
alias pnp:dPNP0f13 psmouse
alias pnp:dPNPb02f analog

View File

@ -1,16 +0,0 @@
diff --git a/rules/gentoo/40-gentoo.rules b/rules/gentoo/40-gentoo.rules
index 4751b51..91a7545 100644
--- a/rules/gentoo/40-gentoo.rules
+++ b/rules/gentoo/40-gentoo.rules
@@ -1,11 +1,5 @@
# do not edit this file, it will be overwritten on update
-# old devfs path, removing this could break systems
-# Bug 195839
-KERNEL=="md[0-9]*", SYMLINK+="md/%n"
-KERNEL=="loop[0-9]*", SYMLINK+="loop/%n"
-KERNEL=="ram[0-9]*", SYMLINK+="rd/%n"
-
# keep devices after driver unload
KERNEL=="ppp", OPTIONS+="ignore_remove"
KERNEL=="tun", OPTIONS+="ignore_remove"

View File

@ -1,20 +0,0 @@
--- a/configure.ac 2010-01-25 21:47:32.000000000 -0800
+++ b/configure.ac 2010-01-25 21:50:24.000000000 -0800
@@ -69,13 +69,13 @@
PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
- AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
- AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
- AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
AC_ARG_WITH(pci-ids-path,
AS_HELP_STRING([--pci-ids-path=DIR], [Path to pci.ids file]),
[PCI_DATABASE=${withval}],
- [if test -n "$pciids" ; then
+ [AC_CHECK_FILES([/usr/share/pci.ids], [pciids=/usr/share/pci.ids])
+ AC_CHECK_FILES([/usr/share/hwdata/pci.ids], [pciids=/usr/share/hwdata/pci.ids])
+ AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
+ if test -n "$pciids" ; then
PCI_DATABASE="$pciids"
else
AC_MSG_ERROR([pci.ids not found, try --with-pci-ids-path=])

View File

@ -1,12 +0,0 @@
--- a/libudev/libudev.pc.in 2009-10-24 23:46:04.000000000 +0000
+++ b/libudev/libudev.pc.in 2009-10-24 23:46:30.000000000 +0000
@@ -1,7 +1,7 @@
prefix=@prefix@
-exec_prefix=@prefix@
+exec_prefix=@exec_prefix@
libdir=@libdir@
-includedir=@prefix@/include
+includedir=@includedir@
Name: libudev
Description: Library to access udev device information

View File

@ -1,13 +0,0 @@
--- extras/rule_generator/rule_generator.functions.orig 2008-10-23 06:33:41.000000000 -0700
+++ extras/rule_generator/rule_generator.functions 2010-05-26 10:26:20.000000000 -0700
@@ -57,7 +57,9 @@
# Choose the real rules file if it is writeable or a temporary file if not.
# Both files should be checked later when looking for existing rules.
choose_rules_file() {
- local tmp_rules_file="/dev/.udev/tmp-rules--${RULES_FILE##*/}"
+ local orig_rules_base=${RULES_FILE##*/}
+ local tmp_rules_base=${orig_rules_base%%.rules}--tmp.rules
+ local tmp_rules_file="/dev/.udev/rules.d/$tmp_rules_base"
[ -e "$RULES_FILE" -o -e "$tmp_rules_file" ] || PRINT_HEADER=1
if writeable ${RULES_FILE%/*}; then

View File

@ -1,29 +0,0 @@
diff --git a/extras/firmware/firmware.c b/extras/firmware/firmware.c
index 8f70be4..16455de 100644
--- a/extras/firmware/firmware.c
+++ b/extras/firmware/firmware.c
@@ -149,6 +149,7 @@ int main(int argc, char **argv)
util_path_encode(firmware, fwencpath, sizeof(fwencpath));
util_strscpyl(misspath, sizeof(misspath), udev_get_dev_path(udev), "/.udev/firmware-missing/", fwencpath, NULL);
+ util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL);
if (fwfile == NULL) {
int err;
@@ -166,6 +167,7 @@ int main(int argc, char **argv)
udev_selinux_resetfscreatecon(udev);
} while (err == -ENOENT);
rc = 2;
+ set_loading(udev, loadpath, "-1");
goto exit;
}
@@ -176,7 +178,6 @@ int main(int argc, char **argv)
if (unlink(misspath) == 0)
util_delete_path(udev, misspath);
- util_strscpyl(loadpath, sizeof(loadpath), udev_get_sys_path(udev), devpath, "/loading", NULL);
set_loading(udev, loadpath, "1");
util_strscpyl(datapath, sizeof(datapath), udev_get_sys_path(udev), devpath, "/data", NULL);

View File

@ -1,12 +0,0 @@
--- extras/modem-modeswitch/61-option-modem-modeswitch.rules~ 2009-12-03 04:45:03.000000000 -0800
+++ extras/modem-modeswitch/61-option-modem-modeswitch.rules 2010-12-22 17:59:59.307733000 -0800
@@ -37,6 +37,9 @@ ATTRS{idVendor}=="0af0", ATTRS{idProduct
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7501", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7601", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
ATTRS{idVendor}=="0af0", ATTRS{idProduct}=="7901", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
+ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1446", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
+ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1520", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
+ATTRS{idVendor}=="12d1", ATTRS{idProduct}=="1521", RUN+="modem-modeswitch -v 0x%s{idVendor} -p 0x%s{idProduct} -t option-zerocd"
# NOTE: only for devices manufactured by Option NV
# DO NOT add devices that are not manufactured by Option NV

View File

@ -1,53 +0,0 @@
diff --git a/extras/cdrom_id/60-cdrom_id.rules b/extras/cdrom_id/60-cdrom_id.rules
index 132a680..a3e8e3c 100644
--- a/extras/cdrom_id/60-cdrom_id.rules
+++ b/extras/cdrom_id/60-cdrom_id.rules
@@ -2,4 +2,4 @@
# import optical drive properties
ACTION=="add|change", SUBSYSTEM=="block", ENV{DEVTYPE}=="disk", \
- KERNEL=="sr[0-9]*|xvd*", IMPORT{program}="cdrom_id --export $tempnode"
+ KERNEL=="sr[0-9]*|hd[a-z]|pcd[0-9]|xvd*", IMPORT{program}="cdrom_id --export $tempnode"
diff --git a/rules/rules.d/50-udev-default.rules b/rules/rules.d/50-udev-default.rules
index f8556d1..ba07079 100644
--- a/rules/rules.d/50-udev-default.rules
+++ b/rules/rules.d/50-udev-default.rules
@@ -77,9 +77,12 @@ SUBSYSTEM=="block", GROUP="disk"
# floppy
SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+SUBSYSTEM=="block", KERNEL=="fd[0-9]", ACTION=="add", ATTRS{cmos}=="?*", RUN+="create_floppy_devices -c -t $attr{cmos} -m %M -M 0660 -G floppy $root/%k"
+KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="floppy", OPTIONS+="all_partitions"
# cdrom
SUBSYSTEM=="block", KERNEL=="sr[0-9]*", SYMLINK+="scd%n", GROUP="cdrom"
+SUBSYSTEM=="block", KERNEL=="hd*", SUBSYSTEMS=="ide", ATTRS{media}=="cdrom", GROUP="cdrom"
SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
KERNEL=="pktcdvd", GROUP="cdrom"
diff --git a/rules/rules.d/60-persistent-storage.rules b/rules/rules.d/60-persistent-storage.rules
index 89041a9..6f12a9a 100644
--- a/rules/rules.d/60-persistent-storage.rules
+++ b/rules/rules.d/60-persistent-storage.rules
@@ -12,12 +12,21 @@ SUBSYSTEM!="block", GOTO="persistent_storage_end"
# skip rules for inappropriate block devices
KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*", GOTO="persistent_storage_end"
+# never access non-cdrom removable ide devices, the drivers are causing event loops on open()
+KERNEL=="hd*[!0-9]", ATTR{removable}=="1", SUBSYSTEMS=="ide", ATTRS{media}=="disk|floppy", GOTO="persistent_storage_end"
+KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GOTO="persistent_storage_end"
+
# ignore partitions that span the entire disk
TEST=="whole_disk", GOTO="persistent_storage_end"
# for partitions import parent information
ENV{DEVTYPE}=="partition", IMPORT{parent}="ID_*"
+# by-id (hardware serial number)
+KERNEL=="hd*[!0-9]", IMPORT{program}="ata_id --export $tempnode"
+KERNEL=="hd*[!0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}"
+KERNEL=="hd*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/ata-$env{ID_SERIAL}-part%n"
+
# USB devices use their own serial number
KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{program}="usb_id --export %p"
# ATA devices with their own "ata" kernel subsystem

View File

@ -1,11 +0,0 @@
--- a/rules/rules.d/50-udev-default.rules 2013-01-23 16:05:36.000000000 -0500
+++ b/rules/rules.d/50-udev-default.rules 2013-01-23 16:05:50.000000000 -0500
@@ -99,7 +99,7 @@
KERNEL=="cpu[0-9]*", MODE="0444"
KERNEL=="fuse", MODE="0666", OPTIONS+="static_node=fuse", \
- RUN+="/bin/mount -t fusectl fusectl /sys/fs/fuse/connections"
+ RUN+="/bin/mount -t fusectl -o nodev,noexec,nosuid fusectl /sys/fs/fuse/connections"
SUBSYSTEM=="rtc", DRIVERS=="rtc_cmos", SYMLINK+="rtc"
KERNEL=="mmtimer", MODE="0644"

View File

@ -1,26 +0,0 @@
From 2761bebdc7b01ed9af9671189c93bf317c4c43ea Mon Sep 17 00:00:00 2001
From: Matthias Schwarzott <zzam@gentoo.org>
Date: Sun, 8 May 2011 21:23:33 +0200
Subject: [PATCH 1/2] Revert "udevd: log warning if /run is not writable"
This reverts commit 2903820a62de1085f6b5def0fb622070805dd90b.
---
udev/udevd.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/udev/udevd.c b/udev/udevd.c
index be4b071..23d14fa 100644
--- a/udev/udevd.c
+++ b/udev/udevd.c
@@ -1227,8 +1227,6 @@ int main(int argc, char *argv[])
if (udev_set_run_path(udev, filename) == NULL)
goto exit;
mkdir(udev_get_run_path(udev), 0755);
- err(udev, "error: runtime directory '%s' not writable, for now falling back to '%s'",
- udev_get_run_config_path(udev), udev_get_run_path(udev));
}
}
/* relabel runtime dir only if it resides below /dev */
--
1.7.5.rc3

View File

@ -1,44 +0,0 @@
From bda2674f22b58bd32802b2057a05efada6155bae Mon Sep 17 00:00:00 2001
From: Scott James Remnant <scott@netsplit.com>
Date: Fri, 20 May 2011 14:06:29 -0700
Subject: [PATCH] configure: allow usb.ids location to be specified
We already allow the pci.ids location to be specified, so add a
patch doing the same for usb.ids. Please don't make me explain
why this is necessary, it will only make you cry.
Signed-off-by: Scott James Remnant <scott@netsplit.com>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
---
configure.ac | 14 ++++++++++++--
1 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 3646f93..cfdb3bf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,8 +93,18 @@ if test "x$enable_hwdb" = xyes; then
AC_CHECK_FILES([/usr/share/misc/pci.ids], [pciids=/usr/share/misc/pci.ids])
fi
- PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
- AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
+ AC_ARG_WITH(usb-ids-path,
+ [AS_HELP_STRING([--with-usb-ids-path=DIR], [Path to usb.ids file])],
+ [USB_DATABASE=${withval}],
+ [if test -n "$usbids" ; then
+ USB_DATABASE="$usbids"
+ else
+ PKG_CHECK_MODULES(USBUTILS, usbutils >= 0.82)
+ AC_SUBST([USB_DATABASE], [$($PKG_CONFIG --variable=usbids usbutils)])
+ fi])
+ AC_MSG_CHECKING([for USB database location])
+ AC_MSG_RESULT([$USB_DATABASE])
+ AC_SUBST(USB_DATABASE)
AC_ARG_WITH(pci-ids-path,
[AS_HELP_STRING([--with-pci-ids-path=DIR], [Path to pci.ids file])],
--
1.7.3.1

View File

@ -1,29 +0,0 @@
#!/bin/sh
#
# This script should run before doing udevtrigger at boot.
# It will create a rule matching the device directory / is on, and
# creating /dev/root symlink pointing on its device node.
#
# This is especially useful for hal looking at /proc/mounts containing
# a line listing /dev/root as device:
# /dev/root / reiserfs rw 0 0
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation version 2 of the License.
#
# (c) 2007-2008 Matthias Schwarzott <zzam@gentoo.org>
eval $(udevadm info --export --export-prefix="ROOT_" --device-id-of-file=/)
[ $? = 0 ] || exit 0
[ "$ROOT_MAJOR" = 0 ] && exit 0
DIR=/dev/.udev/rules.d
[ -d "$DIR" ] || mkdir -p "$DIR"
RULES=$DIR/10-root-link.rules
echo "# Created by /lib/udev/write_root_link_rule" > "${RULES}"
echo "# This rule should create /dev/root as link to real root device." >> "${RULES}"
echo "SUBSYSTEM==\"block\", ENV{MAJOR}==\"$ROOT_MAJOR\", ENV{MINOR}==\"$ROOT_MINOR\", SYMLINK+=\"root\"" >> "${RULES}"

View File

@ -1,597 +0,0 @@
# Copyright 1999-2010 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-151-r4.ebuild,v 1.14 2010/10/29 06:13:22 jer Exp $
EAPI="1"
inherit autotools eutils flag-o-matic multilib toolchain-funcs linux-info
#PATCHSET=${P}-gentoo-patchset-v1
if [[ ${PV} == "9999" ]]; then
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git"
EGIT_BRANCH="master"
inherit git autotools
else
# please update testsys-tarball whenever udev-xxx/test/sys/ is changed
SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2
test? ( mirror://gentoo/${PN}-151-testsys.tar.bz2 )"
[[ -n "${PATCHSET}" ]] && SRC_URI="${SRC_URI} mirror://gentoo/${PATCHSET}.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 devfs-compat old-hd-rules -extras test"
COMMON_DEPEND="selinux? ( sys-libs/libselinux )
extras? (
sys-apps/acl
>=sys-apps/usbutils-0.82
virtual/libusb:0
sys-apps/pciutils
dev-libs/glib:2
)
>=sys-apps/util-linux-2.16
>=sys-libs/glibc-2.9"
DEPEND="${COMMON_DEPEND}
extras? (
dev-util/gperf
dev-util/pkgconfig
)
virtual/os-headers
!<sys-kernel/linux-headers-2.6.29
test? ( app-text/tree )"
RDEPEND="${COMMON_DEPEND}
!sys-apps/coldplug
!<sys-fs/lvm2-2.02.45
!sys-fs/device-mapper
>=sys-apps/baselayout-1.12.5"
if [[ ${PV} == "9999" ]]; then
# for documentation processing with xsltproc
DEPEND="${DEPEND}
app-text/docbook-xsl-stylesheets
app-text/docbook-xml-dtd
dev-util/gtk-doc"
fi
# required kernel options
CONFIG_CHECK="~INOTIFY_USER ~SIGNALFD ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2
~!IDE"
# We need the lib/rcscripts/addon support
PROVIDE="virtual/dev-manager"
udev_check_KV() {
local ok=0
if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]]
then
if kernel_is -ge 2 6 ${KV_PATCH_reliable} ; then
ok=2
elif kernel_is -ge 2 6 ${KV_PATCH_min} ; then
ok=1
fi
fi
return $ok
}
pkg_setup() {
linux-info_pkg_setup
udev_libexec_dir="/$(get_libdir)/udev"
# udev requires signalfd introduced in kernel 2.6.25,
# but a glibc compiled against >=linux-headers-2.6.27 uses the
# new signalfd syscall introduced in kernel 2.6.27 without falling back
# to the old one. So we just depend on 2.6.27 here, see Bug #281312.
KV_PATCH_min=25
KV_PATCH_reliable=27
KV_min=2.6.${KV_PATCH_min}
KV_reliable=2.6.${KV_PATCH_reliable}
# always print kernel version requirements
ewarn
ewarn "${P} does not support Linux kernel before version ${KV_min}!"
if [[ ${KV_PATCH_min} != ${KV_PATCH_reliable} ]]; then
ewarn "For a reliable udev, use at least kernel ${KV_reliable}"
fi
echo
# We don't care about the secondary revision of the kernel.
# 2.6.30.4 -> 2.6.30 is all we check
udev_check_KV
case "$?" in
2) einfo "Your kernel version (${KV_FULL}) is new enough to run ${P} reliably." ;;
1) ewarn "Your kernel version (${KV_FULL}) is new enough to run ${P},"
ewarn "but it may be unreliable in some cases."
ebeep ;;
0) eerror "Your kernel version (${KV_FULL}) is too old to run ${P}"
ebeep ;;
esac
echo
KV_FULL_SRC=${KV_FULL}
get_running_version
udev_check_KV
if [[ "$?" = "0" ]]; then
eerror
eerror "udev cannot be restarted after emerging,"
eerror "as your running kernel version (${KV_FULL}) is too old."
eerror "You really need to use a newer kernel after a reboot!"
NO_RESTART=1
ebeep
fi
}
sed_libexec_dir() {
sed -e "s#/lib/udev#${udev_libexec_dir}#" -i "$@"
}
src_unpack() {
if [[ ${PV} == "9999" ]] ; then
git_src_unpack
else
unpack ${A}
if use test; then
mv "${WORKDIR}"/test/sys "${S}"/test/
fi
fi
cd "${S}"
# patches go here...
# backport some patches
if [[ -n "${PATCHSET}" ]]; then
EPATCH_SOURCE="${WORKDIR}/${PATCHSET}" EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" epatch
fi
# Bug 301667
epatch "${FILESDIR}"/udev-150-fix-missing-firmware-timeout.diff
# pkgconfig fix for when ROOT != /
epatch "${FILESDIR}"/udev-146-pkgconfig.patch
if ! use devfs-compat; then
# see Bug #269359
epatch "${FILESDIR}"/udev-141-remove-devfs-names.diff
fi
# 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} != 5685cc3878df54845dda5e08d712447a ]]
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
if use old-hd-rules; then
epatch "${FILESDIR}"/udev-151-readd-hd-rules.diff
fi
sed_libexec_dir \
rules/rules.d/50-udev-default.rules \
rules/rules.d/78-sound-card.rules \
extras/rule_generator/write_*_rules \
|| die "sed failed"
if [[ ${PV} == 9999 ]]; then
gtkdocize --copy
fi
epatch "${FILESDIR}"/udev-146-cross-pci-ids.patch
epatch "${FILESDIR}"/udev-151-add-huawei-devices.patch
epatch "${FILESDIR}"/udev-146-tmp-rules.diff
eautoreconf
}
src_compile() {
filter-flags -fprefetch-loop-arrays
econf \
--exec-prefix= \
--libdir='${prefix}'/$(get_libdir) \
--libexecdir='${exec_prefix}'"${udev_libexec_dir}" \
--enable-logging \
--with-pci-ids-path='${exec_prefix}'/usr/share/misc/pci.ids \
$(use_with selinux) \
$(use_enable extras) \
--disable-introspection
# we don't have gobject-introspection in portage tree
emake || die "compiling udev failed"
}
src_install() {
local scriptdir="${FILESDIR}/151-r4"
into /
emake DESTDIR="${D}" install || die "make install failed"
exeinto "${udev_libexec_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 "${FILESDIR}"/compat_firmware.sh \
|| die "compat_firmware.sh 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_libexec_dir}"/state
keepdir "${udev_libexec_dir}"/devices
# create symlinks for these utilities to /sbin
# where multipath-tools expect them to be (Bug #168588)
dosym "..${udev_libexec_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_libexec_dir}"/rules.d/
# Our rules files
doins gentoo/??-*.rules
doins packages/40-isdn.rules
# workaround for chromium-os:12387, must be removed for >udev-152
doins "${FILESDIR}"/01-workaround-net-device-db.rules
# compat-wireless firmware loading (needs compat_firmware.sh above)
doins "${FILESDIR}"/50-compat_firmware.rules \
|| die "compat_firmware.rules not installed properly"
# 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_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-146 blacklist.conf
newins "${FILESDIR}"/pnp-aliases pnp-aliases.conf
# convert /lib/udev to real used dir
sed_libexec_dir \
"${D}/$(get_libdir)"/rcscripts/addons/*.sh \
"${D}/${udev_libexec_dir}"/write_root_link_rule \
"${D}"/etc/conf.d/udev \
"${D}"/etc/init.d/udev* \
"${D}"/etc/modprobe.d/*
# documentation
dodoc ChangeLog README TODO || die "failed installing docs"
# keep doc in just one directory, Bug #281137
rm -rf "${D}/usr/share/doc/${PN}"
if use extras; then
dodoc extras/keymap/README.keymap.txt || die "failed installing docs"
fi
}
pkg_preinst() {
# moving old files to support newer modprobe, 12 May 2009
local f dir=${ROOT}/etc/modprobe.d/
for f in pnp-aliases blacklist; do
if [[ -f $dir/$f && ! -f $dir/$f.conf ]]
then
elog "Moving $dir/$f to $f.conf"
mv -f "$dir/$f" "$dir/$f.conf"
fi
done
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
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=$?
}
# 19 Nov 2008
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() {
if [[ ${NO_RESTART} = "1" ]]; then
ewarn "Not restarting udevd, as your kernel is too old!"
return
fi
# 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
sleep 3
if [[ ! -n $(pidof udevd) ]]; then
eerror "FATAL: udev died, please check your kernel is"
eerror "new enough and configured correctly for ${P}."
eerror
eerror "Please have a look at this before rebooting."
eerror "If in doubt, please downgrade udev back to your old version"
ebeep
fi
}
postinst_init_scripts() {
# FIXME: we may need some code that detects if this is a system bootstrap
# and auto-enables udev then
#
# FIXME: inconsistent handling of init-scripts here
# * udev is added to sysinit in openrc-ebuild
# * we add udev-postmount to default in here
#
# migration to >=openrc-0.4
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
# add udev-postmount to default runlevel instead of that ugly injecting
# like a hotplug event, 2009/10/15
# already enabled?
[[ -e "${ROOT}"/etc/runlevels/default/udev-postmount ]] && return
local enable_postmount=0
[[ -e "${ROOT}"/etc/runlevels/sysinit/udev ]] && enable_postmount=1
[[ "${ROOT}" = "/" && -d /dev/.udev/ ]] && enable_postmount=1
if [[ ${enable_postmount} = 1 ]]
then
local initd=udev-postmount
if [[ -e ${ROOT}/etc/init.d/${initd} ]] && \
[[ ! -e ${ROOT}/etc/runlevels/default/${initd} ]]
then
ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/default/${initd}
elog "Auto-adding '${initd}' service to your default runlevel"
fi
else
elog "You should add the udev-postmount service to default runlevel."
elog "Run this to add it:"
elog "\trc-update add udev-postmount default"
fi
}
pkg_postinst() {
fix_old_persistent_net_rules
restart_udevd
postinst_init_scripts
# people want reminders, I'll give them reminders. Odds are they will
# just ignore them anyway...
# delete 40-scsi-hotplug.rules, it is integrated in 50-udev.rules, 19 Jan 2007
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, 25 Jan 2007
if [[ -d ${ROOT}/lib/udev/devices ]]
then
rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom}
fi
# Removing some old file, 29 Jan 2007
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
# 19 Mar 2007
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, 23 Apr 2007
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, 27 Jun 2007
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 #275974, added 2009/09/05
ewarn
ewarn "If after the udev update removable devices or CD/DVD drives"
ewarn "stop working, try re-emerging HAL before filling a bug report"
# 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."
if use devfs-compat; then
ewarn
ewarn "devfs-compat use flag is enabled."
ewarn "This enables devfs compatible device names."
else
ewarn
ewarn "This version of udev no longer has devfs-compat enabled"
fi
ewarn "If you use /dev/md/*, /dev/loop/* or /dev/rd/*,"
ewarn "then please migrate over to using the device names"
ewarn "/dev/md*, /dev/loop* and /dev/ram*."
ewarn "The devfs-compat rules will be removed on the next udev update."
ewarn "For reference see Bug #269359."
if use old-hd-rules; then
ewarn
ewarn "old-hd-rules use flag is enabled"
ewarn "This adds the removed rules for /dev/hd* devices"
else
ewarn
ewarn "This version of udev no longer has use flag old-hd-rules enabled"
ewarn "So all special rules for /dev/hd* devices are missing"
fi
ewarn "Please migrate to the new libata if you need these rules."
ewarn "They will be completely removed on the next udev update."
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"
}

View File

@ -1 +0,0 @@
udev-170.ebuild

View File

@ -1,530 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-168-r2.ebuild,v 1.1 2011/05/14 14:00:34 zzam Exp $
EAPI="1"
inherit eutils flag-o-matic multilib toolchain-funcs linux-info autotools
# I jumped ahead of Gentoo
#PATCHSET=${P}-gentoo-patchset-v1
scriptversion=v3
scriptname=udev-gentoo-scripts-${scriptversion}
if [[ ${PV} == "9999" ]]; then
SRC_URI="mirror://gentoo/${scriptname}.tar.bz2"
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git"
EGIT_BRANCH="master"
inherit git autotools
else
# please update testsys-tarball whenever udev-xxx/test/sys/ is changed
SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2
test? ( mirror://gentoo/${PN}-151-testsys.tar.bz2 )
mirror://gentoo/${scriptname}.tar.bz2"
[[ -n "${PATCHSET}" ]] && SRC_URI="${SRC_URI} mirror://gentoo/${PATCHSET}.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 test rule_generator hwdb acl gudev introspection
keymap floppy edd action_modeswitch"
COMMON_DEPEND="selinux? ( sys-libs/libselinux )
acl? ( sys-apps/acl dev-libs/glib:2 )
gudev? ( dev-libs/glib:2 )
introspection? ( dev-libs/gobject-introspection )
action_modeswitch? ( virtual/libusb:0 )
>=sys-apps/util-linux-2.16
>=sys-libs/glibc-2.9"
DEPEND="${COMMON_DEPEND}
keymap? ( dev-util/gperf )
virtual/os-headers
!<sys-kernel/linux-headers-2.6.29
test? ( app-text/tree )"
RDEPEND="${COMMON_DEPEND}
hwdb?
(
>=sys-apps/usbutils-0.82
sys-apps/pciutils
)
!sys-apps/coldplug
!<sys-fs/lvm2-2.02.45
!sys-fs/device-mapper
>=sys-apps/baselayout-1.12.5"
if [[ ${PV} == "9999" ]]; then
# for documentation processing with xsltproc
DEPEND="${DEPEND}
app-text/docbook-xsl-stylesheets
app-text/docbook-xml-dtd
dev-util/gtk-doc"
fi
# required kernel options
CONFIG_CHECK="~INOTIFY_USER ~SIGNALFD ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2
~!IDE"
udev_check_KV() {
local ok=0
if [[ ${KV_MAJOR} == 2 && ${KV_MINOR} == 6 ]]
then
if kernel_is -ge 2 6 ${KV_PATCH_reliable} ; then
ok=2
elif kernel_is -ge 2 6 ${KV_PATCH_min} ; then
ok=1
fi
fi
return $ok
}
pkg_setup() {
linux-info_pkg_setup
# udev requires signalfd introduced in kernel 2.6.25,
# but a glibc compiled against >=linux-headers-2.6.27 uses the
# new signalfd syscall introduced in kernel 2.6.27 without falling back
# to the old one. So we just depend on 2.6.27 here, see Bug #281312.
KV_PATCH_min=25
KV_PATCH_reliable=31
KV_min=2.6.${KV_PATCH_min}
KV_reliable=2.6.${KV_PATCH_reliable}
# always print kernel version requirements
ewarn
ewarn "${P} does not support Linux kernel before version ${KV_min}!"
if [[ ${KV_PATCH_min} != ${KV_PATCH_reliable} ]]; then
ewarn "For a reliable udev, use at least kernel ${KV_reliable}"
fi
echo
# We don't care about the secondary revision of the kernel.
# 2.6.30.4 -> 2.6.30 is all we check
udev_check_KV
case "$?" in
2) einfo "Your kernel version (${KV_FULL}) is new enough to run ${P} reliably." ;;
1) ewarn "Your kernel version (${KV_FULL}) is new enough to run ${P},"
ewarn "but it may be unreliable in some cases."
ebeep ;;
0) eerror "Your kernel version (${KV_FULL}) is too old to run ${P}"
ebeep ;;
esac
echo
KV_FULL_SRC=${KV_FULL}
get_running_version
udev_check_KV
if [[ "$?" = "0" ]]; then
eerror
eerror "udev cannot be restarted after emerging,"
eerror "as your running kernel version (${KV_FULL}) is too old."
eerror "You really need to use a newer kernel after a reboot!"
NO_RESTART=1
ebeep
fi
}
src_unpack() {
unpack ${A}
if [[ ${PV} == "9999" ]] ; then
git_src_unpack
else
if use test; then
mv "${WORKDIR}"/test/sys "${S}"/test/
fi
fi
#cd "${WORKDIR}/${scriptname}"
cd "${S}"
# patches go here...
# run-not-writable taken from the 168 gentoo patchset
epatch "${FILESDIR}"/udev-170-run-not-writable.patch
# usb.ids location can't come from pkgconfig (chromiumos:15595)
epatch "${FILESDIR}"/udev-170-usb-ids-location.patch
# backport some patches
if [[ -n "${PATCHSET}" ]]; then
EPATCH_SOURCE="${WORKDIR}/${PATCHSET}" EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" epatch
fi
# change rules back to group uucp instead of dialout for now
sed -e 's/GROUP="dialout"/GROUP="uucp"/' \
-i rules/{rules.d,arch}/*.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} != a9954d57e97aa0ad2e0ed53899d9559a ]]
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
if [[ ${PV} == 9999 ]]; then
gtkdocize --copy || die "gtkdocize failed"
fi
eautoreconf
}
src_compile() {
filter-flags -fprefetch-loop-arrays
econf \
--prefix=/usr \
--sysconfdir=/etc \
--sbindir=/sbin \
--libdir=/usr/$(get_libdir) \
--with-rootlibdir=/$(get_libdir) \
--libexecdir=/lib/udev \
--enable-logging \
--enable-static \
$(use_with selinux) \
$(use_enable debug) \
$(use_enable rule_generator) \
$(use_enable hwdb) \
--with-pci-ids-path="/usr/share/misc/pci.ids" \
--with-usb-ids-path="/usr/share/misc/usb.ids" \
$(use_enable acl udev_acl) \
$(use_enable gudev) \
$(use_enable introspection) \
$(use_enable keymap) \
$(use_enable floppy) \
$(use_enable edd) \
$(use_enable action_modeswitch) \
--without-systemdsystemunitdir
emake || die "compiling udev failed"
}
src_install() {
emake -C "${WORKDIR}/${scriptname}" \
DESTDIR="${D}" LIBDIR="$(get_libdir)" \
KV_min="${KV_min}" KV_reliable="${KV_reliable}" \
install || die "make install failed"
into /
emake DESTDIR="${D}" install || die "make install failed"
exeinto /lib/udev
keepdir /lib/udev/state
keepdir /lib/udev/devices
# create symlinks for these utilities to /sbin
# where multipath-tools expect them to be (Bug #168588)
dosym "../lib/udev/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 /lib/udev/rules.d/
# support older kernels
doins misc/30-kernel-compat.rules
# Adding arch specific rules
if [[ -f arch/40-${ARCH}.rules ]]
then
doins "arch/40-${ARCH}.rules"
fi
cd "${S}"
insinto /etc/modprobe.d
newins "${FILESDIR}"/blacklist-146 blacklist.conf
newins "${FILESDIR}"/pnp-aliases pnp-aliases.conf
# documentation
dodoc ChangeLog README TODO || die "failed installing docs"
# keep doc in just one directory, Bug #281137
rm -rf "${D}/usr/share/doc/${PN}"
if use keymap; then
dodoc extras/keymap/README.keymap.txt || die "failed installing docs"
fi
}
pkg_preinst() {
# moving old files to support newer modprobe, 12 May 2009
local f dir=${ROOT}/etc/modprobe.d/
for f in pnp-aliases blacklist; do
if [[ -f $dir/$f && ! -f $dir/$f.conf ]]
then
elog "Moving $dir/$f to $f.conf"
mv -f "$dir/$f" "$dir/$f.conf"
fi
done
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
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=$?
}
# 19 Nov 2008
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() {
if [[ ${NO_RESTART} = "1" ]]; then
ewarn "Not restarting udevd, as your kernel is too old!"
return
fi
# 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
sleep 3
if [[ ! -n $(pidof udevd) ]]; then
eerror "FATAL: udev died, please check your kernel is"
eerror "new enough and configured correctly for ${P}."
eerror
eerror "Please have a look at this before rebooting."
eerror "If in doubt, please downgrade udev back to your old version"
ebeep
fi
}
postinst_init_scripts() {
# FIXME: we may need some code that detects if this is a system bootstrap
# and auto-enables udev then
#
# FIXME: inconsistent handling of init-scripts here
# * udev is added to sysinit in openrc-ebuild
# * we add udev-postmount to default in here
#
# migration to >=openrc-0.4
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
# add udev-postmount to default runlevel instead of that ugly injecting
# like a hotplug event, 2009/10/15
# already enabled?
[[ -e "${ROOT}"/etc/runlevels/default/udev-postmount ]] && return
local enable_postmount=0
[[ -e "${ROOT}"/etc/runlevels/sysinit/udev ]] && enable_postmount=1
[[ "${ROOT}" = "/" && -d /dev/.udev/ ]] && enable_postmount=1
if [[ ${enable_postmount} = 1 ]]
then
local initd=udev-postmount
if [[ -e ${ROOT}/etc/init.d/${initd} ]] && \
[[ ! -e ${ROOT}/etc/runlevels/default/${initd} ]]
then
ln -snf /etc/init.d/${initd} "${ROOT}"/etc/runlevels/default/${initd}
elog "Auto-adding '${initd}' service to your default runlevel"
fi
else
elog "You should add the udev-postmount service to default runlevel."
elog "Run this to add it:"
elog "\trc-update add udev-postmount default"
fi
}
pkg_postinst() {
fix_old_persistent_net_rules
# "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
# So try to remove it here (will only work if empty).
rmdir "${ROOT}"/dev/loop 2>/dev/null
if [[ -d "${ROOT}"/dev/loop ]]; then
ewarn "Please make sure your remove /dev/loop,"
ewarn "else losetup may be confused when looking for unused devices."
fi
restart_udevd
postinst_init_scripts
# people want reminders, I'll give them reminders. Odds are they will
# just ignore them anyway...
# delete 40-scsi-hotplug.rules, it is integrated in 50-udev.rules, 19 Jan 2007
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, 25 Jan 2007
if [[ -d ${ROOT}/lib/udev/devices ]]
then
rm -f "${ROOT}"/lib/udev/devices/{null,zero,console,urandom}
fi
# Removing some old file, 29 Jan 2007
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
# 19 Mar 2007
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, 23 Apr 2007
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, 27 Jun 2007
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 #275974, added 2009/09/05
ewarn
ewarn "If after the udev update removable devices or CD/DVD drives"
ewarn "stop working, try re-emerging HAL before filling a bug report"
# 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."
ewarn
ewarn "If you use /dev/md/*, /dev/loop/* or /dev/rd/*,"
ewarn "then please migrate over to using the device names"
ewarn "/dev/md*, /dev/loop* and /dev/ram*."
ewarn "The devfs-compat rules have been removed."
ewarn "For reference see Bug #269359."
ewarn
ewarn "Rules for /dev/hd* devices have been removed"
ewarn "Please migrate to libata."
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"
}

View File

@ -1 +0,0 @@
udev-171.ebuild

View File

@ -1,588 +0,0 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/sys-fs/udev/udev-171-r2.ebuild,v 1.2 2011/09/18 06:42:42 zmedico Exp $
EAPI=4
KV_min=2.6.32
KV_reliable=2.6.32
PATCHSET=${P}-gentoo-patchset-v1
scriptversion=v4
scriptname=udev-gentoo-scripts-${scriptversion}
if [[ ${PV} == "9999" ]]
then
EGIT_REPO_URI="git://git.kernel.org/pub/scm/linux/hotplug/udev.git"
EGIT_BRANCH="master"
vcs="git-2 autotools"
fi
inherit ${vcs} eutils flag-o-matic multilib toolchain-funcs linux-info systemd libtool
if [[ ${PV} != "9999" ]]
then
KEYWORDS="~alpha amd64 arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~x86-linux"
# please update testsys-tarball whenever udev-xxx/test/sys/ is changed
SRC_URI="mirror://kernel/linux/utils/kernel/hotplug/${P}.tar.bz2
test? ( mirror://gentoo/${PN}-171-testsys.tar.bz2 )"
if [[ -n "${PATCHSET}" ]]
then
SRC_URI="${SRC_URI} mirror://gentoo/${PATCHSET}.tar.bz2"
fi
fi
SRC_URI="${SRC_URI} mirror://gentoo/${scriptname}.tar.bz2"
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"
IUSE="build selinux test debug +rule_generator hwdb acl gudev introspection
keymap floppy edd action_modeswitch extras"
COMMON_DEPEND="selinux? ( sys-libs/libselinux )
extras? ( sys-apps/acl
dev-libs/glib:2
dev-libs/gobject-introspection
virtual/libusb:0 )
acl? ( sys-apps/acl dev-libs/glib:2 )
gudev? ( dev-libs/glib:2 )
introspection? ( dev-libs/gobject-introspection )
action_modeswitch? ( virtual/libusb:0 )
>=sys-apps/util-linux-2.16
>=sys-libs/glibc-2.10"
DEPEND="${COMMON_DEPEND}
keymap? ( dev-util/gperf )
extras? ( dev-util/gperf )
dev-util/pkgconfig
virtual/os-headers
!<sys-kernel/linux-headers-2.6.34
test? ( app-text/tree )"
RDEPEND="${COMMON_DEPEND}
hwdb?
(
>=sys-apps/usbutils-0.82
sys-apps/pciutils
)
extras?
(
>=sys-apps/usbutils-0.82
sys-apps/pciutils
)
!sys-apps/coldplug
!<sys-fs/lvm2-2.02.45
!sys-fs/device-mapper
>=sys-apps/baselayout-1.12.5"
if [[ ${PV} == "9999" ]]
then
# for documentation processing with xsltproc
DEPEND="${DEPEND}
app-text/docbook-xsl-stylesheets
app-text/docbook-xml-dtd
dev-util/gtk-doc"
fi
# required kernel options
CONFIG_CHECK="~INOTIFY_USER ~SIGNALFD ~!SYSFS_DEPRECATED ~!SYSFS_DEPRECATED_V2
~!IDE ~BLK_DEV_BSG"
# Return values:
# 2 - reliable
# 1 - unreliable
# 0 - too old
udev_check_KV() {
local ok=0
if kernel_is -ge ${KV_reliable//./ }
then
ok=2
elif kernel_is -ge ${KV_min//./ }
then
ok=1
fi
return $ok
}
pkg_setup() {
linux-info_pkg_setup
# always print kernel version requirements
ewarn
ewarn "${P} does not support Linux kernel before version ${KV_min}!"
if [[ ${KV_min} != ${KV_reliable} ]]
then
ewarn "For a reliable udev, use at least kernel ${KV_reliable}"
fi
udev_check_KV
case "$?" in
2) einfo "Your kernel version (${KV_FULL}) is new enough to run ${P} reliably." ;;
1) ewarn "Your kernel version (${KV_FULL}) is new enough to run ${P},"
ewarn "but it may be unreliable in some cases."
;;
0) eerror "Your kernel version (${KV_FULL}) is too old to run ${P}"
;;
esac
KV_FULL_SRC=${KV_FULL}
get_running_version
udev_check_KV
if [[ "$?" = "0" ]]
then
eerror
eerror "udev cannot be restarted after emerging,"
eerror "as your running kernel version (${KV_FULL}) is too old."
eerror "You really need to use a newer kernel after a reboot!"
NO_RESTART=1
fi
}
src_unpack() {
unpack ${A}
if [[ ${PV} == "9999" ]]
then
git-2_src_unpack
fi
}
src_prepare() {
if use test && [[ -d "${WORKDIR}"/test/sys ]]
then
mv "${WORKDIR}"/test/sys "${S}"/test/
fi
# patches go here...
epatch "${FILESDIR}"/udev-170-fusectl-opts.patch
# backport some patches
if [[ -n "${PATCHSET}" ]]
then
EPATCH_SOURCE="${WORKDIR}/${PATCHSET}" EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" epatch
fi
# change rules back to group uucp instead of dialout for now
sed -e 's/GROUP="dialout"/GROUP="uucp"/' \
-i rules/{rules.d,arch}/*.rules \
|| die "failed to change group dialout to uucp"
if [[ ${PV} == 9999 ]]
then
gtkdocize --copy || die "gtkdocize failed"
eautoreconf
else
elibtoolize
fi
}
src_configure() {
if ! use extras
then
econf \
--prefix="${EPREFIX}/usr" \
--sysconfdir="${EPREFIX}/etc" \
--sbindir="${EPREFIX}/sbin" \
--libdir="${EPREFIX}/usr/$(get_libdir)" \
--with-rootlibdir="${EPREFIX}/$(get_libdir)" \
--libexecdir="${EPREFIX}/lib/udev" \
--enable-logging \
--enable-static \
$(use_with selinux) \
$(use_enable debug) \
$(use_enable rule_generator) \
$(use_enable hwdb) \
--with-pci-ids-path="${EPREFIX}/usr/share/misc/pci.ids" \
--with-usb-ids-path="${EPREFIX}/usr/share/misc/usb.ids" \
$(use_enable acl udev_acl) \
$(use_enable gudev) \
$(use_enable introspection) \
$(use_enable keymap) \
$(use_enable floppy) \
$(use_enable edd) \
$(use_enable action_modeswitch) \
$(systemd_with_unitdir)
else
econf \
--prefix="${EPREFIX}/usr" \
--sysconfdir="${EPREFIX}/etc" \
--sbindir="${EPREFIX}/sbin" \
--libdir="${EPREFIX}/usr/$(get_libdir)" \
--with-rootlibdir="${EPREFIX}/$(get_libdir)" \
--libexecdir="${EPREFIX}/lib/udev" \
--enable-logging \
--enable-static \
$(use_with selinux) \
$(use_enable debug) \
--enable-rule_generator \
--enable-hwdb \
--with-pci-ids-path="${EPREFIX}/usr/share/misc/pci.ids" \
--with-usb-ids-path="${EPREFIX}/usr/share/misc/usb.ids" \
--enable-udev_acl \
--enable-gudev \
--enable-introspection \
--enable-keymap \
--enable-floppy \
--enable-edd \
--enable-action_modeswitch \
$(systemd_with_unitdir)
fi
}
src_compile() {
filter-flags -fprefetch-loop-arrays
emake
}
src_install() {
emake -C "${WORKDIR}/${scriptname}" \
DESTDIR="${D}" LIBDIR="${EPREFIX}$(get_libdir)" \
LIBUDEV="${EPREFIX}/lib/udev" \
MODPROBE_DIR="${EPREFIX}/etc/modprobe.d" \
INITD="${EPREFIX}/etc/init.d" \
CONFD="${EPREFIX}/etc/conf.d" \
KV_min="${KV_min}" KV_reliable="${KV_reliable}" \
install
into /
emake DESTDIR="${D}" install
exeinto /lib/udev
keepdir /lib/udev/state
keepdir /lib/udev/devices
# create symlinks for these utilities to /sbin
# where multipath-tools expect them to be (Bug #168588)
dosym "../lib/udev/scsi_id" /sbin/scsi_id
# Add gentoo stuff to udev.conf
echo "# If you need to change mount-options, do it in /etc/fstab" \
>> "${ED}"/etc/udev/udev.conf
# let the dir exist at least
keepdir /etc/udev/rules.d
# Now installing rules
cd "${S}"/rules
insinto /lib/udev/rules.d/
# support older kernels
doins misc/30-kernel-compat.rules
# Adding arch specific rules
if [[ -f arch/40-${ARCH}.rules ]]
then
doins "arch/40-${ARCH}.rules"
fi
cd "${S}"
insinto /etc/modprobe.d
newins "${FILESDIR}"/blacklist-146 blacklist.conf
newins "${FILESDIR}"/pnp-aliases pnp-aliases.conf
# documentation
dodoc ChangeLog README TODO
# keep doc in just one directory, Bug #281137
rm -rf "${ED}/usr/share/doc/${PN}"
if use keymap
then
dodoc extras/keymap/README.keymap.txt
fi
}
src_test() {
local emake_cmd="${MAKE:-make} ${MAKEOPTS} ${EXTRA_EMAKE}"
cd "${WORKDIR}/${scriptname}"
vecho ">>> Test phase [scripts:test]: ${CATEGORY}/${PF}"
if ! $emake_cmd -j1 test
then
has test $FEATURES && die "scripts: Make test failed. See above for details."
has test $FEATURES || eerror "scripts: Make test failed. See above for details."
fi
cd "${S}"
vecho ">>> Test phase [udev:check]: ${CATEGORY}/${PF}"
has userpriv $FEATURES && einfo "Disable FEATURES userpriv to run the udev tests"
if ! $emake_cmd -j1 check
then
has test $FEATURES && die "udev: Make test failed. See above for details."
has test $FEATURES || eerror "udev: Make test failed. See above for details."
fi
}
pkg_preinst() {
# moving old files to support newer modprobe, 12 May 2009
local f dir=${EROOT}/etc/modprobe.d/
for f in pnp-aliases blacklist; do
if [[ -f $dir/$f && ! -f $dir/$f.conf ]]
then
elog "Moving $dir/$f to $f.conf"
mv -f "$dir/$f" "$dir/$f.conf"
fi
done
if [[ -d ${EROOT}/lib/udev-state ]]
then
mv -f "${EROOT}"/lib/udev-state/* "${ED}"/lib/udev/state/
rm -r "${EROOT}"/lib/udev-state
fi
if [[ -f ${EROOT}/etc/udev/udev.config &&
! -f ${EROOT}/etc/udev/udev.rules ]]
then
mv -f "${EROOT}"/etc/udev/udev.config "${EROOT}"/etc/udev/udev.rules
fi
# delete the old udev.hotplug symlink if it is present
if [[ -h ${EROOT}/etc/hotplug.d/default/udev.hotplug ]]
then
rm -f "${EROOT}"/etc/hotplug.d/default/udev.hotplug
fi
# delete the old wait_for_sysfs.hotplug symlink if it is present
if [[ -h ${EROOT}/etc/hotplug.d/default/05-wait_for_sysfs.hotplug ]]
then
rm -f "${EROOT}"/etc/hotplug.d/default/05-wait_for_sysfs.hotplug
fi
# delete the old wait_for_sysfs.hotplug symlink if it is present
if [[ -h ${EROOT}/etc/hotplug.d/default/10-udev.hotplug ]]
then
rm -f "${EROOT}"/etc/hotplug.d/default/10-udev.hotplug
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=$?
}
# 19 Nov 2008
fix_old_persistent_net_rules() {
local rules=${EROOT}/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() {
if [[ ${NO_RESTART} = "1" ]]
then
ewarn "Not restarting udevd, as your kernel is too old!"
return
fi
# need to merge to our system
[[ ${EROOT} = / ]] || 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
sleep 3
if [[ ! -n $(pidof udevd) ]]
then
eerror "FATAL: udev died, please check your kernel is"
eerror "new enough and configured correctly for ${P}."
eerror
eerror "Please have a look at this before rebooting."
eerror "If in doubt, please downgrade udev back to your old version"
fi
}
postinst_init_scripts() {
local enable_postmount=false
# FIXME: inconsistent handling of init-scripts here
# * udev is added to sysinit in openrc-ebuild
# * we add udev-postmount to default in here
#
# If we are building stages, add udev to the sysinit runlevel automatically.
if use build
then
if [[ -x "${EROOT}"/etc/init.d/udev \
&& -d "${EROOT}"/etc/runlevels/sysinit ]]
then
ln -s "${EPREFIX}"/etc/init.d/udev "${EROOT}"/etc/runlevels/sysinit/udev
fi
enable_postmount=true
fi
# migration to >=openrc-0.4
if [[ -e "${EROOT}"/etc/runlevels/sysinit && ! -e "${EROOT}"/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
# add udev-postmount to default runlevel instead of that ugly injecting
# like a hotplug event, 2009/10/15
# already enabled?
[[ -e "${EROOT}"/etc/runlevels/default/udev-postmount ]] && return
[[ -e "${EROOT}"/etc/runlevels/sysinit/udev ]] && enable_postmount=true
[[ "${EROOT}" = "/" && -d /dev/.udev/ ]] && enable_postmount=true
if $enable_postmount
then
local initd=udev-postmount
if [[ -e ${EROOT}/etc/init.d/${initd} ]] && \
[[ ! -e ${EROOT}/etc/runlevels/default/${initd} ]]
then
ln -snf "${EPREFIX}"/etc/init.d/${initd} "${EROOT}"/etc/runlevels/default/${initd}
elog "Auto-adding '${initd}' service to your default runlevel"
fi
else
elog "You should add the udev-postmount service to default runlevel."
elog "Run this to add it:"
elog "\trc-update add udev-postmount default"
fi
}
pkg_postinst() {
fix_old_persistent_net_rules
# "losetup -f" is confused if there is an empty /dev/loop/, Bug #338766
# So try to remove it here (will only work if empty).
rmdir "${EROOT}"/dev/loop 2>/dev/null
if [[ -d "${EROOT}"/dev/loop ]]
then
ewarn "Please make sure your remove /dev/loop,"
ewarn "else losetup may be confused when looking for unused devices."
fi
restart_udevd
postinst_init_scripts
# people want reminders, I'll give them reminders. Odds are they will
# just ignore them anyway...
# delete 40-scsi-hotplug.rules, it is integrated in 50-udev.rules, 19 Jan 2007
if [[ $previous_equal_to_103_r3 = 0 ]] &&
[[ -e ${EROOT}/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 "${EROOT}"/etc/udev/rules.d/40-scsi-hotplug.rules
fi
# Removing some device-nodes we thought we need some time ago, 25 Jan 2007
if [[ -d ${EROOT}/lib/udev/devices ]]
then
rm -f "${EROOT}"/lib/udev/devices/{null,zero,console,urandom}
fi
# Removing some old file, 29 Jan 2007
if [[ $previous_less_than_104_r5 = 0 ]]
then
rm -f "${EROOT}"/etc/dev.d/net/hotplug.dev
rmdir --ignore-fail-on-non-empty "${EROOT}"/etc/dev.d/net 2>/dev/null
fi
# 19 Mar 2007
if [[ $previous_less_than_106_r5 = 0 ]] &&
[[ -e ${EROOT}/etc/udev/rules.d/95-net.rules ]]
then
rm -f "${EROOT}"/etc/udev/rules.d/95-net.rules
fi
# Try to remove /etc/dev.d as that is obsolete, 23 Apr 2007
if [[ -d ${EROOT}/etc/dev.d ]]
then
rmdir --ignore-fail-on-non-empty "${EROOT}"/etc/dev.d/default "${EROOT}"/etc/dev.d 2>/dev/null
if [[ -d ${EROOT}/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, 27 Jun 2007
if [[ $previous_less_than_113 = 0 ]] &&
[[ -f ${EROOT}/etc/udev/rules.d/64-device-mapper.rules ]] &&
! has_version sys-fs/device-mapper
then
rm -f "${EROOT}"/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 ${EROOT}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."
ewarn
ewarn "If you use /dev/md/*, /dev/loop/* or /dev/rd/*,"
ewarn "then please migrate over to using the device names"
ewarn "/dev/md*, /dev/loop* and /dev/ram*."
ewarn "The devfs-compat rules have been removed."
ewarn "For reference see Bug #269359."
ewarn
ewarn "Rules for /dev/hd* devices have been removed"
ewarn "Please migrate to libata."
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"
}