For nest-cam v350 release

Bug: 259322762
diff --git a/etc/init.d/S12udev b/etc/init.d/S12udev
new file mode 100755
index 0000000..ed3b959
--- /dev/null
+++ b/etc/init.d/S12udev
@@ -0,0 +1,67 @@
+#!/bin/sh
+#
+# udev	This is a minimal non-LSB version of a UDEV startup script.  It
+#	was derived by stripping down the udev-058 LSB version for use
+#	with buildroot on embedded hardware using Linux 2.6.34+ kernels.
+#
+#	You may need to customize this for your system's resource limits
+#	(including startup time!) and administration.  For example, if
+#	your early userspace has a custom initramfs or initrd you might
+#	need /dev much earlier; or without hotpluggable busses (like USB,
+#	PCMCIA, MMC/SD, and so on) your /dev might be static after boot.
+#
+#	This script assumes your system boots right into the eventual root
+#	filesystem, and that init runs this udev script before any programs
+#	needing more device nodes than the bare-bones set -- /dev/console,
+#	/dev/zero, /dev/null -- that's needed to boot and run this script.
+#
+
+# Check for missing binaries
+
+if [ -f /etc/ambarella.conf ]
+then
+  . /etc/ambarella.conf
+fi
+
+UDEV_BIN=/lib/udev/udevd
+UDEV_ADM=/usr/sbin/udevadm
+UDEV_MAX_CHILDREN=4
+test -x $UDEV_BIN || exit 5
+
+# Check for config file and read it
+UDEV_CONFIG=/etc/udev/udev.conf
+test -r $UDEV_CONFIG || exit 6
+. $UDEV_CONFIG
+
+case "$1" in
+    start)
+        echo -n "Populating $SYS_BOARD_BSP using udev: "
+        echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug
+        $UDEV_BIN --daemon --children-max=$UDEV_MAX_CHILDREN
+        if [ $? -eq 0 ]
+        then
+        	$UDEV_ADM trigger --subsystem-nomatch=i2c* --type=subsystems --action=add
+        	$UDEV_ADM trigger --subsystem-nomatch=i2c* --type=devices --action=add
+        	$UDEV_ADM trigger --subsystem-match=i2c-* --type=devices --action=add
+        	if [ $? -eq 0 ]
+        	then
+        		echo "Done"
+        	else
+        		echo "Failed"
+        	fi
+        else
+        	echo "Failed"
+        fi
+        ;;
+    stop)
+        # Stop execution of events
+        $UDEV_ADM control --stop_exec_queue
+        killall udevd
+        ;;
+    *)
+        echo "Usage: $0 {start|stop}"
+        exit 1
+        ;;
+esac
+
+exit 0
diff --git a/etc/udev/rules.d/10-drivers.rules b/etc/udev/rules.d/10-drivers.rules
new file mode 100644
index 0000000..4831dfc
--- /dev/null
+++ b/etc/udev/rules.d/10-drivers.rules
@@ -0,0 +1,9 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="drivers_end"
+
+SUBSYSTEM=="platform", KERNELS=="ambarella-sd*", RUN+="/sbin/modprobe -b ambarella_sd"
+SUBSYSTEM=="mmc_host", KERNELS=="mmc[0-9]", RUN+="/sbin/modprobe -b mmc_block"
+SUBSYSTEM=="platform", KERNELS=="ambarella-input*", RUN+="/sbin/modprobe -b ambarella_general_input"
+
+LABEL="drivers_end"
diff --git a/etc/udev/rules.d/11-sd-cards-auto-mount.rules b/etc/udev/rules.d/11-sd-cards-auto-mount.rules
new file mode 100644
index 0000000..4b5090a
--- /dev/null
+++ b/etc/udev/rules.d/11-sd-cards-auto-mount.rules
@@ -0,0 +1,13 @@
+KERNEL!="mmcblk[0-9]p[0-9]", GOTO="sd_cards_auto_mount_end"
+
+# Global mount options
+ACTION=="add", ENV{mount_options}="relatime,noatime,nodiratime"
+
+# Filesystem specific options
+ACTION=="add", IMPORT{program}="/sbin/blkid -o udev -p %N"
+ACTION=="add", ENV{ID_FS_TYPE}=="vfat|ntfs", ENV{mount_options}="$env{mount_options},utf8,gid=100,umask=002"
+
+ACTION=="add", RUN+="/bin/mkdir -p /media/%k", RUN+="/bin/ln -s /media/%k /tmp/%k", RUN+="/bin/mount -o $env{mount_options} /dev/%k /media/%k"
+ACTION=="remove", RUN+="/bin/umount -l /media/%k", RUN+="/bin/rm -rf /tmp/%k", RUN+="/bin/rmdir /media/%k"
+LABEL="sd_cards_auto_mount_end"
+
diff --git a/etc/udev/udev.conf b/etc/udev/udev.conf
new file mode 100644
index 0000000..31bb662
--- /dev/null
+++ b/etc/udev/udev.conf
@@ -0,0 +1,4 @@
+# The initial syslog(3) priority: "err", "info", "debug" or its
+# numerical equivalent. For runtime debugging, the daemons internal
+# state can be changed with: "udevadm control --log-priority=<value>".
+udev_log="err"
diff --git a/lib/udev/accelerometer b/lib/udev/accelerometer
new file mode 100755
index 0000000..0839543
--- /dev/null
+++ b/lib/udev/accelerometer
Binary files differ
diff --git a/lib/udev/ata_id b/lib/udev/ata_id
new file mode 100755
index 0000000..d9baf0b
--- /dev/null
+++ b/lib/udev/ata_id
Binary files differ
diff --git a/lib/udev/cdrom_id b/lib/udev/cdrom_id
new file mode 100755
index 0000000..03b4172
--- /dev/null
+++ b/lib/udev/cdrom_id
Binary files differ
diff --git a/lib/udev/collect b/lib/udev/collect
new file mode 100755
index 0000000..be3995f
--- /dev/null
+++ b/lib/udev/collect
Binary files differ
diff --git a/lib/udev/findkeyboards b/lib/udev/findkeyboards
new file mode 100755
index 0000000..537d163
--- /dev/null
+++ b/lib/udev/findkeyboards
@@ -0,0 +1,69 @@
+#!/bin/sh -e
+# Find "real" keyboard devices and print their device path.
+# Author: Martin Pitt <martin.pitt@ubuntu.com>
+#
+# Copyright (C) 2009, Canonical Ltd.
+#
+# 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; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# returns OK if $1 contains $2
+strstr() {
+    [ "${1#*$2*}" != "$1" ]
+}
+
+# returns OK if $1 contains $2 at the beginning
+str_starts() {
+    [ "${1#$2*}" != "$1" ]
+}
+
+str_line_starts() {
+    while read a; do str_starts "$a" "$1" && return 0;done
+    return 1;
+}
+
+# print a list of input devices which are keyboard-like
+keyboard_devices() {
+    # standard AT keyboard
+    for dev in `udevadm trigger --dry-run --verbose --property-match=ID_INPUT_KEYBOARD=1`; do
+        walk=`udevadm info --attribute-walk --path=$dev`
+        env=`udevadm info --query=env --path=$dev`
+        # filter out non-event devices, such as the parent input devices which
+        # have no devnode
+        if ! echo "$env" | str_line_starts 'DEVNAME='; then
+            continue
+        fi
+        if strstr "$walk" 'DRIVERS=="atkbd"'; then
+            echo -n 'AT keyboard: '
+        elif echo "$env" | str_line_starts 'ID_USB_DRIVER=usbhid'; then
+            echo -n 'USB keyboard: '
+        else
+            echo -n 'Unknown type: '
+        fi
+        udevadm info --query=name --path=$dev
+    done
+
+    # modules
+    module=$(udevadm trigger --verbose --dry-run --subsystem-match=input --attr-match=name='*Extra Buttons')
+    module="$module
+$(udevadm trigger --verbose --dry-run --subsystem-match=input --attr-match=name='*extra buttons')"
+    module="$module
+$(udevadm trigger --verbose --dry-run --subsystem-match=input --attr-match=name='Sony Vaio Keys')"
+    for m in $module; do
+        for evdev in $m/event*/dev; do
+            if [ -e "$evdev" ]; then
+		echo -n 'module: '
+		udevadm info --query=name --path=${evdev%%/dev}
+            fi
+	done
+    done
+}
+
+keyboard_devices
diff --git a/lib/udev/firmware b/lib/udev/firmware
new file mode 100755
index 0000000..962416a
--- /dev/null
+++ b/lib/udev/firmware
Binary files differ
diff --git a/lib/udev/keyboard-force-release.sh b/lib/udev/keyboard-force-release.sh
new file mode 100755
index 0000000..b157ac3
--- /dev/null
+++ b/lib/udev/keyboard-force-release.sh
@@ -0,0 +1,22 @@
+#!/bin/sh -e
+# read list of scancodes, convert hex to decimal and
+# append to the atkbd force_release sysfs attribute
+# $1 sysfs devpath for serioX
+# $2 file with scancode list (hex or dec)
+
+case "$2" in
+	/*) scf="$2" ;;
+	*)  scf="/lib/udev/keymaps/force-release/$2" ;;
+esac
+
+read attr <"/sys/$1/force_release"
+while read scancode dummy; do
+	case "$scancode" in
+		\#*) ;;
+		*)
+			scancode=$(($scancode))
+			attr="$attr${attr:+,}$scancode"
+			;;
+	esac
+done <"$scf"
+echo "$attr" >"/sys/$1/force_release"
diff --git a/lib/udev/keymap b/lib/udev/keymap
new file mode 100755
index 0000000..897a65a
--- /dev/null
+++ b/lib/udev/keymap
Binary files differ
diff --git a/lib/udev/keymaps/acer b/lib/udev/keymaps/acer
new file mode 100644
index 0000000..4e7c297
--- /dev/null
+++ b/lib/udev/keymaps/acer
@@ -0,0 +1,22 @@
+0xA5 help # Fn+F1
+0xA6 setup # Fn+F2 Acer eSettings
+0xA7 battery # Fn+F3 Power Management
+0xA9 switchvideomode # Fn+F5
+0xB3 euro
+0xB4 dollar
+0xCE brightnessup # Fn+Right
+0xD4 bluetooth # (toggle) off-to-on
+0xD5 wlan # (toggle) on-to-off
+0xD6 wlan # (toggle) off-to-on
+0xD7 bluetooth # (toggle) on-to-off
+0xD8 bluetooth # (toggle) off-to-on
+0xD9 brightnessup # Fn+Right
+0xEE brightnessup # Fn+Right
+0xEF brightnessdown # Fn+Left
+0xF1 f22 # Fn+F7 Touchpad toggle (off-to-on)
+0xF2 f23 # Fn+F7 Touchpad toggle (on-to-off)
+0xF3 prog2 # "P2" programmable button
+0xF4 prog1 # "P1" programmable button
+0xF5 presentation
+0xF8 fn
+0xF9 f23 # Launch NTI shadow
diff --git a/lib/udev/keymaps/acer-aspire_5720 b/lib/udev/keymaps/acer-aspire_5720
new file mode 100644
index 0000000..b3515b7
--- /dev/null
+++ b/lib/udev/keymaps/acer-aspire_5720
@@ -0,0 +1,5 @@
+0x84 bluetooth  # sent when bluetooth module missing, and key pressed
+0x92 media	# acer arcade
+0xD4 bluetooth  # bluetooth on
+0xD9 bluetooth  # bluetooth off
+
diff --git a/lib/udev/keymaps/acer-aspire_5920g b/lib/udev/keymaps/acer-aspire_5920g
new file mode 100644
index 0000000..633c4e8
--- /dev/null
+++ b/lib/udev/keymaps/acer-aspire_5920g
@@ -0,0 +1,5 @@
+0x8A media
+0x92 media
+0xA6 setup
+0xB2 www
+0xD9 bluetooth # (toggle) on-to-off
diff --git a/lib/udev/keymaps/acer-aspire_6920 b/lib/udev/keymaps/acer-aspire_6920
new file mode 100644
index 0000000..699c954
--- /dev/null
+++ b/lib/udev/keymaps/acer-aspire_6920
@@ -0,0 +1,5 @@
+0xD9 bluetooth # (toggle) on-to-off
+0x92 media
+0x9E back
+0x83 rewind
+0x89 fastforward
diff --git a/lib/udev/keymaps/acer-aspire_8930 b/lib/udev/keymaps/acer-aspire_8930
new file mode 100644
index 0000000..ffe9f37
--- /dev/null
+++ b/lib/udev/keymaps/acer-aspire_8930
@@ -0,0 +1,6 @@
+0xCA prog3        # key 'HOLD' on cine dash media console
+0x83 rewind
+0x89 fastforward
+0x92 media        # key 'ARCADE' on cine dash media console
+0x9E back
+
diff --git a/lib/udev/keymaps/acer-travelmate_c300 b/lib/udev/keymaps/acer-travelmate_c300
new file mode 100644
index 0000000..bfef4cf
--- /dev/null
+++ b/lib/udev/keymaps/acer-travelmate_c300
@@ -0,0 +1,5 @@
+0x67 f24 # FIXME: rotate screen
+0x68 up
+0x69 down
+0x6B fn
+0x6C screenlock # FIXME: lock tablet device/buttons
diff --git a/lib/udev/keymaps/asus b/lib/udev/keymaps/asus
new file mode 100644
index 0000000..2a5995f
--- /dev/null
+++ b/lib/udev/keymaps/asus
@@ -0,0 +1,3 @@
+0xED volumeup
+0xEE volumedown
+0xEF mute
diff --git a/lib/udev/keymaps/compaq-e_evo b/lib/udev/keymaps/compaq-e_evo
new file mode 100644
index 0000000..5fbc573
--- /dev/null
+++ b/lib/udev/keymaps/compaq-e_evo
@@ -0,0 +1,4 @@
+0xA3 www # I key
+0x9A search
+0x9E email
+0x9F homepage
diff --git a/lib/udev/keymaps/dell b/lib/udev/keymaps/dell
new file mode 100644
index 0000000..4f907b3
--- /dev/null
+++ b/lib/udev/keymaps/dell
@@ -0,0 +1,29 @@
+0x81 playpause # Play/Pause
+0x82 stopcd # Stop
+0x83 previoussong # Previous song
+0x84 nextsong # Next song
+0x85 brightnessdown # Fn+Down arrow Brightness Down
+0x86 brightnessup # Fn+Up arrow Brightness Up
+0x87 battery # Fn+F3 battery icon
+0x88 unknown # Fn+F2 Turn On/Off Wireless - handled in hardware
+0x89 ejectclosecd # Fn+F10 Eject CD
+0x8A suspend # Fn+F1 hibernate
+0x8B switchvideomode # Fn+F8 CRT/LCD (high keycode: "displaytoggle")
+0x8C f23 # Fn+Right arrow Auto Brightness
+0x8F switchvideomode # Fn+F7 aspect ratio
+0x90 previoussong # Front panel previous song
+0x91 prog1 # Wifi Catcher (DELL Specific)
+0x92 media # MediaDirect button (house icon)
+0x93 f23 # FIXME Fn+Left arrow Auto Brightness
+0x95 camera # Shutter button Takes a picture if optional camera available
+0x97 email # Tablet email button
+0x98 f21 # FIXME: Tablet screen rotatation
+0x99 nextsong # Front panel next song
+0x9A setup # Tablet tools button
+0x9B switchvideomode # Display Toggle button
+0x9E f21 #touchpad toggle
+0xA2 playpause # Front panel play/pause
+0xA4 stopcd # Front panel stop
+0xED media # MediaDirect button
+0xD8 screenlock # FIXME: Tablet lock button
+0xD9 f21 # touchpad toggle
diff --git a/lib/udev/keymaps/dell-latitude-xt2 b/lib/udev/keymaps/dell-latitude-xt2
new file mode 100644
index 0000000..39872f5
--- /dev/null
+++ b/lib/udev/keymaps/dell-latitude-xt2
@@ -0,0 +1,4 @@
+0x9B up # tablet rocker up
+0x9E enter # tablet rocker press
+0x9F back # tablet back
+0xA3 down # tablet rocker down
diff --git a/lib/udev/keymaps/everex-xt5000 b/lib/udev/keymaps/everex-xt5000
new file mode 100644
index 0000000..4823a83
--- /dev/null
+++ b/lib/udev/keymaps/everex-xt5000
@@ -0,0 +1,7 @@
+0x5C media
+0x65 f21 # Fn+F5 Touchpad toggle
+0x67 prog3 # Fan Speed Control button
+0x6F brightnessup
+0x7F brightnessdown
+0xB2 www
+0xEC mail
diff --git a/lib/udev/keymaps/force-release/common-volume-keys b/lib/udev/keymaps/force-release/common-volume-keys
new file mode 100644
index 0000000..3a7654d
--- /dev/null
+++ b/lib/udev/keymaps/force-release/common-volume-keys
@@ -0,0 +1,3 @@
+0xa0 #mute
+0xae #volume down
+0xb0 #volume up
diff --git a/lib/udev/keymaps/force-release/dell-touchpad b/lib/udev/keymaps/force-release/dell-touchpad
new file mode 100644
index 0000000..18e9bde
--- /dev/null
+++ b/lib/udev/keymaps/force-release/dell-touchpad
@@ -0,0 +1 @@
+0x9E
diff --git a/lib/udev/keymaps/force-release/hp-other b/lib/udev/keymaps/force-release/hp-other
new file mode 100644
index 0000000..6621370
--- /dev/null
+++ b/lib/udev/keymaps/force-release/hp-other
@@ -0,0 +1,3 @@
+# list of scancodes (hex or decimal), optional comment
+0xd8 # Touchpad off
+0xd9 # Touchpad on
diff --git a/lib/udev/keymaps/force-release/samsung-other b/lib/udev/keymaps/force-release/samsung-other
new file mode 100644
index 0000000..c51123a
--- /dev/null
+++ b/lib/udev/keymaps/force-release/samsung-other
@@ -0,0 +1,10 @@
+# list of scancodes (hex or decimal), optional comment
+0x82 # Fn+F4 CRT/LCD
+0x83 # Fn+F2 battery
+0x84 # Fn+F5 backlight on/off
+0x86 # Fn+F9 WLAN
+0x88 # Fn-Up brightness up
+0x89 # Fn-Down brightness down
+0xB3 # Fn+F8 switch power mode (battery/dynamic/performance)
+0xF7 # Fn+F10 Touchpad on
+0xF9 # Fn+F10 Touchpad off
diff --git a/lib/udev/keymaps/fujitsu-amilo_pa_2548 b/lib/udev/keymaps/fujitsu-amilo_pa_2548
new file mode 100644
index 0000000..f7b0c52
--- /dev/null
+++ b/lib/udev/keymaps/fujitsu-amilo_pa_2548
@@ -0,0 +1,3 @@
+0xE0 volumedown
+0xE1 volumeup
+0xE5 prog1
diff --git a/lib/udev/keymaps/fujitsu-amilo_pro_edition_v3505 b/lib/udev/keymaps/fujitsu-amilo_pro_edition_v3505
new file mode 100644
index 0000000..d2e38cb
--- /dev/null
+++ b/lib/udev/keymaps/fujitsu-amilo_pro_edition_v3505
@@ -0,0 +1,4 @@
+0xA5 help # Fn-F1
+0xA9 switchvideomode # Fn-F3
+0xD9 brightnessdown # Fn-F8
+0xE0 brightnessup # Fn-F9
diff --git a/lib/udev/keymaps/fujitsu-amilo_pro_v3205 b/lib/udev/keymaps/fujitsu-amilo_pro_v3205
new file mode 100644
index 0000000..43e3199
--- /dev/null
+++ b/lib/udev/keymaps/fujitsu-amilo_pro_v3205
@@ -0,0 +1,2 @@
+0xF4 f21 # FIXME: silent-mode decrease CPU/GPU clock
+0xF7 switchvideomode # Fn+F3
diff --git a/lib/udev/keymaps/fujitsu-amilo_si_1520 b/lib/udev/keymaps/fujitsu-amilo_si_1520
new file mode 100644
index 0000000..1419bd9
--- /dev/null
+++ b/lib/udev/keymaps/fujitsu-amilo_si_1520
@@ -0,0 +1,6 @@
+0xE1 wlan
+0xF3 wlan
+0xEE brightnessdown
+0xE0 brightnessup
+0xE2 bluetooth
+0xF7 video
diff --git a/lib/udev/keymaps/fujitsu-esprimo_mobile_v5 b/lib/udev/keymaps/fujitsu-esprimo_mobile_v5
new file mode 100644
index 0000000..d3d056b
--- /dev/null
+++ b/lib/udev/keymaps/fujitsu-esprimo_mobile_v5
@@ -0,0 +1,4 @@
+0xA9 switchvideomode
+0xD9 brightnessdown
+0xDF sleep
+0xEF brightnessup
diff --git a/lib/udev/keymaps/fujitsu-esprimo_mobile_v6 b/lib/udev/keymaps/fujitsu-esprimo_mobile_v6
new file mode 100644
index 0000000..52c70c5
--- /dev/null
+++ b/lib/udev/keymaps/fujitsu-esprimo_mobile_v6
@@ -0,0 +1,2 @@
+0xCE brightnessup
+0xEF brightnessdown
diff --git a/lib/udev/keymaps/genius-slimstar-320 b/lib/udev/keymaps/genius-slimstar-320
new file mode 100644
index 0000000..d0a3656
--- /dev/null
+++ b/lib/udev/keymaps/genius-slimstar-320
@@ -0,0 +1,35 @@
+# Genius SlimStar 320
+#
+# Only buttons which are not properly mapped yet are configured below
+
+# "Scroll wheel", a circular up/down/left/right button. Aimed for scolling,
+# but since there are no scrollleft/scrollright, let's map to back/forward.
+0x900f0 scrollup
+0x900f1 scrolldown
+0x900f3 back
+0x900f2 forward
+
+# Multimedia buttons, left side (from left to right)
+# [W]
+0x900f5 wordprocessor
+# [Ex]
+0x900f6 spreadsheet
+# [P]
+0x900f4 presentation
+# Other five (calculator, playpause, stop, mute and eject) are OK
+
+# Right side, from left to right
+# [e]
+0xc0223 www
+# "man"
+0x900f7 chat
+# "Y"
+0x900fb prog1
+# [X]
+0x900f8 close
+# "picture"
+0x900f9 graphicseditor
+# "two windows"
+0x900fd scale
+# "lock"
+0x900fc screenlock
diff --git a/lib/udev/keymaps/hewlett-packard b/lib/udev/keymaps/hewlett-packard
new file mode 100644
index 0000000..4461fa2
--- /dev/null
+++ b/lib/udev/keymaps/hewlett-packard
@@ -0,0 +1,12 @@
+0x81 fn_esc
+0x89 battery # FnF8
+0x8A screenlock # FnF6
+0x8B camera
+0x8C media # music
+0x8E dvd
+0xB1 help
+0xB3 f23 # FIXME: Auto brightness
+0xD7 wlan
+0x92 brightnessdown # FnF7 (FnF9 on 6730b)
+0x97 brightnessup # FnF8 (FnF10 on 6730b)
+0xEE switchvideomode # FnF4
diff --git a/lib/udev/keymaps/hewlett-packard-2510p_2530p b/lib/udev/keymaps/hewlett-packard-2510p_2530p
new file mode 100644
index 0000000..41ad2e9
--- /dev/null
+++ b/lib/udev/keymaps/hewlett-packard-2510p_2530p
@@ -0,0 +1,2 @@
+0xD8 f23 # touchpad off
+0xD9 f22 # touchpad on
diff --git a/lib/udev/keymaps/hewlett-packard-compaq_elitebook b/lib/udev/keymaps/hewlett-packard-compaq_elitebook
new file mode 100644
index 0000000..42007c5
--- /dev/null
+++ b/lib/udev/keymaps/hewlett-packard-compaq_elitebook
@@ -0,0 +1,2 @@
+0x88 presentation
+0xD9 help # I key (high keycode: "info")
diff --git a/lib/udev/keymaps/hewlett-packard-pavilion b/lib/udev/keymaps/hewlett-packard-pavilion
new file mode 100644
index 0000000..3d3cefc
--- /dev/null
+++ b/lib/udev/keymaps/hewlett-packard-pavilion
@@ -0,0 +1,3 @@
+0x88 media # FIXME: quick play
+0xD8 f23 # touchpad off
+0xD9 f22 # touchpad on
diff --git a/lib/udev/keymaps/hewlett-packard-presario-2100 b/lib/udev/keymaps/hewlett-packard-presario-2100
new file mode 100644
index 0000000..1df39dc
--- /dev/null
+++ b/lib/udev/keymaps/hewlett-packard-presario-2100
@@ -0,0 +1,3 @@
+0xF0 help
+0xF1 screenlock
+0xF3 search
diff --git a/lib/udev/keymaps/hewlett-packard-tablet b/lib/udev/keymaps/hewlett-packard-tablet
new file mode 100644
index 0000000..d19005a
--- /dev/null
+++ b/lib/udev/keymaps/hewlett-packard-tablet
@@ -0,0 +1,6 @@
+0x82 prog2 # Funny Key
+0x83 prog1 # Q
+0x84 tab
+0x85 esc
+0x86 pageup
+0x87 pagedown
diff --git a/lib/udev/keymaps/hewlett-packard-tx2 b/lib/udev/keymaps/hewlett-packard-tx2
new file mode 100644
index 0000000..36a690f
--- /dev/null
+++ b/lib/udev/keymaps/hewlett-packard-tx2
@@ -0,0 +1,3 @@
+0xC2 media
+0xD8 f23 # Toggle touchpad button on tx2 (OFF)
+0xD9 f22 # Toggle touchpad button on tx2 (ON)
diff --git a/lib/udev/keymaps/ibm-thinkpad-usb-keyboard-trackpoint b/lib/udev/keymaps/ibm-thinkpad-usb-keyboard-trackpoint
new file mode 100644
index 0000000..027e50b
--- /dev/null
+++ b/lib/udev/keymaps/ibm-thinkpad-usb-keyboard-trackpoint
@@ -0,0 +1,7 @@
+0x900f0 screenlock
+0x900f1 wlan
+0x900f2 switchvideomode
+0x900f3 suspend
+0x900f4 brightnessup
+0x900f5 brightnessdown
+0x900f8 zoom
diff --git a/lib/udev/keymaps/inventec-symphony_6.0_7.0 b/lib/udev/keymaps/inventec-symphony_6.0_7.0
new file mode 100644
index 0000000..4a8b4ba
--- /dev/null
+++ b/lib/udev/keymaps/inventec-symphony_6.0_7.0
@@ -0,0 +1,2 @@
+0xF3 prog2
+0xF4 prog1
diff --git a/lib/udev/keymaps/lenovo-3000 b/lib/udev/keymaps/lenovo-3000
new file mode 100644
index 0000000..5bd1656
--- /dev/null
+++ b/lib/udev/keymaps/lenovo-3000
@@ -0,0 +1,5 @@
+0x8B switchvideomode # Fn+F7 video
+0x96 wlan # Fn+F5 wireless
+0x97 sleep # Fn+F4 suspend
+0x98 suspend # Fn+F12 hibernate
+0xB4 prog1 # Lenovo Care
diff --git a/lib/udev/keymaps/lenovo-ideapad b/lib/udev/keymaps/lenovo-ideapad
new file mode 100644
index 0000000..d5f2567
--- /dev/null
+++ b/lib/udev/keymaps/lenovo-ideapad
@@ -0,0 +1,7 @@
+# Key codes observed on S10-3, assumed valid on other IdeaPad models
+0x81 rfkill			# does nothing in BIOS
+0x83 display_off		# BIOS toggles screen state
+0xB9 brightnessup		# does nothing in BIOS
+0xBA brightnessdown		# does nothing in BIOS
+0xF1 camera			# BIOS toggles camera power
+0xf2 unknown			# trackpad enable/disable (does nothing in BIOS)
diff --git a/lib/udev/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint b/lib/udev/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
new file mode 100644
index 0000000..3e94547
--- /dev/null
+++ b/lib/udev/keymaps/lenovo-thinkpad-usb-keyboard-trackpoint
@@ -0,0 +1,13 @@
+0x90012 screenlock # Fn+F2
+0x90013 battery # Fn+F3
+0x90014 wlan # Fn+F5
+0x90016 switchvideomode # Fn+F7
+0x90017 f21 # Fn+F8  touchpadtoggle
+0x90019 suspend # Fn+F12
+0x9001A brightnessup # Fn+Home
+0x9001B brightnessdown # Fn+End
+0x9001D zoom # Fn+Space
+0x90011 prog1 # Thinkvantage button
+
+0x90015 camera # Fn+F6 headset/camera VoIP key  ??
+0x90010 micmute # Microphone mute button 
diff --git a/lib/udev/keymaps/lenovo-thinkpad_x200_tablet b/lib/udev/keymaps/lenovo-thinkpad_x200_tablet
new file mode 100644
index 0000000..31ea3b2
--- /dev/null
+++ b/lib/udev/keymaps/lenovo-thinkpad_x200_tablet
@@ -0,0 +1,6 @@
+0x5D menu
+0x63 fn
+0x66 screenlock
+0x67 cyclewindows # bezel circular arrow
+0x68 setup # bezel setup / menu
+0x6c direction # rotate screen
diff --git a/lib/udev/keymaps/lenovo-thinkpad_x6_tablet b/lib/udev/keymaps/lenovo-thinkpad_x6_tablet
new file mode 100644
index 0000000..6fd16b5
--- /dev/null
+++ b/lib/udev/keymaps/lenovo-thinkpad_x6_tablet
@@ -0,0 +1,8 @@
+0x6C f21 # rotate
+0x68 screenlock # screenlock
+0x6B esc # escape
+0x6D right # right on d-pad
+0x6E left # left on d-pad
+0x71 up # up on d-pad
+0x6F down # down on d-pad
+0x69 enter # enter on d-pad
diff --git a/lib/udev/keymaps/lg-x110 b/lib/udev/keymaps/lg-x110
new file mode 100644
index 0000000..ba08cba
--- /dev/null
+++ b/lib/udev/keymaps/lg-x110
@@ -0,0 +1,12 @@
+0xA0 mute # Fn-F9
+0xAE volumedown # Fn-Left
+0xAF search # Fn-F3
+0xB0 volumeup # Fn-Right
+0xB1 battery # Fn-F10 Info
+0xB3 suspend # Fn-F12
+0xDF sleep # Fn-F4
+# 0xE2 bluetooth # satellite dish2
+0xE4 f21 # Fn-F5   Touchpad disable
+0xF6 wlan # Fn-F6
+0xF7 reserved # brightnessdown # Fn-Down
+0xF8 reserved # brightnessup # Fn-Up
diff --git a/lib/udev/keymaps/logitech-wave b/lib/udev/keymaps/logitech-wave
new file mode 100644
index 0000000..caa5d5d
--- /dev/null
+++ b/lib/udev/keymaps/logitech-wave
@@ -0,0 +1,16 @@
+0x9001C scale #expo
+0x9001F zoomout #zoom out
+0x90020 zoomin #zoom in
+0x9003D prog1 #gadget
+0x90005 camera #camera
+0x90018 media #media center
+0x90041 wordprocessor #fn+f1 (word)
+0x90042 spreadsheet #fn+f2 (excel)
+0x90043 calendar #fn+f3 (calendar)
+0x90044 prog2 #fn+f4 (program a)
+0x90045 prog3 #fn+f5 (program b)
+0x90046 prog4 #fn+f6 (program c)
+0x90048 messenger #fn+f8 (msn messenger)
+0x9002D find #fn+f10 (search www)
+0x9004B search #fn+f11 (search pc)
+0x9004C ejectclosecd #fn+f12 (eject)
diff --git a/lib/udev/keymaps/logitech-wave-cordless b/lib/udev/keymaps/logitech-wave-cordless
new file mode 100644
index 0000000..a10dad5
--- /dev/null
+++ b/lib/udev/keymaps/logitech-wave-cordless
@@ -0,0 +1,15 @@
+0xD4 zoomin
+0xCC zoomout
+0xC0183 media
+0xC1005 camera
+0xC101F zoomout
+0xC1020 zoomin
+0xC1041 wordprocessor
+0xC1042 spreadsheet
+0xC1043 calendar
+0xC1044 prog2 #fn+f4 (program a)
+0xC1045 prog3 #fn+f5 (program b)
+0xC1046 prog4 #fn+f6 (program c)
+0xC1048 messenger
+0xC104A find #fn+f10 (search www)
+0xC104C ejectclosecd
diff --git a/lib/udev/keymaps/logitech-wave-pro-cordless b/lib/udev/keymaps/logitech-wave-pro-cordless
new file mode 100644
index 0000000..e7aa022
--- /dev/null
+++ b/lib/udev/keymaps/logitech-wave-pro-cordless
@@ -0,0 +1,12 @@
+0xC01B6 camera
+0xC0183 media
+0xC0184 wordprocessor
+0xC0186 spreadsheet
+0xC018E calendar
+0xC0223 homepage
+0xC01BC messenger
+0xC018A mail
+0xC0221 search
+0xC00B8 ejectcd
+0xC022D zoomin
+0xC022E zoomout
diff --git a/lib/udev/keymaps/maxdata-pro_7000 b/lib/udev/keymaps/maxdata-pro_7000
new file mode 100644
index 0000000..c0e4f77
--- /dev/null
+++ b/lib/udev/keymaps/maxdata-pro_7000
@@ -0,0 +1,9 @@
+0x97 prog2
+0x9F prog1
+0xA0 mute # Fn-F5
+0x82 www
+0xEC email
+0xAE volumedown # Fn-Down
+0xB0 volumeup # Fn-Up
+0xDF suspend # Fn+F2
+0xF5 help
diff --git a/lib/udev/keymaps/medion-fid2060 b/lib/udev/keymaps/medion-fid2060
new file mode 100644
index 0000000..5a76c76
--- /dev/null
+++ b/lib/udev/keymaps/medion-fid2060
@@ -0,0 +1,2 @@
+0x6B channeldown # Thottle Down
+0x6D channelup # Thottle Up
diff --git a/lib/udev/keymaps/medionnb-a555 b/lib/udev/keymaps/medionnb-a555
new file mode 100644
index 0000000..c3b5dfa
--- /dev/null
+++ b/lib/udev/keymaps/medionnb-a555
@@ -0,0 +1,4 @@
+0x63 www # N button
+0x66 prog1 # link 1 button
+0x67 email # envelope button
+0x69 prog2 # link 2 button
diff --git a/lib/udev/keymaps/micro-star b/lib/udev/keymaps/micro-star
new file mode 100644
index 0000000..4a43869
--- /dev/null
+++ b/lib/udev/keymaps/micro-star
@@ -0,0 +1,13 @@
+0xA0 mute # Fn-F9
+0xAE volumedown # Fn-F7
+0xB0 volumeup # Fn-F8
+0xB2 www # e button
+0xDF sleep # Fn-F12
+0xE2 bluetooth # satellite dish2
+0xE4 f21 # Fn-F3   Touchpad disable
+0xEC email # envelope button
+0xEE camera # Fn-F6 camera disable
+0xF6 wlan # satellite dish1
+0xF7 brightnessdown # Fn-F4
+0xF8 brightnessup # Fn-F5
+0xF9 search
diff --git a/lib/udev/keymaps/module-asus-w3j b/lib/udev/keymaps/module-asus-w3j
new file mode 100644
index 0000000..773e0b3
--- /dev/null
+++ b/lib/udev/keymaps/module-asus-w3j
@@ -0,0 +1,11 @@
+0x41 nextsong
+0x45 playpause
+0x43 stopcd
+0x40 previoussong
+0x4C ejectclosecd
+0x32 mute
+0x31 volumedown
+0x30 volumeup
+0x5D wlan
+0x7E bluetooth
+0x8A media # high keycode: "tv"
diff --git a/lib/udev/keymaps/module-ibm b/lib/udev/keymaps/module-ibm
new file mode 100644
index 0000000..a92dfa2
--- /dev/null
+++ b/lib/udev/keymaps/module-ibm
@@ -0,0 +1,16 @@
+0x01 battery # Fn+F2
+0x02 screenlock # Fn+F3
+0x03 sleep # Fn+F4
+0x04 wlan # Fn+F5
+0x06 switchvideomode # Fn+F7
+0x07 zoom # Fn+F8 screen expand
+0x08 f24 # Fn+F9 undock
+0x0B suspend # Fn+F12
+0x0F brightnessup # Fn+Home
+0x10 brightnessdown # Fn+End
+0x11 kbdillumtoggle # Fn+PgUp - ThinkLight
+0x13 zoom # Fn+Space
+0x14 volumeup
+0x15 volumedown
+0x16 mute
+0x17 prog1 # ThinkPad/ThinkVantage button  (high keycode: "vendor")
diff --git a/lib/udev/keymaps/module-lenovo b/lib/udev/keymaps/module-lenovo
new file mode 100644
index 0000000..8e38883
--- /dev/null
+++ b/lib/udev/keymaps/module-lenovo
@@ -0,0 +1,17 @@
+0x1 screenlock # Fn+F2
+0x2 battery # Fn+F3
+0x3 sleep # Fn+F4
+0x4 wlan # Fn+F5
+0x6 switchvideomode # Fn+F7
+0x7 f21 # Fn+F8 touchpadtoggle
+0x8 f24 # Fn+F9 undock
+0xB suspend # Fn+F12
+0xF brightnessup # Fn+Home
+0x10 brightnessdown # Fn+End
+0x11 kbdillumtoggle # Fn+PgUp - ThinkLight
+0x13 zoom # Fn+Space
+0x14 volumeup
+0x15 volumedown
+0x16 mute
+0x17 prog1 # ThinkPad/ThinkVantage button (high keycode: "vendor")
+0x1A micmute # Microphone mute
diff --git a/lib/udev/keymaps/module-sony b/lib/udev/keymaps/module-sony
new file mode 100644
index 0000000..7c00013
--- /dev/null
+++ b/lib/udev/keymaps/module-sony
@@ -0,0 +1,8 @@
+0x06 mute # Fn+F2
+0x07 volumedown # Fn+F3
+0x08 volumeup # Fn+F4
+0x09 brightnessdown # Fn+F5
+0x0A brightnessup # Fn+F6
+0x0B switchvideomode # Fn+F7
+0x0E zoom # Fn+F10
+0x10 suspend # Fn+F12
diff --git a/lib/udev/keymaps/module-sony-old b/lib/udev/keymaps/module-sony-old
new file mode 100644
index 0000000..596a342
--- /dev/null
+++ b/lib/udev/keymaps/module-sony-old
@@ -0,0 +1,2 @@
+0x06 battery
+0x07 mute
diff --git a/lib/udev/keymaps/module-sony-vgn b/lib/udev/keymaps/module-sony-vgn
new file mode 100644
index 0000000..c8ba001
--- /dev/null
+++ b/lib/udev/keymaps/module-sony-vgn
@@ -0,0 +1,8 @@
+0x00 brightnessdown # Fn+F5
+0x10 brightnessup # Fn+F6
+0x11 switchvideomode # Fn+F7
+0x12 zoomout
+0x14 zoomin
+0x15 suspend # Fn+F12
+0x17 prog1
+0x20 media
diff --git a/lib/udev/keymaps/olpc-xo b/lib/udev/keymaps/olpc-xo
new file mode 100644
index 0000000..34434a1
--- /dev/null
+++ b/lib/udev/keymaps/olpc-xo
@@ -0,0 +1,74 @@
+0x59 fn
+0x81 fn_esc
+0xF9 camera
+0xF8 sound # Fn-CAMERA = Mic
+
+
+# Function key mappings, as per
+#    http://dev.laptop.org/ticket/10213#comment:20
+#
+# Unmodified F1-F8 produce F1-F8, so no remap necessary.
+# Unmodified F9-F12 control brightness and volume.
+0x43 brightnessdown
+0x44 brightnessup
+0x57 volumedown
+0x58 volumeup
+
+# fn-modified fkeys all produce the unmodified version of the key.
+0xBB f1
+0xBC f2
+0xBD f3
+0xBE f4
+0xBF f5
+0xC0 f6
+0xC1 f7
+0xC2 f8
+0xC3 f9
+0xC4 f10
+0xD7 f11
+0xD8 f12
+
+
+# Using F13-F21 for the .5 F keys right now.
+0xF7 f13
+0xF6 f14
+0xF5 f15
+0xF4 f16
+0xF3 f17
+0xF2 f18
+0xF1 f19
+0xF0 f20
+0xEF f21
+
+0xEE chat
+0xE4 chat # Just mapping Fn-Chat to Chat for now
+0xDD menu # Frame
+0xDA prog1 # Fn-Frame
+
+# The FN of some keys is other keys
+0xD3 delete
+0xD2 insert
+0xC9 pageup
+0xD1 pagedown
+0xC7 home
+0xCF end
+
+# Language key - don't ask what they are doing as KEY_HP
+0x73 hp
+0x7E hp
+
+0xDB leftmeta # left grab
+0xDC rightmeta # right grab
+0x85 rightmeta # Right grab releases on a different scancode
+0xD6 kbdillumtoggle # Fn-space
+0x69 switchvideomode # Brightness key
+
+# Game keys
+0x65 kp8 # up
+0x66 kp2 # down
+0x67 kp4 # left
+0x68 kp6 # right
+0xE5 kp9 # pgup
+0xE6 kp3 # pgdn
+0xE7 kp7 # home
+0xE8 kp1 # end
diff --git a/lib/udev/keymaps/onkyo b/lib/udev/keymaps/onkyo
new file mode 100644
index 0000000..ee864ad
--- /dev/null
+++ b/lib/udev/keymaps/onkyo
@@ -0,0 +1,14 @@
+0xA0 mute # Fn+D
+0xAE volumedown # Fn+F
+0xB0 volumeup # Fn+G
+0xDF sleep # Fn+W
+0xE0 bluetooth # Fn+H
+0xE2 cyclewindows # Fn+Esc
+0xEE battery # Fn+Q
+0xF0 media # Fn+R
+0xF5 switchvideomode # Fn+E
+0xF6 camera # Fn+T
+0xF7 f21 # Fn+Y (touchpad toggle)
+0xF8 brightnessup # Fn+S
+0xF9 brightnessdown # Fn+A
+0xFB wlan # Fn+J
diff --git a/lib/udev/keymaps/oqo-model2 b/lib/udev/keymaps/oqo-model2
new file mode 100644
index 0000000..b7f4851
--- /dev/null
+++ b/lib/udev/keymaps/oqo-model2
@@ -0,0 +1,5 @@
+0x8E wlan
+0xF0 switchvideomode
+0xF1 mute
+0xF2 volumedown
+0xF3 volumeup
diff --git a/lib/udev/keymaps/samsung-other b/lib/udev/keymaps/samsung-other
new file mode 100644
index 0000000..3ac0c2f
--- /dev/null
+++ b/lib/udev/keymaps/samsung-other
@@ -0,0 +1,14 @@
+0x74 prog1 # User key
+0x75 www
+0x78 mail
+0x82 switchvideomode # Fn+F4 CRT/LCD (high keycode: "displaytoggle")
+0x83 battery # Fn+F2
+0x84 prog1 # Fn+F5 backlight on/off
+0x86 wlan # Fn+F9
+0x88 brightnessup # Fn-Up
+0x89 brightnessdown # Fn-Down
+0xB1 prog2 # Fn+F7 run Samsung Magic Doctor (keypressed event is generated twice)
+0xB3 prog3 # Fn+F8 switch power mode (battery/dynamic/performance)
+0xB4 wlan # Fn+F9 (X60P)
+0xF7 f22 # Fn+F10 Touchpad on
+0xF9 f23 # Fn+F10 Touchpad off
diff --git a/lib/udev/keymaps/samsung-sq1us b/lib/udev/keymaps/samsung-sq1us
new file mode 100644
index 0000000..3e05199
--- /dev/null
+++ b/lib/udev/keymaps/samsung-sq1us
@@ -0,0 +1,7 @@
+0xD4 menu
+0xD8 f1
+0xD9 f10 
+0xD6 f3
+0xD7 f9
+0xE4 f5
+0xEE f11
diff --git a/lib/udev/keymaps/samsung-sx20s b/lib/udev/keymaps/samsung-sx20s
new file mode 100644
index 0000000..9d954ee
--- /dev/null
+++ b/lib/udev/keymaps/samsung-sx20s
@@ -0,0 +1,4 @@
+0x74 mute
+0x75 mute
+0x77 f22 # Touchpad on
+0x79 f23 # Touchpad off
diff --git a/lib/udev/keymaps/toshiba-satellite_a100 b/lib/udev/keymaps/toshiba-satellite_a100
new file mode 100644
index 0000000..22007be
--- /dev/null
+++ b/lib/udev/keymaps/toshiba-satellite_a100
@@ -0,0 +1,2 @@
+0xA4 stopcd
+0xB2 www
diff --git a/lib/udev/keymaps/toshiba-satellite_a110 b/lib/udev/keymaps/toshiba-satellite_a110
new file mode 100644
index 0000000..1429409
--- /dev/null
+++ b/lib/udev/keymaps/toshiba-satellite_a110
@@ -0,0 +1,10 @@
+0x92 stop
+0x93 www
+0x94 media
+0x9E f22 # Touchpad on
+0x9F f23 # Touchpad off
+0xB9 nextsong
+0xD9 brightnessup
+0xEE screenlock
+0xF4 previoussong
+0xF7 playpause
diff --git a/lib/udev/keymaps/toshiba-satellite_m30x b/lib/udev/keymaps/toshiba-satellite_m30x
new file mode 100644
index 0000000..9280ae0
--- /dev/null
+++ b/lib/udev/keymaps/toshiba-satellite_m30x
@@ -0,0 +1,7 @@
+0xef brightnessdown
+0xd9 brightnessup
+0xee screenlock
+0x93 media
+0x9e f22 #touchpad_enable
+0x9f f23 #touchpad_disable
+
diff --git a/lib/udev/keymaps/zepto-znote b/lib/udev/keymaps/zepto-znote
new file mode 100644
index 0000000..cf72fda
--- /dev/null
+++ b/lib/udev/keymaps/zepto-znote
@@ -0,0 +1,11 @@
+0x93 switchvideomode    # Fn+F3 Toggle Video Output
+0x95 brightnessdown     # Fn+F4 Brightness Down
+0x91 brightnessup       # Fn+F5 Brightness Up
+0xA5 f23                # Fn+F6 Disable Touchpad
+0xA6 f22                # Fn+F6 Enable Touchpad
+0xA7 bluetooth          # Fn+F10 Enable Bluetooth
+0XA9 bluetooth          # Fn+F10 Disable Bluetooth
+0xF1 wlan               # RF Switch Off
+0xF2 wlan               # RF Switch On
+0xF4 prog1              # P1 Button
+0xF3 prog2              # P2 Button
diff --git a/lib/udev/mtd_probe b/lib/udev/mtd_probe
new file mode 100755
index 0000000..4916d7e
--- /dev/null
+++ b/lib/udev/mtd_probe
Binary files differ
diff --git a/lib/udev/pci-db b/lib/udev/pci-db
new file mode 100755
index 0000000..23d94bf
--- /dev/null
+++ b/lib/udev/pci-db
Binary files differ
diff --git a/lib/udev/rule_generator.functions b/lib/udev/rule_generator.functions
new file mode 100644
index 0000000..4bec27a
--- /dev/null
+++ b/lib/udev/rule_generator.functions
@@ -0,0 +1,116 @@
+# functions used by the udev rule generator
+
+# Copyright (C) 2006 Marco d'Itri <md@Linux.IT>
+
+# 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, either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+PATH='/sbin:/bin'
+#
+
+PATH='/sbin:/bin'
+
+# Read a single line from file $1 in the $DEVPATH directory.
+# The function must not return an error even if the file does not exist.
+sysread() {
+	local file="$1"
+	[ -e "/sys$DEVPATH/$file" ] || return 0
+	local value
+	read value < "/sys$DEVPATH/$file" || return 0
+	echo "$value"
+}
+
+sysreadlink() {
+	local file="$1"
+	[ -e "/sys$DEVPATH/$file" ] || return 0
+	readlink -f /sys$DEVPATH/$file 2> /dev/null || true
+}
+
+# Return true if a directory is writeable.
+writeable() {
+	if ln -s test-link $1/.is-writeable 2> /dev/null; then
+		rm -f $1/.is-writeable
+		return 0
+	else
+		return 1
+	fi
+}
+
+# Create a lock file for the current rules file.
+lock_rules_file() {
+	RUNDIR=$(udevadm info --run)
+	[ -e "$RUNDIR" ] || return 0
+
+	RULES_LOCK="$RUNDIR/.lock-${RULES_FILE##*/}"
+
+	retry=30
+	while ! mkdir $RULES_LOCK 2> /dev/null; do
+		if [ $retry -eq 0 ]; then
+			 echo "Cannot lock $RULES_FILE!" >&2
+			 exit 2
+		fi
+		sleep 1
+		retry=$(($retry - 1))
+	done
+}
+
+unlock_rules_file() {
+	[ "$RULES_LOCK" ] || return 0
+	rmdir $RULES_LOCK || true
+}
+
+# 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() {
+	RUNDIR=$(udevadm info --run)
+	local tmp_rules_file="$RUNDIR/tmp-rules--${RULES_FILE##*/}"
+	[ -e "$RULES_FILE" -o -e "$tmp_rules_file" ] || PRINT_HEADER=1
+
+	if writeable ${RULES_FILE%/*}; then
+		RO_RULES_FILE='/dev/null'
+	else
+		RO_RULES_FILE=$RULES_FILE
+		RULES_FILE=$tmp_rules_file
+	fi
+}
+
+# Return the name of the first free device.
+raw_find_next_available() {
+	local links="$1"
+
+	local basename=${links%%[ 0-9]*}
+	local max=-1
+	for name in $links; do
+		local num=${name#$basename}
+		[ "$num" ] || num=0
+		[ $num -gt $max ] && max=$num
+	done
+
+	local max=$(($max + 1))
+	# "name0" actually is just "name"
+	[ $max -eq 0 ] && return
+	echo "$max"
+}
+
+# Find all rules matching a key (with action) and a pattern.
+find_all_rules() {
+	local key="$1"
+	local linkre="$2"
+	local match="$3"
+
+	local search='.*[[:space:],]'"$key"'"('"$linkre"')".*'
+	echo $(sed -n -r -e 's/^#.*//' -e "${match}s/${search}/\1/p" \
+		$RO_RULES_FILE \
+		$([ -e $RULES_FILE ] && echo $RULES_FILE) \
+		2>/dev/null)
+}
diff --git a/lib/udev/rules.d/42-qemu-usb.rules b/lib/udev/rules.d/42-qemu-usb.rules
new file mode 100644
index 0000000..a4e3864
--- /dev/null
+++ b/lib/udev/rules.d/42-qemu-usb.rules
@@ -0,0 +1,13 @@
+#
+# Enable autosuspend for qemu emulated usb hid devices.
+#
+# Note that there are buggy qemu versions which advertise remote
+# wakeup support but don't actually implement it correctly.  This
+# is the reason why we need a match for the serial number here.
+# The serial number "42" is used to tag the implementations where
+# remote wakeup is working.
+#
+
+ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Mouse", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto"
+ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Tablet", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto"
+ACTION=="add", SUBSYSTEM=="usb", ATTR{product}=="QEMU USB Keyboard", ATTR{serial}=="42", TEST=="power/control", ATTR{power/control}="auto"
diff --git a/lib/udev/rules.d/50-firmware.rules b/lib/udev/rules.d/50-firmware.rules
new file mode 100644
index 0000000..a193adb
--- /dev/null
+++ b/lib/udev/rules.d/50-firmware.rules
@@ -0,0 +1,4 @@
+# do not edit this file, it will be overwritten on update
+
+# firmware-class requests, copies files into the kernel
+SUBSYSTEM=="firmware", ACTION=="add", RUN+="firmware --firmware=$env{FIRMWARE} --devpath=$env{DEVPATH}"
diff --git a/lib/udev/rules.d/50-udev-default.rules b/lib/udev/rules.d/50-udev-default.rules
new file mode 100644
index 0000000..c47cdec
--- /dev/null
+++ b/lib/udev/rules.d/50-udev-default.rules
@@ -0,0 +1,105 @@
+# do not edit this file, it will be overwritten on update
+
+KERNEL=="pty[pqrstuvwxyzabcdef][0123456789abcdef]", GROUP="tty", MODE="0660"
+KERNEL=="tty[pqrstuvwxyzabcdef][0123456789abcdef]", GROUP="tty", MODE="0660"
+KERNEL=="ptmx",			GROUP="tty", MODE="0666"
+KERNEL=="tty",			GROUP="tty", MODE="0666"
+KERNEL=="tty[0-9]*",		GROUP="tty", MODE="0620"
+KERNEL=="vcs|vcs[0-9]*|vcsa|vcsa[0-9]*", GROUP="tty"
+
+# serial
+KERNEL=="tty[A-Z]*[0-9]|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"
+KERNEL=="mwave",		GROUP="dialout"
+KERNEL=="hvc*|hvsi*",		GROUP="dialout"
+
+# virtio serial / console ports
+KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"
+
+# mem
+KERNEL=="null|zero|full|random|urandom", MODE="0666"
+KERNEL=="mem|kmem|port|nvram",	GROUP="kmem", MODE="0640"
+
+# input
+SUBSYSTEM=="input", ENV{ID_INPUT}=="", IMPORT{builtin}="input_id"
+KERNEL=="mouse*|mice|event*",	MODE="0640"
+KERNEL=="ts[0-9]*|uinput",	MODE="0640"
+KERNEL=="js[0-9]*",		MODE="0644"
+
+# video4linux
+SUBSYSTEM=="video4linux",	GROUP="video"
+KERNEL=="vttuner*",		GROUP="video"
+KERNEL=="vtx*|vbi*",		GROUP="video"
+KERNEL=="winradio*",		GROUP="video"
+
+# graphics
+KERNEL=="agpgart",		GROUP="video"
+KERNEL=="pmu",			GROUP="video"
+KERNEL=="nvidia*|nvidiactl*",	GROUP="video"
+SUBSYSTEM=="graphics",		GROUP="video"
+SUBSYSTEM=="drm",		GROUP="video"
+
+# sound
+SUBSYSTEM=="sound",		GROUP="audio", \
+  OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer"
+
+# DVB (video)
+SUBSYSTEM=="dvb", GROUP="video"
+
+# FireWire (firewire-core driver: IIDC devices, AV/C devices)
+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x00010*", GROUP="video"
+SUBSYSTEM=="firewire", ATTR{units}=="*0x00b09d:0x00010*", GROUP="video"
+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x010001*", GROUP="video"
+SUBSYSTEM=="firewire", ATTR{units}=="*0x00a02d:0x014001*", GROUP="video"
+
+# 'libusb' device nodes
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", MODE="0664"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id"
+
+# printer
+KERNEL=="parport[0-9]*",	GROUP="lp"
+SUBSYSTEM=="printer",		KERNEL=="lp*", GROUP="lp"
+SUBSYSTEM=="ppdev",		GROUP="lp"
+KERNEL=="lp[0-9]*",		GROUP="lp"
+KERNEL=="irlpt[0-9]*",		GROUP="lp"
+SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", ENV{ID_USB_INTERFACES}=="*:0701??:*", GROUP="lp"
+
+# block
+SUBSYSTEM=="block", GROUP="disk"
+
+# floppy
+SUBSYSTEM=="block", KERNEL=="fd[0-9]", GROUP="floppy"
+
+# cdrom
+SUBSYSTEM=="block", KERNEL=="sr[0-9]*", GROUP="cdrom"
+SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="4|5", GROUP="cdrom"
+KERNEL=="pktcdvd[0-9]*", GROUP="cdrom"
+KERNEL=="pktcdvd", GROUP="cdrom"
+
+# tape
+KERNEL=="ht[0-9]*|nht[0-9]*", GROUP="tape"
+KERNEL=="pt[0-9]*|npt[0-9]*|pht[0-9]*", GROUP="tape"
+SUBSYSTEM=="scsi_generic|scsi_tape", SUBSYSTEMS=="scsi", ATTRS{type}=="1|8", GROUP="tape"
+
+# block-related
+KERNEL=="sch[0-9]*", GROUP="disk"
+SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="0", GROUP="disk"
+KERNEL=="pg[0-9]*", GROUP="disk"
+KERNEL=="qft[0-9]*|nqft[0-9]*|zqft[0-9]*|nzqft[0-9]*|rawqft[0-9]*|nrawqft[0-9]*", GROUP="disk"
+KERNEL=="rawctl", GROUP="disk"
+SUBSYSTEM=="raw", KERNEL=="raw[0-9]*", GROUP="disk"
+SUBSYSTEM=="aoe", GROUP="disk", MODE="0220"
+SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440"
+
+# network
+KERNEL=="tun",			MODE="0666", OPTIONS+="static_node=net/tun"
+KERNEL=="rfkill",		MODE="0644"
+
+# CPU
+KERNEL=="cpu[0-9]*",		MODE="0444"
+
+KERNEL=="fuse", ACTION=="add",	MODE="0666", OPTIONS+="static_node=fuse"
+
+SUBSYSTEM=="rtc", DRIVERS=="rtc_cmos", SYMLINK+="rtc"
+KERNEL=="mmtimer",		MODE="0644"
+KERNEL=="rflash[0-9]*",		MODE="0400"
+KERNEL=="rrom[0-9]*",		MODE="0400"
diff --git a/lib/udev/rules.d/60-cdrom_id.rules b/lib/udev/rules.d/60-cdrom_id.rules
new file mode 100644
index 0000000..896af34
--- /dev/null
+++ b/lib/udev/rules.d/60-cdrom_id.rules
@@ -0,0 +1,18 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="cdrom_end"
+SUBSYSTEM!="block", GOTO="cdrom_end"
+KERNEL!="sr[0-9]*|xvd*", GOTO="cdrom_end"
+ENV{DEVTYPE}!="disk", GOTO="cdrom_end"
+
+# unconditionally tag device as CDROM
+KERNEL=="sr[0-9]*", ENV{ID_CDROM}="1"
+
+# media eject button pressed
+ENV{DISK_EJECT_REQUEST}=="?*", RUN+="cdrom_id --eject-media $tempnode", GOTO="cdrom_end"
+
+# import device and media properties and lock tray to
+# enable the receiving of media eject button events
+IMPORT{program}="cdrom_id --lock-media $tempnode"
+
+LABEL="cdrom_end"
diff --git a/lib/udev/rules.d/60-persistent-alsa.rules b/lib/udev/rules.d/60-persistent-alsa.rules
new file mode 100644
index 0000000..8154e2d
--- /dev/null
+++ b/lib/udev/rules.d/60-persistent-alsa.rules
@@ -0,0 +1,14 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="persistent_alsa_end"
+SUBSYSTEM!="sound", GOTO="persistent_alsa_end"
+KERNEL!="controlC[0-9]*", GOTO="persistent_alsa_end"
+
+SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{builtin}="usb_id"
+ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}"
+ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", SYMLINK+="snd/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
+
+IMPORT{builtin}="path_id"
+ENV{ID_PATH}=="?*", SYMLINK+="snd/by-path/$env{ID_PATH}"
+
+LABEL="persistent_alsa_end"
diff --git a/lib/udev/rules.d/60-persistent-input.rules b/lib/udev/rules.d/60-persistent-input.rules
new file mode 100644
index 0000000..fb798dd
--- /dev/null
+++ b/lib/udev/rules.d/60-persistent-input.rules
@@ -0,0 +1,38 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="persistent_input_end"
+SUBSYSTEM!="input", GOTO="persistent_input_end"
+SUBSYSTEMS=="bluetooth", GOTO="persistent_input_end"
+
+SUBSYSTEMS=="usb", ENV{ID_BUS}=="", IMPORT{builtin}="usb_id"
+
+# determine class name for persistent symlinks
+ENV{ID_INPUT_KEYBOARD}=="?*", ENV{.INPUT_CLASS}="kbd"
+ENV{ID_INPUT_MOUSE}=="?*", ENV{.INPUT_CLASS}="mouse"
+ENV{ID_INPUT_TOUCHPAD}=="?*", ENV{.INPUT_CLASS}="mouse"
+ENV{ID_INPUT_TABLET}=="?*", ENV{.INPUT_CLASS}="mouse"
+ENV{ID_INPUT_JOYSTICK}=="?*", ENV{.INPUT_CLASS}="joystick"
+DRIVERS=="pcspkr", ENV{.INPUT_CLASS}="spkr"
+ATTRS{name}=="*dvb*|*DVB*|* IR *", ENV{.INPUT_CLASS}="ir"
+
+# fill empty serial number
+ENV{.INPUT_CLASS}=="?*", ENV{ID_SERIAL}=="", ENV{ID_SERIAL}="noserial"
+
+# by-id links
+KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-$env{.INPUT_CLASS}"
+KERNEL=="mouse*|js*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-$env{.INPUT_CLASS}"
+KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-$env{.INPUT_CLASS}"
+KERNEL=="event*", ENV{ID_BUS}=="?*", ENV{.INPUT_CLASS}=="?*", ATTRS{bInterfaceNumber}=="?*", ATTRS{bInterfaceNumber}!="00", SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$attr{bInterfaceNumber}-event-$env{.INPUT_CLASS}"
+# allow empty class for USB devices, by appending the interface number
+SUBSYSTEMS=="usb", ENV{ID_BUS}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", ATTRS{bInterfaceNumber}=="?*", \
+  SYMLINK+="input/by-id/$env{ID_BUS}-$env{ID_SERIAL}-event-if$attr{bInterfaceNumber}"
+
+# by-path
+SUBSYSTEMS=="pci|usb|platform|acpi", IMPORT{builtin}="path_id"
+ENV{ID_PATH}=="?*", KERNEL=="mouse*|js*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-$env{.INPUT_CLASS}"
+ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="?*", SYMLINK+="input/by-path/$env{ID_PATH}-event-$env{.INPUT_CLASS}"
+# allow empty class for platform and usb devices; platform supports only a single interface that way
+SUBSYSTEMS=="usb|platform", ENV{ID_PATH}=="?*", KERNEL=="event*", ENV{.INPUT_CLASS}=="", \
+  SYMLINK+="input/by-path/$env{ID_PATH}-event"
+
+LABEL="persistent_input_end"
diff --git a/lib/udev/rules.d/60-persistent-serial.rules b/lib/udev/rules.d/60-persistent-serial.rules
new file mode 100644
index 0000000..2948200
--- /dev/null
+++ b/lib/udev/rules.d/60-persistent-serial.rules
@@ -0,0 +1,20 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="persistent_serial_end"
+SUBSYSTEM!="tty", GOTO="persistent_serial_end"
+KERNEL!="ttyUSB[0-9]*|ttyACM[0-9]*", GOTO="persistent_serial_end"
+
+SUBSYSTEMS=="usb-serial", ENV{.ID_PORT}="$attr{port_number}"
+
+IMPORT{builtin}="path_id"
+ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="", SYMLINK+="serial/by-path/$env{ID_PATH}"
+ENV{ID_PATH}=="?*", ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-path/$env{ID_PATH}-port$env{.ID_PORT}"
+
+IMPORT{builtin}="usb_id"
+ENV{ID_SERIAL}=="", GOTO="persistent_serial_end"
+SUBSYSTEMS=="usb", ENV{ID_USB_INTERFACE_NUM}="$attr{bInterfaceNumber}"
+ENV{ID_USB_INTERFACE_NUM}=="", GOTO="persistent_serial_end"
+ENV{.ID_PORT}=="", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}"
+ENV{.ID_PORT}=="?*", SYMLINK+="serial/by-id/$env{ID_BUS}-$env{ID_SERIAL}-if$env{ID_USB_INTERFACE_NUM}-port$env{.ID_PORT}"
+
+LABEL="persistent_serial_end"
diff --git a/lib/udev/rules.d/60-persistent-storage-tape.rules b/lib/udev/rules.d/60-persistent-storage-tape.rules
new file mode 100644
index 0000000..b1a64ce
--- /dev/null
+++ b/lib/udev/rules.d/60-persistent-storage-tape.rules
@@ -0,0 +1,25 @@
+# do not edit this file, it will be overwritten on update
+
+# persistent storage links: /dev/tape/{by-id,by-path}
+
+ACTION=="remove", GOTO="persistent_storage_tape_end"
+
+# type 8 devices are "Medium Changers"
+SUBSYSTEM=="scsi_generic", SUBSYSTEMS=="scsi", ATTRS{type}=="8", IMPORT{program}="scsi_id --sg-version=3 --export --whitelisted -d $tempnode", \
+  SYMLINK+="tape/by-id/scsi-$env{ID_SERIAL}"
+
+SUBSYSTEM!="scsi_tape", GOTO="persistent_storage_tape_end"
+
+KERNEL=="st*[0-9]|nst*[0-9]", ATTRS{ieee1394_id}=="?*", ENV{ID_SERIAL}="$attr{ieee1394_id}", ENV{ID_BUS}="ieee1394"
+KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
+KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", KERNELS=="[0-9]*:*[0-9]", ENV{.BSG_DEV}="$root/bsg/$id"
+KERNEL=="st*[0-9]|nst*[0-9]", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --whitelisted --export --device=$env{.BSG_DEV}", ENV{ID_BUS}="scsi"
+KERNEL=="st*[0-9]",  ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
+KERNEL=="nst*[0-9]", ENV{ID_SERIAL}=="?*", SYMLINK+="tape/by-id/$env{ID_BUS}-$env{ID_SERIAL}-nst"
+
+# by-path (parent device path)
+KERNEL=="st*[0-9]|nst*[0-9]", IMPORT{builtin}="path_id"
+KERNEL=="st*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}"
+KERNEL=="nst*[0-9]", ENV{ID_PATH}=="?*", SYMLINK+="tape/by-path/$env{ID_PATH}-nst"
+
+LABEL="persistent_storage_tape_end"
diff --git a/lib/udev/rules.d/60-persistent-storage.rules b/lib/udev/rules.d/60-persistent-storage.rules
new file mode 100644
index 0000000..894b50b
--- /dev/null
+++ b/lib/udev/rules.d/60-persistent-storage.rules
@@ -0,0 +1,91 @@
+# do not edit this file, it will be overwritten on update
+
+# persistent storage links: /dev/disk/{by-id,by-uuid,by-label,by-path}
+# scheme based on "Linux persistent device names", 2004, Hannes Reinecke <hare@suse.de>
+
+# forward scsi device event to corresponding block device
+ACTION=="change", SUBSYSTEM=="scsi", ENV{DEVTYPE}=="scsi_device", TEST=="block", ATTR{block/*/uevent}="change"
+
+ACTION=="remove", GOTO="persistent_storage_end"
+
+# enable in-kernel media-presence polling
+ACTION=="add", SUBSYSTEM=="module", KERNEL=="block", ATTR{parameters/events_dfl_poll_msecs}=="0", ATTR{parameters/events_dfl_poll_msecs}="2000"
+
+SUBSYSTEM!="block", GOTO="persistent_storage_end"
+
+# skip rules for inappropriate block devices
+KERNEL=="fd*|mtd*|nbd*|gnbd*|btibm*|dm-*|md*", 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_*"
+
+# virtio-blk
+KERNEL=="vd*[!0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}"
+KERNEL=="vd*[0-9]", ATTRS{serial}=="?*", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/virtio-$env{ID_SERIAL}-part%n"
+
+# ATA devices with their own "ata" kernel subsystem
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="ata", IMPORT{program}="ata_id --export $tempnode"
+# ATA devices using the "scsi" subsystem
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{vendor}=="ATA", IMPORT{program}="ata_id --export $tempnode"
+# ATA/ATAPI devices (SPC-3 or later) using the "scsi" subsystem
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="scsi", ATTRS{type}=="5", ATTRS{scsi_level}=="[6-9]*", IMPORT{program}="ata_id --export $tempnode"
+
+# Run ata_id on non-removable USB Mass Storage (SATA/PATA disks in enclosures)
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", ATTR{removable}=="0", SUBSYSTEMS=="usb", IMPORT{program}="ata_id --export $tempnode"
+# Otherwise fall back to using usb_id for USB devices
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
+
+# scsi devices
+KERNEL=="sd*[!0-9]|sr*", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="scsi"
+KERNEL=="cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}!="?*", IMPORT{program}="scsi_id --export --whitelisted -d $tempnode", ENV{ID_BUS}="cciss"
+KERNEL=="sd*|sr*|cciss*", ENV{DEVTYPE}=="disk", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}"
+KERNEL=="sd*|cciss*", ENV{DEVTYPE}=="partition", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/$env{ID_BUS}-$env{ID_SERIAL}-part%n"
+
+# firewire
+KERNEL=="sd*[!0-9]|sr*", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}"
+KERNEL=="sd*[0-9]", ATTRS{ieee1394_id}=="?*", SYMLINK+="disk/by-id/ieee1394-$attr{ieee1394_id}-part%n"
+
+# scsi compat links for ATA devices
+KERNEL=="sd*[!0-9]", ENV{ID_BUS}=="ata", PROGRAM="scsi_id --whitelisted --replace-whitespace -p0x80 -d$tempnode", RESULT=="?*", ENV{ID_SCSI_COMPAT}="$result", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}"
+KERNEL=="sd*[0-9]", ENV{ID_SCSI_COMPAT}=="?*", SYMLINK+="disk/by-id/scsi-$env{ID_SCSI_COMPAT}-part%n"
+
+KERNEL=="mmcblk[0-9]", SUBSYSTEMS=="mmc", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}"
+KERNEL=="mmcblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/mmc-$env{ID_NAME}_$env{ID_SERIAL}-part%n"
+KERNEL=="mspblk[0-9]", SUBSYSTEMS=="memstick", ATTRS{name}=="?*", ATTRS{serial}=="?*", ENV{ID_NAME}="$attr{name}", ENV{ID_SERIAL}="$attr{serial}", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}"
+KERNEL=="mspblk[0-9]p[0-9]", ENV{ID_NAME}=="?*", ENV{ID_SERIAL}=="?*", SYMLINK+="disk/by-id/memstick-$env{ID_NAME}_$env{ID_SERIAL}-part%n"
+
+# by-path (parent device path)
+ENV{DEVTYPE}=="disk", DEVPATH!="*/virtual/*", IMPORT{builtin}="path_id"
+ENV{DEVTYPE}=="disk", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}"
+ENV{DEVTYPE}=="partition", ENV{ID_PATH}=="?*", SYMLINK+="disk/by-path/$env{ID_PATH}-part%n"
+
+# skip unpartitioned removable media devices from drivers which do not send "change" events
+ENV{DEVTYPE}=="disk", KERNEL!="sd*|sr*", ATTR{removable}=="1", GOTO="persistent_storage_end"
+
+# probe filesystem metadata of optical drives which have a media inserted
+KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="?*", IMPORT{program}="/sbin/blkid -o udev -p -u noraid -O $env{ID_CDROM_MEDIA_SESSION_LAST_OFFSET} $tempnode"
+# single-session CDs do not have ID_CDROM_MEDIA_SESSION_LAST_OFFSET
+KERNEL=="sr*", ENV{DISK_EJECT_REQUEST}!="?*", ENV{ID_CDROM_MEDIA_TRACK_COUNT_DATA}=="?*", ENV{ID_CDROM_MEDIA_SESSION_LAST_OFFSET}=="", IMPORT{program}="/sbin/blkid -o udev -p -u noraid $tempnode"
+
+# probe filesystem metadata of disks
+KERNEL!="sr*", IMPORT{program}="/sbin/blkid -o udev -p $tempnode"
+
+# watch metadata changes by tools closing the device after writing
+KERNEL!="sr*", OPTIONS+="watch"
+
+# by-label/by-uuid links (filesystem metadata)
+ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}"
+ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}"
+
+# by-id (World Wide Name)
+ENV{DEVTYPE}=="disk", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}"
+ENV{DEVTYPE}=="partition", ENV{ID_WWN_WITH_EXTENSION}=="?*", SYMLINK+="disk/by-id/wwn-$env{ID_WWN_WITH_EXTENSION}-part%n"
+
+# by-partlabel/by-partuuid links (partition metadata)
+ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_UUID}=="?*", SYMLINK+="disk/by-partuuid/$env{ID_PART_ENTRY_UUID}"
+ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_NAME}=="?*", SYMLINK+="disk/by-partlabel/$env{ID_PART_ENTRY_NAME}"
+
+LABEL="persistent_storage_end"
diff --git a/lib/udev/rules.d/60-persistent-v4l.rules b/lib/udev/rules.d/60-persistent-v4l.rules
new file mode 100644
index 0000000..edfd844
--- /dev/null
+++ b/lib/udev/rules.d/60-persistent-v4l.rules
@@ -0,0 +1,20 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="persistent_v4l_end"
+SUBSYSTEM!="video4linux", GOTO="persistent_v4l_end"
+ENV{MAJOR}=="", GOTO="persistent_v4l_end"
+
+IMPORT{program}="v4l_id $tempnode"
+
+SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
+KERNEL=="video*", ENV{ID_SERIAL}=="?*", SYMLINK+="v4l/by-id/$env{ID_BUS}-$env{ID_SERIAL}-video-index$attr{index}"
+
+# check for valid "index" number
+TEST!="index", GOTO="persistent_v4l_end"
+ATTR{index}!="?*", GOTO="persistent_v4l_end"
+
+IMPORT{builtin}="path_id"
+ENV{ID_PATH}=="?*", KERNEL=="video*|vbi*", SYMLINK+="v4l/by-path/$env{ID_PATH}-video-index$attr{index}"
+ENV{ID_PATH}=="?*", KERNEL=="audio*", SYMLINK+="v4l/by-path/$env{ID_PATH}-audio-index$attr{index}"
+
+LABEL="persistent_v4l_end"
diff --git a/lib/udev/rules.d/61-accelerometer.rules b/lib/udev/rules.d/61-accelerometer.rules
new file mode 100644
index 0000000..a6a2bfd
--- /dev/null
+++ b/lib/udev/rules.d/61-accelerometer.rules
@@ -0,0 +1,3 @@
+# do not edit this file, it will be overwritten on update
+
+SUBSYSTEM=="input", ACTION!="remove", ENV{ID_INPUT_ACCELEROMETER}=="1", IMPORT{program}="accelerometer %p"
diff --git a/lib/udev/rules.d/75-cd-aliases-generator.rules b/lib/udev/rules.d/75-cd-aliases-generator.rules
new file mode 100644
index 0000000..e6da010
--- /dev/null
+++ b/lib/udev/rules.d/75-cd-aliases-generator.rules
@@ -0,0 +1,9 @@
+# these rules generate rules for the /dev/{cdrom,dvd,...} symlinks
+
+# the "path" of usb/ieee1394 devices changes frequently, use "id"
+ACTION=="add", SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", \
+  PROGRAM="write_cd_rules by-id", SYMLINK+="%c", GOTO="persistent_cd_end"
+
+ACTION=="add", SUBSYSTEM=="block", ENV{ID_CDROM}=="?*", ENV{GENERATED}!="?*", PROGRAM="write_cd_rules", SYMLINK+="%c"
+
+LABEL="persistent_cd_end"
diff --git a/lib/udev/rules.d/75-net-description.rules b/lib/udev/rules.d/75-net-description.rules
new file mode 100644
index 0000000..0ffce2c
--- /dev/null
+++ b/lib/udev/rules.d/75-net-description.rules
@@ -0,0 +1,14 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="net_end"
+SUBSYSTEM!="net", GOTO="net_end"
+
+SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{builtin}="usb_id"
+SUBSYSTEMS=="usb", ENV{ID_MODEL_FROM_DATABASE}=="", IMPORT{program}="usb-db %p"
+SUBSYSTEMS=="usb", ATTRS{idVendor}!="", ATTRS{idProduct}!="", ENV{ID_VENDOR_ID}="$attr{idVendor}", ENV{ID_MODEL_ID}="$attr{idProduct}"
+SUBSYSTEMS=="usb", GOTO="net_end"
+
+SUBSYSTEMS=="pci", ENV{ID_MODEL_FROM_DATABASE}=="", IMPORT{program}="pci-db %p"
+SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}"
+
+LABEL="net_end"
diff --git a/lib/udev/rules.d/75-persistent-net-generator.rules b/lib/udev/rules.d/75-persistent-net-generator.rules
new file mode 100644
index 0000000..539807c
--- /dev/null
+++ b/lib/udev/rules.d/75-persistent-net-generator.rules
@@ -0,0 +1,101 @@
+# do not edit this file, it will be overwritten on update
+
+# these rules generate rules for persistent network device naming
+#
+# variables used to communicate:
+#   MATCHADDR             MAC address used for the match
+#   MATCHID               bus_id used for the match
+#   MATCHDRV              driver name used for the match
+#   MATCHIFTYPE           interface type match
+#   COMMENT               comment to add to the generated rule
+#   INTERFACE_NAME        requested name supplied by external tool
+#   INTERFACE_NEW         new interface name returned by rule writer
+
+ACTION!="add", GOTO="persistent_net_generator_end"
+SUBSYSTEM!="net", GOTO="persistent_net_generator_end"
+
+# ignore the interface if a name has already been set
+NAME=="?*", GOTO="persistent_net_generator_end"
+
+# device name whitelist
+KERNEL!="eth*|ath*|wlan*[0-9]|msh*|ra*|sta*|ctc*|lcs*|hsi*", GOTO="persistent_net_generator_end"
+
+# ignore Xen virtual interfaces
+SUBSYSTEMS=="xen", GOTO="persistent_net_generator_end"
+
+# read MAC address
+ENV{MATCHADDR}="$attr{address}"
+
+# match interface type
+ENV{MATCHIFTYPE}="$attr{type}"
+
+# ignore KVM virtual interfaces
+ENV{MATCHADDR}=="52:54:00:*", GOTO="persistent_net_generator_end"
+# ignore VMWare virtual interfaces
+ENV{MATCHADDR}=="00:0c:29:*|00:50:56:*", GOTO="persistent_net_generator_end"
+# ignore Hyper-V virtual interfaces
+ENV{MATCHADDR}=="00:15:5d:*", GOTO="persistent_net_generator_end"
+
+# These vendors are known to violate the local MAC address assignment scheme
+# Interlan, DEC (UNIBUS or QBUS), Apollo, Cisco, Racal-Datacom
+ENV{MATCHADDR}=="02:07:01:*", GOTO="globally_administered_whitelist"
+# 3Com
+ENV{MATCHADDR}=="02:60:60:*", GOTO="globally_administered_whitelist"
+# 3Com IBM PC; Imagen; Valid; Cisco; Apple
+ENV{MATCHADDR}=="02:60:8c:*", GOTO="globally_administered_whitelist"
+# Intel
+ENV{MATCHADDR}=="02:a0:c9:*", GOTO="globally_administered_whitelist"
+# Olivetti
+ENV{MATCHADDR}=="02:aa:3c:*", GOTO="globally_administered_whitelist"
+# CMC Masscomp; Silicon Graphics; Prime EXL
+ENV{MATCHADDR}=="02:cf:1f:*", GOTO="globally_administered_whitelist"
+# Prominet Corporation Gigabit Ethernet Switch
+ENV{MATCHADDR}=="02:e0:3b:*", GOTO="globally_administered_whitelist"
+# BTI (Bus-Tech, Inc.) IBM Mainframes
+ENV{MATCHADDR}=="02:e6:d3:*", GOTO="globally_administered_whitelist"
+# Realtek
+ENV{MATCHADDR}=="52:54:00:*", GOTO="globally_administered_whitelist"
+# Novell 2000
+ENV{MATCHADDR}=="52:54:4c:*", GOTO="globally_administered_whitelist"
+# Realtec
+ENV{MATCHADDR}=="52:54:ab:*", GOTO="globally_administered_whitelist"
+# Kingston Technologies
+ENV{MATCHADDR}=="e2:0c:0f:*", GOTO="globally_administered_whitelist"
+
+# match interface dev_id
+ATTR{dev_id}=="?*", ENV{MATCHDEVID}="$attr{dev_id}"
+
+# do not use "locally administered" MAC address
+ENV{MATCHADDR}=="?[2367abef]:*", ENV{MATCHADDR}=""
+
+# do not use empty address
+ENV{MATCHADDR}=="00:00:00:00:00:00", ENV{MATCHADDR}=""
+
+LABEL="globally_administered_whitelist"
+
+# build comment line for generated rule:
+SUBSYSTEMS=="pci", ENV{COMMENT}="PCI device $attr{vendor}:$attr{device} ($driver)"
+SUBSYSTEMS=="usb", ATTRS{idVendor}=="?*", ENV{COMMENT}="USB device 0x$attr{idVendor}:0x$attr{idProduct} ($driver)"
+SUBSYSTEMS=="pcmcia", ENV{COMMENT}="PCMCIA device $attr{card_id}:$attr{manf_id} ($driver)"
+SUBSYSTEMS=="ieee1394", ENV{COMMENT}="Firewire device $attr{host_id})"
+
+# ibmveth likes to use "locally administered" MAC addresses
+DRIVERS=="ibmveth", ENV{MATCHADDR}="$attr{address}", ENV{COMMENT}="ibmveth ($id)"
+
+# S/390 uses id matches only, do not use MAC address match
+SUBSYSTEMS=="ccwgroup", ENV{COMMENT}="S/390 $driver device at $id", ENV{MATCHID}="$id", ENV{MATCHDRV}="$driver", ENV{MATCHADDR}=""
+
+# see if we got enough data to create a rule
+ENV{MATCHADDR}=="", ENV{MATCHID}=="", ENV{INTERFACE_NAME}=="", GOTO="persistent_net_generator_end"
+
+# default comment
+ENV{COMMENT}=="", ENV{COMMENT}="net device ($attr{driver})"
+
+# write rule
+DRIVERS=="?*", IMPORT{program}="write_net_rules"
+
+# rename interface if needed
+ENV{INTERFACE_NEW}=="?*", NAME="$env{INTERFACE_NEW}"
+
+LABEL="persistent_net_generator_end"
+
diff --git a/lib/udev/rules.d/75-probe_mtd.rules b/lib/udev/rules.d/75-probe_mtd.rules
new file mode 100644
index 0000000..184fda5
--- /dev/null
+++ b/lib/udev/rules.d/75-probe_mtd.rules
@@ -0,0 +1,8 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION!="add", GOTO="mtd_probe_end"
+
+KERNEL=="mtd*ro", IMPORT{program}="mtd_probe $tempnode"
+KERNEL=="mtd*ro", ENV{MTD_FTL}=="smartmedia", RUN+="/sbin/modprobe -bv sm_ftl"
+
+LABEL="mtd_probe_end"
diff --git a/lib/udev/rules.d/75-tty-description.rules b/lib/udev/rules.d/75-tty-description.rules
new file mode 100644
index 0000000..b67c857
--- /dev/null
+++ b/lib/udev/rules.d/75-tty-description.rules
@@ -0,0 +1,14 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="tty_end"
+SUBSYSTEM!="tty", GOTO="tty_end"
+
+SUBSYSTEMS=="usb", ENV{ID_MODEL}=="", IMPORT{builtin}="usb_id"
+SUBSYSTEMS=="usb", ENV{ID_MODEL_FROM_DATABASE}=="", IMPORT{program}="usb-db %p"
+SUBSYSTEMS=="usb", ATTRS{idVendor}!="", ATTRS{idProduct}!="", ENV{ID_VENDOR_ID}="$attr{idVendor}", ENV{ID_MODEL_ID}="$attr{idProduct}"
+SUBSYSTEMS=="usb", GOTO="tty_end"
+
+SUBSYSTEMS=="pci", ENV{ID_MODEL_FROM_DATABASE}=="", IMPORT{program}="pci-db %p"
+SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}"
+
+LABEL="tty_end"
diff --git a/lib/udev/rules.d/78-sound-card.rules b/lib/udev/rules.d/78-sound-card.rules
new file mode 100644
index 0000000..e3a13b5
--- /dev/null
+++ b/lib/udev/rules.d/78-sound-card.rules
@@ -0,0 +1,83 @@
+# do not edit this file, it will be overwritten on update
+
+SUBSYSTEM!="sound", GOTO="sound_end"
+
+ACTION=="add|change", KERNEL=="controlC*", ATTR{../uevent}="change"
+ACTION!="change", GOTO="sound_end"
+
+# Ok, we probably need a little explanation here for what the two lines above
+# are good for.
+#
+# The story goes like this: when ALSA registers a new sound card it emits a
+# series of 'add' events to userspace, for the main card device and for all the
+# child device nodes that belong to it. udev relays those to applications,
+# however only maintains the order between father and child, but not between
+# the siblings. The control device node creation can be used as synchronization
+# point. All other devices that belong to a card are created in the kernel
+# before it. However unfortunately due to the fact that siblings are forwarded
+# out of order by udev this fact is lost to applications.
+#
+# OTOH before an application can open a device it needs to make sure that all
+# its device nodes are completely created and set up.
+#
+# As a workaround for this issue we have added the udev rule above which will
+# generate a 'change' event on the main card device from the 'add' event of the
+# card's control device. Due to the ordering semantics of udev this event will
+# only be relayed after all child devices have finished processing properly.
+# When an application needs to listen for appearing devices it can hence look
+# for 'change' events only, and ignore the actual 'add' events.
+#
+# When the application is initialized at the same time as a device is plugged
+# in it may need to figure out if the 'change' event has already been triggered
+# or not for a card. To find that out we store the flag environment variable
+# SOUND_INITIALIZED on the device which simply tells us if the card 'change'
+# event has already been processed.
+
+KERNEL!="card*", GOTO="sound_end"
+
+ENV{SOUND_INITIALIZED}="1"
+
+SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
+SUBSYSTEMS=="usb", ENV{ID_VENDOR_FROM_DATABASE}=="", IMPORT{program}="usb-db %p"
+SUBSYSTEMS=="usb", GOTO="skip_pci"
+
+SUBSYSTEMS=="pci", ENV{ID_VENDOR_FROM_DATABASE}=="", IMPORT{program}="pci-db %p"
+SUBSYSTEMS=="pci", ENV{ID_BUS}="pci", ENV{ID_VENDOR_ID}="$attr{vendor}", ENV{ID_MODEL_ID}="$attr{device}"
+
+LABEL="skip_pci"
+
+ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="?*", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$env{ID_USB_INTERFACE_NUM}-$attr{id}"
+ENV{ID_SERIAL}=="?*", ENV{ID_USB_INTERFACE_NUM}=="", ENV{ID_ID}="$env{ID_BUS}-$env{ID_SERIAL}-$attr{id}"
+
+IMPORT{builtin}="path_id"
+
+# The values used here for $SOUND_FORM_FACTOR and $SOUND_CLASS should be kept
+# in sync with those defined for PulseAudio's src/pulse/proplist.h
+# PA_PROP_DEVICE_FORM_FACTOR, PA_PROP_DEVICE_CLASS properties.
+
+# If the first PCM device of this card has the pcm class 'modem', then the card is a modem
+ATTR{pcmC%nD0p/pcm_class}=="modem", ENV{SOUND_CLASS}="modem", GOTO="sound_end"
+
+# Identify cards on the internal PCI bus as internal
+SUBSYSTEMS=="pci", DEVPATH=="*/0000:00:??.?/sound/*", ENV{SOUND_FORM_FACTOR}="internal", GOTO="sound_end"
+
+# Devices that also support Image/Video interfaces are most likely webcams
+SUBSYSTEMS=="usb", ENV{ID_USB_INTERFACES}=="*:0e????:*", ENV{SOUND_FORM_FACTOR}="webcam", GOTO="sound_end"
+
+# Matching on the model strings is a bit ugly, I admit
+ENV{ID_MODEL}=="*[Ss]peaker*", ENV{SOUND_FORM_FACTOR}="speaker", GOTO="sound_end"
+ENV{ID_MODEL_FROM_DATABASE}=="*[Ss]peaker*", ENV{SOUND_FORM_FACTOR}="speaker", GOTO="sound_end"
+
+ENV{ID_MODEL}=="*[Hh]eadphone*", ENV{SOUND_FORM_FACTOR}="headphone", GOTO="sound_end"
+ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]eadphone*", ENV{SOUND_FORM_FACTOR}="headphone", GOTO="sound_end"
+
+ENV{ID_MODEL}=="*[Hh]eadset*", ENV{SOUND_FORM_FACTOR}="headset", GOTO="sound_end"
+ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]eadset*", ENV{SOUND_FORM_FACTOR}="headset", GOTO="sound_end"
+
+ENV{ID_MODEL}=="*[Hh]andset*", ENV{SOUND_FORM_FACTOR}="handset", GOTO="sound_end"
+ENV{ID_MODEL_FROM_DATABASE}=="*[Hh]andset*", ENV{SOUND_FORM_FACTOR}="handset", GOTO="sound_end"
+
+ENV{ID_MODEL}=="*[Mm]icrophone*", ENV{SOUND_FORM_FACTOR}="microphone", GOTO="sound_end"
+ENV{ID_MODEL_FROM_DATABASE}=="*[Mm]icrophone*", ENV{SOUND_FORM_FACTOR}="microphone", GOTO="sound_end"
+
+LABEL="sound_end"
diff --git a/lib/udev/rules.d/80-drivers.rules b/lib/udev/rules.d/80-drivers.rules
new file mode 100644
index 0000000..cf89735
--- /dev/null
+++ b/lib/udev/rules.d/80-drivers.rules
@@ -0,0 +1,12 @@
+# do not edit this file, it will be overwritten on update
+
+ACTION=="remove", GOTO="drivers_end"
+
+DRIVER!="?*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe -bv $env{MODALIAS}"
+SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="SD", RUN+="/sbin/modprobe -bv tifm_sd"
+SUBSYSTEM=="tifm", ENV{TIFM_CARD_TYPE}=="MS", RUN+="/sbin/modprobe -bv tifm_ms"
+SUBSYSTEM=="memstick", RUN+="/sbin/modprobe -bv --all ms_block mspro_block"
+SUBSYSTEM=="i2o", RUN+="/sbin/modprobe -bv i2o_block"
+SUBSYSTEM=="module", KERNEL=="parport_pc", RUN+="/sbin/modprobe -bv ppdev"
+
+LABEL="drivers_end"
diff --git a/lib/udev/rules.d/95-keyboard-force-release.rules b/lib/udev/rules.d/95-keyboard-force-release.rules
new file mode 100644
index 0000000..63cf67f
--- /dev/null
+++ b/lib/udev/rules.d/95-keyboard-force-release.rules
@@ -0,0 +1,53 @@
+# Set model specific atkbd force_release quirk
+#
+# Several laptops have hotkeys which don't generate release events,
+# which can cause problems with software key repeat.
+# The atkbd driver has a quirk handler for generating synthetic
+# release events, which can be configured via sysfs since 2.6.32.
+# Simply add a file with a list of scancodes for your laptop model
+# in /lib/udev/keymaps, and add a rule here.
+# If the hotkeys also need a keymap assignment you can copy the
+# scancodes from the keymap file, otherwise you can run
+# /lib/udev/keymap -i /dev/input/eventX
+# on a Linux vt to find out.
+
+ACTION=="remove", GOTO="force_release_end"
+SUBSYSTEM!="serio", GOTO="force_release_end"
+KERNEL!="serio*", GOTO="force_release_end"
+DRIVER!="atkbd", GOTO="force_release_end"
+
+ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}"
+
+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", RUN+="keyboard-force-release.sh $devpath samsung-other"
+
+ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Studio 1557|Studio 1558", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+ENV{DMI_VENDOR}=="Dell Inc.", ATTR{[dmi/id]product_name}=="Latitude E*|Precision M*", RUN+="keyboard-force-release.sh $devpath dell-touchpad"
+
+ENV{DMI_VENDOR}=="FUJITSU SIEMENS", ATTR{[dmi/id]product_name}=="AMILO Si 1848+u|AMILO Xi 2428", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+ENV{DMI_VENDOR}=="FOXCONN", ATTR{[dmi/id]product_name}=="QBOOK", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+ENV{DMI_VENDOR}=="MTC", ATTR{[dmi/id]product_version}=="A0", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+ENV{DMI_VENDOR}=="PEGATRON CORP.", ATTR{[dmi/id]product_name}=="Spring Peak", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite [uU]300*|Satellite Pro [uU]300*|Satellite [uU]305*|SATELLITE [uU]500*", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+ENV{DMI_VENDOR}=="Viooo Corporation", ATTR{[dmi/id]product_name}=="PT17", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+# These are all the HP laptops that setup a touchpad toggle key
+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[pP][aA][vV][iI][lL][iI][oO][nN]*", RUN+="keyboard-force-release.sh $devpath hp-other"
+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*", RUN+="keyboard-force-release.sh $devpath hp-other"
+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*|HP G60 Notebook PC", RUN+="keyboard-force-release.sh $devpath hp-other"
+
+ENV{DMI_VENDOR}=="Zepto", ATTR{[dmi/id]product_name}=="Znote 6615WD", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+ENV{DMI_VENDOR}=="Zepto", ATTR{[dmi/id]product_name}=="Znote", ATTR{[dmi/id]product_version}=="6625WD", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+ENV{DMI_VENDOR}=="HANNspree", ATTR{[dmi/id]product_name}=="SN10E100", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+ENV{DMI_VENDOR}=="GIGABYTE", ATTR{[dmi/id]product_name}=="i1520M", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+ENV{DMI_VENDOR}=="BenQ", ATTR{[dmi/id]product_name}=="*nScreen*", RUN+="keyboard-force-release.sh $devpath common-volume-keys"
+
+LABEL="force_release_end"
diff --git a/lib/udev/rules.d/95-keymap.rules b/lib/udev/rules.d/95-keymap.rules
new file mode 100644
index 0000000..7c2f88c
--- /dev/null
+++ b/lib/udev/rules.d/95-keymap.rules
@@ -0,0 +1,164 @@
+# Set model specific hotkey keycodes.
+#
+# Key map overrides can be specified by either giving scancode/keyname pairs
+# directly as keymap arguments (if there are just one or two to change), or as
+# a file name (in /lib/udev/keymaps), which has to contain scancode/keyname
+# pairs.
+
+ACTION=="remove", GOTO="keyboard_end"
+KERNEL!="event*", GOTO="keyboard_end"
+ENV{ID_INPUT_KEY}=="", GOTO="keyboard_end"
+SUBSYSTEMS=="bluetooth", GOTO="keyboard_end"
+
+SUBSYSTEMS=="usb", IMPORT{builtin}="usb_id"
+SUBSYSTEMS=="usb", GOTO="keyboard_usbcheck"
+GOTO="keyboard_modulecheck"
+
+#
+# The following are external USB keyboards
+#
+
+LABEL="keyboard_usbcheck"
+
+ENV{ID_VENDOR}=="Genius", ENV{ID_MODEL_ID}=="0708", ENV{ID_USB_INTERFACE_NUM}=="01", RUN+="keymap $name genius-slimstar-320"
+ENV{ID_VENDOR}=="Logitech*", ATTRS{name}=="Logitech USB Multimedia Keyboard", RUN+="keymap $name logitech-wave"
+ENV{ID_VENDOR}=="Logitech*", ATTRS{name}=="Logitech USB Receiver", RUN+="keymap $name logitech-wave-cordless"
+# Logitech Cordless Wave Pro looks slightly weird; some hotkeys are coming through the mouse interface
+ENV{ID_VENDOR_ID}=="046d", ENV{ID_MODEL_ID}=="c52[9b]", ATTRS{name}=="Logitech USB Receiver", RUN+="keymap $name logitech-wave-pro-cordless"
+
+ENV{ID_VENDOR}=="Lite-On_Technology_Corp*", ATTRS{name}=="Lite-On Technology Corp. ThinkPad USB Keyboard with TrackPoint", RUN+="keymap $name lenovo-thinkpad-usb-keyboard-trackpoint"
+ENV{ID_VENDOR_ID}=="04b3", ENV{ID_MODEL_ID}=="301[89]", RUN+="keymap $name ibm-thinkpad-usb-keyboard-trackpoint"
+
+ENV{ID_VENDOR}=="Microsoft", ENV{ID_MODEL_ID}=="00db", RUN+="keymap $name 0xc022d zoomin 0xc022e zoomout"
+
+GOTO="keyboard_end"
+
+#
+# The following are exposed as separate input devices with low key codes, thus
+# we need to check their input device product name
+#
+
+LABEL="keyboard_modulecheck"
+
+ENV{DMI_VENDOR}="$attr{[dmi/id]sys_vendor}"
+ENV{DMI_VENDOR}=="", GOTO="keyboard_end"
+
+ENV{DMI_VENDOR}=="LENOVO*", KERNELS=="input*", ATTRS{name}=="ThinkPad Extra Buttons", RUN+="keymap $name module-lenovo"
+ENV{DMI_VENDOR}=="LENOVO*", KERNELS=="input*", ATTRS{name}=="Lenovo ThinkPad SL Series extra buttons", RUN+="keymap $name 0x0E bluetooth"
+
+ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Asus Extra Buttons", ATTR{[dmi/id]product_name}=="W3J", RUN+="keymap $name module-asus-w3j"
+ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Eee PC WMI hotkeys|Asus Laptop Support|Asus*WMI*", RUN+="keymap $name 0x6B f21"
+ENV{DMI_VENDOR}=="ASUS*", KERNELS=="input*", ATTRS{name}=="Eee PC Hotkey Driver", RUN+="keymap $name 0x37 f21"
+
+ENV{DMI_VENDOR}=="IBM*", KERNELS=="input*", ATTRS{name}=="ThinkPad Extra Buttons", RUN+="keymap $name module-ibm"
+ENV{DMI_VENDOR}=="Sony*", KERNELS=="input*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony"
+ENV{DMI_VENDOR}=="Acer*", KERNELS=="input*", ATTRS{name}=="Acer WMI hotkeys", RUN+="keymap $name 0x82 f21"
+ENV{DMI_VENDOR}=="MICRO-STAR*|Micro-Star*", KERNELS=="input*", ATTRS{name}=="MSI Laptop hotkeys", RUN+="keymap $name 0x213 f22 0x214 f23"
+
+# Older Vaios have some different keys
+ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="*PCG-C1*|*PCG-K25*|*PCG-F1*|*PCG-F2*|*PCG-F3*|*PCG-F4*|*PCG-F5*|*PCG-F6*|*PCG-FX*|*PCG-FRV*|*PCG-GR*|*PCG-TR*|*PCG-NV*|*PCG-Z*|*VGN-S360*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-old"
+
+# Some Sony VGN models have yet another one
+ENV{DMI_VENDOR}=="Sony*", ATTR{[dmi/id]product_name}=="VGN-AR71*|VGN-FW*|VGN-Z21*", ATTRS{name}=="Sony Vaio Keys", RUN+="keymap $name module-sony-vgn"
+
+
+#
+# The following rules belong to standard i8042 AT keyboard with high key codes.
+#
+
+DRIVERS=="atkbd", GOTO="keyboard_vendorcheck"
+GOTO="keyboard_end"
+
+LABEL="keyboard_vendorcheck"
+
+ENV{DMI_VENDOR}=="Dell*", RUN+="keymap $name dell"
+ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Inspiron 910|Inspiron 1010|Inspiron 1011|Inspiron 1012|Inspiron 1110|Inspiron 1210", RUN+="keymap $name 0x84 wlan"
+ENV{DMI_VENDOR}=="Dell*", ATTR{[dmi/id]product_name}=="Latitude XT2", RUN+="keymap $name dell-latitude-xt2"
+
+ENV{DMI_VENDOR}=="Compaq*", ATTR{[dmi/id]product_name}=="*E500*|*Evo N*", RUN+="keymap $name compaq-e_evo"
+
+ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*3000*", RUN+="keymap $name lenovo-3000"
+ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X6*", ATTR{[dmi/id]product_version}=="* Tablet", RUN+="keymap $name lenovo-thinkpad_x6_tablet"
+ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="ThinkPad X20* Tablet*", ATTR{[dmi/id]product_version}=="* Tablet", RUN+="keymap $name lenovo-thinkpad_x200_tablet"
+ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_version}=="*IdeaPad*", RUN+="keymap $name lenovo-ideapad"
+ENV{DMI_VENDOR}=="LENOVO*", ATTR{[dmi/id]product_name}=="S10-*", RUN+="keymap $name lenovo-ideapad"
+ENV{DMI_VENDOR}=="LENOVO", ATTR{[dmi/id]product_version}=="*IdeaPad Y550*", RUN+="keymap $name 0x95 media 0xA3 play"
+
+ENV{DMI_VENDOR}=="Hewlett-Packard*", RUN+="keymap $name hewlett-packard"
+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][aA][bB][lL][eE][tT]*", RUN+="keymap $name hewlett-packard-tablet"
+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[pP][aA][vV][iI][lL][iI][oO][nN]*", RUN+="keymap $name hewlett-packard-pavilion"
+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*Compaq*|*EliteBook*|*2230s*", RUN+="keymap $name hewlett-packard-compaq_elitebook"
+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*2510p*|*2530p*|HP G60 Notebook PC", RUN+="keymap $name hewlett-packard-2510p_2530p"
+ENV{DMI_VENDOR}=="Hewlett-Packard*", ATTR{[dmi/id]product_name}=="*[tT][xX]2*", RUN+="keymap $name hewlett-packard-tx2"
+ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="Presario 2100*", RUN+="keymap $name hewlett-packard-presario-2100"
+ENV{DMI_VENDOR}=="Hewlett-Packard", ATTR{[dmi/id]product_name}=="HP G62 Notebook PC", RUN+="keymap $name 0xB2 www"
+# HP Pavillion dv6315ea has empty DMI_VENDOR
+ATTR{[dmi/id]board_vendor}=="Quanta", ATTR{[dmi/id]board_name}=="30B7", ATTR{[dmi/id]board_version}=="65.2B", RUN+="keymap $name 0x88 media" # "quick play
+
+# Gateway clone of Acer Aspire One AOA110/AOA150
+ENV{DMI_VENDOR}=="Gateway*", ATTR{[dmi/id]product_name}=="*AOA1*", RUN+="keymap $name acer"
+
+ENV{DMI_VENDOR}=="Acer*", RUN+="keymap $name acer"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Extensa*", ATTR{[dmi/id]product_name}=="*5210*|*5220*|*5610*|*5620*|*5720*", RUN+="keymap $name 0xEE screenlock"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*C3[01]0*", RUN+="keymap $name acer-travelmate_c300"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*6292*|TravelMate*8471*|TravelMate*4720*|TravelMate*7720*|Aspire 1810T*|AO751h|AO531h", RUN+="keymap $name 0xD9 bluetooth"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate*4720*", RUN+="keymap $name 0xB2 www 0xEE screenlock"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="TravelMate 6593|Aspire 1640", RUN+="keymap $name 0xB2 www 0xEE screenlock"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 6920", RUN+="keymap $name acer-aspire_6920"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5920G", RUN+="keymap $name acer-aspire_5920g"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 5720*", RUN+="keymap $name acer-aspire_5720"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_name}=="Aspire 8930", RUN+="keymap $name acer-aspire_8930"
+ENV{DMI_VENDOR}=="Acer*", ATTR{[dmi/id]product_serial}=="ZG8*", RUN+="keymap $name acer-aspire_5720"
+
+ENV{DMI_VENDOR}=="*BenQ*", ATTR{[dmi/id]product_name}=="*Joybook R22*", RUN+="keymap $name 0x6E wlan"
+
+ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*AMILO Pro V3205*", RUN+="keymap $name fujitsu-amilo_pro_v3205"
+ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*AMILO Pa 2548*", RUN+="keymap $name fujitsu-amilo_pa_2548"
+ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*ESPRIMO Mobile V5*", RUN+="keymap $name fujitsu-esprimo_mobile_v5"
+ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*ESPRIMO Mobile V6*", RUN+="keymap $name fujitsu-esprimo_mobile_v6"
+ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*AMILO Pro Edition V3505*", RUN+="keymap $name fujitsu-amilo_pro_edition_v3505"
+ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="*Amilo Si 1520*", RUN+="keymap $name fujitsu-amilo_si_1520"
+ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="AMILO*M*", RUN+="keymap $name 0x97 prog2 0x9F prog1"
+ENV{DMI_VENDOR}=="FUJITSU*", ATTR{[dmi/id]product_name}=="Amilo Li 1718", RUN+="keymap $name 0xD6 wlan"
+
+ENV{DMI_VENDOR}=="LG*", ATTR{[dmi/id]product_name}=="*X110*", RUN+="keymap $name lg-x110"
+
+ENV{DMI_VENDOR}=="MEDION*", ATTR{[dmi/id]product_name}=="*FID2060*", RUN+="keymap $name medion-fid2060"
+ENV{DMI_VENDOR}=="MEDIONNB", ATTR{[dmi/id]product_name}=="A555*", RUN+="keymap $name medionnb-a555"
+
+ENV{DMI_VENDOR}=="MICRO-STAR*|Micro-Star*", RUN+="keymap $name micro-star"
+
+# some MSI models generate ACPI/input events on the LNXVIDEO input devices,
+# plus some extra synthesized ones on atkbd as an echo of actually changing the
+# brightness; so ignore those atkbd ones, to avoid loops
+ENV{DMI_VENDOR}=="MICRO-STAR*", ATTR{[dmi/id]product_name}=="*U-100*|*U100*|*N033", RUN+="keymap $name 0xF7 reserved 0xF8 reserved"
+
+ENV{DMI_VENDOR}=="INVENTEC", ATTR{[dmi/id]product_name}=="SYMPHONY 6.0/7.0", RUN+="keymap $name inventec-symphony_6.0_7.0"
+
+ENV{DMI_VENDOR}=="MAXDATA", ATTR{[dmi/id]product_name}=="Pro 7000*", RUN+="keymap $name maxdata-pro_7000"
+
+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", RUN+="keymap $name samsung-other"
+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="*SX20S*", RUN+="keymap $name samsung-sx20s"
+ENV{DMI_VENDOR}=="[sS][aA][mM][sS][uU][nN][gG]*", ATTR{[dmi/id]product_name}=="SQ1US", RUN+="keymap $name samsung-sq1us"
+
+ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="SATELLITE A100", RUN+="keymap $name toshiba-satellite_a100"
+ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite A110", RUN+="keymap $name toshiba-satellite_a110"
+ENV{DMI_VENDOR}=="TOSHIBA", ATTR{[dmi/id]product_name}=="Satellite M30X", RUN+="keymap $name toshiba-satellite_m30x"
+
+ENV{DMI_VENDOR}=="OQO Inc.*", ATTR{[dmi/id]product_name}=="OQO Model 2*", RUN+="keymap $name oqo-model2"
+
+ENV{DMI_VENDOR}=="ONKYO CORPORATION", ATTR{[dmi/id]product_name}=="ONKYOPC", RUN+="keymap $name onkyo"
+
+ENV{DMI_VENDOR}=="ASUS", RUN+="keymap $name asus"
+
+ENV{DMI_VENDOR}=="VIA", ATTR{[dmi/id]product_name}=="K8N800", ATTR{[dmi/id]product_version}=="VT8204B", RUN+="keymap $name 0x81 prog1"
+
+ENV{DMI_VENDOR}=="Zepto", ATTR{[dmi/id]product_name}=="Znote", ATTR{[dmi/id]product_version}=="62*|63*", RUN+="keymap $name zepto-znote"
+
+ENV{DMI_VENDOR}=="Everex", ATTR{[dmi/id]product_name}=="XT5000*", RUN+="keymap $name everex-xt5000"
+
+ENV{DMI_VENDOR}=="COMPAL", ATTR{[dmi/id]product_name}=="HEL80I", RUN+="keymap $name 0x84 wlan"
+
+ENV{DMI_VENDOR}=="OLPC", ATTR{[dmi/id]product_name}=="XO", RUN+="keymap $name olpc-xo"
+
+LABEL="keyboard_end"
diff --git a/lib/udev/rules.d/95-udev-late.rules b/lib/udev/rules.d/95-udev-late.rules
new file mode 100644
index 0000000..eca0faa
--- /dev/null
+++ b/lib/udev/rules.d/95-udev-late.rules
@@ -0,0 +1,4 @@
+# do not edit this file, it will be overwritten on update
+
+# run a command on remove events
+ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}"
diff --git a/lib/udev/scsi_id b/lib/udev/scsi_id
new file mode 100755
index 0000000..9ffcdc3
--- /dev/null
+++ b/lib/udev/scsi_id
Binary files differ
diff --git a/lib/udev/udevd b/lib/udev/udevd
new file mode 100755
index 0000000..2110303
--- /dev/null
+++ b/lib/udev/udevd
Binary files differ
diff --git a/lib/udev/usb-db b/lib/udev/usb-db
new file mode 100755
index 0000000..9bd66c1
--- /dev/null
+++ b/lib/udev/usb-db
Binary files differ
diff --git a/lib/udev/v4l_id b/lib/udev/v4l_id
new file mode 100755
index 0000000..3137f3d
--- /dev/null
+++ b/lib/udev/v4l_id
Binary files differ
diff --git a/lib/udev/write_cd_rules b/lib/udev/write_cd_rules
new file mode 100755
index 0000000..00382ad
--- /dev/null
+++ b/lib/udev/write_cd_rules
@@ -0,0 +1,127 @@
+#!/bin/sh -e
+
+# This script is run if an optical drive lacks a rule for persistent naming.
+#
+# It adds symlinks for optical drives based on the device class determined
+# by cdrom_id and used ID_PATH to identify the device.
+
+# (C) 2006 Marco d'Itri <md@Linux.IT>
+#
+# 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, either version 2 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# debug, if UDEV_LOG=<debug>
+if [ -n "$UDEV_LOG" ]; then
+	if [ "$UDEV_LOG" -ge 7 ]; then
+		set -x
+	fi
+fi
+
+RULES_FILE="/etc/udev/rules.d/70-persistent-cd.rules"
+
+. /lib/udev/rule_generator.functions
+
+find_next_available() {
+	raw_find_next_available "$(find_all_rules 'SYMLINK\+=' "$1")"
+}
+
+write_rule() {
+	local match="$1"
+	local link="$2"
+	local comment="$3"
+
+	{
+	if [ "$PRINT_HEADER" ]; then
+		PRINT_HEADER=
+		echo "# This file was automatically generated by the $0"
+		echo "# program, run by the cd-aliases-generator.rules rules file."
+		echo "#"
+		echo "# You can modify it, as long as you keep each rule on a single"
+		echo "# line, and set the \$GENERATED variable."
+		echo ""
+	fi
+
+	[ "$comment" ] && echo "# $comment"
+	echo "$match, SYMLINK+=\"$link\", ENV{GENERATED}=\"1\""
+	} >> $RULES_FILE
+	SYMLINKS="$SYMLINKS $link"
+}
+
+if [ -z "$DEVPATH" ]; then
+	echo "Missing \$DEVPATH." >&2
+	exit 1
+fi
+if [ -z "$ID_CDROM" ]; then
+	echo "$DEVPATH is not a CD reader." >&2
+	exit 1
+fi
+
+if [ "$1" ]; then
+	METHOD="$1"
+else
+	METHOD='by-path'
+fi
+
+case "$METHOD" in
+	by-path)
+	if [ -z "$ID_PATH" ]; then
+		echo "$DEVPATH not supported by path_id. by-id may work." >&2
+		exit 1
+	fi
+	RULE="ENV{ID_PATH}==\"$ID_PATH\""
+	;;
+
+	by-id)
+	if [ "$ID_SERIAL" ]; then
+		RULE="ENV{ID_SERIAL}==\"$ID_SERIAL\""
+	elif [ "$ID_MODEL" -a "$ID_REVISION" ]; then
+		RULE="ENV{ID_MODEL}==\"$ID_MODEL\", ENV{ID_REVISION}==\"$ID_REVISION\""
+	else
+		echo "$DEVPATH not supported by ata_id. by-path may work." >&2
+		exit 1
+	fi
+	;;
+
+	*)
+	echo "Invalid argument (must be either by-path or by-id)." >&2
+	exit 1
+	;;
+esac
+
+# Prevent concurrent processes from modifying the file at the same time.
+lock_rules_file
+
+# Check if the rules file is writeable.
+choose_rules_file
+
+link_num=$(find_next_available 'cdrom[0-9]*')
+
+match="SUBSYSTEM==\"block\", ENV{ID_CDROM}==\"?*\", $RULE"
+
+comment="$ID_MODEL ($ID_PATH)"
+
+	write_rule "$match" "cdrom$link_num" "$comment"
+[ "$ID_CDROM_CD_R" -o "$ID_CDROM_CD_RW" ] && \
+	write_rule "$match" "cdrw$link_num"
+[ "$ID_CDROM_DVD" ] && \
+	write_rule "$match" "dvd$link_num"
+[ "$ID_CDROM_DVD_R" -o "$ID_CDROM_DVD_RW" -o "$ID_CDROM_DVD_RAM" ] && \
+	write_rule "$match" "dvdrw$link_num"
+echo >> $RULES_FILE
+
+unlock_rules_file
+
+echo $SYMLINKS
+
+exit 0
+
diff --git a/lib/udev/write_net_rules b/lib/udev/write_net_rules
new file mode 100755
index 0000000..4379792
--- /dev/null
+++ b/lib/udev/write_net_rules
@@ -0,0 +1,141 @@
+#!/bin/sh -e
+
+# This script is run to create persistent network device naming rules
+# based on properties of the device.
+# If the interface needs to be renamed, INTERFACE_NEW=<name> will be printed
+# on stdout to allow udev to IMPORT it.
+
+# variables used to communicate:
+#   MATCHADDR             MAC address used for the match
+#   MATCHID               bus_id used for the match
+#   MATCHDEVID            dev_id used for the match
+#   MATCHDRV              driver name used for the match
+#   MATCHIFTYPE           interface type match
+#   COMMENT               comment to add to the generated rule
+#   INTERFACE_NAME        requested name supplied by external tool
+#   INTERFACE_NEW         new interface name returned by rule writer
+
+# Copyright (C) 2006 Marco d'Itri <md@Linux.IT>
+# Copyright (C) 2007 Kay Sievers <kay.sievers@vrfy.org>
+#
+# 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, either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# debug, if UDEV_LOG=<debug>
+if [ -n "$UDEV_LOG" ]; then
+	if [ "$UDEV_LOG" -ge 7 ]; then
+		set -x
+	fi
+fi
+
+RULES_FILE='/etc/udev/rules.d/70-persistent-net.rules'
+
+. /lib/udev/rule_generator.functions
+
+interface_name_taken() {
+	local value="$(find_all_rules 'NAME=' $INTERFACE)"
+	if [ "$value" ]; then
+		return 0
+	else
+		return 1
+	fi
+}
+
+find_next_available() {
+	raw_find_next_available "$(find_all_rules 'NAME=' "$1")"
+}
+
+write_rule() {
+	local match="$1"
+	local name="$2"
+	local comment="$3"
+
+	{
+	if [ "$PRINT_HEADER" ]; then
+		PRINT_HEADER=
+		echo "# This file was automatically generated by the $0"
+		echo "# program, run by the persistent-net-generator.rules rules file."
+		echo "#"
+		echo "# You can modify it, as long as you keep each rule on a single"
+		echo "# line, and change only the value of the NAME= key."
+	fi
+
+	echo ""
+	[ "$comment" ] && echo "# $comment"
+	echo "SUBSYSTEM==\"net\", ACTION==\"add\"$match, NAME=\"$name\""
+	} >> $RULES_FILE
+}
+
+if [ -z "$INTERFACE" ]; then
+	echo "missing \$INTERFACE" >&2
+	exit 1
+fi
+
+# Prevent concurrent processes from modifying the file at the same time.
+lock_rules_file
+
+# Check if the rules file is writeable.
+choose_rules_file
+
+# the DRIVERS key is needed to not match bridges and VLAN sub-interfaces
+if [ "$MATCHADDR" ]; then
+	match="$match, DRIVERS==\"?*\", ATTR{address}==\"$MATCHADDR\""
+fi
+
+if [ "$MATCHDRV" ]; then
+	match="$match, DRIVERS==\"$MATCHDRV\""
+fi
+
+if [ "$MATCHDEVID" ]; then
+	match="$match, ATTR{dev_id}==\"$MATCHDEVID\""
+fi
+
+if [ "$MATCHID" ]; then
+	match="$match, KERNELS==\"$MATCHID\""
+fi
+
+if [ "$MATCHIFTYPE" ]; then
+	match="$match, ATTR{type}==\"$MATCHIFTYPE\""
+fi
+
+if [ -z "$match" ]; then
+	echo "missing valid match" >&2
+	unlock_rules_file
+	exit 1
+fi
+
+basename=${INTERFACE%%[0-9]*}
+match="$match, KERNEL==\"$basename*\""
+
+if [ "$INTERFACE_NAME" ]; then
+	# external tools may request a custom name
+	COMMENT="$COMMENT (custom name provided by external tool)"
+	if [ "$INTERFACE_NAME" != "$INTERFACE" ]; then
+		INTERFACE=$INTERFACE_NAME;
+		echo "INTERFACE_NEW=$INTERFACE"
+	fi
+else
+	# if a rule using the current name already exists, find a new name
+	if interface_name_taken; then
+		INTERFACE="$basename$(find_next_available "$basename[0-9]*")"
+		# prevent INTERFACE from being "eth" instead of "eth0"
+		[ "$INTERFACE" = "${INTERFACE%%[ \[\]0-9]*}" ] && INTERFACE=${INTERFACE}0
+		echo "INTERFACE_NEW=$INTERFACE"
+	fi
+fi
+
+write_rule "$match" "$INTERFACE" "$COMMENT"
+
+unlock_rules_file
+
+exit 0
diff --git a/run b/run
new file mode 120000
index 0000000..1c2f433
--- /dev/null
+++ b/run
@@ -0,0 +1 @@
+tmp
\ No newline at end of file
diff --git a/usr/lib/libgudev-1.0.so.0 b/usr/lib/libgudev-1.0.so.0
new file mode 120000
index 0000000..83148bc
--- /dev/null
+++ b/usr/lib/libgudev-1.0.so.0
@@ -0,0 +1 @@
+libgudev-1.0.so.0.1.1
\ No newline at end of file
diff --git a/usr/lib/libgudev-1.0.so.0.1.1 b/usr/lib/libgudev-1.0.so.0.1.1
new file mode 100755
index 0000000..a8392e4
--- /dev/null
+++ b/usr/lib/libgudev-1.0.so.0.1.1
Binary files differ
diff --git a/usr/lib/libudev.so.0 b/usr/lib/libudev.so.0
new file mode 120000
index 0000000..a57a1aa
--- /dev/null
+++ b/usr/lib/libudev.so.0
@@ -0,0 +1 @@
+libudev.so.0.13.0
\ No newline at end of file
diff --git a/usr/lib/libudev.so.0.13.0 b/usr/lib/libudev.so.0.13.0
new file mode 100755
index 0000000..5646957
--- /dev/null
+++ b/usr/lib/libudev.so.0.13.0
Binary files differ
diff --git a/usr/sbin/udevadm b/usr/sbin/udevadm
new file mode 100755
index 0000000..0d46294
--- /dev/null
+++ b/usr/sbin/udevadm
Binary files differ