[Lunar-commits] r26653 - in moonbase/branches/crater: . filesys filesys/udev

Dennis Veatch stumbles at lunar-linux.org
Wed Nov 7 14:01:33 CET 2007


Author: stumbles
Date: 2007-11-07 14:01:33 +0100 (Wed, 07 Nov 2007)
New Revision: 26653

Added:
   moonbase/branches/crater/filesys/
   moonbase/branches/crater/filesys/udev/
   moonbase/branches/crater/filesys/udev/BUILD
   moonbase/branches/crater/filesys/udev/DEPENDS
   moonbase/branches/crater/filesys/udev/DETAILS
   moonbase/branches/crater/filesys/udev/POST_INSTALL
   moonbase/branches/crater/filesys/udev/udev
Log:

Adding this for some udev testing. Got this from florin a while back
and used it for quite a while and found no issues with it but.....
expert be udev not I and leave that in the capable hands of Moe.



Added: moonbase/branches/crater/filesys/udev/BUILD
===================================================================
--- moonbase/branches/crater/filesys/udev/BUILD	                        (rev 0)
+++ moonbase/branches/crater/filesys/udev/BUILD	2007-11-07 13:01:33 UTC (rev 26653)
@@ -0,0 +1,46 @@
+(
+
+    # add missing groups:
+    add_priv_group dialout
+    add_priv_group usb
+    add_priv_group cdrw
+
+    UDEV_EXTRAS="extras/ata_id          \
+                 extras/cdrom_id        \
+                 extras/edd_id          \
+                 extras/firmware        \
+                 extras/floppy          \
+                 extras/path_id         \
+                 extras/rule_generator  \
+                 extras/scsi_id         \
+                 extras/usb_id          \
+                 extras/volume_id"
+
+    patch_it $SOURCE2 0  &&
+
+    make EXTRAS="${UDEV_EXTRAS}"  &&
+    prepare_install  &&
+    make EXTRAS="${UDEV_EXTRAS}" install  &&
+
+    # Deprecated .. but udevd still doesn't do what udevstart does
+    install -m755 udevstart /sbin/  &&
+    install -m644 udevstart.8 /usr/share/man/man8/  &&
+
+    # install the init.d script
+    # we cannot use automagic install via coretools
+    # since the udev script would be linked from rcX.d
+    # and would interfere with boot/{reboot,halt}
+    mkdir -p /etc/udev/rules.d /etc/udev/scripts.d  &&
+
+    install -m755 ${SCRIPT_DIRECTORY}/udev /etc/init.d/  &&
+
+    for script in ${SOURCE_DIRECTORY}/etc/udev/rules.d/*; do
+      install -m644 ${script} /etc/udev/rules.d/
+    done  &&
+
+    install -m644 ${SOURCE_DIRECTORY}/etc/udev/gentoo/50-udev.rules  \
+                  /etc/udev/rules.d/50-udev.rules                   &&
+    install -m755 ${SOURCE_CACHE}/${SOURCE3} \
+                  /etc/udev/scripts.d/raid-devfs.sh
+
+) > $C_FIFO 2>&1

Added: moonbase/branches/crater/filesys/udev/DEPENDS
===================================================================
--- moonbase/branches/crater/filesys/udev/DEPENDS	                        (rev 0)
+++ moonbase/branches/crater/filesys/udev/DEPENDS	2007-11-07 13:01:33 UTC (rev 26653)
@@ -0,0 +1 @@
+depends sysfsutils

Added: moonbase/branches/crater/filesys/udev/DETAILS
===================================================================
--- moonbase/branches/crater/filesys/udev/DETAILS	                        (rev 0)
+++ moonbase/branches/crater/filesys/udev/DETAILS	2007-11-07 13:01:33 UTC (rev 26653)
@@ -0,0 +1,34 @@
+          MODULE=udev
+         VERSION=112
+          SOURCE=$MODULE-$VERSION.tar.bz2
+         SOURCE2=udev.rules-v8.patch.bz2
+         SOURCE3=raid-devfs.sh-udev-088
+      SOURCE_URL=http://www.kernel.org/pub/linux/utils/kernel/hotplug/
+     SOURCE2_URL=$PATCH_URL
+     SOURCE3_URL=$PATCH_URL
+      SOURCE_VFY=sha1:f55270798370eb7f432c8ec0c83627ae57cc6274
+     SOURCE2_VFY=sha1:ac08d45180342b19ebedf94c3733158fe50fcebb
+     SOURCE3_VFY=sha1:44a12035774c2b42b784267d38e61a34aa0b645b
+        WEB_SITE=http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html
+         ENTERED=20040104
+         UPDATED=20071107
+      MAINTAINER=moe at lunar-linux.org
+           SHORT="Hotplug and device handling daemon"
+
+cat << EOF
+udev is supposed to provide a framework for hotpluggable devices
+under linux 2.6.x carrying an event listening daemon that also
+creates the necesserary nodes for the hotplugged devices inside
+the /dev directory.
+
+Its behaviour can be altered by a set of rules defined in udev(7).
+udev superseeds devfs and renders it obsolete. Some of the
+differences are:
+
+* udev runs completely in userspace. No kernel interaction especially
+  in device naming.
+* udev creates a dynamic /dev directory with ever changing device nodes
+  that fit your needs and rules
+* udev provides LSB standard device names
+* udev is also the hotplug handler of the future
+EOF

Added: moonbase/branches/crater/filesys/udev/POST_INSTALL
===================================================================
--- moonbase/branches/crater/filesys/udev/POST_INSTALL	                        (rev 0)
+++ moonbase/branches/crater/filesys/udev/POST_INSTALL	2007-11-07 13:01:33 UTC (rev 26653)
@@ -0,0 +1,70 @@
+# this is a way of checking if the nodes are permanent or not
+# e.g. if you have /dev with some static nodes, and you have
+# devfs on top, you will see the underlaying static nodes
+
+FAKEROOT=/tmp/UDEV_NODE_ROOT
+DEVPREFIX=${FAKEROOT}/dev
+
+create_node()
+{
+
+  local PERMS=$1
+  local NODE=$2
+  local TYPE=$3
+  local MAJOR=$4
+  local MINOR=$5
+  local SYMLINK=$6
+
+  echo -ne "\tTesting for /dev/${NODE}: "
+
+  if [ -e ${DEVPREFIX}/${NODE} ]; then
+     echo "node already present. "
+  else
+     mknod -m $PERMS ${DEVPREFIX}/${NODE} ${TYPE} ${MAJOR} ${MINOR} || { echo "cannot create node."; exit 1; }
+     echo "node created. "
+  fi
+
+  test -z "${SYMLINK}" &&  return 0
+
+  echo -ne "\tTesting for /dev/${SYMLINK} -> /dev/${NODE} symlink: "
+
+  if [ -e ${DEVPREFIX}/${SYMLINK} ]; then
+     if [ "`readlink ${DEVPREFIX}/${SYMLINK}`" = "${NODE}" ]; then
+        echo "already present."
+        return 0
+     fi
+
+     rm ${DEVPREFIX}/${SYMLINK}
+  fi
+
+  ln -sf ${NODE} ${DEVPREFIX}/${SYMLINK} || { echo "cannot create."; exit 1; }
+  echo "created."
+
+  return 0
+}
+
+echo    ""
+echo -n "Creating virtual fake root... "       && mkdir ${FAKEROOT}/          && echo "done." &&
+echo -n "Creating fake root to check /dev... " && mount --bind / ${FAKEROOT}/ && echo "done." &&
+echo    "Checking /dev/ for needed static boot nodes... " &&
+
+create_node 0600 console c 5 1      &&
+create_node 0666 null    c 1 3      &&
+create_node 0600 ram0    b 1 0 ram  &&
+create_node 0600 ram1    b 1 1      &&
+
+echo -n "Unmounting fake root... "   && umount ${FAKEROOT} && echo "done." &&
+echo -n "Removing fake root dir... " && rm -rf ${FAKEROOT} && echo "done." &&
+
+echo -en "\nMaking sure mount script has udev support... "
+
+if grep -q "udev" /etc/init.d/mount ; then
+   echo "yes."
+else
+   echo "no."
+   echo -e "Reinstalling e2fsprogs to get an updated initscript with udev support:"
+   echo -en "\t* Renaming mount initscript to mount.old... " &&
+   mv /etc/init.d/mount /etc/init.d/mount.old && echo "done."
+   echo -e "\t* re-lin'ing e2fsprogs...\n"
+   lin -c e2fsprogs
+fi

Added: moonbase/branches/crater/filesys/udev/udev
===================================================================
--- moonbase/branches/crater/filesys/udev/udev	                        (rev 0)
+++ moonbase/branches/crater/filesys/udev/udev	2007-11-07 13:01:33 UTC (rev 26653)
@@ -0,0 +1,30 @@
+#! /bin/bash
+#
+# udev init script to setup /dev
+# config: /etc/udev/udev.conf
+
+case "$1" in
+
+  start)
+    rm -rf /dev/.udevdb
+    export ACTION=add
+    /sbin/udevstart
+    /sbin/udevd --daemon || exit 1;
+    ;;
+
+  stop)
+    killall udevd
+    ;;
+
+  restart)
+    $0 stop
+    $0 start
+    ;;
+
+  *)
+    echo "Usage: $0 {start|stop|restart}"
+    exit 1
+
+esac
+
+exit 0


Property changes on: moonbase/branches/crater/filesys/udev/udev
___________________________________________________________________
Name: svn:executable
   + *



More information about the Lunar-commits mailing list