Thanks, that made it work great. Now we have a somewhat more "mobile"
demonstration (although to Ethernet still needs no network when no
WiFi is available ;p)

- Maxime

On 20 nov, 06:44, Sean McNeil <[EMAIL PROTECTED]> wrote:
> This is a well-known problem with splitting the sdcard up. You need to
> do the following for system/core:
>
> diff --git a/mountd/AutoMount.c b/mountd/AutoMount.c
> index bfe8ad1..09e9759 100644
> --- a/mountd/AutoMount.c
> +++ b/mountd/AutoMount.c
> @@ -254,9 +254,6 @@ static int DoMountDevice(const char* device, const
> char* mou
>
>      if (result == 0) {
>          NotifyMediaState(mountPoint, MEDIA_MOUNTED, (flags & MS_RDONLY)
> != 0);
> -    } else if (errno == EBUSY) {
> -    // ignore EBUSY, since it usually means the device is already mounted
> -        result = 0;
>      } else {
>  #if CREATE_MOUNT_POINTS
>          rmdir(mountPoint);
>
> Jay Freeman (saurik) wrote:
> > Ok, thanks for the information on how to debug this. ;P Here's what's going
> > on:
>
> > Normally we get this when the USB cable is unplugged:
>
> > D/mountd  (   30): RequestMount /sdcard
> > D/mountd  (   30): mounting /dev/block/mmcblk0 at /sdcard
> > D/mountd  (   30): mount returned -1 errno: 22
> > D/mountd  (   30): mount failed, errno: 22
> > D/mountd  (   30): mounting /dev/block/mmcblk0p1 at /sdcard
> > D/mountd  (   30): mount returned 0 errno: 0
> > D/mountd  (   30): Write: media_mounted:/sdcard
>
> > If we remove have mmcblk0p2 mounted, we get only this:
>
> > D/mountd  (   30): RequestMount /sdcard
> > D/mountd  (   30): mounting /dev/block/mmcblk0 at /sdcard
> > D/mountd  (   30): mount returned -1 errno: 16
>
> > For those of us who don't have these error numbers memorized, which for the
> > sake of all that is right in the world I hope is all of us ;P:
>
> > #define   EBUSY           16      /* Device or resource busy */
> > #define   EINVAL          22      /* Invalid argument */
>
> > The code that is handling these error messages is here, in AutoMount.c:
>
> >     255     if (result == 0) {
> >     256         NotifyMediaState(mountPoint, MEDIA_MOUNTED, (flags &
> > MS_RDONLY) != 0);
> >     257     } else if (errno == EBUSY) {
> >     258     // ignore EBUSY, since it usually means the device is already
> > mounted
> >     259         result = 0;
> >     260     } else {
> >     261 #if CREATE_MOUNT_POINTS
> >     262         rmdir(mountPoint);
> >     263 #endif
> >     264         LOG_MOUNT("mount failed, errno: %d\n", errno);
> >     265     }
>
> > Removing lines 257-259 does, in fact, fix the problem. When mmcblk0 is
> > specified instead of mmcblk0p1, this function needs to fail for it to bother
> > scanning partitions of the main device. Frankly, I disagree with mountd's
> > assumption that EBUSY there should mean "already mounted" (especially with
> > this counter example), and even if it were true I still believe it to be a
> > mistake: if I have mountd managing this mount, I would prefer it to either
> > know or not whether it is mounted and if I do so manually it should be an
> > error.
>
> > With this change I now get:
>
> > D/mountd  (   32): RequestMount /sdcard
> > D/mountd  (   32): mounting /dev/block/mmcblk0 at /sdcard
> > D/mountd  (   32): mount returned -1 errno: 16
> > D/mountd  (   32): mount failed, errno: 16
> > D/mountd  (   32): mounting /dev/block/mmcblk0p1 at /sdcard
> > D/mountd  (   32): mount returned 0 errno: 16
> > D/mountd  (   32): Write: media_mounted:/sdcard
>
> > Which seems perfectly reasonable to me and makes everything work correctly,
> > including the "someone formatted an SD card without a partition map" case
> > (which I didn't realize would ever come up: sorry about that).
>
> > I have submitted this as this new patch:
> >http://review.source.android.com/r/1964942af0f1
>
> > Sincerely,
> > Jay Freeman (saurik)
> > [EMAIL PROTECTED]
> >http://www.saurik.com/
>
> > --------------------------------------------------
> > From: "Mike Lockwood" <[EMAIL PROTECTED]>
> > Sent: Wednesday, November 19, 2008 3:18 PM
> > To: <[email protected]>
> > Subject: [android-porting] Re: Filesystems (yaffs2, jffs2 and nfs)
>
> >> Changing mountd.conf to mount mmcblk0p1 is a fine workaround for your
> >> problem, but won't work as a general solution.  In particular, it will
> >> not work with SD cards that have a FAT file system starting at the
> >> first sector (with no partition map at all).
>
> >> I think the real problem is somewhere in mountd.  Could you enable
> >> mountd logging by turning on ENABLE_LOG_MOUNT and ENABLE_LOG_SERVER in
> >> mountd.h and send me a logcat?  Send me a dmesg too.  Then I might be
> >> able to figure out a better solution.
>
> >> thanks,
> >> Mike
>
> >> On Wed, Nov 19, 2008 at 5:48 PM, Jay Freeman (saurik) <[EMAIL PROTECTED]>
> >> wrote:
>
> >>> Ok, I've got it!!! I had to change "mmcblk0" to "mmcblk0p1" in
> >>> /etc/mountd.conf. This will probably fix Maxime's problem as well.
>
> >>> I have uploaded this change to Gerrit at:
> >>>http://review.source.android.com/r/7507ee976e1c
>
> >>> For the record, in case this clarifies things, here is complete order of
> >>> events I was experiencing before I made that change:
>
> >>> 1) boot device
> >>> 2) notice that /sdcard mounted fine
> >>> 3) plug in USB cable
> >>> 4) select "mount" from USB notification
> >>> 5) notice that /sdcard correctly unmounted
> >>> 6) unplug USB cable
> >>> 7) /sdcard is immediately remounted
> >>> 8) repeat steps 3-7 a few times to verify sanity
>
> >>> Ok, so far, so good. This is what I expect from an un-messed with device.
>
> >>> 9) plug in USB cable
> >>> 10) mount /dev/block/mmcblk0p2 to /mnt (we now have:)
> >>>      /dev/block/mmcblk0p1 /sdcard vfat rw,dirsync,... 0 0
> >>>      /dev/block/mmcblk0p2 /mnt ext2 rw,errors=continue 0 0
> >>> 11) select "mount" from USB notification
> >>> 12) notice that /sdcard correctly unmounted
> >>> 13) unplug USB cable
> >>> 14) wait and wait and wait... no /sdcard
>
> >>> This is not what I expected, and maid me frowny pants. :(
>
> >>> 15) plug in USB cable (for adb shell)
> >>> 16) unmount /mnt
> >>> 17) unplug USB cable
> >>> 18) still no /sdcard
>
> >>> It was this part I wasn't expecting even going into this e-mail, which
> >>> made
> >>> me think that maybe I should go seriously scan over the mountd
> >>> configuration
> >>> to make certain it wasn't broken (and it was). Yay!
>
> >>> Sincerely,
> >>> Jay Freeman (saurik)
> >>> [EMAIL PROTECTED]
> >>>http://www.saurik.com/
>
> >>> --------------------------------------------------
> >>> From: "Mike Lockwood" <[EMAIL PROTECTED]>
> >>> Sent: Tuesday, November 18, 2008 4:48 PM
> >>> To: <[email protected]>
> >>> Subject: [android-porting] Re: Filesystems (yaffs2, jffs2 and nfs)
>
> >>>> If you boot from the SD card, do you have the files /dev/block/mmcblk0
> >>>> and /dev/block/mmcblk0p1?  If those files are missing, then mountd
> >>>> will not attempt to mount the SD card.
>
> >>>> You might want to turn on:
>
> >>>> #define ENABLE_LOG_MOUNT
> >>>> #define ENABLE_LOG_SERVER
>
> >>>> in system/core/mountd/mountd.h to enable some extra logcat diagnostics
> >>>> in mountd so you can see what's going on.
>
> >>>> Mike
>
> >>>> On Tue, Nov 18, 2008 at 6:52 PM, Jay Freeman (saurik)
> >>>> <[EMAIL PROTECTED]>
> >>>> wrote:
>
> >>>>> In my experience, using any part of the SD card makes /sdcard not work.
> >>>>> Example: if, after the system has already booted up and /sdcard is
> >>>>> mounted,
> >>>>> I mount a second partition off the SD card, everything is fine until I
> >>>>> next
> >>>>> need /sdcard to mount. Specifically, if I plug in the USB cable it
> >>>>> works,
> >>>>> if
> >>>>> I ask the G1 to mount over USB that even works (and /sdcard is
> >>>>> unmounted),
> >>>>> but when I unplug the USB cable nothing happens: I need to unmount my
> >>>>> second
> >>>>> partition to get Android to understand that the card isn't in use
> >>>>> anymore.
> >>>>> Maybe its doing something like checking the number of active usages of
> >>>>> the
> >>>>> base card rather than the one partition it wants or something (or maybe
> >>>>> its
> >>>>> something weird in mountd: I haven't even looked into how /sdcard works
> >>>>> yet). -J
>
> >>>>> --------------------------------------------------
> >>>>> From: "Maxime Petazzoni" <[EMAIL PROTECTED]>
> >>>>> Sent: Tuesday, November 18, 2008 3:00 PM
> >>>>> To: "android-porting" <[email protected]>
> >>>>> Subject: [android-porting] Re: Filesystems (yaffs2, jffs2 and nfs)
>
> >>>>>> I may have a similar problem here. I'm trying to run Android entirely
> >>>>>> off the SD card (actually, microSD, on the Zoom). I made three
> >>>>>> partitions :
>
> >>>>>> - /dev/mmcblk0p1, vfat, 1G, to be mounted as /sdcard for media data
> >>>>>> - /dev/mmcblk0p2, msdos, 10M, to host the uImage for U-Boot (i could
> >>>>>> have put it on the first partition, but here it's hidden from the
> >>>>>> user)
> >>>>>> - /dev/mmcblk0p3, ext3, 1.99G, to be mounted as the entire Android
> >>>>>> root filesystem
>
> >>>>>> Using the following bootargs : 'console=ttyS2,115200n8 ip=none rw
> >>>>>> rootwait root=/dev/mmcblk0p3 init=/init' and the following bootcmd :
> >>>>>> 'mmcinit;fatload mmc 0:2 0x81600000 uImage;bootm 0x81600000'. The
> >>>>>> system boots and runs fine, but there's nothing mounted in /sdcard.
>
> >>>>>> Did you ever got something similar ? How did you get the sdcard to be
> >>>>>> mounted by Android when not using NFS root ? When booting from NFS
> >>>>>> with the card already inserted, it works and /dev/block/mmcblk0p1 gets
> >>>>>> mounted as /sdcard.
>
> >>>>>> Thanks,
> >>>>>> - Maxime
>
> >>>>>> On Nov 11, 7:15 am, "Misael Lopez" <[EMAIL PROTECTED]> wrote:
>
> >>>>>>>> What I did for that is
> >>>>>>>> to split the sdcard into 2 partitions: fat for user data like
> >>>>>>>> music,
> >>>>>>>> videos, etc, and ext3 for the /data partition.
>
> >>>>>>> Did you do something else apart from creating/formatting the
> >>>>>>> partitions? I tried the
> >>>>>>> same but Music application never accepted the card (even it the fat
> >>>>>>> partition is
>
> ...
>
> plus de détails »
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [EMAIL PROTECTED]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---

Reply via email to