[maemo-commits] [maemo-commits] r18952 - in projects/haf/tags/ke-recv/3.19-1fixes: debian src

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Wed Jul 22 17:28:49 EEST 2009
Author: kihamala
Date: 2009-07-22 17:28:47 +0300 (Wed, 22 Jul 2009)
New Revision: 18952

Modified:
   projects/haf/tags/ke-recv/3.19-1fixes/debian/changelog
   projects/haf/tags/ke-recv/3.19-1fixes/src/events.c
   projects/haf/tags/ke-recv/3.19-1fixes/src/ke-recv.c
   projects/haf/tags/ke-recv/3.19-1fixes/src/osso-mmc-mount.sh
   projects/haf/tags/ke-recv/3.19-1fixes/src/osso-mmc-umount.sh
Log:
partition layout fix etc.  


Modified: projects/haf/tags/ke-recv/3.19-1fixes/debian/changelog
===================================================================
--- projects/haf/tags/ke-recv/3.19-1fixes/debian/changelog	2009-07-22 13:34:04 UTC (rev 18951)
+++ projects/haf/tags/ke-recv/3.19-1fixes/debian/changelog	2009-07-22 14:28:47 UTC (rev 18952)
@@ -1,3 +1,11 @@
+ke-recv (3.19-1fixes) unstable; urgency=low
+
+  * Fixes: NB#127339 - AppCert-ke-recv doesn't export card if the partition
+    format isn't recognized
+  * Fixes: NB#128388 - vfat should sit at the first partition
+
+ -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Wed, 22 Jul 2009 15:50:52 +0300
+
 ke-recv (3.19-1) unstable; urgency=low
 
   * Fixes: NB#119586 - Unsafe signal handler in ke-recv

Modified: projects/haf/tags/ke-recv/3.19-1fixes/src/events.c
===================================================================
--- projects/haf/tags/ke-recv/3.19-1fixes/src/events.c	2009-07-22 13:34:04 UTC (rev 18951)
+++ projects/haf/tags/ke-recv/3.19-1fixes/src/events.c	2009-07-22 14:28:47 UTC (rev 18952)
@@ -904,30 +904,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;
 
@@ -962,6 +950,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);
@@ -1072,11 +1075,20 @@
                                    mmc->preferred_volume);
                         all_unmounted = 0;
                 } else {
-                        if (vol->mountpoint &&
-                            do_unmount(vol->mountpoint, lazy)) {
-                                ULOG_DEBUG_F("unmounted %s", vol->udi);
+                        char *arg;
+                        if (vol->mountpoint)
+                                arg = vol->mountpoint;
+                        else
+                                /* use device name in case it is not mounted
+                                 * or mount point could be unknown */
+                                arg = vol->dev_name;
+
+                        if (do_unmount(arg, lazy)) {
+                                ULOG_DEBUG_F("unmounted %s (%s)", arg,
+                                             vol->udi);
                         } else {
-                                ULOG_INFO_F("couldn't unmount %s", vol->udi);
+                                ULOG_INFO_F("couldn't unmount %s (%s)", arg,
+                                            vol->udi);
                                 all_unmounted = 0;
                         }
                 }

Modified: projects/haf/tags/ke-recv/3.19-1fixes/src/ke-recv.c
===================================================================
--- projects/haf/tags/ke-recv/3.19-1fixes/src/ke-recv.c	2009-07-22 13:34:04 UTC (rev 18951)
+++ projects/haf/tags/ke-recv/3.19-1fixes/src/ke-recv.c	2009-07-22 14:28:47 UTC (rev 18952)
@@ -1569,7 +1569,7 @@
                 mmc->swap_off_op = INTERNAL_MMC_SWAP_OFF_OP;
 
 #ifdef FREMANTLE_MODE
-                mmc->preferred_volume = 3;
+                mmc->preferred_volume = 1;
                 mmc->control_partitions = 0;
 #else
                 mmc->preferred_volume = 1;

Modified: projects/haf/tags/ke-recv/3.19-1fixes/src/osso-mmc-mount.sh
===================================================================
--- projects/haf/tags/ke-recv/3.19-1fixes/src/osso-mmc-mount.sh	2009-07-22 13:34:04 UTC (rev 18951)
+++ projects/haf/tags/ke-recv/3.19-1fixes/src/osso-mmc-mount.sh	2009-07-22 14:28:47 UTC (rev 18952)
@@ -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

Modified: projects/haf/tags/ke-recv/3.19-1fixes/src/osso-mmc-umount.sh
===================================================================
--- projects/haf/tags/ke-recv/3.19-1fixes/src/osso-mmc-umount.sh	2009-07-22 13:34:04 UTC (rev 18951)
+++ projects/haf/tags/ke-recv/3.19-1fixes/src/osso-mmc-umount.sh	2009-07-22 14:28:47 UTC (rev 18952)
@@ -20,7 +20,7 @@
 # 02110-1301 USA
 
 if [ $# -lt 1 ]; then
-  echo "Usage: $0 <mount point> [\"lazy\"]"
+  echo "Usage: $0 <mount point | device> [\"lazy\"]"
   exit 1
 fi
 

More information about the maemo-commits mailing list