Difference between revisions of "User:Gordon/Optical Drive Testing Script/scratchpad"
Jump to navigation
Jump to search
(→Ubuntu) |
|||
(9 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
* http://club.myce.com/f52/determine-dvd-r-write-capability-ubuntu-306981/ not much luck yet | * http://club.myce.com/f52/determine-dvd-r-write-capability-ubuntu-306981/ not much luck yet | ||
* http://ubuntuforums.org/showthread.php?t=1240043 -- maybe use 'hal' to determine dvd+r info? | * http://ubuntuforums.org/showthread.php?t=1240043 -- maybe use 'hal' to determine dvd+r info? | ||
− | + | * http://dannipenguin.livejournal.com/206645.html -- python hal+dbus example | |
+ | * http://ubuntuforums.org/showthread.php?p=8928791 -- genisoimage "Short read on old image" error | ||
==Dependencies== | ==Dependencies== | ||
Line 12: | Line 13: | ||
* python-virtualenv | * python-virtualenv | ||
* python-pip | * 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) | ||
+ | * python-openssl (probably, for fast pseudorandom number generator, faster than urandom) | ||
* mercurial (won't be needed for a dpkg dependency, most likely) | * mercurial (won't be needed for a dpkg dependency, most likely) | ||
+ | * [http://hal.freedesktop.org/ hal] (probably -- it probably has to be there to talk to via python-dbus) | ||
+ | * cdrkit (probably) or cdrtools | ||
+ | ** cdrtools is not included in Debian and Ubuntu due to licensing disputes | ||
+ | ** however, it has bugfixes which the Debian fork, cdrkit, does not | ||
+ | ** [[/cdrtools installation on Ubuntu 9.10|see here]] for cdrtools installation details | ||
* [http://fy.chalmers.se/~appro/linux/DVD+RW/ dvd+rw-tools] (probably) | * [http://fy.chalmers.se/~appro/linux/DVD+RW/ dvd+rw-tools] (probably) | ||
Line 21: | Line 29: | ||
* [http://somethingaboutorange.com/mrl/projects/nose/0.11.1/ nose] (for testing) | * [http://somethingaboutorange.com/mrl/projects/nose/0.11.1/ nose] (for testing) | ||
** [http://ivory.idyll.org/articles/nose-intro.html examples] | ** [http://ivory.idyll.org/articles/nose-intro.html examples] | ||
+ | |||
==Development installation== | ==Development installation== | ||
# Install all Ubuntu dependencies | # Install all Ubuntu dependencies | ||
# cd to the dir where you want the virtualenv containing the code to live. | # cd to the dir where you want the virtualenv containing the code to live. | ||
− | # <code>virtualenv --no-site-packages | + | # <code>virtualenv lazers</code> (I would prefer to use --no-site-packages but python-dbus/dbus-python doesn't play nice) |
# <code>cd lazers</code> | # <code>cd lazers</code> | ||
# <code>. bin/activate</code> | # <code>. bin/activate</code> | ||
Line 36: | Line 45: | ||
==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. |
− | # | + | # Query HAL about the drive's capabilities and store them. |
− | # | + | # 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. |
− | # | + | # Find any mismatches and decide whether to alert the user (???) |
+ | |||
+ | Scratchpad for command line hal... | ||
+ | |||
+ | # <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. |
Latest revision as of 18:15, 13 March 2010
- http://club.myce.com/f34/dvd-rw-multisession-questions-306321/
- http://club.myce.com/f33/best-media-optical-drive-testing-306320/
- http://club.myce.com/f52/uniquely-iding-optical-discs-306323/
- http://fy.chalmers.se/~appro/linux/DVD+RW/
- http://club.myce.com/f52/determine-dvd-r-write-capability-ubuntu-306981/ not much luck yet
- http://ubuntuforums.org/showthread.php?t=1240043 -- maybe use 'hal' to determine dvd+r info?
- http://dannipenguin.livejournal.com/206645.html -- python hal+dbus example
- http://ubuntuforums.org/showthread.php?p=8928791 -- genisoimage "Short read on old image" error
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)
- python-openssl (probably, for fast pseudorandom number generator, faster than urandom)
- 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) or cdrtools
- cdrtools is not included in Debian and Ubuntu due to licensing disputes
- however, it has bugfixes which the Debian fork, cdrkit, does not
- see here for cdrtools installation details
- 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
- Install all Ubuntu dependencies
- cd to the dir where you want the virtualenv containing the code to live.
virtualenv lazers
(I would prefer to use --no-site-packages but python-dbus/dbus-python doesn't play nice)cd lazers
. bin/activate
pip install -E . yolk
(optional, but useful)pip install -E . cmdln
pip install -E . nose
(if you want to run the tests)mkdir src
cd src
hg clone http://bitbucket.org/gmfreegeek/lazers/
Optical drive examination procedure
- 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 capabilitystorage.cdrom
and a propertyblock.device
that corresponds. - Query HAL about the drive's capabilities and store them.
- Query
wodim
-- probably by scraping stdout ofwodim dev=/dev/sr0 -prcap
about the drive's capabilities and store those as well. Does NOT detect DVD+R capability. - Find any mismatches and decide whether to alert the user (???)
Scratchpad for command line hal...
hal-find-by-capability --capability storage.cdrom
to get a udilshal -u [udi]
reveals the drive's capabilities one by one, including plusr, dvdram, etc. Dunno about lightscribe.