summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas N. Ferreira <lnf07@c3sl.ufpr.br>2010-08-16 19:23:14 -0300
committerLucas N. Ferreira <lnf07@c3sl.ufpr.br>2010-08-16 19:23:14 -0300
commit4391052abfbfc8a004947f43be62a61f0e2913f8 (patch)
treea90dafaf0de28e6568daf14521e79a55986283e1
parentac9b50db1fa87028ecaca579608ac7bb3f461284 (diff)
Documentaion and .deb files for dependencies.
-rw-r--r--COPYING19
-rw-r--r--INSTALL190
-rw-r--r--README27
-rw-r--r--TODO2
-rw-r--r--dependencies/Ubuntu/consolekit_0.4.1-3ubuntu1_i386.debbin0 -> 108616 bytes
-rw-r--r--dependencies/Ubuntu/gdm_2.30.0-0ubuntu5_i386.debbin0 -> 1905854 bytes
-rw-r--r--etc/ConsoleKit/displays.d/usbseat.display2
-rw-r--r--etc/ConsoleKit/seats.d/00-primary.seat6
-rw-r--r--etc/ConsoleKit/sessions.d/usbseat.session6
-rw-r--r--etc/X11/xorg.conf.usbseat9
-rw-r--r--etc/modprobe.d/fbcon.conf4
-rwxr-xr-xinstall.sh27
-rwxr-xr-xsrc/seat-id20
-rwxr-xr-xsrc/usbseat.sh38
-rw-r--r--udev/50-usbseat.rules11
15 files changed, 317 insertions, 44 deletions
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..35298aa
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,19 @@
+Copyright (c) 2010 Lucas Nascimento Ferreira
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..ce944d2
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,190 @@
+Software Requirements
+=====================
+
+Before installing, please verity that you have the following programs
+installed:
+
+ - Xorg 1.8
+ http://cgit.freedesktop.org/xorg/xserver/
+
+ - ConsoleKit (multi-seat branch)
+ http://cgit.freedesktop.org/ConsoleKit/commit/?h=multi-seat
+
+ - GDM (display-configuration branch)
+ http://git.gnome.org/browse/gdm/log/?h=display-configuration
+
+ - git
+ Install using this command at a terminal: sudo apt-get install git-core
+
+Ubuntu Instalation
+==================
+
+For an easier installation upgrade your operating system to Ubuntu 10.10. Now
+Ubuntu 10.10 is at Alpha 3 edition. This version of Ubuntu is available to
+download here:
+
+ http://cdimage.ubuntu.com/releases/maverick/alpha-3/
+
+Ubuntu 10.10 already comes with Xorg 1.8, so is necessary to install gdm and
+ConsoleKit. For Ubuntu (intel x86) is available .deb packages. So just follow
+the tutorial below to install those software and the usbseat solution:
+
+- Download and Install DisplayLink FrameBuffer Driver:
+
+ $ git clone http://git.plugable.com/webdav/udlfb/
+ $ cd udlfb
+ $ make
+ $ sudo make install
+ $ sudo depmod -a
+
+ Now, when you plug in a DisplayLink device, you should see a “green screen” as
+ the driver successfully loads and sets the graphics mode to match your
+ monitor.
+
+- Download and Install fbdev Xserver Driver:
+
+ $ sudo apt-get install pkg-config xorg-dev
+ $ git clone http://git.plugable.com/webdav/xf86-video-fbdev
+ $ cd xf-video-fbdev
+ $ ./configure
+ $ make
+ $ sudo make install
+
+- Install usbseat solution and it dependencies:
+
+ $ git clone git://anongit.freedesktop.org/~lucasferreira/usbseat
+ $ cd usbseat
+ $ dpkg -i dependencies/Ubuntu/*.deb
+ $ ./install.sh
+
+
+Other Distros (Debian Based)
+============================
+
+It can be done compiling those software from git repository. Follow the tutorial
+below to install them:
+
+First of all, become root user:
+
+$ sudo su
+
+- Install some dependences packages for compile things:
+
+ Change the repository to download latest packages from Ubuntu Unstable version.
+ Open the file /etc/apt/sources.list and change the lines:
+
+ deb http://br.archive.ubuntu.com/ubuntu/ lucid main restricted
+ deb-src http://br.archive.ubuntu.com/ubuntu/ lucid main restricted
+
+ to
+
+ deb http://br.archive.ubuntu.com/ubuntu/ maverick main restricted
+ deb-src http://br.archive.ubuntu.com/ubuntu/ maverick main restricted
+
+ # apt-get update
+
+ # apt-get install git-core build-essential automake autoconf libtool
+ libpthread-stubs0-dev libx11-dev diffstat libexpat1-dev libxdamage-dev
+ libxext-dev libxfixes-dev libxxf86vm-dev quilt x11proto-damage-dev
+ x11proto-fixes-dev x11proto-gl-dev x11proto-xext-dev gettext
+ x11proto-xf86vidmode-dev xutils-dev libxt-dev libxmu-dev libxi-dev
+ libpixman-1-dev libgcrypt11-dev libpciaccess-dev x11proto-dri2-dev
+ libfreetype6-dev gnome-common dpkg-dev autogen fakeroot pkg-config
+ module-assistant libgl1-mesa-dri libgl1-mesa-dev
+
+- Compile Xorg 1.8 from git using this tutorial. It will install Xorg at
+ /opt/xorg.
+
+- Compile mouse, keyboard and evdev Xserver drivers:
+
+ # git clone git://anongit.freedesktop.org/driver/xf86-input-mouse
+ # cd xf86-input-mouse
+ # ./autogen --prefix=/opt/xorg
+ # make
+ # make install
+
+ # git clone git://anongit.freedesktop.org/driver/xf86-input-keyboard
+ # cd xf86-input-keyboard
+ # ./autogen --prefix=/opt/xorg
+ # make
+ # make install
+
+ # git clone git://anongit.freedesktop.org/driver/xf86-input-evdev
+ # cd xf86-input-evdev
+ # ./autogen --prefix=/opt/xorg
+ # make
+ # make install
+
+- Download and Install xkeyboard configuration:
+
+ # git clone git://anongit.freedesktop.org/xkeyboard-config
+ # cd xkeyboard-config
+ # ./autogen --prefix=/opt/xorg
+ # make
+ # make install
+
+- Download and Install DisplayLink FrameBuffer Driver:
+
+ # module-assistant prepare
+ # git clone http://git.plugable.com/webdav/udlfb/
+ # cd udlfb
+ # make
+ # make install
+ # depmod -a
+
+ Now, when you plug in a DisplayLink device, you should see a “green screen” as
+ the driver successfully loads and sets the graphics mode to match your
+ monitor.
+
+- Download and Install DisplayLink Xserver Driver:
+
+ # git clone http://git.plugable.com/webdav/xf-video-udlfb/
+ # cd xf-video-udlfb
+ # ./configure --prefix=/opt/xorg
+ # make
+ # make install
+
+- Make a link in /opt/xorg/bin to xkbcomp
+
+ # ln -s /usr/bin/xkbcomp /opt/xorg/bin/xkbcomp
+
+- Download gdm (display-configuration branch) from git repository and install
+ it:
+
+ # git clone git://git.gnome.org/gdm -b display-configuration
+ # sudo apt-get build-dep gdm
+ # cd gdm
+ CFLAGS="-g -O2 -g -Wall -O2" CXXFLAGS="-g -O2 -g -Wall -O2" CPPFLAGS=""
+ LDFLAGS="-Wl,-Bsymbolic-functions" ./autogen.sh --build=i486-linux-gnu
+ --prefix=/usr --includedir="\${prefix}/include"
+ --mandir="\${prefix}/share/man" --infodir="\${prefix}/share/info"
+ --sysconfdir=/etc --localstatedir=/var --libexecdir="\${prefix}/lib/gdm"
+ --disable-maintainer-mode --disable-dependency-tracking
+ --disable-silent-rules --srcdir=. --disable-scrollkeeper
+ --with-at-spi-registryd-directory=/usr/lib/at-spi --enable-ipv6=yes
+ --with-incomplete-locales --with-selinux
+ # make
+ # make install
+
+- Download and Install ConsoleKit (multi-seat branch) from git repository:
+
+ # git clone git://anongit.freedesktop.org/ConsoleKit -b multi-seat
+ # cd ConsoleKit
+ # CFLAGS="-g -O2 -g -Wall -O2" CXXFLAGS="-g -O2 -g -Wall -O2"
+ LDFLAGS="-Wl,-Bsymbolic-functions" ./autogen.sh --build=i486-linux-gnu
+ --prefix=/usr --includedir="\${prefix}/include"
+ --mandir="\${prefix}/share/man" --infodir="\${prefix}/share/info"
+ --sysconfdir=/etc --localstatedir=/var
+ --libexecdir="\$(prefix)/lib/ConsoleKit" --disable-maintainer-mode
+ --disable-dependency-tracking --disable-silent-rules --srcdir=.
+ --enable-pam-module --with-pid-file=/var/run/console-kit-daemon.pid
+ # make
+ # make install
+
+- Download and Install udev rules to detect the Dock Stations and a script
+ to name the seats in /dev directory. It also install xorg.conf and
+ ConsoleKit files for two seats.
+
+ # git clone git://anongit.freedesktop.org/~lucasferreira/usbseat
+ # cd usbseat
+ # ./install.sh
diff --git a/README b/README
index 9890162..b9ba156 100644
--- a/README
+++ b/README
@@ -1,5 +1,22 @@
-<<<<<<< HEAD:README
-Lucas Ferreira GSOC 2010 Project
-=======
-Lucas Ferreira GSOC 2010 project
->>>>>>> 2cf2b4363c84d5ab5e2b57ee1698f4df459594e1:README
+ Usbseat
+
+This is a fully plug-and-play multiseat solution that uses the Plugable's
+Docking Station with Video [0]. This solution is based on a USB hierarchy makes
+an controlled environment, and this turns the problem easier to be solved. A USB
+hierarchy is a way of dispose the devices, a set of devices (keyboard, mouse,
+...) are attached in one USB HUB and this HUB is associated to one user, making
+one seat. The Plugable Docking station are more useful to make a USB hierarchy
+because the video is also in the HUB, so the seats are totally separated. This
+kind of solution has some problems: Those USB HUBS must be fully plug-and-play,
+because user doesn't want to manually reconfigure the devices every time a USB
+HUB is detached from the machine.
+
+A USB Multiseat solution based on Plugable HUBS has another advantage, and this
+is the main attraction to end users, the cost/benefit. The USB terminals
+themselves are a significant cost savings over buying even low-costs netbooks.
+The cost of maintaining PCs goes way down, as many terminals share a single
+server. Plug and play nature also provides big savings. This solution is
+perfect to "office user", in other words, those users who only use browsers,
+messengers, text editors and other common applications like these.
+
+[0]: http://plugable.com/products/ud-160-a/
diff --git a/TODO b/TODO
new file mode 100644
index 0000000..814b49b
--- /dev/null
+++ b/TODO
@@ -0,0 +1,2 @@
+- Correct /etc/rc.local script to initialize correctly all the usbseats after
+ the boot.
diff --git a/dependencies/Ubuntu/consolekit_0.4.1-3ubuntu1_i386.deb b/dependencies/Ubuntu/consolekit_0.4.1-3ubuntu1_i386.deb
new file mode 100644
index 0000000..e10abb6
--- /dev/null
+++ b/dependencies/Ubuntu/consolekit_0.4.1-3ubuntu1_i386.deb
Binary files differ
diff --git a/dependencies/Ubuntu/gdm_2.30.0-0ubuntu5_i386.deb b/dependencies/Ubuntu/gdm_2.30.0-0ubuntu5_i386.deb
new file mode 100644
index 0000000..2e045d0
--- /dev/null
+++ b/dependencies/Ubuntu/gdm_2.30.0-0ubuntu5_i386.deb
Binary files differ
diff --git a/etc/ConsoleKit/displays.d/usbseat.display b/etc/ConsoleKit/displays.d/usbseat.display
index 3c8128c..6d495a4 100644
--- a/etc/ConsoleKit/displays.d/usbseat.display
+++ b/etc/ConsoleKit/displays.d/usbseat.display
@@ -2,4 +2,4 @@
Type=X11
[X11]
-Exec=/usr/bin/X -config /tmp/xorg.conf.tmp $display -br -audit 0 -verbose -auth $auth -nolisten tcp
+Exec=/usr/bin/X -config /tmp/xorg.conf.tmp $display -br -audit 0 -verbose -auth $auth -nolisten tcp vt7
diff --git a/etc/ConsoleKit/seats.d/00-primary.seat b/etc/ConsoleKit/seats.d/00-primary.seat
index 8ad10f3..1e55ea0 100644
--- a/etc/ConsoleKit/seats.d/00-primary.seat
+++ b/etc/ConsoleKit/seats.d/00-primary.seat
@@ -1,14 +1,14 @@
-[eat Entry]
+[Seat Entry]
Version=1.0
Name=Primary seat
# Specified Seat ID, if this value is NULL, ConsoleKit will decide one.
# The ID only contain the ASICC characters "[A-Z][a-z][0-9]_"
-ID=StaticSeat1
+ID=PrimarySeat1
Description=start one static local display at :0
# Indicate whether to create this seat or not. If it is set true, then CK will
# not create this seat. Default value is false.
-Hidden=true
+Hidden=false
# Indicate input/output devices including keyboard-pointer-video
# card-monitor-sound-usb devices,
diff --git a/etc/ConsoleKit/sessions.d/usbseat.session b/etc/ConsoleKit/sessions.d/usbseat.session
index f055e7a..4bd4ab5 100644
--- a/etc/ConsoleKit/sessions.d/usbseat.session
+++ b/etc/ConsoleKit/sessions.d/usbseat.session
@@ -1,8 +1,4 @@
[Session Entry]
-Name=Local
Type=LoginWindow
-Description=Local Login Screen
+Description=Usbseat
DisplayTemplate=usbseat
-
-[Local]
-display=:0
diff --git a/etc/X11/xorg.conf.usbseat b/etc/X11/xorg.conf.usbseat
index e3dd78d..68f714c 100644
--- a/etc/X11/xorg.conf.usbseat
+++ b/etc/X11/xorg.conf.usbseat
@@ -17,9 +17,10 @@ Section "Files"
EndSection
Section "Device"
- Identifier "dl"
- driver "displaylink"
- Option "fbdev" "/dev/usbseat/%ID_SEAT%/display"
+ Identifier "dl"
+ driver "fbdev"
+ Option "ReportDamage" "true"
+ Option "fbdev" "/dev/usbseat/%ID_SEAT%/display"
EndSection
Section "InputDevice"
@@ -52,7 +53,7 @@ Section "Screen"
EndSection
Section "ServerLayout"
- Identifier "seat"
+ Identifier "%ID_SEAT%"
Screen 0 "screen" 0 0
InputDevice "keyboard" "CoreKeyboard"
InputDevice "mouse" "CorePointer"
diff --git a/etc/modprobe.d/fbcon.conf b/etc/modprobe.d/fbcon.conf
new file mode 100644
index 0000000..cf644b0
--- /dev/null
+++ b/etc/modprobe.d/fbcon.conf
@@ -0,0 +1,4 @@
+blacklist font
+blacklist tileblit
+blacklist bitblit
+blacklist fbcon
diff --git a/install.sh b/install.sh
index e9028eb..c3d05a3 100755
--- a/install.sh
+++ b/install.sh
@@ -1,10 +1,29 @@
#!/bin/bash
-# Lucas Ferreira
+#Copyright (c) 2010 Lucas Nascimento Ferreira
+#
+#Permission is hereby granted, free of charge, to any person obtaining a copy
+#of this software and associated documentation files (the "Software"), to deal
+#in the Software without restriction, including without limitation the rights
+#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+#copies of the Software, and to permit persons to whom the Software is
+#furnished to do so, subject to the following conditions:
+#
+#The above copyright notice and this permission notice shall be included in
+#all copies or substantial portions of the Software.
+#
+#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+#THE SOFTWARE.
SRC_DIR=/usr/sbin/
UDEV_DIR=/lib/udev/rules.d/
XORG_CONFIG_DIR=/etc/X11/
CONSOLE_KIT_CONFIG_DIR=/etc/ConsoleKit/
+MODPROBE_DIR=/etc/modprobe.d/
echo "Installing scripts"
cp src/seat-id $SRC_DIR
@@ -14,7 +33,11 @@ echo "Installing udev rules for detect the Plugable Dock Stations."
cp udev/50-usbseat.rules $UDEV_DIR
echo "Install Xorg configuration files for two static seats"
-cp -r etc/X11/* $XORG_CONFIG_DIR
+cp etc/X11/xorg.conf.usbseat $XORG_CONFIG_DIR
echo "Configuring ConsoleKit"
cp -r etc/ConsoleKit/* $CONSOLE_KIT_CONFIG_DIR
+
+echo "Adding modules to blacklist"
+cp etc/modprobe.d/fbcon.conf $MODPROBE_DIR
+update-initramfs -u
diff --git a/src/seat-id b/src/seat-id
index 6cfad67..b28cf41 100755
--- a/src/seat-id
+++ b/src/seat-id
@@ -1,5 +1,23 @@
#!/bin/bash
-#Lucas Ferreira
+#Copyright (c) 2010 Lucas Nascimento Ferreira
+
+#Permission is hereby granted, free of charge, to any person obtaining a copy
+#of this software and associated documentation files (the "Software"), to deal
+#in the Software without restriction, including without limitation the rights
+#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+#copies of the Software, and to permit persons to whom the Software is
+#furnished to do so, subject to the following conditions:
+#
+#The above copyright notice and this permission notice shall be included in
+#all copies or substantial portions of the Software.
+#
+#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+#THE SOFTWARE.
SEAT_PATH="/dev/usbseat/"
diff --git a/src/usbseat.sh b/src/usbseat.sh
index b64f4f0..ecf9b98 100755
--- a/src/usbseat.sh
+++ b/src/usbseat.sh
@@ -4,48 +4,40 @@
SEAT_NAME=$1
SEAT_NUMBER=${SEAT_NAME#seat}
+CK_SESSIONS_DIR="/etc/ConsoleKit/sessions.d/"
CK_LIST_SESSION="/usr/bin/ck-list-sessions"
CK_SEAT_TOOL="/usr/sbin/ck-seat-tool"
XORG_CONF_USBSEAT="/etc/X11/xorg.conf.usbseat"
XORG_CONF_TMP="/tmp/xorg.conf.tmp"
-if [[ ! -n `/bin/pidof gdm-binary` ]]; then
+echo "Udev Action: $ACTION" &>> /var/log/usbseat.log
- exit 0
-fi
-
-SEAT_RUNNING=$(ck-list-sessions | grep "seat = '${SEAT_NAME}'")
+if [ "$ACTION" == "remove" ]; then
-echo "UDEV ACTION: $ACTION" >> /var/log/usbseat.log
+ echo "Removing $SEAT_NAME." &>> /var/log/usbseat.log
-# $ACTION environment variable is set by udev subsystem
-if [[ $ACTION == "remove" && -n "$SEAT_RUNNING" ]]; then
+ rm -f /tmp/$SEAT_NAME.lock
- echo "Seat removed, removing session" >> /var/log/usbseat.log
+ SESSION_ID=`$CK_LIST_SESSION -a | grep -B3 usbseat$SEAT_NUMBER | head -n1`
+ $CK_SEAT_TOOL -d --session-id ${SESSION_ID%\:} &>> /var/log/usbseat.log
- $CK_SEAT_TOOL -d --sesion-id Session${SEAT_NUMBER}
+ echo "$SESSION_ID removed." &>> /var/log/usbseat.log
else
- # A device which might be part of a seat has been added
- # if we already have a running seat for this #, exit
- if [[ -n "$SEAT_RUNNING" ]]; then
+ if [ -e /tmp/$SEAT_NAME.lock ]; then
- echo "Seat $SEAT_RUNNING is already running. Does not start it" \
- >> /var/log/usbseat.log
+ echo "${SEAT_NAME} already exists." &>> /var/log/usbseat.log
exit 0
fi
- echo "Starting Seat${SEAT_NUMBER}" >> /var/log/usbseat.log
+ if [[ -e /dev/usbseat/$SEAT_NAME/keyboard && -e /dev/usbseat/$SEAT_NAME/mouse && -e /dev/usbseat/$SEAT_NAME/display ]]; then
- if [[ -e /dev/usbseat/$SEAT_NAME/keyboard && \
- -e /dev/usbseat/$SEAT_NAME/mouse && \
- -e /dev/usbseat/$SEAT_NAME/display ]]; then
+ echo "Starting ${SEAT_NAME}" &>> /var/log/usbseat.log
+ touch /tmp/$SEAT_NAME.lock
# We have a newly complete seat. Start it.
- sed "s/%ID_SEAT%/$SEAT_NAME/g" < $XORG_CONF_USBSEAT \
- > /tmp/xorg.conf.tmp
+ sed "s/%ID_SEAT%/$SEAT_NAME/g" < $XORG_CONF_USBSEAT > $XORG_CONF_TMP
- $CK_SEAT_TOOL -a --session-type usbseat --display-type usbseat \
- --seat-id $SEAT_NAME
+ $CK_SEAT_TOOL -a --session-type usbseat --display-type usbseat --seat-id usbseat$SEAT_NUMBER &>> /var/log/usbseat.log
fi
fi
diff --git a/udev/50-usbseat.rules b/udev/50-usbseat.rules
index e2663e5..537d4b3 100644
--- a/udev/50-usbseat.rules
+++ b/udev/50-usbseat.rules
@@ -20,3 +20,14 @@ PROGRAM="/usr/sbin/seat-id %b",SYMLINK+="usbseat/%c/keyboard",RUN+="/usr/sbin/us
KERNEL=="mouse*", SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="02", \
PROGRAM="/usr/sbin/seat-id %b",SYMLINK+="usbseat/%c/mouse",RUN+="/usr/sbin/usbseat.sh %c"
+
+# remove rules
+ACTION=="remove", KERNEL=="fb*",SUBSYSTEMS=="usb", PROGRAM="/usr/sbin/seat-id %b", RUN+="/usr/sbin/usbseat.sh %c"
+
+ACTION=="remove", KERNEL=="mouse*", SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="02", \
+PROGRAM="/usr/sbin/seat-id %b", RUN+="/usr/sbin/usbseat.sh %c"
+
+ACTION=="remove", KERNEL=="event*", SUBSYSTEM=="input", ATTRS{bInterfaceClass}=="03", ATTRS{bInterfaceProtocol}=="01", \
+PROGRAM="/usr/sbin/seat-id %b", RUN+="/usr/sbin/usbseat.sh %c"
+
+ACTION=="remove", KERNEL=="control*", SUBSYSTEM=="sound", SUBSYSTEMS=="usb", PROGRAM="/usr/sbin/seat-id %b"