On Wed, 9 Dec 2009, Andreas Kemnade wrote: > On Wed, 9 Dec 2009 10:39:58 -0500 (EST) > Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > > > > Originally I wrote the cdrom additions using a 2048-byte block size. > > This turned out to be quite messy, and when I realized that the SCSI > > spec allows a CD drive to use 512-byte blocks I gladly removed all the > > support for larger sectors. > What worth has a standard if so many people do not care? > It is messy because constants are spread all over the code. My patch > does not make that better. I do not see a reason why not at least put the > 512, 9 and all calculated 2048/512=4 into constants (which should not > increase runtime) They already are constants. And the runtime doesn't matter, it's just a question of making the code more awkward. > or variables (to be set according to the cdrom parameter). That's what I did originally. > That would prevent a lot of mess. > Before I start cleaning up, I would like to hear an opinion on this. Maybe inline routines for conversion between byte offsets and block numbers would help. > If every BIOS would boot from every usb stick I would not care about the block > size problem. I can put a file_gadget into my pocket but not a cdrom drive. > So to me booting from CDs is very useful. > > > > > I cleaned up the patch especially the sector size stuff and with that patch > > > I have installed ubuntu from a g_file_storage_gadget in cdrom mode successfully. > > > > Of course you didn't bother to change do_write() and a bunch of other > > places. Doing it properly means reintroducing all that mess, which I'm > > not anxious to do. > > Even wodim dev=/dev/scdX -toc fails, so if you want to have cd write support, > there seems to be still a lot to do. I was thinking more along the lines of DVD-RAM, which doesn't need wodim. g_file_storage doesn't have true CD write support -- and it never will, since it doesn't allow audio tracks (or more than one track for that matter) or subchannels or any of the other fancy stuff. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html