<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>udev &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://en.wordpress.com/tag/udev/</link>
	<description>Feed of posts on WordPress.com tagged "udev"</description>
	<pubDate>Sun, 29 Nov 2009 23:27:39 +0000</pubDate>

	<generator>http://en.wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[HowTo: Udev e script in base al dispositivo]]></title>
<link>http://idl3.wordpress.com/2009/10/29/howto-udev-e-script-in-base-al-dispositivo/</link>
<pubDate>Thu, 29 Oct 2009 14:00:58 +0000</pubDate>
<dc:creator>idl3</dc:creator>
<guid>http://idl3.wordpress.com/2009/10/29/howto-udev-e-script-in-base-al-dispositivo/</guid>
<description><![CDATA[Stamattina ho scritto come sia possibile usare le regole di Udev per far si che i dispositivi vengan]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Stamattina ho <a href="http://idl3.wordpress.com/2009/10/29/howto-montare-dispositivo-sempre/">scritto</a> come sia possibile <strong>usare le regole di Udev</strong> per far si che i dispositivi vengano montati in una <strong>directory</strong> piuttosto che in un&#8217;altra a seconda del <strong>dispositivo</strong>. Ora vedremo come aggiungere <strong>regole a Udev</strong> per fargli eseguire un determinato <strong>script</strong> quando si monta una <strong>penna USB</strong> (o quando la si smonta).</p>
<p><img src="http://idl3.wordpress.com/files/2009/10/hd-wd-esterno.jpg?w=150" alt="hd-wd-esterno" title="hd-wd-esterno" width="150" height="150" class="alignleft size-thumbnail wp-image-588" />Prima di tutto dobbiamo ottenere <strong>informazioni sull&#8217;hardware</strong>, quindi diamo questo comando da terminale:<br />
<code># tail -f /var/log/syslog</code><br />
e inseriamo la nostra periferica USB (penna, HD esterno). Otterremo un bel po&#8217; di testo come output, segniamoci il percorso della <em>device</em> (ad esempio <code>/dev/sdb</code>).</p>
<p>Ora che sappiamo <strong>dove trovare la periferica</strong>, possiamo ottenere molte informazioni, facciamolo con questo <strong>comando</strong>:<br />
<code>$ udevinfo -a -p $(udevinfo -q path -n /dev/sdb)</code></p>
<p>Anche in questo caso come output otterremo molte righe di testo, ma tra questi, i dati che ci servono non sono molti, segnateveli, perche&#8217; vi serviranno per scrivere la/e regola/e.</p>
<p>Un file di <strong>regole per Udev</strong> e&#8217; ad esempio questo:</p>
<pre>---8&#60;---
BUS=="scsi", SYSFS{model}=="BLAblabla", KERNEL=="sd?1", NAME="pendatilavoro", OWNER="luca"
SUBSYSTEM=="block", ACTION=="add", RUN+="/etc/udev/dev.d/script/mount.dev"
SUBSYSTEM=="block", ACTION=="remove", RUN+="/etc/udev/dev.d/script/umount.dev"
---8&#60;---</pre>
<p>da salvare <strong>ad esempio</strong> su <code>/etc/udev/rules/10-dam.rules</code> (il numero davanti al nome indica la priorita&#8217; di esecuzione, <strong>piu&#8217; basso e&#8217; il numero prima verra&#8217; eseguita la regola</strong>).</p>
<p>Questo e&#8217; il <strong>significato</strong> dei valori:</p>
<pre>BUS=="scsi" =&#62;                      la penna USB viene riconosciuta come disco scsi
SYSFS{model}=="UMni512MB*IOM2J4" =&#62; un modo per riferirsi a quella specifica penna USB
KERNEL=="sd?1" =&#62;                   la prima partizione della penna
NAME="pendatilavoro" =&#62;                  Udev mettera' la nostra penna nel percorso /dev/pendatilavoro (per la prima partizione)
OWNER="luca" =&#62;                    il percorso /dev/pendatilavoro e' dell'utente luca

SUBSYSTEM=="block", ACTION=="add", RUN+="/etc/udev/dev.d/script/mount.dev" =&#62; quando la periferica viene inserita viene eseguito lo script RUN+="/etc/udev/dev.d/script/mount.dev"

SUBSYSTEM=="block", ACTION=="remove", RUN+="/etc/udev/dev.d/script/umount.dev" =&#62; quando la penna viene estratta viene eseguito lo script RUN+="/etc/udev/dev.d/script/umount.dev"</pre>
<p><img src="http://idl3.wordpress.com/files/2009/09/chiave_chiavetta_penna_usb.jpg?w=150" alt="Penna USB" title="Penna USB" width="150" height="96" class="alignright size-thumbnail wp-image-234" />Aggiungendo <strong>script</strong>, potete ad esempio fare in modo che la penna si <strong>sincronizzi</strong> con una directory del vostro hard disk (potete utilizzare <code>rsync</code>) o quando la inserite, o prima di smontarla. Con <code>rsync</code> il comando e&#8217; una cosa del genere:<br />
<code>$ rsync -a -v --delete /dev/pendatilavoro /home/utente/hddatilavoro</code><br />
quindi con le dovute modifiche fate lo script e inserite il suo percorso nella regola di Udev.</p>
<p>Fonte: <a href="http://dventurin.blogspot.com/2007/04/udev-action-add-remove.html">Udev &#8211; action add &#8211; remove</a></p>
<hr />
<p style="text-align:right;"><a href="#content" title="torna su">[^] torna su</a>&#160;&#124;&#160;<a href="http://postli.com/post?u=http://idl3.wordpress.com/2009/10/29/howto-udev-e-script-in-base-al-dispositivo/&#38;t=HowTo: Udev e script in base al dispositivo" title="Post to Postli" style="color:blue;text-decoration:none;">post<span style="color:orange;">&#60;</span><span style="color:red;">li</span><span style="color:orange;">&#62;</span></a>&#160;&#124;&#160;<a href="http://www.wikio.it/vote?url=http://idl3.wordpress.com/2009/10/29/howto-udev-e-script-in-base-al-dispositivo/" target="_blank"><img src="http://www.wikio.it/shared/img/vote/wikio2.gif" border="0" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[HowTo: montare dispositivo dove voglio]]></title>
<link>http://idl3.wordpress.com/2009/10/29/howto-montare-dispositivo-sempre/</link>
<pubDate>Thu, 29 Oct 2009 06:06:27 +0000</pubDate>
<dc:creator>idl3</dc:creator>
<guid>http://idl3.wordpress.com/2009/10/29/howto-montare-dispositivo-sempre/</guid>
<description><![CDATA[Abbiamo visto qualche tempo fa come montare in automatico i dispositivi USB, in quel caso i disposit]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Abbiamo visto qualche tempo fa come <strong><a href="http://idl3.wordpress.com/2009/10/01/howto-monta-con-linux/">montare in automatico</a> i dispositivi USB</strong>, in quel caso i dispositivi venivano montati in un <strong>percorso casuale</strong>. Insomma, non proprio casuale, veniva montato nella prima directory libera di un elenco (con <code>usbmount</code>). Ma, come faccio a far montare in automatico un determinato dispositivo rimovibile <strong>in una determinata directory</strong>? Mi spiego meglio, se abbiamo due penne USB di diversa marca e un HD USB, come facciamo a fare in modo che la <strong>penna A</strong> venga montata nella <strong>directory A</strong>, la <strong>penna B</strong> nella <strong>directory B</strong> e l&#8217;<strong>HD esterno C</strong> nella <strong>directory C</strong>? Il modo esiste, vediamolo.</p>
<p><img src="http://idl3.wordpress.com/files/2009/09/chiave_chiavetta_penna_usb.jpg?w=150" alt="Penna USB" title="Penna USB" width="150" height="96" class="alignleft size-thumbnail wp-image-234" />Prima di tutto bisogna conoscere qualcosa di <a href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html">udev</a>, sapere come <a href="http://guide.debianizzati.org/index.php/Udev_e_Debian">funziona</a> e come <a href="http://www.reactivated.net/writing_udev_rules.html">scriverne le regole</a>. Ho capito, non ne avete voglia.</p>
<p>Le <strong>regole di udev</strong> si trovano nella directory <code>/etc/udev/rules.d/</code>, meglio non modificare le regole gia&#8217; esistenti, creiamo dunque un <strong>nuovo file</strong>, e siccome le regole vengono lette e processate in ordine alfabetico, il file che andiamo a creare per essere letto per primo lo possiamo nominare:</p>
<pre>00_local.rules</pre>
<p><img src="http://idl3.wordpress.com/files/2009/10/hd-wd-esterno.jpg?w=150" alt="hd-wd-esterno" title="hd-wd-esterno" width="150" height="150" class="alignright size-thumbnail wp-image-588" />Ma prima dobbiamo sapere <strong>come vengono identificati i nostri dispositivi</strong>. Diamo dunque il seguente comando:<br />
<code># tail -f /var/log/messages</code><br />
e inseriamo il dispositivo rimovibile.<br />
Oppure, inseriamo il dispositivo e poi diamo questo comando:<br />
<code>$ dmesg</code><br />
Possiamo subito notare il posizionamento (sda ad esempio), il tipo di prodotto e il modello (ad esempio External HDD e Western Digital).</p>
<p>Ora diamo il comando:<br />
<code>$ udevinfo -a -p /sys/block/sda</code><br />
se il dispositivo non si trova in sda, ma sdb, sdc, o quello che e&#8217;, inserite il percorso giusto. Esce un output piuttosto lungo, ma non spaventatevi, le cose che ci interessano sono tre, annotatevi:</p>
<pre>---8&#60;---
KERNEL=="sda"
---8&#60;---
ATTRS{vendor}=="WD"
---8&#60;---
ATTRS{model}=="5000AAV External"
---8&#60;---</pre>
<p>Queste informazioni sono <strong>sufficienti per creare una regola</strong>. Infatti sono informazioni che possono essere <strong>reperite da udev</strong>, che le puo&#8217; utilizzare per <strong>riconoscere</strong> il dispositivo.</p>
<p>Tutto quello che abbiamo visto fin qui e&#8217; <strong>propedeutico</strong> alla scrittura delle regole. Veniamo ora alla scrittura della/e regola/e. Vogliamo che quando inseriamo il nostro Hard Disk Western Digital, venga montato nella directory <code>/media/hdwd</code>.<br />
Creiamo il nostro file:<br />
<code># nano /etc/udev/rules.d/00_local.rules</code><br />
e aggiungiamoci la regola:</p>
<pre>---8&#60;---
KERNEL=="sda", ATTRS{vendor}=="WD", ATTRS{model}=="5000AAV External", NAME="%k", SYMLINK+="usbhdwd"
ACTION=="add", KERNEL=="sda", ATTRS{vendor}=="WD", ATTRS{model}=="5000AAV External", RUN+="/bin/mkdir /media/hdwd"
ACTION=="add", KERNEL=="sda", ATTRS{vendor}=="WD", ATTRS{model}=="5000AAV External", RUN+="/bin/mount -t vfat -o sync,flush,uid=1000,gid=100 /dev/usbhdwd /media/hdwd"
ACTION=="remove", KERNEL=="sda", ENV{ID_VENDOR}=="WD", ENV{ID_MODEL}="5000AAV_External", RUN+="/bin/umount /media/hdwd"
ACTION=="remove", KERNEL=="sda", ENV{ID_VENDOR}=="WD", ENV{ID_MODEL}="5000AAV_External", RUN+="/bin/rmdir /media/hdwd"
---8&#60;---</pre>
<p>Se fosse un Hard Disk partizionato, allora la regola sarebbe questa:</p>
<pre>---8&#60;---
KERNEL=="sd?1", ATTRS{vendor}=="WD", ATTRS{model}=="5000AAV External", NAME="%k", SYMLINK+="usbhdwd"
ACTION=="add", KERNEL=="sd?1", ATTRS{vendor}=="WD", ATTRS{model}=="5000AAV External", RUN+="/bin/mkdir /media/hdwd"
ACTION=="add", KERNEL=="sd?1", ATTRS{vendor}=="WD", ATTRS{model}=="5000AAV External", RUN+="/bin/mount -t vfat -o sync,flush,uid=1000,gid=100 /dev/usbhdwd /media/hdwd"
ACTION=="remove", KERNEL=="sd?1", ENV{ID_VENDOR}=="WD", ENV{ID_MODEL}="5000AAV_External", RUN+="/bin/umount /media/hdwd"
ACTION=="remove", KERNEL=="sd?1", ENV{ID_VENDOR}=="WD", ENV{ID_MODEL}="5000AAV_External", RUN+="/bin/rmdir /media/hdwd"
---8&#60;---</pre>
<p>Quando scrivete le vostre regole, <strong>state attenti</strong> a inserire i dati che corrispondono al <strong>vostro dispositivo</strong>. Ora potete creare in questo modo anche le <strong>regole per la vostra penna USB</strong> di <em>marca x</em> e per quella di <em>marca y</em>. Questo sistema e&#8217; molto utile quando dovete usare piu&#8217; dispositivi rimovibili contemporaneamente, venendo montati sempre nella stessa posizione, <strong>non rischiate di confondervi</strong> tra un dispositivo e l&#8217;altro.</p>
<hr />
<p style="text-align:right;"><a href="#content" title="torna su">[^] torna su</a>&#160;&#124;&#160;<a href="http://postli.com/post?u=http://idl3.wordpress.com/2009/10/29/howto-montare-dispositivo-sempre/&#38;t=HowTo: montare dispositivo dove voglio" title="Post to Postli" style="color:blue;text-decoration:none;">post<span style="color:orange;">&#60;</span><span style="color:red;">li</span><span style="color:orange;">&#62;</span></a>&#160;&#124;&#160;<a href="http://www.wikio.it/vote?url=http://idl3.wordpress.com/2009/10/29/howto-montare-dispositivo-sempre/" target="_blank"><img src="http://www.wikio.it/shared/img/vote/wikio2.gif" border="0" /></a></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Create /dev/bus_pirate on Linux]]></title>
<link>http://dangerousprototypes.com/2009/10/16/create-devbus_pirate-on-linux/</link>
<pubDate>Fri, 16 Oct 2009 06:32:25 +0000</pubDate>
<dc:creator>Ian</dc:creator>
<guid>http://dangerousprototypes.com/2009/10/16/create-devbus_pirate-on-linux/</guid>
<description><![CDATA[blue.zener demonstrates some handy Linux UDEV foo that assigns the Bus Pirate to /dev/bus_pirate, in]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignnone size-full wp-image-1664" title="slashbp" src="http://wherelabs.wordpress.com/files/2009/10/slashbp.png" alt="slashbp" width="392" height="244" /></p>
<p><a href="http://wiki.countercaster.com/Main_Page">blue.zener</a> demonstrates some <a href="http://wiki.countercaster.com/The_Bus_Pirate_on_Linux:_From_/dev/ttyUSB%3F_to_/dev/bus_pirate">handy Linux UDEV foo</a> that assigns the Bus Pirate to /dev/bus_pirate, instead of the boring /dev/ttyusb. This can be used to give any device a more memorable name under Linux.</p>
<p>Thanks for the tip!</p>
<p>[<a href="http://commons.wikimedia.org/wiki/File:Tux.png">Tux image</a>]</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[FILESYSTEM CHECK FAILED]]></title>
<link>http://mirutalibre.wordpress.com/2009/09/23/filesystem-check-failed/</link>
<pubDate>Thu, 24 Sep 2009 01:19:27 +0000</pubDate>
<dc:creator>zuargo</dc:creator>
<guid>http://mirutalibre.wordpress.com/2009/09/23/filesystem-check-failed/</guid>
<description><![CDATA[Ese fue el error que me dio Archlinux una vez que actualicé el sistema. Lo peor es que  aparecía cua]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p style="text-align:justify;"><a href="http://mirutalibre.wordpress.com/files/2009/09/128px-archlinux-icon-128.png"><img class="alignright size-full wp-image-418" title="Archlinux-icon" src="http://mirutalibre.wordpress.com/files/2009/09/128px-archlinux-icon-128.png" alt="Archlinux-icon" width="128" height="128" /></a>Ese fue el error que me dio Archlinux una vez que actualicé el sistema. Lo peor es que  aparecía cuando iniciaba el computador, dándome las posibilidades de ingresar la clave de root para solucionar el problema o de presionar control+d para reiniciar:</p>
<blockquote>
<p style="text-align:justify;">The superblock could not be read or does not describe a correct ext4<br />
filesystem. If the device is valid and it really contains an ext4<br />
filesystem (and not swap or ufs or something else), then the superblock<br />
is corrupt, and you might try running e2fsck with an alternate superblock:<br />
e2fsck -b 8193</p>
<p style="text-align:justify;">******************* FILESYSTEM CHECK FAILED *************<br />
* Please repair manually and reboot. Note that the root *<br />
* filesystem is currently mounted read-only. To remount *<br />
* it read-write type: mount -n -o remount,rw /          *<br />
* When you exit the mantenance shel the system will     *<br />
* reboot automatically.                                 *<br />
*********************************************************</p>
<p style="text-align:justify;">Give root password for mantenance:</p>
</blockquote>
<p style="text-align:justify;">Obviamente no me quedaba más que reiniciar u.u</p>
<p style="text-align:justify;">Estuve cerca de dos meses con el problemita =/. De cada dos veces que iniciaba el sistema una me mandaba el error u.u. Entonces puse esto en un <a href="http://bbs.archlinux.org/viewtopic.php?pid=623631" target="_blank">tema</a> del <a href="http://bbs.archlinux.org/" target="_blank">foro oficial de archlinux</a> y adivinen qué&#8230; no me ayudaron <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> . Pasó otro mes y pedí que por favor alguien me diera alguna idea para solucionar este asunto, esta vez, por suerte, dos usuarios de la comunidad me ayudaron <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Aquí pongo la solución que funcionó para mi:</p>
<p style="text-align:justify;">Mi fstab (antes de solucionar el problema) era así:</p>
<blockquote><p>#<br />
# /etc/fstab: static file system information<br />
#<br />
#</p>
<p>none                   /dev/pts      devpts    defaults            0      0<br />
none                   /dev/shm      tmpfs     defaults            0      0</p>
<p>#/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0<br />
#/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0<br />
#/dev/fd0               /media/fl   auto    user,noauto             0      0</p>
<p>/dev/sda1 / ext4 defaults 0 1<br />
/dev/sda3 swap swap defaults 0 0<br />
/dev/sda4 /home ext4 defaults 0 1<br />
/dev/sdb1 /home/zuargo/Sata ext4 defaults 0 1</p></blockquote>
<p style="text-align:justify;">Pero debía ser así:</p>
<blockquote><p>#<br />
# /etc/fstab: static file system information<br />
#<br />
#</p>
<p>none                   /dev/pts      devpts    defaults            0      0<br />
none                   /dev/shm      tmpfs     defaults            0      0</p>
<p>#/dev/cdrom             /media/cd   auto    ro,user,noauto,unhide   0      0<br />
#/dev/dvd               /media/dvd  auto    ro,user,noauto,unhide   0      0<br />
#/dev/fd0               /media/fl   auto    user,noauto             0      0</p>
<p>UUID=2727445b-47fa-4ffb-b70d-370a13651a4e / ext4 defaults 0 1<br />
UUID=2222e40b-f06b-496e-bf29-4845a8f4d164 swap swap defaults 0 0<br />
UUID=f4129b69-5944-476f-8db7-668cb5e81679 /home ext4 defaults 0 1<br />
UUID=3a2a074a-ef50-4faa-94e8-b53b3de51508 /home/zuargo/Sata ext4 defaults 0 1</p></blockquote>
<p style="text-align:justify;">¿Notan la diferencia? en vez de decir el nombre de las particiones, es decir, /dev/sda1, /dev/sda2, /dev/sdb1, etc. el fstab muestra ese parámetro llamado UUID, no me preguntes qué diablos es eso porque no lo se xD. O sea para solucionar el problema debes conseguir las UUID de tus particiones, esto lo puedes lograr mediante el comando blkid:</p>
<blockquote><p>[root@zuargo-archlinux ~]# blkid<br />
/dev/sda1: UUID=&#8221;2727445b-47fa-4ffb-b70d-370a13651a4e&#8221; TYPE=&#8221;ext4&#8243;<br />
/dev/sda3: UUID=&#8221;2222e40b-f06b-496e-bf29-4845a8f4d164&#8243; TYPE=&#8221;swap&#8221;<br />
/dev/sda4: UUID=&#8221;f4129b69-5944-476f-8db7-668cb5e81679&#8243; TYPE=&#8221;ext4&#8243;<br />
/dev/sdb1: UUID=&#8221;3a2a074a-ef50-4faa-94e8-b53b3de51508&#8243; TYPE=&#8221;ext4&#8243;</p></blockquote>
<p style="text-align:justify;">Luego reemplaza dichas UUID en tu fstab por el /dev/sdxx que corresponda, guarda los cambios, reinicia y listo (al menos a mi me funcionó <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ).</p>
<p style="text-align:justify;">Respecto a por qué se debe el problema he leído que es un ¿bug? de archlinux con udev (o algo así xD)</p>
<p style="text-align:justify;">Muchas gracias a <a href="http://bbs.archlinux.org/profile.php?id=17977" target="_blank">foutrelis</a> y a <a href="http://bbs.archlinux.org/profile.php?id=24210" target="_blank">Leonid.I</a>, ambos, usuarios del <a href="http://bbs.archlinux.org/" target="_blank">foro oficial de Archlinux</a>, quienes me ayudaron a resolver este problemilla ^^.</p>
<p style="text-align:justify;">Saludos y espero que a alguien le sirva esto <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to write udev rules]]></title>
<link>http://hackaday.com/2009/09/18/how-to-write-udev-rules/</link>
<pubDate>Fri, 18 Sep 2009 17:00:27 +0000</pubDate>
<dc:creator>Mike Szczys</dc:creator>
<guid>http://hackaday.com/2009/09/18/how-to-write-udev-rules/</guid>
<description><![CDATA[Since the adoption of Kernel 2.6, Linux has used the udev system to handle devices such as USB conne]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><img class="alignnone size-full wp-image-15647" title="writing_udev_rules" src="http://hackadaycom.wordpress.com/files/2009/09/writing_udev_rules.jpg" alt="writing_udev_rules" width="470" height="285" /></p>
<p>Since the adoption of Kernel 2.6, Linux has used the <a href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html">udev system</a> to handle devices such as USB connected peripherals. If you want to change the behavior when you plug something into a USB port, this section is for you. As an example, we will use a USB thumb drive but these methods should translate to any device handled by udev. As a goal for this exercise we decided to create a symlink and execute a script when a specific thumb drive was loaded. The operating system we used for this exercise is Ubuntu 9.04 Jaunty Jackalope.<!--more--></p>
<h3>Background Investigation</h3>
<p>Before writing rules, we have to gather all the information needed to identify our device. We found the <a href="http://en.wikipedia.org/wiki/Device_node#Block_devices">block device node</a> that the drive was assigned to by plugging it in and checking <code>/var/log/messages</code>. We then pass that location (/dev/sdd1) to two commands that we run at the same time. Some distributions use the &#8220;udevinfo&#8221; command but with Ubuntu 9.04 the command has changed to &#8220;udevadm info&#8221;:</p>
<pre class="brush: bash;">udevadm info -a -p $(udevadm info -q path -n /dev/sdd1)</pre>
<p>The output of this is pretty meaty. We need to find the top of the chain that provides the block node which is used for mounting removable storage (in our case, /dev/sdd1). Using this KERNEL as identification will ensure that our symlink points to a mountable block device and not some part of the USB controller. We are also looking for device specific identifiers that differentiate this particular thumbdrive from all others:</p>
<pre class="brush: bash;">looking at device '/devices/pci0000:00/0000:00:02.1/usb1/1-2/1-2:1.0/host29/target29:0:0/29:0:0:0/block/sdd/sdd1':
 KERNEL==&#34;sdd1&#34;
 SUBSYSTEM==&#34;block&#34;
 DRIVER==&#34;&#34;
 ATTR{partition}==&#34;1&#34;
 ATTR{start}==&#34;63&#34;
 ATTR{size}==&#34;31310622&#34;
 ATTR{stat}==&#34;     208    15448    16282      776        2        0        2       12        0      508      788&#34;

looking at parent device '/devices/pci0000:00/0000:00:02.1/usb1/1-2':
KERNELS==&#34;1-2&#34;
 SUBSYSTEMS==&#34;usb&#34;
 DRIVERS==&#34;usb&#34;
 ATTRS{configuration}==&#34;&#34;
 ATTRS{bNumInterfaces}==&#34; 1&#34;
 ATTRS{bConfigurationValue}==&#34;1&#34;
 ATTRS{bmAttributes}==&#34;80&#34;
 ATTRS{bMaxPower}==&#34;200mA&#34;
 ATTRS{urbnum}==&#34;1858&#34;
 ATTRS{idVendor}==&#34;13fe&#34;
 ATTRS{idProduct}==&#34;1f00&#34;
 ATTRS{bcdDevice}==&#34;0110&#34;
 ATTRS{bDeviceClass}==&#34;00&#34;
 ATTRS{bDeviceSubClass}==&#34;00&#34;
 ATTRS{bDeviceProtocol}==&#34;00&#34;
 ATTRS{bNumConfigurations}==&#34;1&#34;
 ATTRS{bMaxPacketSize0}==&#34;64&#34;
 ATTRS{speed}==&#34;480&#34;
 ATTRS{busnum}==&#34;1&#34;
 ATTRS{devnum}==&#34;69&#34;
 ATTRS{version}==&#34; 2.00&#34;
 ATTRS{maxchild}==&#34;0&#34;
 ATTRS{quirks}==&#34;0x0&#34;
 ATTRS{authorized}==&#34;1&#34;
 ATTRS{manufacturer}==&#34;OCZ&#34;
 ATTRS{product}==&#34;DIESEL&#34;
 ATTRS{serial}==&#34;50E6920B000AE8&#34;</pre>
<p>In writing a udev rule, any of these characteristics can be used as conditions for the rule&#8217;s execution. That being said, only properties from <span style="text-decoration:underline;"><strong>one</strong></span> parent of the device and from the device itself  can be match. Trying to match values from more than one parent in the chain will be invalid and will not work.</p>
<h3>The Rule</h3>
<p>Rule files are stored in the <code>/etc/udev/rules.d/</code> directory. We got some advice from the README in that directory on how to name rule files:</p>
<blockquote><p>Files should be named xx-descriptive-name.rules, the xx should be<br />
chosen first according to the following sequence points:</p>
<p>&#60; 60  most user rules; if you want to prevent an assignment being<br />
overriden by default rules, use the := operator.</p>
<p>these cannot access persistent information such as that from<br />
vol_id</p>
<p>&#60; 70  rules that run helpers such as vol_id to populate the udev db</p>
<p>&#60; 90  rules that run other programs (often using information in the<br />
udev db)</p>
<p>&#62;=90  rules that should run last</p></blockquote>
<p>We plan to run a script with this rule so we gave it a name that started with a higher number than our other rules but lower than 90. We used the filename:</p>
<pre>81-thumbdrive.rules</pre>
<p>The first part of a udev rule is the matching keys. We will use the KERNEL entry from the very top of the chain as well as the idVendor, idProduct, and serial attributes from the device specific information. This will positively identify this particular thumb drive and ignore all others. The kernel argument uses  a question mark as a wild card so that if our drive were mounted on a different node (ie: sda1, sdb1, sdc1, etc.) it could still be identified.</p>
<pre class="brush: bash;">KERNEL==&#34;sd?1&#34;, ATTRS{idVendor}==&#34;13fe&#34;, ATTRS{idProduct}==&#34;1f00&#34;, ATTRS{serial}==&#34;50E6920B000AE8&#34;</pre>
<p>Now that we have the keys necessary to identify the particular hardware we&#8217;re looking for we can add assignment arguments. In our case we added two. The first creates a symlink to this device inside of the /dev/ directory. The second executes a script in our home directory:</p>
<pre class="brush: bash;">SYMLINK+=&#34;hackaday&#34;, RUN+=&#34;/home/mike/notify-plugin.sh 'HackaDay Thumbdrive:' 'Connected as: $KERNEL'&#34;</pre>
<p>Here is the final rule assembled into one line:</p>
<pre class="brush: bash;">KERNEL==&#34;sd?1&#34;, ATTRS{idVendor}==&#34;13fe&#34;, ATTRS{idProduct}==&#34;1f00&#34;, ATTRS{serial}==&#34;50E6920B000AE8&#34;, SYMLINK+=&#34;hackaday&#34;, RUN+=&#34;/home/mike/notify-plugin.sh 'HackaDay Thumbdrive:' 'Connected as: $KERNEL'&#34;</pre>
<p>We added this as the only line in our rule file and then restarted udev using these commands:</p>
<pre>sudo nano /etc/init.d/81-thumbdrive.rules
sudo /etc/init.d/udev restart</pre>
<h3>The Script (and the bug workaround)</h3>
<p>We wanted to use the <a href="http://hackaday.com/2009/09/03/simple-pop-up-notifications/">pop-up notification we covered a while back</a> but couldn&#8217;t get it to work. After a bit of frustration we found out that <a href="https://bugs.launchpad.net/ubuntu/+source/libnotify/+bug/160598">the notify-send package has trouble</a> putting notifications on a user&#8217;s screen when called from a script run by root. There is a <a href="http://ubuntuforums.org/showthread.php?p=6889270#post6889270">workaround for this bug</a>. We altered the script just a bit for our purposes and pasted it to a new file named: /usr/local/bin/alt-notify-send</p>
<pre class="brush: bash;">#!/bin/sh
user=`whoami`
pids=`pgrep -u $user gnome-panel`
title=$1
text=$2
timeout=$3
icon=$4

if [ -z &#34;$title&#34; ]; then
 echo You need to give me a title &#62;&#38;2
 exit 1
fi
if [ -z &#34;$text&#34; ]; then
 text=$title
fi
if [ -z &#34;$timeout&#34; ]; then
 timeout=60000
fi

for pid in $pids; do
 # find DBUS session bus for this session
 DBUS_SESSION_BUS_ADDRESS=`grep -z DBUS_SESSION_BUS_ADDRESS \
 /proc/$pid/environ &#124; sed -e 's/DBUS_SESSION_BUS_ADDRESS=//'`
 # use it

 #icon hack:
 if [ -z $icon ]; then
 DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS \
 notify-send -u low -t $timeout &#34;$title&#34; &#34;$text&#34;
 else
 DBUS_SESSION_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS \
 notify-send -u low -t $timeout -i &#34;$icon&#34; &#34;$title&#34; &#34;$text&#34;
 fi
done</pre>
<p>We then created the script that the udev rule calls. This is placed in our home directory at /home/mike/notify-plugin.sh</p>
<pre class="brush: bash;">#!/bin/bash

su mike alt-notify-send &#34;$1&#34; &#34;$2&#34; 6000 &#34;/home/mike/hackaday_icon.png&#34;</pre>
<p>The script can do just about anything we want it to. In this case it calls the notification workaround script passing two strings from the udev rule, a delay time, and an icon to display with the pop-up.</p>
<h3>Order of events:</h3>
<p>Now that everything&#8217;s in place, let&#8217;s take a look at what happens when our drive is plugged in.</p>
<ol>
<li>-USB drive is plugged into the computer</li>
<li>-Udev checks the /etc/udev/rules.d/ directory and starts using the rule files in order</li>
<li>-Udev gets to our file: 81-thumbdrive.rules and matches the &#8220;sd?1&#8243; kernel, idVendor, idProduct, and serial number of the thumbdrive.</li>
<li>-If udev confirms a match on our four conditions, a symlink is created at /dev/hackaday and the /home/mike/notify-plugin.sh script is executed, passing it a message that includes the kernel information.</li>
<li>-Our script executes creating a pop-up notification using the alt-notify-send workaround.</li>
<li>-HAL takes over, automatically mounting our drive (this is part of Ubuntu&#8217;s removable storage handling and unrelated to our udev rule).</li>
</ol>
<p>Here we see the symlink pointing to our block device and the pop-up notification:</p>
<p><img class="alignnone size-full wp-image-15388" title="udev_symlink" src="http://hackadaycom.wordpress.com/files/2009/09/udev_symlink.jpg" alt="udev_symlink" width="470" height="120" /></p>
<p><img class="alignnone size-full wp-image-15389" title="plugin_popup" src="http://hackadaycom.wordpress.com/files/2009/09/plugin_popup.jpg" alt="plugin_popup" width="470" height="223" /></p>
<h3>Other uses:</h3>
<p>Udev rules give you control over the hardware attached to your machine. If you are working on a USB connected project, these rules will allow you to set permissions for access, execute scripts when added or removed, and provide a persistent symlink for accessing this hardware without relying on the same node name each time the device is connected. We use a udev rule to allow <a href="http://savannah.nongnu.org/projects/avrdude/">avrdude</a> to access our <a href="http://www.atmel.com/dyn/Products/tools_card.asp?tool_id=3891">AVR Dragon</a> programmer without root permission. In this case our rule sets read/write permissions for owner and group, then assigns the device to the &#8220;plugdev&#8221; group. As long as the user trying to run avrdude is a member of the plugdev group the program will be able to access the dragon. Here&#8217;s the rule:</p>
<pre class="brush: bash;">SUBSYSTEM==&#34;usb&#34;, ATTR{idVendor}==&#34;03eb&#34;, ATTR{idProduct}==&#34;2107&#34;, MODE=&#34;0660&#34;, GROUP=&#34;plugdev&#34;</pre>
<p>We hope this helps clarify how the udev system works. Give it a try with your next project.</p>
<h3>Resources:</h3>
<ul>
<li>Writing udev rules by Daniel Drake: <a href="http://reactivated.net/writing_udev_rules.html">http://reactivated.net/writing_udev_rules.html</a></li>
<li>notify-send bug: <a href="https://bugs.launchpad.net/ubuntu/+source/libnotify/+bug/160598">https://bugs.launchpad.net/ubuntu/+source/libnotify/+bug/160598</a></li>
<li>notify-send workaround: <a href="http://ubuntuforums.org/showthread.php?p=6889270#post6889270">http://ubuntuforums.org/showthread.php?p=6889270#post6889270</a></li>
</ul>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Arranque lento en Fedora 11]]></title>
<link>http://iyanmv.com/2009/09/09/arranque-lento-en-fedora-11/</link>
<pubDate>Wed, 09 Sep 2009 20:06:28 +0000</pubDate>
<dc:creator>iyanmv</dc:creator>
<guid>http://iyanmv.com/2009/09/09/arranque-lento-en-fedora-11/</guid>
<description><![CDATA[No os alarméis con el título Sólo es una cosa curiosa. Cuando instalo Fedora 11, antes de actualizar]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>No os alarméis con el título <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Sólo es una cosa curiosa. Cuando instalo Fedora 11, antes de actualizar ningún paquete, me arranca en 25 segundos más o menos. Pero una vez que actualizo todos los paquetes, tarda más de un minuto. Al principio no le di importancia porque pensé que sería problema del kernel y se solucionaría en la siguiente versión, pero no fue así. Luego pensé que a lo mejor sólo ocurría en la versión de 64 bits e instalé la de 32 bits. Nada, todo igual. Pues investigando un poco descubrí que <strong>el problema es el paquete udev y la librería libudeb0</strong>. No se por qué, pero hice un downgrade y ahora me arranca en 21 segundos. Una maravilla. Si os pasa lo mismo, abrid una terminal y escribid:</p>
<blockquote><p>su -c &#8216;yum downgrade udev libudev0&#8242;</p></blockquote>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Vmware ESX ethernet problem after "migration"]]></title>
<link>http://stefanomatic.wordpress.com/2009/08/25/vmware-esx-ethernet-problem-after-migration/</link>
<pubDate>Tue, 25 Aug 2009 08:08:57 +0000</pubDate>
<dc:creator>stefanomatic</dc:creator>
<guid>http://stefanomatic.wordpress.com/2009/08/25/vmware-esx-ethernet-problem-after-migration/</guid>
<description><![CDATA[Generally, the command &#8220;migrate&#8221; of the Vmware Infrastructure Client is a very safe oper]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Generally, the command &#8220;migrate&#8221; of the Vmware Infrastructure Client is a very safe operation and you can move completely one virtual machine from one ESX server to another in few steps and few minutes.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">The n.1 error that could happen is that the single virtual ethernet controller eth0 is &#8220;disappeared&#8221; after migration and your machine lost its ip address.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">The solution, in my cases (on a Suse 10.1 with only one ethernet), was always the same:</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">go to /etc/sysconfig/network</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">locate a file similiar to ifcfg-eth-id-XX:XX&#8230; that&#8217;s related to the old mac address of eth0</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">rename it to ifcfg-eth0 (with mv command)</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">go to /etc/udev/rules.d</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">edit a file named 30-net_persistent_names</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">inside there are X lines where X is the number of your eth devices (old, new, used, unused&#8230;); in a default situation there are two lines, one old related to eth0 and one new related to eth1</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">delete the line related to the same old mac address you saw before (related to eth0 as you can see at the end of that line) and change from eth1 to eth0 in the remaining line, that&#8217;s the one containing the new mac of your ethernet card.</div>
<div id="_mcePaste" style="position:absolute;left:-10000px;top:0;width:1px;height:1px;">Save and reboot.Now your eth0 should be ok as in the past.</div>
<p>Generally, the command &#8220;migrate&#8221; of the Vmware Infrastructure Client is a very safe operation and you can move completely one virtual machine from one ESX server to another one in few steps and few minutes.</p>
<p>The n.1 error that could happen is that the single virtual ethernet controller eth0 is &#8220;disappeared&#8221; after migration and your machine lost its ip address (and this could be REALLY dramatic).</p>
<p>The solution, in my cases (on a Suse 10.1 with only one ethernet), was always the same:</p>
<p>go to <em>/etc/sysconfig/network</em></p>
<p>locate a file similiar to <em>ifcfg-eth-id-XX:XX&#8230; </em>that&#8217;s related to the old mac address of eth0</p>
<p>rename it simply to <em>ifcfg-eth0</em> (with mv command)</p>
<p>go to <em>/etc/udev/rules.d</em></p>
<p>edit a file named <em>30-net_persistent_names</em></p>
<p>inside there are X lines where X is the number of your eth devices (old, new, used, unused&#8230;); in a default situation there are two lines, one old for eth0 and one new for a new created eth1</p>
<p>delete the first line that includes the same old mac address you saw before (related to eth0 as you can see at the end of that line) and change from <em>eth1</em> to <em>eth0</em> in the remaining line, that&#8217;s the one containing the new mac of your ethernet card.</p>
<p>Save and reboot.Now your eth0 should be ok as in the past.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Renombrar interfaces de red estáticamente con Udev ]]></title>
<link>http://sololinex.wordpress.com/2009/08/09/renombrar-interfaces-de-red-estaticamente-con-udev/</link>
<pubDate>Sun, 09 Aug 2009 11:23:27 +0000</pubDate>
<dc:creator>cristo990</dc:creator>
<guid>http://sololinex.wordpress.com/2009/08/09/renombrar-interfaces-de-red-estaticamente-con-udev/</guid>
<description><![CDATA[Reciéntemente estaba instalando los controladores de una tarjeta inalámbrica Broadcom BCM4312 en un ]]></description>
<content:encoded><![CDATA[Reciéntemente estaba instalando los controladores de una tarjeta inalámbrica Broadcom BCM4312 en un ]]></content:encoded>
</item>
<item>
<title><![CDATA[Mudando o nome das interfaces de rede Debian/Lenny]]></title>
<link>http://viniciusprado.wordpress.com/2009/07/31/mudando-o-nome-das-interfaces-de-rede-debianlenny/</link>
<pubDate>Fri, 31 Jul 2009 18:18:28 +0000</pubDate>
<dc:creator>vncprado</dc:creator>
<guid>http://viniciusprado.wordpress.com/2009/07/31/mudando-o-nome-das-interfaces-de-rede-debianlenny/</guid>
<description><![CDATA[Eu instalei o driver proprietário da minha placa wireless e por algum motivo que eu desconheço ele n]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Eu instalei o driver proprietário da minha placa wireless e por algum motivo que eu desconheço ele não fica com o nome &#8220;wlan0&#8243;. O pior é que eu tenho um amigo <span style="text-decoration:line-through;">otário</span> que ficava tirando onda por causa dessa bobagem. ¬¬&#8217;</p>
<p>Mas tudo bem, vai ai a solução que eu encontrei.</p>
<p>No arquivo <strong>/etc/udev/rules.d/50-udev.rules</strong> (o número 50 pode ser diferente) eu acrescentei a seguinte linha:</p>
<p><strong>SUBSYSTEM==&#8221;net&#8221;, DRIVERS==&#8221;?*&#8221;, ATTRS{address}==&#8221;XX:XX:XX:XX:XX:XX&#8221;, NAME=&#8221;wlan0&#8243;</strong></p>
<p>e dei um restart no udev:</p>
<p><strong> # /etc/init.d/udev restart</strong></p>
<p>Referência: <a href="http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames" target="_blank">http://www.science.uva.nl/research/air/wiki/LogicalInterfaceNames</a></p>
<p>Para ir mais longe: <a href="http://www.debianadmin.com/rename-network-interface-using-udev-in-linux.html" target="_blank">http://www.debianadmin.com/rename-network-interface-using-udev-in-linux.html</a></p>
<p>PS: da última vez que eu tentei ele não mudou o nome só reiniciando o udev.</p>
<p>[]&#8217;s</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[udev blocks update]]></title>
<link>http://arturmartins.wordpress.com/2009/07/08/udev-blocks-update/</link>
<pubDate>Wed, 08 Jul 2009 18:17:13 +0000</pubDate>
<dc:creator>Artur Martins</dc:creator>
<guid>http://arturmartins.wordpress.com/2009/07/08/udev-blocks-update/</guid>
<description><![CDATA[I got an error today trying to upgrade a gentoo cluster: [blocks B ] &gt;=sys-fs/udev-126 (&#8220;]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I got an error today trying to upgrade a gentoo cluster:<br />
<blockquote><font face="Courier New">[blocks B     ] &#62;=sys-fs/udev-126 (&#8220;&#62;=sys-fs/udev-126&#8243; is blocking<br />sys-fs/cryptsetup-1.0.6)</font></p></blockquote>
<p>Solution:<br />
<blockquote><font face="Courier New">emerge -u cryptsetup</font></p></blockquote>
<p>Done! After try to reboot to check if the udev detects all your network devices correctly.</p>
<p></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[poor auto-mounting with udev]]></title>
<link>http://beuwolf.wordpress.com/2009/07/07/poor-automounting-with-udev/</link>
<pubDate>Tue, 07 Jul 2009 22:51:45 +0000</pubDate>
<dc:creator>Flo</dc:creator>
<guid>http://beuwolf.wordpress.com/2009/07/07/poor-automounting-with-udev/</guid>
<description><![CDATA[Although I should learn for my ongoing exams I found a few moments to try getting auto-mounting on t]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Although I should learn for my ongoing exams I found a few moments to try getting auto-mounting on the console. (Note: This is rather a post for me to remember than anything useful <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  )</p>
<p>As I didn&#8217;t find a properly working solution for my minimal installation (some troubles with thunar and I wanted also for the console), I decided to do a poor alternative on my own. I tried to make it almost as convenient as in GNOME (or KDE&#8230;) as I was sick of always typing &#8220;sudo mount /dev/sd?1 /mnt&#8221; which also led to some troubles when using more than one stick.</p>
<p>It&#8217;s no more than two small scripts combined with two rules of <a title="udev" href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html">udev</a> (save as /etc/udev/rules/01-YOURNAME.rules and modify the script path):<br />
<code>BUS=="usb", KERNEL=="sd??", ACTION=="add", RUN+="/home/flo/.scripts/udev/mount.sh %k"<br />
BUS=="usb", KERNEL=="sd??", ACTION=="remove", RUN+="/home/flo/.scripts/udev/umount.sh %k"</code><br />
These lines execute mount.sh when attaching an USB device and execute umount.sh when removing it. &#8220;%k&#8221; gives the device name (e.g. sdb1) as parameter for the script.</p>
<p>mount.sh:</p>
<pre><code>#!/bin/bash
label=$(ls -l /dev/disk/by-label/ &#124; grep $1)
if [ $? -eq 0 ]; then	#found the device
    label=$(echo $label &#124; sed -e 's/.*:...//g' &#124; sed -e 's/.-&#62;.*//g')
else
    label=$(ls -l /dev/disk/by-uuid &#124; grep $1 &#124; sed -e 's/.*:...//g' &#124; sed 's/.-&#62;.*//g')
fi
mkdir /media/$label
mount /dev/$1 /media/$label -o sync,gid=46,umask=007

</code></pre>
<p>This script tries to find the label of the partition. If not possible it uses the UUID as a name for the mount directory, which is /media/{UUID&#124;LABEL}. It finally mounts the device into this newly created folder, setting the &#8220;sync&#8221; option, which makes it save to remove the device without umounting it. &#8220;gid=46,umask=007&#8243; means, that only root and members of the group &#8220;plugdev&#8221; are allowed to acces the device &#8211; this is needed for FAT formated sticks.</p>
<p>umount.sh:</p>
<pre><code>#!/bin/bash
label=$(mount &#124; grep $1 &#124; sed -e 's/.*\/media\///g' &#124; sed -e 's/.type.*//g' )
umount -l /dev/$1
rmdir /media/$label

</code></pre>
<p>This script umounts the device and removes the folder, that was created.</p>
<p><strong>Important note:</strong> These scripts should *not* be editable by users as they are executed with root rights &#8211; and therefor might be used to &#8220;hack&#8221; the system when modified!</p>
<p>I have no idea, how well these lines work with hard drives containing several partitions (I don&#8217;t have one here at the moment) or with encrypted partitions. I&#8217;ll have a look at that after the exams (in roughly 2 weeks).</p>
<p>As always: Use with care, I&#8217;m not responsible for any harm <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Hyper-V plus Ubuntu minus udev]]></title>
<link>http://mattonrails.wordpress.com/2009/07/02/hyper-v-plus-ubuntu-minus-udev/</link>
<pubDate>Thu, 02 Jul 2009 14:17:10 +0000</pubDate>
<dc:creator>Matt</dc:creator>
<guid>http://mattonrails.wordpress.com/2009/07/02/hyper-v-plus-ubuntu-minus-udev/</guid>
<description><![CDATA[In my earlier post on getting a Ubuntu VM running on VPC, I neglected one important and usually insi]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>In my earlier post on getting a <a href="http://mattonrails.wordpress.com/2008/10/27/vpc-ubuntu-810-beta-and-active-directory/">Ubuntu VM running on VPC</a>, I neglected one important and usually insignificant detail: how to disable <a href="http://www.kernel.org/pub/linux/utils/kernel/hotplug/udev.html">udev</a> for the VM&#8217;s NICs.</p>
<p>The problem with udev is that it effectively disables the VM&#8217;s NIC under certain conditions. To understand why, it helps to make some observations about the various modules involved.</p>
<p>Udev is the device manager for Linux 2.6 systems. It is responsible for populating /dev with only the devices that are present. It provides notification to other software when devices are changed. And, most importantly for this blog post, it provides &#8220;persistent naming for devices when they move around the device tree.&#8221; So, if you move your USB cabling and routers around, your machine should still be able to identify, say, your printer. Or if you add a new NIC and your system detects it before your existing eth0, your old NIC will still be eth0 and your new one will be eth1. This is pretty awesome, and it helps resolve some of the problems I remember having with old PCs, trying to guess which device name maps to which physical device.</p>
<p>On Hyper-V (or Virtual Server, or Virtual PC), NICs are usually virtual, so they get assigned virtual MAC addresses. The default configuration is to let Windows pick the MAC address. These MAC addresses are typically stable, unless you do something like recreate the NIC or move the VM to a new host.</p>
<p>The scenario that this blog post is concerned about is this: you set up a VM on one host, and then you move it to another host. You might move it for any number of reasons: you set it up on VPC and want to permanently host it on Hyper-V, or your Hyper-V hosting situation changes and you need to migrate VMs around, or whatever. Following the move, your VM is no longer on the network! Bad news.</p>
<p>So, when you&#8217;re setting up your VM, you need to consider how udev will interact with Hyper-V. Some possible solutions include assigning a static MAC address to the NIC, or making udev smart enough to realize that if the old NIC went away and a new one is in its place, that it should use the new one in place of the old one. My solution is to make udev ignore eth*, since I usually am configuring a Linux VM to run some particular service, and I will not be changing the network configuration in any significant way. My solution is likely to be affected by upgrades because it modifies files that are generated by scripts.</p>
<p>And now, to the point of this post: how to make udev ignore your eth* devices:</p>
<ol>
<li>Open <code>/etc/udev/rules.d/75-persistent-net-generator.rules</code> in your favorite text editor.</li>
<li>On line 21, where it says <code>KERNEL!="eth*&#124;ath*</code>&#8230; remove <code>eth*&#124;</code>. For example, on my system, I start with<br />
<code>KERNEL!="eth*&#124;ath*&#124;wlan*[0-9]&#124;ra*&#124;sta*&#124;ctc*&#124;lcs*&#124;hsi*", GOTO="persistent_net_generator_end"</code><br />
and end up with<br />
<code>KERNEL!="ath*&#124;wlan*[0-9]&#124;ra*&#124;sta*&#124;ctc*&#124;lcs*&#124;hsi*", GOTO="persistent_net_generator_end"</code></li>
<li>If udev has already renamed your nic, you&#8217;ll also need to open <code>/etc/udev/rules.d/70-persistent-net.rules</code> and remove any <code>eth*</code> entries you find.</li>
</ol>
<p>This should work on any Linux with udev (kernel &#62;= 2.6). Line 21 is the right one to change on Ubuntu 8.10 and 8.04.2 systems that I&#8217;ve configured this way.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[wyłączanie touchpada po podłączeniu myszy]]></title>
<link>http://carnophage.wordpress.com/2009/06/29/wylaczanie-touchpada-po-podlaczeniu-myszy/</link>
<pubDate>Mon, 29 Jun 2009 21:48:02 +0000</pubDate>
<dc:creator>carnophage</dc:creator>
<guid>http://carnophage.wordpress.com/2009/06/29/wylaczanie-touchpada-po-podlaczeniu-myszy/</guid>
<description><![CDATA[Stworzyć plik /etc/udev/rules.d/01-touchpad.rules Zawartość: SUBSYSTEM==&quot;usb&quot;, SYSFS{produ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Stworzyć plik /etc/udev/rules.d/01-touchpad.rules</p>
<p>Zawartość:</p>
<pre class="brush: bash;">
SUBSYSTEM==&quot;usb&quot;, SYSFS{product}==&quot;*Mouse*&quot;
ACTION==&quot;add&quot;, SUBSYSTEM==&quot;input&quot;, ENV{ID_CLASS}=&quot;mouse&quot;, RUN+=&quot;/usr/bin/synclient TouchpadOff=1&quot;
ACTION==&quot;remove&quot;, SUBSYSTEM==&quot;input&quot;, ENV{ID_CLASS}=&quot;mouse&quot;, RUN+=&quot;/usr/bin/synclient TouchpadOff=0&quot;
</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Storage Device Manager]]></title>
<link>http://trx64.wordpress.com/2009/06/24/storage-device-manager/</link>
<pubDate>Thu, 25 Jun 2009 02:57:32 +0000</pubDate>
<dc:creator>trx64</dc:creator>
<guid>http://trx64.wordpress.com/2009/06/24/storage-device-manager/</guid>
<description><![CDATA[O PySDM (Storage Device Manager) é um gerenciador de pontos de montagem, permitindo alterar a forma ]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>O PySDM (Storage Device Manager) é um gerenciador de pontos de montagem, permitindo alterar a forma como os dispositivos são montados no sistema. Ele permite definir graficamente o nome da partição, ponto de montagem e opções, como montagem pelo usuário, acesso, etc. Ele realiza as alterações no fstab sozinho. É, isso mesmo, edite o fstab pelo modo grafico! Se você quiser, ao invés de alterar o fstab, é possível criar regras dinâmicas para o udev. Tudo isso é feito por meio de assistentes simplificados. Um bom programa que ainda permite aprender sobre as opções mexendo com uma interface fácil.</p>
<p>Procure pelo pacote pysdm no gerenciador de pacotes de sua distro, não irá se arrepender.</p>
<p><img class="aligncenter" title="pysdm" src="http://pysdm.sourceforge.net/screenshots/fstab_04.png" alt="" width="489" height="336" /></p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[debian changing eth* name]]></title>
<link>http://paragasu.wordpress.com/2009/06/23/debian-changing-eth-name/</link>
<pubDate>Tue, 23 Jun 2009 23:26:37 +0000</pubDate>
<dc:creator>paragasu</dc:creator>
<guid>http://paragasu.wordpress.com/2009/06/23/debian-changing-eth-name/</guid>
<description><![CDATA[changing eth0 name to eth1 and eth2 after each reboot. it is a bug in udev package.]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>changing eth0 name to eth1 and eth2 after each reboot. it is a bug in udev package.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Calentito recien fuera del horno: Ubuntu 9.10 Karmic Koala Alpha 1 is OUT]]></title>
<link>http://fried.wordpress.com/2009/05/15/calentito-recien-fuera-del-horno-ubuntu-9-10-karmic-koala-alpha-1-is-out/</link>
<pubDate>Fri, 15 May 2009 21:54:54 +0000</pubDate>
<dc:creator>Fried #</dc:creator>
<guid>http://fried.wordpress.com/2009/05/15/calentito-recien-fuera-del-horno-ubuntu-9-10-karmic-koala-alpha-1-is-out/</guid>
<description><![CDATA[Con este mensaje en la lista de correo de Ubuntu devel, se anunció que Ubuntu 9.10 karmic Koala ya e]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><a href="https://lists.ubuntu.com/archives/ubuntu-devel-announce/2009-May/000569.html">Con este mensaje en la lista de correo de Ubuntu devel,</a> se anunció que Ubuntu 9.10 karmic Koala ya esta entre nosotros. Que quede claro, que es la version Alpha 1, por lo que queda un laaargo camino de desarrollo por delante.</p>
<p>Las cosas que se presentan en esta versión, por lo pronto, son:</p>
<ul>
<li>Administración de energía y &#8220;mapeado&#8221; de las teclas especiales <em>Fn</em> de las notebooks movida de <a href="http://www.freedesktop.org/wiki/Software/hal">Hal</a> (Hardware Abstraction Layer) a <code>DeviceKit-power</code> y <code>udev-extras</code>.</li>
<li>Nueva arquitectura para el testeo de los drivers de video de Intel.</li>
<li>GCC 4.4 como el compilador por defecto.</li>
</ul>
<p>Y las unicas maneras de upgradear nuestras PCs a esta version, es mediante los cd&#8217;s <em>alternativos</em> (tanto para ubuntu como kubuntu y xubuntu) o mediante:</p>
<p>ALT+F2</p>
<blockquote><p>update-manager -d</p></blockquote>
<p>Links relacionados: <a href="http://www.ubuntu.com/testing/karmic/alpha1"><br />
Karmic Koala Alpha 1 &#124; Ubuntu</a>.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[How to extract storage device information without using dmesg]]></title>
<link>http://joekuan.wordpress.com/2009/05/07/how-to-extract-storage-device-information-without-using-dmesg/</link>
<pubDate>Thu, 07 May 2009 20:08:44 +0000</pubDate>
<dc:creator>Joe Kuan</dc:creator>
<guid>http://joekuan.wordpress.com/2009/05/07/how-to-extract-storage-device-information-without-using-dmesg/</guid>
<description><![CDATA[I come across this problem in one of my projects. How can I easily retrieve storage device informati]]></description>
<content:encoded><![CDATA[I come across this problem in one of my projects. How can I easily retrieve storage device informati]]></content:encoded>
</item>
<item>
<title><![CDATA[Problema initramfs-tools al actualizar a Ubuntu 9.04]]></title>
<link>http://adrian15sgd.wordpress.com/2009/05/07/problema-initramfs-tools-al-actualizar-a-ubuntu-904/</link>
<pubDate>Thu, 07 May 2009 19:52:15 +0000</pubDate>
<dc:creator>adrian15sgd</dc:creator>
<guid>http://adrian15sgd.wordpress.com/2009/05/07/problema-initramfs-tools-al-actualizar-a-ubuntu-904/</guid>
<description><![CDATA[Como ya  os contaba en el post de la clonación tenía problemas con paquetes no encontrados. Ahora ya]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>Como ya  os contaba en el <a href="http://adrian15sgd.wordpress.com/2009/05/05/como-clonar-una-distribucion-para-actualizarla/">post de la clonación</a> tenía problemas con paquetes no encontrados. Ahora ya tengo todos los paquetes puesto que volví a ejecutar apt-mirror como ya indiqué en <a href="http://adrian15sgd.wordpress.com/2009/05/05/el-truco-del-apt-mirror/">el truco de apt-mirror</a>.</p>
<p>Ahora he intentado hacer el apt-get dist-upgrade.</p>
<p>Se detiene en:</p>
<pre>mkdir: no se puede crear el directorio Â«/tmp/mkinitramfs_hoESCF/etc/udev/rules.dÂ»: El fichero ya existe
cpio: ./sbin/udevsettle: No se puede stat: No existe el fichero Ã³ directorio
cpio: ./sbin/udevtrigger: No se puede stat: No existe el fichero Ã³ directorio
cpio: ./bin/udevinfo: No se puede stat: No existe el fichero Ã³ directorio
dpkg: el subproceso post-installation script devolviÃ³ el cÃ³digo de salida de error 1</pre>
<p>Al principio creía que era por mis paquetes codip2p del <a href="http://desdeslin.wordpress.com">proyecto desdeslin</a> pero no era así porque tenía la versión del initramfs-tools era la de jaunty.</p>
<p>Al final lo que he hecho ha sido enlazar udevsettle y udevtrigger al binario true.</p>
<p>Con udevinfo no había manera así que he tenido que editar un fichero de configuración de initramfs-tools (Vaya ahora mismo no tengo la ruta) para que hiciera caso omiso del mismo. Para que no lo copiaran.</p>
<p>En Ubuntu (y no sé si en Debian) esos tres comandos se han substituido por uno nuevo que hace las veces de ellos.</p>
<p>Pero no sé por qué el initramfs-tools sigue haciendo referencia a ellos.</p>
<p>Todo esto lo he hecho offline y es posible que actualice este post con enlaces a gente que le ha haya pasado lo mismo y con su solución.</p>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[Panik !! Stress !! Puyeng !! Argghhh]]></title>
<link>http://pranotoutomo.wordpress.com/2009/04/29/panik-stress-puyeng-argghhh/</link>
<pubDate>Wed, 29 Apr 2009 20:21:41 +0000</pubDate>
<dc:creator>suryopranoto</dc:creator>
<guid>http://pranotoutomo.wordpress.com/2009/04/29/panik-stress-puyeng-argghhh/</guid>
<description><![CDATA[0-day-Exploit Well, hanya beberapa minggu saya nggak jalan &#8211; jalan ke milworm ternyata exploit]]></description>
<content:encoded><![CDATA[0-day-Exploit Well, hanya beberapa minggu saya nggak jalan &#8211; jalan ke milworm ternyata exploit]]></content:encoded>
</item>
<item>
<title><![CDATA[iPhone syncing and Linux]]></title>
<link>http://n8wood.wordpress.com/2009/04/22/iphone-syncing-and-linux/</link>
<pubDate>Wed, 22 Apr 2009 22:37:04 +0000</pubDate>
<dc:creator>n8wood</dc:creator>
<guid>http://n8wood.wordpress.com/2009/04/22/iphone-syncing-and-linux/</guid>
<description><![CDATA[Note: installing iPhone updates through VirtualBox is not a good idea. Make sure you have a backup m]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p><strong>Note: installing iPhone updates through VirtualBox is not a good idea. Make sure you have a backup method to restore your phone before diving into this.</strong></p>
<p>I love my iPhone, but I hate that I can&#8217;t sync it natively inside Linux. I was never able to get iTunes working running under Wine, so I&#8217;ve been forced to create a virtual machine running WinXP to sync it. I don&#8217;t like the idea of a VM running in the background, wasting system resources when it&#8217;s not being used. I wanted a better solution.</p>
<p><a href="http://n8wood.wordpress.com/files/2009/04/vbox.png"><img class="alignleft size-medium wp-image-143" title="VirtualBox" src="http://n8wood.wordpress.com/files/2009/04/vbox.png?w=300" alt="VirtualBox" width="300" height="261" /></a></p>
<p>With the help of udev and VirtualBox command-line tools, I was able to come up with something better. Now when I&#8217;m ready for bed I plug my iPhone in, VirtualBox automatically boots the VM, and it syncs with iTunes. When I unplug the phone, Windows shuts down automatically. The only time the VM is using system resources is while I&#8217;m sleeping, so I don&#8217;t care.</p>
<p>I think this is as good as it gets with the iPhone on Linux and the only compromise is the time invested to set it up.</p>
<p>To do this, you&#8217;ll first need to install the full version of Sun&#8217;s <a href="http://www.virtualbox.org/wiki/Linux_Downloads">VirtualBox</a>, it includes USB features that are required. It&#8217;s free for personal use. Create a new VM with a bare Windows install on it. I didn&#8217;t install any additional updates and I disabled Windows Update, since it&#8217;s behind a NAT and I won&#8217;t be doing anything other than the sync on it. I also disabled a bunch of unnecessary services and ran <a href="http://en.wikipedia.org/wiki/Bootvis">Bootvis</a> to minimize the VM boot time. Then I mapped a network drive to my music folder (on the host system) so iTunes will have access to my entire music collection. I logged in with my iTunes account and resubscribed to all my podcasts. At this point it&#8217;s not a bad idea to make a copy of the VM in it&#8217;s pristine state.</p>
<h3>VirtualBox Settings</h3>
<p>Shut down Windows. In VirtualBox, right-click the VM and select Preferences. You should tell it to use VT-x/AMD-V <a href="http://n8wood.wordpress.com/files/2009/04/usb.png"><img class="alignright size-medium wp-image-142" title="usb" src="http://n8wood.wordpress.com/files/2009/04/usb.png?w=300" alt="usb" width="300" height="275" /></a>(General &#62; Advanced) if you have a relatively modern processor that supports virtualization extensions; it&#8217;s not a requirement but will improve performance. The settings you will need are under USB. Check &#8220;Enable USB Controller&#8221; and &#8220;Enable USB 2.0 EHCI Controller&#8221;, the click the plus icon to add a filter. While your iPhone is attached to the system, you should see it listed in the dropdown (Apple Inc. iPhone), select it and click OK. This is required so your VM can see the device. You might also want to configure a sound device (PulseAudio) or iTunes will complain.</p>
<p>Now we get to the fun stuff, tweaking the host Linux system and writing BASH scripts. First, let&#8217;s create a log file that anyone can write to in case we need to troubleshoot:</p>
<blockquote><p>$ sudo touch /var/log/iphone.log</p>
<p>$ sudo chmod 777 /var/log/iphone.log</p></blockquote>
<p>Now, we need to get the internal ID of the VM you created.</p>
<blockquote><p>$ VBoxManage list vms</p></blockquote>
<p>You should see the name of the new VM followed by it&#8217;s UUID in parenthesis. Copy that UUID, we&#8217;ll need it for our first script:</p>
<h3>iphone_attach.sh</h3>
<blockquote><p>#!/bin/bash<br />
export XAUTHORITY=/home/nathan/.Xauthority<br />
export DISPLAY=:0.0<br />
su nathan -c &#8220;/usr/bin/VBoxManage startvm bc341828-db3b-46a9-8bc9-153c8eb35ad7&#8243; &#62;&#62; /var/log/iphone.log</p></blockquote>
<p>The two export lines tell the script which X Windows session to attach to. The final command uses the VBoxManage tools to start your VM, log the output, and do it under your own user account (since this will run as root). Obviously you&#8217;ll need to change &#8220;nathan&#8221; to your account name for each instance. You should also replace the UUID with your own. The remove script is not all too different:</p>
<h3>iphone_remove.sh</h3>
<blockquote><p>#!/bin/bash<br />
export XAUTHORITY=/home/nathan/.Xauthority<br />
export DISPLAY=:0.0<br />
su nathan -c &#8220;/usr/bin/VBoxManage controlvm bc341828-db3b-46a9-8bc9-153c8eb35ad7 acpipowerbutton&#8221; &#62;&#62; /var/log/iphone.log</p></blockquote>
<p>Again, the export commands tell it which X session to use and we use VBoxManage to simulate an ACPI shutdown. You&#8217;ll need to replace the UUID with your own and change the user name and home folder path. Make sure these scripts work before you move on to the udev stuff.</p>
<h3>grab the serial number</h3>
<p>Note, this section was originally created using 0810 (Intrepid) but it broke in Jaunty (0904). I have another way to configure this so it works in Jaunty at the end of this post (it may also work in Interpid).</p>
<p>Now we need to tell Linux to run the above scripts when the device is connected/disconnected from the USB bus. First we need to find the serial number of your iPhone so we can tell udev what to look for.</p>
<blockquote><p>$ lsusb &#124; grep Apple</p></blockquote>
<p>This displays the USB bus and device numbers for your phone, note the two 3-digit numbers and plug them into the next command.</p>
<blockquote><p>udevinfo -a -p `udevinfo -q path -n /dev/bus/usb/004/002`&#124;grep &#8220;ATTR{serial}&#8221;</p></blockquote>
<p>Change 004 to the bus number you got in the previous command and change 002 to your device number. This digs into the attributes of your iPhone and displays the serial number which we&#8217;ll need later on. Note that you can remove the grep command to view all available attributes of your phone if you&#8217;re curious.</p>
<h3>udev stuff</h3>
<p>Go to the udev rules directory and create a new iphone rule, use a lower number like 98 so it gets processed after the other rules.</p>
<blockquote><p>$ cd /etc/udev/rules.d</p>
<p>$ sudo vi 98-iphone.rules</p></blockquote>
<h3>98-iphone.rules</h3>
<blockquote><p>ACTION==&#8221;add&#8221;, SUBSYSTEM==&#8221;usb&#8221;, ATTR{serial}==&#8221;c4560xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&#8221;, SYMLINK+=&#8221;iphone&#8221;, RUN+=&#8221;/home/nathan/scripts/iphone_attach.sh&#8221;</p>
<p>ACTION==&#8221;remove&#8221;, SYMLINK==&#8221;iphone&#8221; ,RUN+=&#8221;/home/nathan/scripts/iphone_remove.sh&#8221;</p></blockquote>
<p>The first line here describes what to look for when a device is attached and what to do when it finds your iPhone. The ACTION, SUBSYTEM, and ATTR declarations tell it to watch for a USB device being added with the serial number of your iPhone. SYMLINK tells it to create an entry on the dev file system for it (/dev/iphone); through trial and error I discovered that this is required so we have something to look for when the phone is disconnected. The RUN section tells it to run the iphone_attach.sh script.</p>
<p>The second line is a bit different and maybe not as intuitive. It is watching for the dev file of your iphone to disappear (/dev/iphone) which happens as soon as you unplug it. Then it runs the iphone_remove.sh script. That&#8217;s it, you&#8217;re done.</p>
<h3>other stuff</h3>
<p>One annoyance I ran into was Nautilus trying to automount the phone as a camera. I was unable to tell it to ignore the iPhone, so I just turned off automount completely in Nautilus using gconf-editor.</p>
<blockquote><p>$ gconf-editor</p>
<p>(uncheck: apps &#62; nautilus &#62; preferences &#62; media_automount)</p></blockquote>
<p>Another idea I had to use the suspend/resume functionality instead of stopping/starting the VM. However, I found that on resume the VM wouldn&#8217;t properly sync with the phone until Windows rebooted, even after using the VBoxManage commands to disconnect/reconnect the phone.</p>
<p><a href="http://n8wood.wordpress.com/files/2009/04/itunes.png"><img class="alignright size-medium wp-image-144" title="itunes" src="http://n8wood.wordpress.com/files/2009/04/itunes.png?w=300" alt="itunes" width="300" height="247" /></a>In the future, I&#8217;d like to look into reducing the XP install size with something like <a href="http://www.nliteos.com/">nLite</a> and using dropbox to move the VM to the cloud. The ultimate goal would be to have the ability to sync my phone from home, work, or my laptop while travelling. I have some ideas on the way to approach this but it&#8217;s not a burning need at the moment. It would be really cool though.</p>
<p style="text-align:left;"><iframe src='http://digg.com/api/diggthis.php?u=http%3A%2F%2Fdigg.com%2Flinux_unix%2FiPhone_syncing_and_Linux' height='82' width='55' frameborder='0' scrolling='no' style='float: right; margin-left: 10px; margin-bottom: 5px; padding: 4px 0 2px 4px; background: #fff;'></iframe></p>
<h3 style="text-align:left;">Jaunty</h3>
<p style="text-align:left;">Unfortunately I noticed the iphone_remove.sh script was no longer triggering after I upgraded to Jaunty. So I figured out another way to configure udev. First, we need to come up with another identifier to use in the udev rule:</p>
<blockquote>
<p style="text-align:left;">udevadm monitor &#8211;environment</p>
</blockquote>
<p style="text-align:left;">While that command is running in the background, plug in your phone, one of the lines should look like this:</p>
<blockquote>
<p style="text-align:left;">PRODUCT=5ac/1292/1</p>
</blockquote>
<p style="text-align:left;">Copy this line. I&#8217;m not sure if the same ID applies to the original and 3G phones, so run this for yourself. Then we can create the udev rule.</p>
<blockquote>
<p style="text-align:left;">vi /etc/udev/rules.d/98-iphone.rules</p>
</blockquote>
<p style="text-align:left;">You may need to change the Product ID here if it differs from mine, and change the path to your script:</p>
<blockquote>
<p style="text-align:left;">SUBSYSTEM==&#8221;usb&#8221;, ENV{PRODUCT}==&#8221;5ac/1292/1&#8243;, ACTION==&#8221;add&#8221;, RUN+=&#8221;/home/nathan/scripts/iphone_attach.sh&#8221;<br />
SUBSYSTEM==&#8221;usb&#8221;, ENV{PRODUCT}==&#8221;5ac/1292/1&#8243;, ACTION==&#8221;remove&#8221;, RUN+=&#8221;/home/nathan/scripts/iphone_remove.sh&#8221;</p></blockquote>
<p style="text-align:left;">And that&#8217;s it. This may actually be the proper way to configure the rules in Intrepid, but I no longer have a 0810 system to test on.</p>
<p style="text-align:left;">
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[แฮ็กเกอร์อาจได้ root privilleges จากช่องโหว่ของ udev บน Linux]]></title>
<link>http://akedemo.wordpress.com/2009/04/17/hacker-may-get-root-through-udev-bug/</link>
<pubDate>Fri, 17 Apr 2009 16:55:18 +0000</pubDate>
<dc:creator>akedemo</dc:creator>
<guid>http://akedemo.wordpress.com/2009/04/17/hacker-may-get-root-through-udev-bug/</guid>
<description><![CDATA[ช่องโหว่ integer overflow ของ udev เป็นโอกาสที่จะให้แฮกเกอร์สามารถส่ง Process อันตรายเข้ามาได้ หลังจ]]></description>
<content:encoded><![CDATA[ช่องโหว่ integer overflow ของ udev เป็นโอกาสที่จะให้แฮกเกอร์สามารถส่ง Process อันตรายเข้ามาได้ หลังจ]]></content:encoded>
</item>
<item>
<title><![CDATA[Colinux upgrade woes]]></title>
<link>http://razorvine.wordpress.com/2009/04/13/colinux-upgrade-woes/</link>
<pubDate>Mon, 13 Apr 2009 12:37:37 +0000</pubDate>
<dc:creator>razorvine</dc:creator>
<guid>http://razorvine.wordpress.com/2009/04/13/colinux-upgrade-woes/</guid>
<description><![CDATA[I just upgraded from colinux 0.7.3 to 0.7.4. The upgrade went smoothly, but udev screwed up my netwo]]></description>
<content:encoded><![CDATA[<div class='snap_preview'><p>I just upgraded from colinux 0.7.3 to 0.7.4. The upgrade went smoothly, but udev screwed up my network interfaces on the next boot.</p>
<pre>udev: renamed network interface eth1 to eth2
udev: renamed network interface eth0_rename to eth1</pre>
<p>Apparently, the upgrade changed the MAC address of my TAP adapter. To solve the issue, i edited udev&#8217;s rules file:</p>
<pre>diakonos  /etc/udev/rules.d/70-persistent-net.rules

# PCI device 0x10ec:0x8029 (ne2k-pci)
<span style="color:#ff0000;">#Comment out old rule</span>
<span style="color:#ff0000;">#</span>SUBSYSTEM=="net", DRIVERS=="?*", ATTR{address}=="52:54:00:12:34:56", NAME="eth0"

# PCI device 0x1a55:0x0005 (conet)
<span style="color:#ff0000;">#adjust NAMEs in new rules</span>
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:ff:7d:99:00:00",
 ATTR{type}=="1", KERNEL=="eth*", NAME="eth<span style="color:#ff0000;">0</span>"

# PCI device 0x1a55:0x0005 (conet)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:ff:e1:57:98:e0",
 ATTR{type}=="1", KERNEL=="eth*", NAME="eth<span style="color:#ff0000;">1</span>"</pre>
</div>]]></content:encoded>
</item>
<item>
<title><![CDATA[xorg, hal, udev &amp;&amp; Touchpad/Mouse Toggle (&gt;=xorg-server-1.5)]]></title>
<link>http://body0r.wordpress.com/2009/04/07/xorg-hal-toggle/</link>
<pubDate>Tue, 07 Apr 2009 17:00:59 +0000</pubDate>
<dc:creator>body0r</dc:creator>
<guid>http://body0r.wordpress.com/2009/04/07/xorg-hal-toggle/</guid>
<description><![CDATA[I read, there were some changes between &#60;xorg-server-1.5 and &#62;=xorg-server-1.5. While I]]></description>
<content:encoded><![CDATA[I read, there were some changes between &#60;xorg-server-1.5 and &#62;=xorg-server-1.5. While I]]></content:encoded>
</item>
<item>
<title><![CDATA[Xorg &amp;&amp; Touchpad/Mouse toggle (&lt;xorg-server-1.5)]]></title>
<link>http://body0r.wordpress.com/2009/03/14/backup-x/</link>
<pubDate>Sat, 14 Mar 2009 15:15:14 +0000</pubDate>
<dc:creator>body0r</dc:creator>
<guid>http://body0r.wordpress.com/2009/03/14/backup-x/</guid>
<description><![CDATA[Following should help for turning the Touchpad off, when an external mouse is connected [~]# cat /et]]></description>
<content:encoded><![CDATA[Following should help for turning the Touchpad off, when an external mouse is connected [~]# cat /et]]></content:encoded>
</item>

</channel>
</rss>
