Difference between revisions of "CDemu"

From ArchWiki
Jump to: navigation, search
(add new option needed when calling cdemu)
(Instructions for systemd)
(35 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[Category:HOWTOs (English)]]
+
[[Category:Optical]]
[[Category:Utilities (English)]]
+
[[zh-CN:CDemu]]
 +
[http://cdemu.sourceforge.net/ CDemu] is a software suite designed to emulate an optical drive and disc (including CD-ROMs and DVD-ROMs). It enables you to use other disk image formats that contain more than just the standard ISO-9660 filesystem, for instance .bin/.cue, .nrg, or .ccd images. {{Ic|mount}} can directly handle only .iso disc images (which contain a single filesystem), but many images contain multiple sessions, mixed data/audio tracks… In short, cdemu enables you to mount nearly any kind of image file with ease.
  
{{stub}}
+
==Installation==
 +
CDemu can be [[pacman|installed]] with the package {{Pkg|cdemu-client}}, available in the [[official repositories]].
 +
To enable the daemon in systemd run:
 +
# systemctl enable cdemu-daemon.service
  
== About ==
+
===GUI===
 +
There are several GUIs available in the [[AUR]].
  
[http://cdemu.sourceforge.net/ CDemu] is a kernel module that emulates a CD- or DVD-ROM device.  It enables you to use disc images that contain more than a standard ISO-9660 filesystem, like .bin/.cue, .nrg, or .ccd images.  It's needed only because <tt>mount</tt> can only directly handle .iso disc images, which can only contain a single filesystem, but many CDs have multiple sessions, mixed data/audio tracks, etc.  CDemu enables you to get to the full, original contents of these CD images.
+
* GTK/Gnome: {{AUR|gcdemu}} is the official GTK version, which also provides a GNOME panel applet.
 +
* KDE: {{AUR|kde-cdemu-manager}} is the KDE equivalent which also integrates with Dolphin's Actions menu when right clicking an image file.
  
The original CDemu is currently at version 0.8. As you can read on the [http://cdemu.sourceforge.net/ CDemu website], development has stopped on that line of CDemu, and a rewrite is under way, dubbed userspace-cdemu.  userspace-cdemu should be even more stable than the original version at this point.
+
==Examples==
 +
Loading a single image to first device:
 +
  # cdemu load 0 ~/image.mds
  
== Using Original CDemu ==
+
Loading multiple-file image to first device:
 +
# cdemu load 0 ~/session1.toc ~/session2.toc ~/session3.toc
  
CDemu can be found in the unsupported section of [[AUR]] under the obvious name of <tt>cdemu</tt>.
+
Loading a text-based image in non-ASCII/non-Unicode encoding:
 +
# cdemu load 0 ~/image.cue --encoding=windows-1250
  
TODO: somebody with more experience with original CDemu please fill this out.
+
Loading an encrypted image with password provided as an argument:
 +
# cdemu load 0 ~/image.daa --password=seeninplain
  
== userspace-cdemu ==
+
Unloading first device:
 +
# cdemu unload 0
  
userspace-cdemu has a different architecture than the original.  Instead of a single kernel module that does all the work parsing image files and presenting the data to the user, userspace-cdemu takes advantage of a kernel module (<tt>vhba</tt>) that simply emulates a SCSI CD/DVD device, putting off as much work on the existing kernel code as possible. Then the cdemud daemon (<tt>cdemud</tt>) runs in the background communicating with the kernel module.  The image parsing code has been abstracted out into a library (<tt>libmirage</tt>), and can be easily extended for future formats.  The daemon responds to [[dbus]] commands from clients.  The userspace-cdemu package comes with two example clients: one that simply runs from the command line (<tt>cdemu-client</tt>), and a [[GNOME]] panel applet (<tt>gcdemu</tt>).
+
Displaying device status:
 +
  # cdemu status
  
=== Installing userspace-cdemu ===
+
Displaying device mapping information:
 +
# cdemu device-mapping
  
The userspace-cdemu suite can be found under the unsupported section of [[AUR]]. A search for "userspace-cdemu" should turn up all the necessary packages.
+
Setting daemon debug mask for the first device:
 +
  # cdemu daemon-debug-mask 0 0x01
  
You'll need to install at least following packages, in roughly this order:
+
Obtaining library debug mask for the first device:
* <tt>vhba</tt>
+
# cdemu library-debug-mask 0
* <tt>libmirage</tt>
+
* <tt>cdemud</tt>
+
  
From here, you've got options of what client you want to use. The simple command line client is <tt>cdemu-client</tt>, and the [[GNOME]] panel applet is <tt>gcdemu</tt>.  You'll need at least one, but you can install both too as they don't conflict.
+
Disabling DPM emulation on all devices:
 +
  # cdemu dpm-emulation all 0
  
=== Using userspace-cdemu ===
+
Enabling transfer rate emulation on first device:
 +
# cdemu tr-emulation 0 1
  
Once all the requisite packages are installed, you'll want to start the daemon.  You can do that by simply running:
+
Changing device ID of first device:
  # /etc/rc.d/cdemud start
+
  # cdemu device-id 0 "MyVendor" "MyProduct" "1.0.0" "Test device ID"
as root.
+
  
Add <tt>cdemud</tt> to the list of <tt>DAEMONS=</tt> in /etc/rc.conf to have the daemon start when the system boots. The cdemud rc script inserts the vhba kernel module, so you don't need to worry about adding <tt>vhba</tt> to <tt>MODULES=</tt>.
+
Enumerating supported parsers:
 +
  # cdemu enum-supported-parsers
  
Now you're ready to use all those .bin CD images you have lying around.  The command line client is simple enough:
+
Enumerating supported fragments:
  $ cdemu load 0 <imagefile>
+
  # cdemu enum-supported-fragments
will load the imagefile to the first (and only by default) emulated device.
+
  
'''NOTE:''' If you run cdemud by initscript, you may need to add '-b system' option when calling cdemu.
+
Enumerating supported daemon debug masks:
  $ cdemu -b system load 0 <imagefile>
+
  # cdemu enum-daemon-debug-masks
  
Or, to use the [[GNOME]] panel applet, right click on a panel and click "Add to Panel...", scroll all the way down and add the "gCDEmu Applet". Then simply click on the icon and click on whatever device to bring up the open file dialog, select an image file, and hit ok.
+
Enumerating supported library debug masks:
 +
  # cdemu enum-library-debug-masks
  
Now, you can mount the virtual CD so you can get to the data on it:
+
Displaying daemon and library version:
  # mount -t iso9660 /dev/sr1 /media
+
  # cdemu version
<tt>/dev/sr1</tt> is the device that cdemud will create if you already have one real CD/DVD device (which would be <tt>/dev/sr0</tt>).  Tailor that line to suit your system.
+
 
+
From here, you can browse the CD's data contents in <tt>/media</tt> like it was any regular CD.
+

Revision as of 10:48, 8 February 2013

CDemu is a software suite designed to emulate an optical drive and disc (including CD-ROMs and DVD-ROMs). It enables you to use other disk image formats that contain more than just the standard ISO-9660 filesystem, for instance .bin/.cue, .nrg, or .ccd images. mount can directly handle only .iso disc images (which contain a single filesystem), but many images contain multiple sessions, mixed data/audio tracks… In short, cdemu enables you to mount nearly any kind of image file with ease.

Installation

CDemu can be installed with the package cdemu-client, available in the official repositories. To enable the daemon in systemd run:

# systemctl enable cdemu-daemon.service

GUI

There are several GUIs available in the AUR.

  • GTK/Gnome: gcdemuAUR is the official GTK version, which also provides a GNOME panel applet.
  • KDE: kde-cdemu-managerAUR is the KDE equivalent which also integrates with Dolphin's Actions menu when right clicking an image file.

Examples

Loading a single image to first device:

# cdemu load 0 ~/image.mds

Loading multiple-file image to first device:

# cdemu load 0 ~/session1.toc ~/session2.toc ~/session3.toc

Loading a text-based image in non-ASCII/non-Unicode encoding:

# cdemu load 0 ~/image.cue --encoding=windows-1250

Loading an encrypted image with password provided as an argument:

# cdemu load 0 ~/image.daa --password=seeninplain

Unloading first device:

# cdemu unload 0

Displaying device status:

# cdemu status

Displaying device mapping information:

# cdemu device-mapping

Setting daemon debug mask for the first device:

# cdemu daemon-debug-mask 0 0x01

Obtaining library debug mask for the first device:

# cdemu library-debug-mask 0

Disabling DPM emulation on all devices:

# cdemu dpm-emulation all 0

Enabling transfer rate emulation on first device:

# cdemu tr-emulation 0 1

Changing device ID of first device:

# cdemu device-id 0 "MyVendor" "MyProduct" "1.0.0" "Test device ID"

Enumerating supported parsers:

# cdemu enum-supported-parsers

Enumerating supported fragments:

# cdemu enum-supported-fragments

Enumerating supported daemon debug masks:

# cdemu enum-daemon-debug-masks

Enumerating supported library debug masks:

# cdemu enum-library-debug-masks

Displaying daemon and library version:

# cdemu version