On Wed, May 30, 2007 at 05:09:55PM +0200, Martin Toft wrote:
> When connecting a Nikon Coolpix L10 camera to my laptop via USB, no i
> partition shows up:
[snip]

Thanks to krw@, the cause of the problem has been found! Yay! :)

The msdos partition on my camera's flash memory extends past the end of
the device. OpenBSD therefore refused to make the fake i label, as this
condition is checked for in /usr/src/sys/arch/i386/i386/disksubr.c (line
193). After having commented out the check, rebuilt and installed a new
kernel, I can now use my camera with OpenBSD. disklabel now warns me:

  $ sudo disklabel sd0
  [snip]
  16 partitions:
  #             size        offset  fstype [fsize bsize  cpg]
    c:       4019904             0  unused      0     0      # Cyl     0 -   
250*
    i:       4022029           243   MSDOS                   # Cyl     0*-   
250*
  disklabel: partition i: partition extends past end of unit

The simple change:

--- /usr/src/sys/arch/i386/i386/disksubr.c.orig Wed May 30 21:19:37 2007
+++ /usr/src/sys/arch/i386/i386/disksubr.c      Wed May 30 21:23:54 2007
@@ -190,8 +190,6 @@
 
                        if (dp2->dp_typ == DOSPTYP_OPENBSD)
                                continue;
-                       if (letoh32(dp2->dp_size) > lp->d_secperunit)
-                               continue;
                        if (letoh32(dp2->dp_start) > lp->d_secperunit)
                                continue;
                        if (letoh32(dp2->dp_size) == 0)

I know it's not an optimal situation, but this is the way the in-camera
software formatted the flash memory.

Best regards,
Martin

Reply via email to