0

I would like to find the host OS while enumerating and select only the corresponding OS image file with the mass storage driver.

For example: "insmod g_mass_storage.ko file=/win.iso,mac.iso"

While executing the above command, when the device is attached to WINDOWS, i need to show up win.iso instead of exposing mac.iso. The command should look like "insmod g_mass_storage.ko file=/win.iso"

While executing the above command, when the device is attached to MAC, i need to show up mac.iso instead of exposing win.iso. The command should look like "insmod g_mass_storage.ko file=/mac.iso".

I would appreciate any other thoughts/work around to this problem.

user1427180
  • 133
  • 2
  • 9
  • You might be able to deduce it from behavior, but its not formally specified to the USB device what the host OS is. And your detection might break at the next OS upgrade if the implementation details you rely on change. Why not just have a larger ISO with both programs on it (and perhaps data in common) as is typical with CD's? – Chris Stratton Dec 22 '12 at 16:33
  • While I was looking at the multiple options, I do ended up with hybrid ISO image. But the now issue is as per my understanding, ISO images are read only and we cann't update the ISO images. Is there any work around for updating/editing the ISO images instead of overwriting the whole ISO image. As a part of remote upgrade, we need to have this feature and updating the complete ISO Image for minor changes doesn't really looks like a good option. – user1427180 Dec 24 '12 at 17:58
  • Depending on how the ISO is constructed you may actually be able to binary patch it with some kind of diff tool - as far your as your system is concerned, it *is* just data when not in use. However ISO may not be the only option - perhaps you can use some variation of FAT, ugly as it is. – Chris Stratton Dec 24 '12 at 18:32
  • The trouble is with MAC. It only recognizes as CDROM when the image is Hybrid ISO.I guess FAT or any other partition/Image with read write may not be the option for me. In fact i tried these options with no luck. All i need as an read/write hybrid image to show up as CDROM in both platforms. – user1427180 Dec 24 '12 at 20:24
  • But you are not actually a cdrom anyway. Macs definitely recognize usb mass storage devices (memory sticks, etc) with fat file systems. – Chris Stratton Dec 24 '12 at 20:26
  • Yes that is true and it do recognizes it as Mass storage. I applied the patch to the mass storage driver to show up the hybrid ISO image as CDROM in MAC. But then i ended up with read only file system. – user1427180 Dec 24 '12 at 20:37
  • The file system may be read only when mounted, but the data file which backs it would not be read only when not mounted; however figuring out how to change it might be tricky. The advantage of FAT (without pretending to be a CDROM) would be that you could mount it locally on the linux device and change it's contents. With an iso you are more likely to have to diff/patch the file as a binary blob, without trying to mount it. – Chris Stratton Dec 24 '12 at 21:33

0 Answers0