View Single Post
Old 03-04-2008, 12:20 PM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,017
Karma: 22669822
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The recommended way to do this for modern linux distributions is to write an fdi file for HAL. That way you can specify where the device should be mounted and make it user/auto mountable. For example, here's the FDI file I use for the SONY reader and Kindle:
Code:
cat /usr/share/hal/fdi/policy/20thirdparty/10-libprs500.fdi

<?xml version="1.0" encoding="UTF-8"?>

<deviceinfo version="0.2">

  <device>
      <match key="usb_device.vendor_id" int="1356">
          <match key="usb_device.product_id" int="667">
              <merge key="libprs500.deviceclass" type="string">PRS500</merge>
          </match>
      </match>
  </device>


  <device>
      <match key="usb_device.vendor_id" int="1356">
          <match key="usb_device.product_id" int="798">
              <merge key="libprs500.deviceclass" type="string">PRS505</merge>
          </match>
      </match>
  </device>


  <device>
      <match key="info.category" string="volume">
          <match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.vendor_id" int="0x54c">
              <match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.product_id" int="0x31e">
                  <match key="volume.is_partition" bool="false">
                      <merge key="volume.label" type="string">Sony Reader Main Memory</merge>
                      <merge key="libprs500.mainvolume" type="string">PRS505</merge>
                  </match>
              </match>
          </match>
      </match>
  </device>
  <device>
      <match key="info.category" string="volume">
          <match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.vendor_id" int="0x54c">
              <match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.product_id" int="0x31e">
                  <match key="volume.is_partition" bool="true">
                      <merge key="volume.label" type="string">Sony Reader Storage Card</merge>
                      <merge key="libprs500.cardvolume" type="string">PRS505</merge>
                  </match>
              </match>
          </match>
      </match>
  </device>

  <device>
      <match key="usb_device.vendor_id" int="6473">
          <match key="usb_device.product_id" int="1">
              <merge key="libprs500.deviceclass" type="string">KINDLE</merge>
          </match>
      </match>
  </device>


  <device>
      <match key="info.category" string="volume">
          <match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.vendor_id" int="0x1949">
              <match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.product_id" int="0x1">
                  <match key="volume.is_partition" bool="false">
                      <merge key="volume.label" type="string">Kindle Internal Storage USB Device</merge>
                      <merge key="kindle.mainvolume" type="string">KINDLE</merge>
                  </match>
              </match>
          </match>
      </match>
  </device>
  <device>
      <match key="info.category" string="volume">
          <match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.vendor_id" int="0x1949">
              <match key="@info.parent:@info.parent:@info.parent:@info.parent:usb.product_id" int="0x1">
                  <match key="volume.is_partition" bool="true">
                      <merge key="volume.label" type="string">Kindle Card Storage USB Device</merge>
                      <merge key="kindle.cardvolume" type="string">KINDLE</merge>
                  </match>
              </match>
          </match>
      </match>
  </device>

</deviceinfo>
kovidgoyal is offline   Reply With Quote