[maemo-commits] [maemo-commits] r18926 - in projects/haf/trunk/ke-recv: debian src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Tue Jul 21 15:42:47 EEST 2009
Author: kihamala
Date: 2009-07-21 15:42:45 +0300 (Tue, 21 Jul 2009)
New Revision: 18926

Modified:
   projects/haf/trunk/ke-recv/debian/changelog
   projects/haf/trunk/ke-recv/src/events.c
   projects/haf/trunk/ke-recv/src/osso-mmc-mount.sh
Log:
add the touch fix back and untested fix for the partition scheme change


Modified: projects/haf/trunk/ke-recv/debian/changelog
===================================================================
--- projects/haf/trunk/ke-recv/debian/changelog	2009-07-21 12:41:19 UTC (rev 18925)
+++ projects/haf/trunk/ke-recv/debian/changelog	2009-07-21 12:42:45 UTC (rev 18926)
@@ -11,6 +11,9 @@
     - Add USB mode signal and querying interface for the USB plugin
     - NOTE: requires infonote and infobanner interfaces to be provided on
       the system bus also
+  * Fixes: NB#114280 - MyDocs gets dated Jan 1 1970 after using USB in mass
+    storage mode
+  * Fixes: NB#128388 - vfat should sit at the first partition
 
  -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Wed, 15 Jul 2009 13:02:48 +0300
 

Modified: projects/haf/trunk/ke-recv/src/events.c
===================================================================
--- projects/haf/trunk/ke-recv/src/events.c	2009-07-21 12:41:19 UTC (rev 18925)
+++ projects/haf/trunk/ke-recv/src/events.c	2009-07-21 12:42:45 UTC (rev 18926)
@@ -915,30 +915,18 @@
 static int mount_volumes(mmc_info_t *mmc, gboolean show_errors)
 {
         const char *mount_args[] = {MMC_MOUNT_COMMAND, NULL, NULL, NULL};
-        volume_list_t *l;
+        volume_list_t *l, *l_on_first_try = NULL;
         const char *udi = NULL, *device = NULL;
         int ret, count = 0;
        
         l = get_nth_volume(mmc, mmc->preferred_volume);
-        /*
-        if (l && l->corrupt) {
-                ULOG_DEBUG_F("partition %d is corrupt",
-                             mmc->preferred_volume);
-                return 0;
-        }
-        */
 
         if (l == NULL || l->udi == NULL) {
                 ULOG_DEBUG_F("partition %d not found", mmc->preferred_volume);
-                if (mmc->preferred_volume != 1 && mmc->internal_card) {
-                        /* workaround for not yet partitioned systems */
-                        ULOG_DEBUG_F("falling back to partition 1!");
-                        l = get_nth_volume(mmc, 1);
-                        if (l == NULL || l->udi == NULL)
-                                return 0;
-                } else
-                        return 0;
+                return 0;
         }
+
+try_again:
         udi = l->udi;
         device = l->dev_name;
 
@@ -973,6 +961,21 @@
         } else {
                 /* corrupt beyond mounting, or unsupported format */
                 ULOG_DEBUG_F("exec_prog returned %d", ret);
+
+                if (!l_on_first_try && l->volume_number == 1 &&
+                    mmc->internal_card) {
+                        /* try partition 3 for not yet partitioned systems */
+                        ULOG_DEBUG_F("falling back to partition 3");
+                        l_on_first_try = l;
+                        l = get_nth_volume(mmc, 3);
+                        if (l == NULL || l->udi == NULL)
+                                l = l_on_first_try;
+                        else
+                                goto try_again;
+                } else if (l_on_first_try)
+                        /* the partition on first try was just corrupt */
+                        l = l_on_first_try;
+
                 l->mountpoint = NULL;
                 l->corrupt = 1;
                 inform_mmc_swapping(FALSE, mmc);

Modified: projects/haf/trunk/ke-recv/src/osso-mmc-mount.sh
===================================================================
--- projects/haf/trunk/ke-recv/src/osso-mmc-mount.sh	2009-07-21 12:41:19 UTC (rev 18925)
+++ projects/haf/trunk/ke-recv/src/osso-mmc-mount.sh	2009-07-21 12:42:45 UTC (rev 18926)
@@ -77,6 +77,7 @@
     for d in .sounds .videos .documents .images .camera; do
       mkdir -p $MP/$d
     done
+    touch $MP
   elif [ "x$MP" = "x/home/user/MyDocs" ]; then
     logger "$0: '$MP' is not writable"
   fi

More information about the maemo-commits mailing list