Difference between revisions of "Didj USB Mounting"

From eLinux.org
Jump to: navigation, search
(make it clear that hardware is optional)
(Udev Rule)
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
This is a list of various techniques for mounting the Didj as a USB drive under Windows, Linux, and OS X. These techniques will make the /Didj folder on the Didj available, give you access to Base/ Data/ and ProgramFiles/ where you will find most of the image and sound files used by the AppManager for the GUI, plus other various files in use, except for the underlying linux system files.
 
This is a list of various techniques for mounting the Didj as a USB drive under Windows, Linux, and OS X. These techniques will make the /Didj folder on the Didj available, give you access to Base/ Data/ and ProgramFiles/ where you will find most of the image and sound files used by the AppManager for the GUI, plus other various files in use, except for the underlying linux system files.
 +
 +
== Prerequisites ==
 +
[[LeapFrog_Pollux_Platform:_LFConnect#Disable_Auto_Start| Disable LFConnect Auto Start Feature]]
 +
* This prevents LFConnect from interfering with the techniques that do not want it running.
  
 
== Programs Needed ==
 
== Programs Needed ==
sg3_util for SCSI Command technique in Linux.
+
SCSI Command technique
 +
* sg3_util for Linux.
 +
* SCSI Utility v0.1 for Windows.
 +
 
 +
== Hardware Needed ==
 +
Required for usbctl options.
 +
 
 +
[[LeapFrog_Pollux_Platform:_Console_Access| Console Access]]
  
SCSI Utility v0.1 or equivalent for SCSI Command technique in Windows.
 
  
(optional) Terminal Program set for 115200 8/n/1, for techniques requiring usbctl commands to be executed on the Didj.  
+
== On Didj ==
 +
This method will leave your Didj partition permanently 'unlocked.' It will always be available to be mounted on a host PC. But will not be available for the Didj itself. It will not automount on the host unless the USB cable is plugged in when the Didj has already been booted.
  
== Hardware Needed ==
+
'' On Didj ''
(optional) UART connection for techniques requiring usbctl commands to be executed on the Didj.
+
echo "UNLOCKED" > /flags/usb_mass_storage
  
 
== Under Windows ==
 
== Under Windows ==
  
'''With LFConnect'''
+
==== With LFConnect Running ====
  
When connecting the Didj to Windows under USB, the contents will be mounted in this folder.
+
When connecting the Didj to Windows under USB, the contents will be mounted in one of these folders, depending on your version of windows.
  
C:\Documents and Settings\All Users\Application Data\Leapfrog\LeapFrog Connect\Mnt\<Didj Serial Number>\0
+
C:\Documents and Settings\All Users\Application Data\Leapfrog\LeapFrog Connect\Mnt\<Didj Serial Number>\0
 +
C:\ProgramData\Leapfrog\LeapFrog Connect\Mnt\<Didj Serial Number>\0
  
 
LFConnect Software must be installed, and allowed to open for this to be accessible.
 
LFConnect Software must be installed, and allowed to open for this to be accessible.
  
'''With out LFConnect'''
+
==== usbctl on Didj ====
 
 
It still must be installed, but this will prevent the need to have it open.
 
  
Look in Task Manager Process for Monitor.exe, this is the program that tells LFConnect to open when Didj is plugged in. Terminate the process. This will allow you to plug in the Didj to USB with out LFConnect opening, until your next reboot. A more permanent solution is to delete this registry entry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\Monitor which has the value "C:\Program Files\LeapFrog\LeapFrog Connect\Monitor.exe" This will prevent Monitor.exe from starting up when your computer starts.
+
LFConnect still must be installed, but this will prevent the need to have it running.
  
 
You will have to run this command on the Didj from a terminal, to unlock it.
 
You will have to run this command on the Didj from a terminal, to unlock it.
$ usbctl -d mass_storage -a unlock
+
'' On Didj ''
 +
$ usbctl -d mass_storage -a unlock
  
'''Assigning Drive Letter'''
+
==== Assigning Drive Letter ====
 +
[http://wtfmoogle.com/?page_id=741 Assign Drive Letter Pictures]
  
Run these commands on your Didj
+
With LFConnect disabled from auto starting, you can assign a drive letter, and access it like a normal drive
 +
'' On Didj ''
  
 
/etc/init.d/lightning stop
 
/etc/init.d/lightning stop
Line 40: Line 53:
 
usbctl -d mass_storage -a enable
 
usbctl -d mass_storage -a enable
  
Make sure Monitor.exe is disabled, then plug your Didj in, and use the assigning a drive letter technique. As long as you don't allow LFConnect to open, the drive letter will be recognized, even after reboot. You will have to continue using the commands on your Didj to access it, unless you create a custom script on the Didj to handle this.
+
Make sure Monitor.exe is disabled, which can be done via Task Manager, then plug your Didj in.
 +
 
 +
Go to Administrative Tools > Computer Management > Disk Management
  
'''Custom SCSI Command'''
+
Right click the drive, and select '' Change Drive Letters and Paths '' click '' Add '' and assign the letter.
  
Turn on Didj with USB connected. Then open SCSI Utility, under devices look for "LeapFrogDidj" and right click on it, choose 'Execute Custom CDB' which will bring up the Custom CDB dialog. In BYTE 0 put the value C2, for BYTE 1 thru BYTE 9 put the value 0 in, and be sure to leave BYTE 10 thru BYTE 15 blank. CDB Size should equal 10. For Buffer Size value put 0. Then click Execute, there will be a warning dialog box, as the wrong command to the wrong drive, could cause serious issues, make sure LeapFrogDidj is the drive selected, and click Yes. On Windows XP I get a Autoplay dialog box that pops up before it asks me what I want to do. You can also lock the Didj, using the same technique but with C1 instead of C2. To eject the Didj, use C6.
+
As long as you don't allow LFConnect to open, the drive letter will be recognized, even after reboot. You will have to continue using the commands on your Didj to access it, unless you create a custom script on the Didj to handle this.
  
== Under Linux ==
+
==== SCSI Command ====
 +
[[Didj_SCSI_Commands#In_Windows| SCSI Commands Windows]]
  
 +
Commands go in byte 0
 +
* C1 = Unlock (mount)
 +
* C2 = Lock (unmount)
 +
* C6 = Eject.
  
'''Custom SCSI Command With scsi_custom from Didj source'''
+
== Under Linux ==
 +
==== scsi_custom ====
 +
This is a program provided in the Didj sources.
  
 
Compile the program Didj-Linux-4222-20090422-1236\host_tools\scsi\scsi_custom.c with
 
Compile the program Didj-Linux-4222-20090422-1236\host_tools\scsi\scsi_custom.c with
  
$ gcc -o scsi_custom scsi_custom.c
+
$ gcc -o scsi_custom scsi_custom.c
  
  
 
Tail your messages with
 
Tail your messages with
  
$ sudo tail -f /var/log/messages
+
$ sudo tail -f /var/log/messages
  
  
 
Plug in your Didj to the USB
 
Plug in your Didj to the USB
 
  
 
Look in your messages for something like this
 
Look in your messages for something like this
  
kernel: sd 5:0:0:0: Attached scsi generic sg2 type 0
+
kernel: sd 5:0:0:0: Attached scsi generic sg2 type 0
  
 
Your looking for the sg with a number sg0, sg1, sg2 etc.
 
Your looking for the sg with a number sg0, sg1, sg2 etc.
Line 73: Line 94:
 
Now run the scsi_custom app
 
Now run the scsi_custom app
  
$ sudo scsi_custom -c unlock /dev/sg<your number>
+
$ sudo scsi_custom -c unlock /dev/sg<your number>
 
 
 
 
And depending on your system, it should mount the Didj as a USB drive. Mine uses sg0 every time, once you figure out the number, you'll probably only have to run the scsi_custom app to get this work. Thanks to reddog176 for this method.
 
  
 +
And depending on your system, it should auto mount the Didj as a USB drive.
  
'''Custom SCSI Command With sg_raw'''
 
  
Turn on Didj with USB connected.
+
==== SCSI Command ====
+
[[Didj_SCSI_Commands#In_Linux| SCSI Commands Linux]]
  
Tail your messages with
 
  
$ sudo tail -f /var/log/messages
+
==== Udev Rule ====
 +
This is a permanent solution, as the device will be unlocked on plug in by udev. It requires your Linux system to be using udev and have sg3_utils installed, which seems rather common.
  
 +
Create a text file named something like 99-LeapFrog-Didj.rules the number is the order it is called in, 99 works good. Insert this text all on one line:
  
Plug in your Didj to the USB
+
SUBSYSTEM=="scsi_generic", KERNEL=="sg*", ACTION=="add", ATTRS{vendor}=="LeapFrog", ATTRS{model}=="Didj",
 +
MODE="666", NAME="didj", RUN+="/usr/bin/sg_raw /dev/didj C2 00 00 00 00 00 00 00 00 00"
  
Look in your messages for something like this
+
This will run the sg_raw command to unlock the Didj, it also gives it a persistent device name of Didj, so you can further access it thru sg commands with /dev/didj. Also note you won't need sudo as the permissions are changed for regular users.
  
kernel: sd 5:0:0:0: Attached scsi generic sg2 type 0
+
Finally:
 +
$ sudo chown root:root 99-LeapFrog-Didj.rules
 +
$ sudo chmod 644 99-LeapFrog-Didj.rules
 +
$ sudo cp 99-LeapFrog-Didj.rules /etc/udev/rules.d/
  
Your looking for the sg with a number sg0, sg1, sg2 etc.
+
You may have to restart your system for it to take effect or try running:
 
+
$ sudo udevadm test /sys/class/scsi_generic/sg2/
 
 
Make sure you got sg3_utils installed, it came stock with Ubuntu 9.10 for me. The command you'll be using is sg_raw.
 
 
 
 
 
To unlock the Didj
 
 
 
$ sg_raw /dev/sg2 C2 00 00 00 00 00 00 00 00 00
 
 
 
 
 
To eject the Didj
 
 
 
First unmount the Didj
 
 
 
$ sg_raw /dev/sg2 C6 00 00 00 00 00 00 00 00 00
 
 
 
 
 
To lock the Didj
 
 
 
$ sg_raw /dev/sg2 C1 00 00 00 00 00 00 00 00 00
 
 
 
 
 
A word of caution, double check you got the right device, as the wrong command to the wrong device, can be catastrophic.
 
  
 
== Under OS X ==
 
== Under OS X ==
Line 134: Line 135:
  
 
Once you have access to your Didj you can force quit LeapFrog Connect if it's bothering you.  Quitting normally causes it to eject the Didj.  However, you won't be able to unmount the Didj from finder, it keeps mounting again once it's unmounted.  To safely disconnect the Didj you'll have to open LeapFrog Connect again and use the eject button inside the application.
 
Once you have access to your Didj you can force quit LeapFrog Connect if it's bothering you.  Quitting normally causes it to eject the Didj.  However, you won't be able to unmount the Didj from finder, it keeps mounting again once it's unmounted.  To safely disconnect the Didj you'll have to open LeapFrog Connect again and use the eject button inside the application.
 +
 +
[[Category:Didj]]
 +
[[Category:LeapFrog_Pollux_Platform]]

Latest revision as of 19:01, 13 January 2012

This is a list of various techniques for mounting the Didj as a USB drive under Windows, Linux, and OS X. These techniques will make the /Didj folder on the Didj available, give you access to Base/ Data/ and ProgramFiles/ where you will find most of the image and sound files used by the AppManager for the GUI, plus other various files in use, except for the underlying linux system files.

Prerequisites

Disable LFConnect Auto Start Feature

  • This prevents LFConnect from interfering with the techniques that do not want it running.

Programs Needed

SCSI Command technique

  • sg3_util for Linux.
  • SCSI Utility v0.1 for Windows.

Hardware Needed

Required for usbctl options.

Console Access


On Didj

This method will leave your Didj partition permanently 'unlocked.' It will always be available to be mounted on a host PC. But will not be available for the Didj itself. It will not automount on the host unless the USB cable is plugged in when the Didj has already been booted.

On Didj

echo "UNLOCKED" > /flags/usb_mass_storage

Under Windows

With LFConnect Running

When connecting the Didj to Windows under USB, the contents will be mounted in one of these folders, depending on your version of windows.

C:\Documents and Settings\All Users\Application Data\Leapfrog\LeapFrog Connect\Mnt\<Didj Serial Number>\0
C:\ProgramData\Leapfrog\LeapFrog Connect\Mnt\<Didj Serial Number>\0

LFConnect Software must be installed, and allowed to open for this to be accessible.

usbctl on Didj

LFConnect still must be installed, but this will prevent the need to have it running.

You will have to run this command on the Didj from a terminal, to unlock it. On Didj

$ usbctl -d mass_storage -a unlock

Assigning Drive Letter

Assign Drive Letter Pictures

With LFConnect disabled from auto starting, you can assign a drive letter, and access it like a normal drive On Didj

/etc/init.d/lightning stop

usbctl -d mass_storage -a unlock

usbctl -d mass_storage -a enable

Make sure Monitor.exe is disabled, which can be done via Task Manager, then plug your Didj in.

Go to Administrative Tools > Computer Management > Disk Management

Right click the drive, and select Change Drive Letters and Paths click Add and assign the letter.

As long as you don't allow LFConnect to open, the drive letter will be recognized, even after reboot. You will have to continue using the commands on your Didj to access it, unless you create a custom script on the Didj to handle this.

SCSI Command

SCSI Commands Windows

Commands go in byte 0

  • C1 = Unlock (mount)
  • C2 = Lock (unmount)
  • C6 = Eject.

Under Linux

scsi_custom

This is a program provided in the Didj sources.

Compile the program Didj-Linux-4222-20090422-1236\host_tools\scsi\scsi_custom.c with

$ gcc -o scsi_custom scsi_custom.c


Tail your messages with

$ sudo tail -f /var/log/messages


Plug in your Didj to the USB

Look in your messages for something like this

kernel: sd 5:0:0:0: Attached scsi generic sg2 type 0

Your looking for the sg with a number sg0, sg1, sg2 etc.


Now run the scsi_custom app

$ sudo scsi_custom -c unlock /dev/sg<your number>

And depending on your system, it should auto mount the Didj as a USB drive.


SCSI Command

SCSI Commands Linux


Udev Rule

This is a permanent solution, as the device will be unlocked on plug in by udev. It requires your Linux system to be using udev and have sg3_utils installed, which seems rather common.

Create a text file named something like 99-LeapFrog-Didj.rules the number is the order it is called in, 99 works good. Insert this text all on one line:

SUBSYSTEM=="scsi_generic", KERNEL=="sg*", ACTION=="add", ATTRS{vendor}=="LeapFrog", ATTRS{model}=="Didj",
MODE="666", NAME="didj", RUN+="/usr/bin/sg_raw /dev/didj C2 00 00 00 00 00 00 00 00 00"

This will run the sg_raw command to unlock the Didj, it also gives it a persistent device name of Didj, so you can further access it thru sg commands with /dev/didj. Also note you won't need sudo as the permissions are changed for regular users.

Finally:

$ sudo chown root:root 99-LeapFrog-Didj.rules
$ sudo chmod 644 99-LeapFrog-Didj.rules
$ sudo cp 99-LeapFrog-Didj.rules /etc/udev/rules.d/

You may have to restart your system for it to take effect or try running:

$ sudo udevadm test /sys/class/scsi_generic/sg2/

Under OS X

Easier than Windows or Linux.


Plug in your Didj to the USB


Now you can access the didj using terminal or in Finder by selecting the "Go" menu and using "Go to Folder..."

navigate to /Users/*current_user*/.lf_mount_points/


Once you have access to your Didj you can force quit LeapFrog Connect if it's bothering you. Quitting normally causes it to eject the Didj. However, you won't be able to unmount the Didj from finder, it keeps mounting again once it's unmounted. To safely disconnect the Didj you'll have to open LeapFrog Connect again and use the eject button inside the application.