Rechercher dans ce blog

jeudi 11 février 2021

Use usb Apple superdrive with linux

 

from techtalk – Christian Moser

Thanks to him. 


Unlock with SCSI Generic (sg) driver

For communicating with the SCSI device directly we need the Linux SCSI Generic (sg) driver packages.

# Debian
sudo apt-get install sg3-utils

Lookup the device, it should be sr0 or sr1 by default depending on how many USB disc drives are currently attached. Check the output of following command to get a list off all device paths:

ls /dev

After you’ve the SuperDrive identified, we’ll send the magic sequence to the device.

# Do magic...
sg_raw /dev/sr0 EA 00 00 00 00 00 01

Try to insert a disc, the drive should be awake now and start initialising the disc. For now the last step is necessary each time the drive is unplugged, so let’s automate it!

Custom udev rule

We’ll make us of the udev device manager. It runs as a deamon and receives events each time a device is initialised or removed. Furthermore, it features an extensible rule set for easy customising. Please check out this very good guide for further instructions.

Let’s write such a custom rule.

# Debian
sudo nano /etc/udev/rules.d/99-local.rules

Add following rule definition.

# Initialise Apple SuperDrive
ACTION=="add", ATTRS{idProduct}=="1500", ATTRS{idVendor}=="05ac", DRIVERS=="usb", RUN+="/usr/bin/sg_raw /dev/$kernel EA 00 00 00 00 00 01"

This will do the “magic” each time a SuperDrive device is connected. To test the rule, disconnect the drive and connect it again, the drive should be unlocked, already.

Aucun commentaire:

Enregistrer un commentaire