[oe-commits] org.oe.dev udev: add 0.100, default preference = -1

koen commit openembedded-commits at lists.openembedded.org
Fri Sep 8 11:24:10 UTC 2006


udev: add 0.100, default preference = -1

Author: koen at openembedded.org
Branch: org.openembedded.dev
Revision: 7fe7f8c6e5643a6104c91a6a3c5869d483a193aa
ViewMTN: http://monotone.openembedded.org/revision.psp?id=7fe7f8c6e5643a6104c91a6a3c5869d483a193aa
Files:
1
packages/udev/udev-100
packages/udev/udev-100/flags.patch
packages/udev/udev-100/init
packages/udev/udev-100/links.conf
packages/udev/udev-100/local.rules
packages/udev/udev-100/permissions.rules
packages/udev/udev-100/udev.rules
packages/udev/udev_100.bb
Diffs:

#
# mt diff -r39edb7cb1f59f721cbbef84d4663c268586f700f -r7fe7f8c6e5643a6104c91a6a3c5869d483a193aa
#
# 
# 
# add_dir "packages/udev/udev-100"
# 
# add_file "packages/udev/udev-100/flags.patch"
#  content [a54dac0c7a55365f7b81bd93e48b056828b4179f]
# 
# add_file "packages/udev/udev-100/init"
#  content [6b909ce1f686b73d7df86e399360055ee1ae3862]
# 
# add_file "packages/udev/udev-100/links.conf"
#  content [340438861d5e0a5b6ce3c26640c2780e3328a23b]
# 
# add_file "packages/udev/udev-100/local.rules"
#  content [3d6bf3dacc4965c551acc4dbe95379b2739e66dd]
# 
# add_file "packages/udev/udev-100/permissions.rules"
#  content [74e2d33de646c7a8e315cfd7938763f0607b4f18]
# 
# add_file "packages/udev/udev-100/udev.rules"
#  content [867f8972c7a4fd228a2bda1138b2dfb3999791f2]
# 
# add_file "packages/udev/udev_100.bb"
#  content [611984d386fc246bf1d5b3aa6e616dbf9b38db98]
# 
============================================================
--- packages/udev/udev-100/flags.patch	a54dac0c7a55365f7b81bd93e48b056828b4179f
+++ packages/udev/udev-100/flags.patch	a54dac0c7a55365f7b81bd93e48b056828b4179f
@@ -0,0 +1,51 @@
+--- udev-089/Makefile.orig	2006-04-08 13:32:53.000000000 +0200
++++ udev-089/Makefile	2006-04-08 13:34:27.000000000 +0200
+@@ -117,28 +117,28 @@
+ AR = $(CROSS_COMPILE)ar
+ RANLIB = $(CROSS_COMPILE)ranlib
+ 
+-CFLAGS		= -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
++override CFLAGS		= -g -Wall -pipe -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
+ WARNINGS	= -Wstrict-prototypes -Wsign-compare -Wshadow \
+ 		  -Wchar-subscripts -Wmissing-declarations -Wnested-externs \
+ 		  -Wpointer-arith -Wcast-align -Wsign-compare -Wmissing-prototypes
+-CFLAGS		+= $(WARNINGS)
++override CFLAGS		+= $(WARNINGS)
+ 
+ LDFLAGS = -Wl,-warn-common
+ 
+ OPTFLAGS = -Os
+-CFLAGS += $(OPTFLAGS)
++override CFLAGS += $(OPTFLAGS)
+ 
+ ifeq ($(strip $(USE_LOG)),true)
+-	CFLAGS += -DUSE_LOG
++	override CFLAGS += -DUSE_LOG
+ endif
+ 
+ # if DEBUG is enabled, then we do not strip
+ ifeq ($(strip $(DEBUG)),true)
+-	CFLAGS  += -DDEBUG
++	override CFLAGS  += -DDEBUG
+ endif
+ 
+ ifeq ($(strip $(USE_GCOV)),true)
+-	CFLAGS += -fprofile-arcs -ftest-coverage
++	override CFLAGS += -fprofile-arcs -ftest-coverage
+ 	LDFLAGS += -fprofile-arcs
+ endif
+ 
+@@ -151,11 +151,11 @@
+ ifeq ($(strip $(USE_SELINUX)),true)
+ 	UDEV_OBJS += udev_selinux.o
+ 	LIB_OBJS += -lselinux -lsepol
+-	CFLAGS += -DUSE_SELINUX
++	override CFLAGS += -DUSE_SELINUX
+ endif
+ 
+ ifeq ($(strip $(USE_STATIC)),true)
+-	CFLAGS += -DUSE_STATIC
++	override CFLAGS += -DUSE_STATIC
+ 	LDFLAGS += -static
+ endif
+ 
============================================================
--- packages/udev/udev-100/init	6b909ce1f686b73d7df86e399360055ee1ae3862
+++ packages/udev/udev-100/init	6b909ce1f686b73d7df86e399360055ee1ae3862
@@ -0,0 +1,242 @@
+#!/bin/sh -e
+### BEGIN INIT INFO
+# Provides:          udev
+# Required-Start:    mountvirtfs 
+# Required-Stop:     
+# Default-Start:     S
+# Default-Stop:
+# Short-Description: Start udevd, populate /dev and load drivers.
+### END INIT INFO
+
+# we need to unmount /dev/pts/ and remount it later over the tmpfs
+unmount_devpts() {
+  if mountpoint -q /dev/pts/; then
+    umount -l /dev/pts/
+  fi
+
+  if mountpoint -q /dev/shm/; then
+    umount -l /dev/shm/
+  fi
+}
+
+# mount a tmpfs over /dev, if somebody did not already do it
+mount_tmpfs() {
+  if grep -E -q "^[^[:space:]]+ /dev tmpfs" /proc/mounts; then
+    return
+  fi
+
+  # /dev/.static/dev/ is used by MAKEDEV to access the real /dev/ directory.
+  # /etc/udev/ is recycled as a temporary mount point because it's the only
+  # directory which is guaranteed to be available.
+  mount -n -o bind /dev /etc/udev
+
+  if ! mount -n -o size=$tmpfs_size,mode=0755 -t tmpfs tmpfs /dev; then
+    umount /etc/udev
+    echo "udev requires tmpfs support, not started."
+    exit 1
+  fi
+
+  mkdir -p /dev/.static/dev
+  chmod 700 /dev/.static/
+  # The mount options in busybox are non-standard...
+  if test -x /bin/mount.util-linux
+  then
+    /bin/mount.util-linux --move /etc/udev /dev/.static/dev
+  elif test -x /bin/busybox
+  then
+    busybox mount -n -o move /etc/udev /dev/.static/dev
+  else
+    echo "udev requires an identifiable mount command, not started."
+    umount /etc/udev
+    umount /dev
+    exit 1
+  fi
+}
+
+create_dev_makedev() {
+  if [ -e /sbin/MAKEDEV ]; then
+    [ ! -e /dev/MAKEDEV ] || ln -s /sbin/MAKEDEV /dev/MAKEDEV
+  else
+    ln -s /bin/true /dev/MAKEDEV
+  fi
+}
+
+# I hate this hack.  -- Md
+make_extra_nodes() {
+  if [ "$(echo /lib/udev/devices/*)" != "/lib/udev/devices/*" ]; then
+    cp -a /lib/udev/devices/* /dev/
+  fi
+
+  [ -e /etc/udev/links.conf ] || return 0
+  grep '^[^#]' /etc/udev/links.conf | \
+  while read type name arg1; do
+    [ "$type" -a "$name" -a ! -e "/dev/$name" -a ! -L "/dev/$name" ] ||continue
+    case "$type" in
+      L) ln -s $arg1 /dev/$name ;;
+      D) mkdir -p /dev/$name ;;
+      M) mknod -m 600 /dev/$name $arg1 ;;
+      *) echo "links.conf: unparseable line ($type $name $arg1)" ;;
+    esac
+  done
+}
+
+supported_kernel() {
+  case "$(uname -r)" in
+    2.[012345].*|2.6.[0-9]|2.6.[0-9][!0-9]*) return 1 ;;
+    2.6.1[0-4]|2.6.1[0-4][!0-9]*) return 1 ;;
+  esac
+  return 0
+}
+
+load_input_modules() {
+  case "$(uname -r)" in
+    2.6.1[0-5]|2.6.1[0-5][!0-9]*) ;; # <= 2.6.15
+    *) return 0
+  esac
+
+  for module in mousedev evdev joydev; do
+    modprobe -q $module || true
+  done
+}
+
+# shell version of /usr/bin/tty
+my_tty() {
+  [ -x /bin/readlink ] || return 0
+  [ -e /proc/self/fd/0 ] || return 0
+  readlink --silent /proc/self/fd/0 || true
+}
+
+warn_if_interactive() {
+  if [ "$RUNLEVEL" = "S" -a "$PREVLEVEL" = "N" ]; then
+    return
+  fi
+
+  TTY=$(my_tty)
+  if [ -z "$TTY" -o "$TTY" = "/dev/console" ]; then
+    return
+  fi
+
+  printf "\n\n\nIt has been detected that the command\n\n\t$0 $*\n\n"
+  printf "has been run from an interactive shell.\n"
+  printf "It will probably not do what you expect, so this script will wait\n"
+  printf "60 seconds before continuing. Press ^C to stop it.\n"
+  printf "RUNNING THIS COMMAND IS HIGHLY DISCOURAGED!\n\n\n\n"
+  sleep 60
+}
+
+##############################################################################
+
+[ -x /sbin/udevd ] || exit 0
+
+PATH="/sbin:/bin:/usr/bin"
+
+# defaults
+tmpfs_size="10M"
+udev_root="/dev"
+
+if [ -e /etc/udev/udev.conf ]; then
+  . /etc/udev/udev.conf
+fi
+
+if ! supported_kernel; then
+  echo "udev requires a kernel >= 2.6.15, not started."
+  exit 1
+fi
+
+if [ ! -e /proc/filesystems ]; then
+  echo "udev requires a mounted procfs, not started."
+  exit 1
+fi
+
+if ! grep -q '[[:space:]]tmpfs$' /proc/filesystems; then
+  echo "udev requires tmpfs support, not started."
+  exit 1
+fi
+
+if [ ! -d /sys/class/ ]; then
+  echo "udev requires a mounted sysfs, not started."
+  exit 1
+fi
+
+if [ ! -e /proc/sys/kernel/hotplug ]; then
+  echo "udev requires hotplug support, not started."
+  exit 1
+fi
+
+##############################################################################
+
+# When modifying this script, do not forget that between the time that
+# the new /dev has been mounted and udevsynthesize has been run there will be
+# no /dev/null. This also means that you cannot use the "&" shell command.
+
+udev_root=${udev_root%/}
+
+case "$1" in
+    start)
+    if [ -e "$udev_root/.udev/" ]; then
+	if mountpoint -q $udev_root/; then
+	    TMPFS_MOUNTED=1
+	else
+	    echo ".udev/ already exists on the static $udev_root!"
+	fi
+    else
+	warn_if_interactive
+    fi
+
+    echo > /proc/sys/kernel/hotplug
+
+    if [ -z "$TMPFS_MOUNTED" ]; then
+	unmount_devpts
+	mount_tmpfs
+	[ -d /proc/1 ] || mount -n /proc
+    fi
+
+    # /dev/null must be created before udevd is started
+    make_extra_nodes
+
+    echo "Starting the hotplug events dispatcher" "udevd"
+    udevd --daemon
+
+    # if this directory is not present /dev will not be updated by udev
+    mkdir -p /dev/.udev/db/ /dev/.udev/queue/
+
+    echo "Synthesizing the initial hotplug events"
+    udevtrigger
+
+    load_input_modules
+    create_dev_makedev
+
+    # wait for the udevd childs to finish
+    echo "Waiting for /dev to be fully populated"
+    if ! udevsettle; then
+	echo 'timeout'
+    fi
+    ;;
+
+    stop)
+    echo "Stopping the hotplug events dispatcher" "udevd"
+    start-stop-daemon --stop --name udevd --quiet
+    ;;
+
+    restart)
+    echo "Stopping the hotplug events dispatcher" "udevd"
+    if start-stop-daemon --stop --name udevd --quiet ; then
+	exit 1
+    fi
+
+    echo "Starting the hotplug events dispatcher" "udevd"
+    udevd --daemon
+    ;;
+
+    reload)
+    udevcontrol reload_rules
+    ;;
+
+    *)
+    echo "Usage: /etc/init.d/udev {start|stop|restart|reload}"
+    exit 1
+    ;;
+esac
+
+exit 0
+
============================================================
--- packages/udev/udev-100/links.conf	340438861d5e0a5b6ce3c26640c2780e3328a23b
+++ packages/udev/udev-100/links.conf	340438861d5e0a5b6ce3c26640c2780e3328a23b
@@ -0,0 +1,20 @@
+# This file does not exist. Please do not ask the debian maintainer about it.
+# You may use it to do strange and wonderful things, at your risk.
+
+L fd		/proc/self/fd
+L stdin		/proc/self/fd/0
+L stdout	/proc/self/fd/1
+L stderr	/proc/self/fd/2
+L core		/proc/kcore
+L sndstat	/proc/asound/oss/sndstat
+
+D pts
+D shm
+
+# Hic sunt leones.
+M ppp		c 108 0
+D loop
+M loop/0	b 7 0
+D net
+M net/tun	c 10 200
+
============================================================
--- packages/udev/udev-100/local.rules	3d6bf3dacc4965c551acc4dbe95379b2739e66dd
+++ packages/udev/udev-100/local.rules	3d6bf3dacc4965c551acc4dbe95379b2739e66dd
@@ -0,0 +1,31 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+#    For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# Media automounting
+SUBSYSTEM=="block", ACTION=="add"    RUN+="/etc/udev/scripts/mount.sh"
+SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh"
+
+# Handle network interface setup
+SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh"
+SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh"
+
+# The first rtc device is symlinked to /dev/rtc
+KERNEL=="rtc0", SYMLINK+="rtc"
+
+# Try and modprobe for drivers for new hardware
+ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}"
+
+# Create a symlink to any touchscreen input device
+SUBSYSTEM=="input", KERNEL=="event[0-9]*", SYSFS{modalias}=="input:*-e0,1*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0"
============================================================
--- packages/udev/udev-100/permissions.rules	74e2d33de646c7a8e315cfd7938763f0607b4f18
+++ packages/udev/udev-100/permissions.rules	74e2d33de646c7a8e315cfd7938763f0607b4f18
@@ -0,0 +1,109 @@
+ACTION!="add", GOTO="permissions_end"
+
+# workarounds needed to synchronize with sysfs
+DEVPATH=="/devices/*", ENV{PHYSDEVBUS}=="?*",	WAIT_FOR_SYSFS="bus"
+SUBSYSTEM=="scsi",				WAIT_FOR_SYSFS="ioerr_cnt"
+# only needed for kernels < 2.6.16
+SUBSYSTEM=="net",				WAIT_FOR_SYSFS="address"
+# only needed for kernels < 2.6.17
+SUBSYSTEM=="net", ENV{PHYSDEVDRIVER}=="?*",	WAIT_FOR_SYSFS="device/driver"
+
+# default permissions for block devices
+SUBSYSTEM=="block",				GROUP="disk"
+SUBSYSTEM=="block", SYSFS{removable}=="1",	GROUP="floppy"
+
+# IDE devices
+BUS=="ide", KERNEL=="hd[a-z]|pcd[0-9]*", DRIVER=="ide-cdrom|pcd", \
+	IMPORT{program}="cdrom_id --export $tempnode"
+ENV{ID_CDROM}=="?*",				GROUP="cdrom"
+BUS=="ide", KERNEL=="ht[0-9]*",			GROUP="tape"
+BUS=="ide", KERNEL=="nht[0-9]*",		GROUP="tape"
+
+# SCSI devices
+BUS=="scsi", SYSFS{type}=="1",			GROUP="tape"
+BUS=="scsi", SYSFS{type}=="3", SYSFS{vendor}=="HP", GROUP="scanner"
+BUS=="scsi", SYSFS{type}=="5",			GROUP="cdrom"
+BUS=="scsi", SYSFS{type}=="6",			GROUP="scanner"
+
+# USB devices
+BUS=="usb", KERNEL=="legousbtower*", MODE="0666"
+BUS=="usb", KERNEL=="lp[0-9]*",			GROUP="lp"
+
+# usbfs-like devices
+SUBSYSTEM=="usb_device",	MODE="0664"
+
+# iRiver music players
+SUBSYSTEM=="usb_device",			GROUP="plugdev", \
+	SYSFS{idVendor}=="4102", SYSFS{idProduct}=="10[01][135789]"
+
+# serial devices
+SUBSYSTEM=="tty",				GROUP="dialout"
+SUBSYSTEM=="capi",				GROUP="dialout"
+SUBSYSTEM=="slamr",				GROUP="dialout"
+SUBSYSTEM=="zaptel",				GROUP="dialout"
+
+# vc devices (all members of the tty subsystem)
+KERNEL=="ptmx",			MODE="0666",	GROUP="root"
+KERNEL=="console",		MODE="0600",	GROUP="root"
+KERNEL=="tty",			MODE="0666",	GROUP="root"
+KERNEL=="tty[0-9]*",				GROUP="root"
+KERNEL=="pty*",			MODE="0666",	GROUP="tty"
+
+# video devices
+SUBSYSTEM=="video4linux",			GROUP="video"
+SUBSYSTEM=="drm",				GROUP="video"
+SUBSYSTEM=="dvb",				GROUP="video"
+SUBSYSTEM=="em8300",				GROUP="video"
+SUBSYSTEM=="graphics",				GROUP="video"
+SUBSYSTEM=="nvidia",				GROUP="video"
+
+# misc devices
+KERNEL=="random",		MODE="0666"
+KERNEL=="urandom",		MODE="0666"
+KERNEL=="mem",			MODE="0640",	GROUP="kmem"
+KERNEL=="kmem",			MODE="0640",	GROUP="kmem"
+KERNEL=="port",			MODE="0640",	GROUP="kmem"
+KERNEL=="full",			MODE="0666"
+KERNEL=="null",			MODE="0666"
+KERNEL=="zero",			MODE="0666"
+KERNEL=="inotify",		MODE="0666"
+KERNEL=="sgi_fetchop",		MODE="0666"
+KERNEL=="sonypi",		MODE="0666"
+KERNEL=="agpgart",				GROUP="video"
+KERNEL=="nvram",				GROUP="nvram"
+KERNEL=="rtc",					GROUP="audio"
+KERNEL=="tpm*",			MODE="0600",	OWNER="tss", GROUP="tss"
+KERNEL=="fuse",					GROUP="fuse"
+
+KERNEL=="cdemu[0-9]*",				GROUP="cdrom"
+KERNEL=="pktcdvd[0-9]*",			GROUP="cdrom"
+KERNEL=="pktcdvd",		MODE="0644"
+
+KERNEL=="uverbs*",				GROUP="rdma"
+KERNEL=="ucm*",					GROUP="rdma"
+
+# printers and parallel devices
+SUBSYSTEM=="printer",				GROUP="lp"
+SUBSYSTEM=="ppdev",				GROUP="lp"
+KERNEL=="pt[0-9]*",				GROUP="tape"
+KERNEL=="pht[0-9]*",				GROUP="tape"
+
+# sound devices
+SUBSYSTEM=="sound",				GROUP="audio"
+
+# ieee1394 devices       
+KERNEL=="raw1394",				GROUP="disk"
+KERNEL=="dv1394*",				GROUP="video"
+KERNEL=="video1394*",				GROUP="video"
+
+# input devices
+KERNEL=="event[0-9]*", SYSFS{name}=="*dvb*|*DVB*|* IR *" \
+				MODE="0664",	GROUP="video"
+KERNEL=="js[0-9]*",		MODE="0664"
+
+# AOE character devices
+SUBSYSTEM=="aoe",		MODE="0220",	GROUP="disk"
+SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
+
+LABEL="permissions_end"
+
============================================================
--- packages/udev/udev-100/udev.rules	867f8972c7a4fd228a2bda1138b2dfb3999791f2
+++ packages/udev/udev-100/udev.rules	867f8972c7a4fd228a2bda1138b2dfb3999791f2
@@ -0,0 +1,98 @@
+# There are a number of modifiers that are allowed to be used in some
+# of the different fields. They provide the following subsitutions:
+#
+# %n the "kernel number" of the device.
+#    For example, 'sda3' has a "kernel number" of '3'
+# %e the smallest number for that name which does not matches an existing node
+# %k the kernel name for the device
+# %M the kernel major number for the device
+# %m the kernel minor number for the device
+# %b the bus id for the device
+# %c the string returned by the PROGRAM
+# %s{filename} the content of a sysfs attribute
+# %% the '%' char itself
+#
+
+# SCSI devices
+BUS=="scsi", KERNEL=="sr[0-9]*",	NAME="scd%n", SYMLINK+="sr%n"
+
+# USB devices
+BUS=="usb", KERNEL=="auer[0-9]*",	NAME="usb/%k"
+BUS=="usb", KERNEL=="cpad[0-9]*",	NAME="usb/%k"
+BUS=="usb", KERNEL=="dabusb*",		NAME="usb/%k"
+BUS=="usb", KERNEL=="hiddev*",		NAME="usb/%k"
+BUS=="usb", KERNEL=="legousbtower*",	NAME="usb/%k"
+BUS=="usb", KERNEL=="lp[0-9]*",		NAME="usb/%k"
+BUS=="usb", KERNEL=="ttyUSB*", SYSFS{product}=="Palm Handheld*", \
+					SYMLINK+="pilot"
+
+# usbfs-like devices
+SUBSYSTEM=="usb_device", \
+	PROGRAM="/bin/sh -c 'export X=%k; export X=$${X#usbdev}; export B=$${X%%%%.*}; export D=$${X#*.}; echo bus/usb/$$B/$$D'", SYMLINK+="%c"
+
+# serial devices
+KERNEL=="capi",			NAME="capi20", SYMLINK+="isdn/capi20"
+KERNEL=="capi[0-9]*",		NAME="capi/%n"
+
+# video devices
+KERNEL=="card[0-9]*",		NAME="dri/%%s
>>> DIFF TRUNCATED @ 16K






More information about the Openembedded-commits mailing list