Difference between revisions of "User:Gordon/Optical Drive Testing Script/scratchpad"

From FreekiWiki
Jump to navigation Jump to search
Line 40: Line 40:
  
 
==Optical drive examination procedure==
 
==Optical drive examination procedure==
# <code>wodim dev=/dev/sr0 -prcap</code>
+
# Given a block device (defaults to <code>/dev/sr0</code>), query HAL via DBus to see if we can get a HAL UDI for a device with capability <code>storage.cdrom</code> and a property <code>block.device</code> that corresponds.
#* Makes sure a drive is there
+
# Query HAL about the drive's capabilities and store them.
#* Gets a list of most capabilities
+
# Query <code>wodim</code> -- probably by scraping stdout of <code>wodim dev=/dev/sr0 -prcap</code> about the drive's capabilities and store those as well.  Does NOT detect DVD+R capability.
#* Does NOT distinguish DVD-R from DVD+R capability
+
# Find any mismatches and decide whether to alert the user (???)
  
or alternatively...
+
Scratchpad for command line hal...
  
 
# <code>hal-find-by-capability --capability storage.cdrom</code> to get a udi
 
# <code>hal-find-by-capability --capability storage.cdrom</code> to get a udi
 
# <code>lshal -u [udi]</code> reveals the drive's capabilities one by one, including plusr, dvdram, etc.  Dunno about lightscribe.
 
# <code>lshal -u [udi]</code> reveals the drive's capabilities one by one, including plusr, dvdram, etc.  Dunno about lightscribe.

Revision as of 19:40, 9 January 2010

Dependencies

Ubuntu

  • python-setuptools (?)
  • python-virtualenv
  • python-pip
  • python-dbus (this won't install to a virtualenv based on 10 min of trying, so no-site-packages shouldn't be used when creating the virtualenv for lazers)
  • mercurial (won't be needed for a dpkg dependency, most likely)
  • hal (probably -- it probably has to be there to talk to via python-dbus)
  • cdrkit (probably)
  • dvd+rw-tools (probably)

Python

(Hopefully) see pip-requirements.txt once the project is closer to completion, and automatically install all these with pip.


Development installation

  1. Install all Ubuntu dependencies
  2. cd to the dir where you want the virtualenv containing the code to live.
  3. virtualenv lazers (I would prefer to use --no-site-packages but python-dbus/dbus-python doesn't play nice)
  4. cd lazers
  5. . bin/activate
  6. pip install -E . yolk (optional, but useful)
  7. pip install -E . cmdln
  8. pip install -E . nose (if you want to run the tests)
  9. mkdir src
  10. cd src
  11. hg clone http://bitbucket.org/gmfreegeek/lazers/

Optical drive examination procedure

  1. Given a block device (defaults to /dev/sr0), query HAL via DBus to see if we can get a HAL UDI for a device with capability storage.cdrom and a property block.device that corresponds.
  2. Query HAL about the drive's capabilities and store them.
  3. Query wodim -- probably by scraping stdout of wodim dev=/dev/sr0 -prcap about the drive's capabilities and store those as well. Does NOT detect DVD+R capability.
  4. Find any mismatches and decide whether to alert the user (???)

Scratchpad for command line hal...

  1. hal-find-by-capability --capability storage.cdrom to get a udi
  2. lshal -u [udi] reveals the drive's capabilities one by one, including plusr, dvdram, etc. Dunno about lightscribe.