[arch-commits] Commit in udev/trunk (3 files)

Tom Gundersen tomegun at archlinux.org
Wed Feb 8 08:39:07 EST 2012


    Date: Wednesday, February 8, 2012 @ 08:39:07
  Author: tomegun
Revision: 149541

add mkinitcpio hook

Added:
  udev/trunk/initcpio-hooks-udev
  udev/trunk/initcpio-install-udev
Modified:
  udev/trunk/PKGBUILD

-----------------------+
 PKGBUILD              |    6 +++++-
 initcpio-hooks-udev   |    9 +++++++++
 initcpio-install-udev |   26 ++++++++++++++++++++++++++
 3 files changed, 40 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2012-02-08 13:34:03 UTC (rev 149540)
+++ PKGBUILD	2012-02-08 13:39:07 UTC (rev 149541)
@@ -39,7 +39,7 @@
 
   # /dev/loop0 is created for convenience, to autoload the module if necessary
   # this is no longer needed when util-linux-2.21 is released as /dev/loop-control
-  # will be used instead. In that case move this to udev-compat
+  # will be used instead. Support for this will go away in a future version of udev
   install -d -m755 ${pkgdir}/lib/udev/devices/
   mknod ${pkgdir}/lib/udev/devices/loop0 b 7 0
   chgrp disk ${pkgdir}/lib/udev/devices/loop0
@@ -53,5 +53,9 @@
                s#GROUP="tape"#GROUP="storage"#g;
                s#GROUP="cdrom"#GROUP="optical"#g' $i
   done
+
+  # install the mkinitpcio hook
+  install -D -m644 initcpio-hooks-udev ${pkgdir}/lib/initcpio/hooks/udev
+  install -D -m644 initcpio-install-udev ${pkgdir}/lib/initcpio/install/udev
 }
 md5sums=('0d7af750702620a871b9f9b98d8ad859')

Added: initcpio-hooks-udev
===================================================================
--- initcpio-hooks-udev	                        (rev 0)
+++ initcpio-hooks-udev	2012-02-08 13:39:07 UTC (rev 149541)
@@ -0,0 +1,9 @@
+# vim: set ft=sh:
+run_hook ()
+{
+    msg -n ":: Triggering uevents..."
+    udevadm trigger --action=add --type=subsystems
+    udevadm trigger --action=add --type=devices
+    udevadm settle
+    msg "done."
+}

Added: initcpio-install-udev
===================================================================
--- initcpio-install-udev	                        (rev 0)
+++ initcpio-install-udev	2012-02-08 13:39:07 UTC (rev 149541)
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+build() {
+    FILES="/etc/udev/udev.conf"
+    SCRIPT="udev"
+
+    add_binary /lib/udev/udevd
+    add_binary /usr/bin/udevadm
+
+    for rules in 50-udev-default.rules 60-persistent-storage.rules 80-drivers.rules; do
+        add_file "/lib/udev/rules.d/$rules"
+    done
+    for tool in ata_id scsi_id; do
+        add_file "/lib/udev/$tool"
+    done
+}
+
+help() {
+    cat <<HELPEOF
+This hook will use udev to create your root device node and detect the needed
+modules for your root device. It is also required for firmware loading in
+initramfs. It is recommended to use this hook.
+HELPEOF
+}
+
+# vim: set ft=sh ts=4 sw=4 et:



More information about the arch-commits mailing list