[maemo-commits] [maemo-commits] r18125 - in projects/haf/trunk/osso-app-killer: . debian src
From: subversion at stage.maemo.org subversion at stage.maemo.orgDate: Tue Apr 21 17:22:08 EEST 2009
- Previous message: [maemo-commits] r18124 - in projects/haf/trunk/gtk+: . gdk gtk
- Next message: [maemo-commits] r18126 - projects/haf/tags/osso-app-killer
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Author: schulhof
Date: 2009-04-21 17:21:57 +0300 (Tue, 21 Apr 2009)
New Revision: 18125
Removed:
projects/haf/trunk/osso-app-killer/remove-user-content-cud.sh
Modified:
projects/haf/trunk/osso-app-killer/debian/changelog
projects/haf/trunk/osso-app-killer/debian/osso-app-killer.install
projects/haf/trunk/osso-app-killer/src/osso-app-killer-cud.sh
projects/haf/trunk/osso-app-killer/src/osso-clean-mmc.sh
Log:
Replacing osso-clean-mmc.sh with on the works on files, not partitions
Modified: projects/haf/trunk/osso-app-killer/debian/changelog
===================================================================
--- projects/haf/trunk/osso-app-killer/debian/changelog 2009-04-21 12:39:36 UTC (rev 18124)
+++ projects/haf/trunk/osso-app-killer/debian/changelog 2009-04-21 14:21:57 UTC (rev 18125)
@@ -1,7 +1,6 @@
osso-app-killer (1.29-1) unstable; urgency=low
- * Provide script /etc/osso-cud-scripts/remove-user-content-cud.sh
- to remove user content during CUD
+ * Re-write script osso-clean-mmc.sh to handle Fremantle's MMC cleaning
* Fixes: NB#109305 (Unable to delete default files from File manager with clear device option from control panel)
* Parially fixes NB#111442 (osso-app-killer-cud.sh shall be checked and refreshed)
Modified: projects/haf/trunk/osso-app-killer/debian/osso-app-killer.install
===================================================================
--- projects/haf/trunk/osso-app-killer/debian/osso-app-killer.install 2009-04-21 12:39:36 UTC (rev 18124)
+++ projects/haf/trunk/osso-app-killer/debian/osso-app-killer.install 2009-04-21 14:21:57 UTC (rev 18125)
@@ -1,3 +1,2 @@
*.sh /usr/sbin
../osso-app-killer.sudoers /etc/sudoers.d
-../remove-user-content-cud.sh /etc/osso-cud-scripts
Deleted: projects/haf/trunk/osso-app-killer/remove-user-content-cud.sh
===================================================================
--- projects/haf/trunk/osso-app-killer/remove-user-content-cud.sh 2009-04-21 12:39:36 UTC (rev 18124)
+++ projects/haf/trunk/osso-app-killer/remove-user-content-cud.sh 2009-04-21 14:21:57 UTC (rev 18125)
@@ -1,9 +0,0 @@
-#!/bin/sh
-
-set -x
-
-DIR_TO_CLEAR=${HOME}/MyDocs
-
-for rmable in $(ls -A ${DIR_TO_CLEAR}); do
- rm -rf ${DIR_TO_CLEAR}/${rmable}
-done
Modified: projects/haf/trunk/osso-app-killer/src/osso-app-killer-cud.sh
===================================================================
--- projects/haf/trunk/osso-app-killer/src/osso-app-killer-cud.sh 2009-04-21 12:39:36 UTC (rev 18124)
+++ projects/haf/trunk/osso-app-killer/src/osso-app-killer-cud.sh 2009-04-21 14:21:57 UTC (rev 18125)
@@ -43,11 +43,14 @@
# shut down things
if [ -x /etc/init.d/hildon-desktop ]; then
+ logger -t CUD 'Stopping hildon-desktop'
$SUDO /etc/init.d/hildon-desktop stop
fi
if [ -x /etc/init.d/icd2 ]; then
+ logger -t CUD 'Stopping icd2'
$SUDO /etc/init.d/icd2 stop
fi
+logger -t CUD 'Stopping a bunch more things'
$SUDO /etc/init.d/af-base-apps stop
$SUDO $DIR/gconf-daemon.sh stop
if ps ax | grep -v grep | grep -q gconfd-2; then
@@ -56,60 +59,47 @@
if [ "x$OSSO_CUD_DOES_NOT_DESTROY" = "x" ]; then
# Remove all user data
+ logger -t CUD 'Cleaning gconf'
CUD=foo /usr/sbin/gconf-clean.sh
- # possibly clear memory card
- if [ -x /usr/bin/osso-product-info ]; then
- HW=`/usr/bin/osso-product-info -qOSSO_PRODUCT_HARDWARE`
- if [ "$HW" = 'RX-44' -o "$HW" = 'RX-48' ]; then
- /usr/sbin/osso-clean-mmc.sh
- fi
- fi
-
OLDDIR=`pwd`
- if [ -d /home/user/.osso ]; then
- cd /home/user/.osso
- rm -rf *
- fi
+ logger -t CUD 'Running user cud scripts'
+
cd $HOME/.osso-cud-scripts ;# this location should be deprecated
for f in `ls *.sh`; do
# if we are root, this is run as root (but no can do because
# user 'user' might not exist)
+ logger -t CUD "$HOME/.osso-cud-scripts/$f"
./$f
RC=$?
if [ $RC != 0 ]; then
echo "$0: Warning, '$f' returned non-zero return code $RC"
fi
done
+
+ logger -t CUD 'Cleaning mmc'
+
+ /usr/sbin/osso-clean-mmc.sh
+
+ logger -t CUD 'Running system CUD scripts'
cd /etc/osso-cud-scripts
for f in `ls *.sh`; do
# if we are root, this is run as root (but no can do because
# user 'user' might not exist)
+ logger -t CUD "/etc/osso-cud-scripts/$f"
./$f
RC=$?
if [ $RC != 0 ]; then
echo "$0: Warning, '$f' returned non-zero return code $RC"
fi
done
- rm -rf $MYDOCSDIR/*
- rm -rf $MYDOCSDIR/.documents/*
- rm -rf $MYDOCSDIR/.games/*
- rm -rf $MYDOCSDIR/.images/*
- rm -rf $MYDOCSDIR/.sounds/*
- rm -rf $MYDOCSDIR/.videos/*
cd $OLDDIR
else
echo "$0: OSSO_CUD_DOES_NOT_DESTROY defined, no data deleted"
fi
-# re-create first boot flags
-touch $HOME/.suw_first_run
-touch $HOME/first-boot-flag
-if test $(id -u) -eq 0; then
- chown user.users $HOME/.suw_first_run
- chown user.users $HOME/first-boot-flag
-fi
+logger -t CUD 'Running common bits'
# final cleanup and reboot
CUD=foo source /usr/sbin/osso-app-killer-common.sh
Modified: projects/haf/trunk/osso-app-killer/src/osso-clean-mmc.sh
===================================================================
--- projects/haf/trunk/osso-app-killer/src/osso-clean-mmc.sh 2009-04-21 12:39:36 UTC (rev 18124)
+++ projects/haf/trunk/osso-app-killer/src/osso-clean-mmc.sh 2009-04-21 14:21:57 UTC (rev 18125)
@@ -1,62 +1,21 @@
#!/bin/sh
-set +e
-if test $(id -u) -eq 0; then
- SUDO=''
- echo "$0: Warning, I'm root"
-else
- SUDO='sudo'
-fi
+OLD_PWD=$(pwd)
-/usr/sbin/anim-shower 20000 &
-DEV=''
-HOST=`hal-find-by-property --key mmc_host.slot_name --string internal`
-if [ $? = 0 ]; then
- RCA=`hal-find-by-property --key info.parent --string $HOST`
- if [ $? = 0 ]; then
- STOR=`hal-find-by-property --key info.parent --string $RCA`
- if [ $? = 0 ]; then
- TMP=`hal-get-property --udi $STOR --key block.device`
- if [ $? = 0 ]; then
- DEV=$TMP
- fi
- fi
- fi
-fi
-if [ "x$DEV" != "x" ]; then
- echo "Internal memory card device is $DEV"
+set -x
- # Wait until memory card is not used by applications
- # (this will only detect files open by 'user' if this
- # script is run as 'user')
- INC=1
- while lsof /media/mmc2 > /dev/null; do
- if [ $INC -gt 10 ]; then
- echo "$0: memory card still used after 10 seconds"
- break
- fi
- sleep 1
- INC=`expr $INC + 1`
- done
+DIR_TO_CLEAR=${HOME}/MyDocs
- $SUDO /etc/init.d/ke-recv stop
+cd ${HOME}/MyDocs
+for rmable in $(ls -A); do
+ rm -rf $rmable
+done
- # Wait until ke-recv has exited
- INC=1
- while pidof ke-recv > /dev/null; do
- if [ $INC -gt 10 ]; then
- echo "$0: ke-recv still running after 10 seconds"
- break
- fi
- sleep 1
- INC=`expr $INC + 1`
- done
+cd ${HOME}
+for rmable in $(ls -A); do
+ if test "x${rmable}" != "xMyDocs"; then
+ rm -rf $rmable
+ fi
+done
- $SUDO /bin/umount /media/mmc2
- $SUDO /usr/sbin/osso-prepare-partition.sh $DEV
- if [ $? = 0 ]; then
- $SUDO /sbin/mkdosfs "${DEV}p1"
- fi
-else
- echo "Could not find out internal memory card device"
-fi
+cd ${OLD_PWD}
- Previous message: [maemo-commits] r18124 - in projects/haf/trunk/gtk+: . gdk gtk
- Next message: [maemo-commits] r18126 - projects/haf/tags/osso-app-killer
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
