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

From: subversion at stage.maemo.org subversion at stage.maemo.org
Date: Thu Mar 26 14:21:46 EET 2009
Author: kihamala
Date: 2009-03-26 14:21:43 +0200 (Thu, 26 Mar 2009)
New Revision: 17808

Modified:
   projects/haf/trunk/ke-recv/debian/changelog
   projects/haf/trunk/ke-recv/src/mmc-mount
   projects/haf/trunk/ke-recv/src/osso-mmc-mount.sh
   projects/haf/trunk/ke-recv/src/osso-usb-mass-storage-enable.sh
Log:
add FAT magic check, add -n to time-limited check options


Modified: projects/haf/trunk/ke-recv/debian/changelog
===================================================================
--- projects/haf/trunk/ke-recv/debian/changelog	2009-03-26 10:58:55 UTC (rev 17807)
+++ projects/haf/trunk/ke-recv/debian/changelog	2009-03-26 12:21:43 UTC (rev 17808)
@@ -1,8 +1,11 @@
 ke-recv (3.11-1~unreleased) unstable; urgency=low
 
-  * fix partitioning script for 3 partitions
+  * Fix partitioning script for 3 partitions
+  * Added check for the success of "rmmod g_nokia".
+  * Added check for FAT magic number before trying to mount as FAT.
+  * Fixes: NB#108219 - osso-mmc-mount.sh should use -n (no interaction)
 
- -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Wed, 18 Mar 2009 14:33:36 +0200
+ -- Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>  Thu, 26 Mar 2009 14:16:46 +0200
 
 ke-recv (3.10-1) unstable; urgency=low
 

Modified: projects/haf/trunk/ke-recv/src/mmc-mount
===================================================================
--- projects/haf/trunk/ke-recv/src/mmc-mount	2009-03-26 10:58:55 UTC (rev 17807)
+++ projects/haf/trunk/ke-recv/src/mmc-mount	2009-03-26 12:21:43 UTC (rev 17808)
@@ -1,2 +1,2 @@
 #!/bin/sh
-mount -t vfat -o rw,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null
+mount -t vfat -o $3,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133,rodir "$1" "$2" > /dev/null

Modified: projects/haf/trunk/ke-recv/src/osso-mmc-mount.sh
===================================================================
--- projects/haf/trunk/ke-recv/src/osso-mmc-mount.sh	2009-03-26 10:58:55 UTC (rev 17807)
+++ projects/haf/trunk/ke-recv/src/osso-mmc-mount.sh	2009-03-26 12:21:43 UTC (rev 17808)
@@ -3,7 +3,7 @@
 #
 # Copyright (C) 2005-2009 Nokia Corporation. All rights reserved.
 #
-# Contact: Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>
+# Author: Kimmo Hämäläinen <kimmo.hamalainen at nokia.com>
 #
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License 
@@ -27,19 +27,6 @@
 PDEV=$1  ;# preferred device (partition)
 MP=$2    ;# mount point
 
-install_module() # $1 = kernel version $2 = modulename (no .ko)
-{
-  if lsmod | grep -qi $2; then return 0 ; fi
-
-  if [ -f /mnt/initfs/lib/modules/$1/$2.ko ]; then
-    if insmod /mnt/initfs/lib/modules/$1/$2.ko; then
-      return 0
-    fi
-  fi
-
-  return 1
-}
-
 grep "$PDEV " /proc/mounts > /dev/null
 if [ $? = 0 ]; then
   logger "$0: $PDEV is already mounted"
@@ -50,12 +37,22 @@
   mkdir -p $MP
 fi
 
-# TODO: check the FAT magic number
+if ! [ $PDEV = /dev/mmcblk0 -o $PDEV = /dev/mmcblk0 ]; then
+  # check the FAT magic number
+  PNUM=$(echo $PDEV | sed "s#/dev/mmcblk[01]p##")
+  DEV=$(echo $PDEV | sed "s#p[1234]##")
+  PID=$(sfdisk -c $DEV $PNUM)
+  if [ $PID != b -a $PID != c ]; then
+    logger "$0: $PDEV is not FAT32"
+    exit 1
+  fi
+fi
 
-/sbin/dosfsck -T 10 $PDEV
+# time limited check
+/sbin/dosfsck -n -T 10 $PDEV
 if [ $? != 0 ]; then
   logger "$0: $PDEV is corrupt, trying to mount it read-only"
-  mount -t vfat -o ro,noauto,nodev,noexec,nosuid,noatime,nodiratime,utf8,uid=29999,shortname=mixed,dmask=000,fmask=0133 $PDEV $MP > /dev/null
+  mmc-mount $PDEV $MP ro
   if [ $? = 0 ]; then
     logger "$0: $PDEV mounted read-only"
     exit 2
@@ -65,7 +62,7 @@
   fi
 fi
 
-mmc-mount $PDEV $MP
+mmc-mount $PDEV $MP rw
 RC=$?
 logger "$0: mounting $PDEV read-write to $MP, rc: $RC"
 
@@ -80,29 +77,4 @@
   fi
 fi
 
-#if [ $RC != 0 ]; then
-if false; then
-
-  # Let's try ext3 - need to load modules
-  KERNEL_VERSION=`uname -r`
-  if install_module $KERNEL_VERSION mbcache; then
-    if install_module $KERNEL_VERSION jbd; then
-      if install_module $KERNEL_VERSION ext3; then
-        mount -t ext3 $PDEV $MP > /dev/null
-        RC=$?
-      fi
-    fi
-  fi
-
-  if [ $RC != 0 ]; then
-    if install_module $KERNEL_VERSION ext2; then
-      mount -t ext2 $PDEV $MP > /dev/null
-      RC=$?
-    fi
-  fi
-
-  if [ $RC = 0 ]; then
-    chown user:users $MP
-  fi
-fi
 exit $(($RC != 0))

Modified: projects/haf/trunk/ke-recv/src/osso-usb-mass-storage-enable.sh
===================================================================
--- projects/haf/trunk/ke-recv/src/osso-usb-mass-storage-enable.sh	2009-03-26 10:58:55 UTC (rev 17807)
+++ projects/haf/trunk/ke-recv/src/osso-usb-mass-storage-enable.sh	2009-03-26 12:21:43 UTC (rev 17808)
@@ -46,8 +46,12 @@
         logger "$0: syncd is not running"
     fi
 
-    sleep 1
+    sleep 2
     /sbin/rmmod g_nokia
+    if [ $? != 0 ]; then
+        logger "$0: failed to rmmod g_nokia!"
+        exit 1
+    fi
 fi
 
 /sbin/lsmod | grep g_file_storage > /dev/null


More information about the maemo-commits mailing list