From 6322a20675851b5ff9dd01b02a50588a8f7a37f1 Mon Sep 17 00:00:00 2001 From: "nslu2-linux.adm@bkbits.net" Date: Mon, 9 May 2005 14:40:04 +0000 Subject: Merge bk://oe-devel.bkbits.net/openembedded into bkbits.net:/repos/n/nslu2-linux/openembedded 2005/05/09 16:38:35+02:00 handhelds.org!CoreDump sdcontrol: some cleanups BKrev: 427f76445aiW91-JnTrPB66b7DUuQg --- .../sdcontrol | 58 +++++++++++----------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/packages/sharp-binary-only/sharp-sdmmc-support-2.4.18-rmk7-pxa3-embedix/sdcontrol b/packages/sharp-binary-only/sharp-sdmmc-support-2.4.18-rmk7-pxa3-embedix/sdcontrol index a857817bbc..63e5256f3d 100644 --- a/packages/sharp-binary-only/sharp-sdmmc-support-2.4.18-rmk7-pxa3-embedix/sdcontrol +++ b/packages/sharp-binary-only/sharp-sdmmc-support-2.4.18-rmk7-pxa3-embedix/sdcontrol @@ -64,27 +64,31 @@ wait_release() kill_task() { - ps_line=`ps ax | grep 'qpe$'` # no -w on busybox - qpe_pid=`get_pid $ps_line` - #echo qpe_pid = $qpe_pid >> /tmp/sd - target_pids=`fuser -m $DEVICE | cut -d : -f2` - #echo $target_pids >> /tmp/sd - if [ "$target_pids" = "" ]; then - return - fi - is_exist_qpe=`echo $target_pids | grep $qpe_pid` # no -w on busybox - if [ "$is_exist_qpe" = "" ]; then - kill -9 $target_pids - #echo kill -9 $target_pids >> /tmp/sd - else - #echo "found qpe!!!" >> /tmp/sd - target_pids=`echo $target_pids | sed -e "s/$qpe_pid//"` - if [ "$target_pids" != "" ]; then - kill -9 $target_pids - #echo kill -9 $target_pids >> /tmp/sd - fi - wait_release - exit 0 + + if ! test -z "`which fuser`" + then + ps_line=`ps ax | grep 'qpe$'` # no -w on busybox + qpe_pid=`get_pid $ps_line` + #echo qpe_pid = $qpe_pid >> /tmp/sd + target_pids=`fuser -m $DEVICE | cut -d : -f2` + #echo $target_pids >> /tmp/sd + if [ "$target_pids" = "" ]; then + return + fi + is_exist_qpe=`echo $target_pids | grep $qpe_pid` # no -w on busybox + if [ "$is_exist_qpe" = "" ]; then + kill -9 $target_pids + #echo kill -9 $target_pids >> /tmp/sd + else + #echo "found qpe!!!" >> /tmp/sd + target_pids=`echo $target_pids | sed -e "s/$qpe_pid//"` + if [ "$target_pids" != "" ]; then + kill -9 $target_pids + #echo kill -9 $target_pids >> /tmp/sd + fi + wait_release + exit 0 + fi fi } ###### for QPE ###### @@ -230,17 +234,13 @@ case "$ACTION" in 'compeject') for part in `mount | grep mmcda|awk '{print $1}'` do - DEVICE="$part" + DEVICE="$part" || echo "umount $DEVICE failed!" kill_task # for QPE - #fuser -k -m $DEVICE > /dev/null - umount $DEVICE - if [ $? != 0 ]; then - usleep 500000 - umount $DEVICE - fi - rm $SMB_MOUNT + umount $DEVICE >/dev/null 2>&1 || echo -e "\n* * * WARNING: umount $DEVICE failed! * * *" + + test -e "$SMB_MOUNT" && rm $SMB_MOUNT done ;; 'change') -- cgit v1.2.3