Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usb: gadget: mass_storage: added sysfs entry for cdrom to LUNs #2

Closed
wants to merge 1 commit into from

Conversation

FrozenCow
Copy link
Contributor

This patch adds a "cdrom" sysfs entry for each mass_storage LUN, just
like "ro" sysfs entry. This allows switching between USB and CD-ROM
emulation without reinserting the module or recompiling the kernel.

As requested in: http://forum.xda-developers.com/showpost.php?p=45293017&postcount=1505

This patch adds a "cdrom" sysfs entry for each mass_storage LUN, just
like "ro" sysfs entry. This allows switching between USB and CD-ROM
emulation without reinserting the module or recompiling the kernel.

Change-Id: Idf83c74815b1ad370428ab9d3e5503d5f7bcd3b6
@FrozenCow
Copy link
Contributor Author

I am not sure whether this actually works, because I don't have a Sony device nor do I have the required config to compile the kernel. However since the patch worked for various Samsung devices (and it applied without problems) it should just work.

@DooMLoRD
Copy link
Owner

DooMLoRD commented Sep 5, 2013

@FrozenCow can u tell me how do i check if this is working? i will build test kernel and check it out

@FrozenCow
Copy link
Contributor Author

The following file should exist:

/sys/devices/platform/msm_hsusb/gadget/lun0/cdrom

When you have USB Mass Storage enabled (and you can see a USB-drive on your PC) you should be able to unplug the phone and execute:

echo 1 > /sys/devices/platform/msm_hsusb/gadget/lun0/cdrom

Plug the phone back in and your phone should pop up as a CD-rom device.

Alternatively you can install DriveDroid (https://play.google.com/store/apps/details?id=com.softwarebakery.drivedroid). In DriveDroid follow the initial setup to see whether your phone pops up as USB-drive in Windows (you may skip rebooting your PC and trying to boot off of the phone). After that select 'drivedroid.img' (or any other image) and a dialog will pop up similar to this:
http://softwarebakery.com/using-rufus-to-create-bootable-usb-images/04-selectusbrw.png

In this dialog you should see the CD-rom icons in the right column (this is hidden when the device does not have the CD-rom patch). Just to be safe, unplug the phone and press the first CD-rom icon. A notification should pop up that the image was hosted succesfully. Now plug your phone back in and your phone should pop up on your PC as a CD-rom device. (the content will be unreadable when drivedroid.img is used, but this is normal, a real ISO file is needed to fully test the rest, but you can presume from here that everything works).

@DooMLoRD
Copy link
Owner

thanks working perfectly fine!

merged offline!

@DooMLoRD DooMLoRD closed this Sep 12, 2013
@FrozenCow
Copy link
Contributor Author

Aah cool! Thanks for merging!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants