G
G
Groosha2015-04-17 00:27:02
Android
Groosha, 2015-04-17 00:27:02

How to mount Android device as CD-ROM?

Hello. There is a device - Galaxy S4 with custom firmware and kernel. You need to mount the ISO image so that Windows and Linux see it as a CD-ROM (the image is on the device). There is a DriveDroid program, it does everything right, I need to copy its behavior. So far without success. Win 8 writes, they say, the device needs to be formatted.
Code I use (bash):

# Отключение USB
echo 0 > /sys/class/android_usb/android0/enable

# Выставление нужных значений
echo 0x04e8 > /sys/class/android_usb/android0/idVendor
echo 0x6860 > /sys/class/android_usb/android0/idProduct

# Выставляю режим UMS
echo mass_storage > /sys/class/android_usb/android0/functions

# Включаю CD-ROM и ставлю режим Read-only
echo 1 > /sys/class/android_usb/android0/f_mass_storage/lun0/cdrom
echo 1 > /sys/class/android_usb/android0/f_mass_storage/lun0/ro

# Указываю путь к образу
echo /mnt/shell/emulated/0/obraz.iso > /sys/class/android_usb/android0/f_mass_storage/lun0/file

#Включаю USB
echo 1 > /sys/class/android_usb/android0/enable

The problem is that in this case, cdrom remains at zero (and should be 1), so Windows does not perceive it correctly. Maybe something else needs to be written somewhere?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
Groosha, 2015-05-05
@Groosha

Problem solved! It was enough before the "fraud" with the cdrom and ro files to clear the contents of the file file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question