Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/sbin/sh -x
- ## This program is free software; you can redistribute it and/or modify it
- # under the terms of the GNU Library General Public License as published
- # by the Free Software Foundation; either version 2, or (at your option)
- # any later version.
- ## This program is distributed in the hope that it will be useful,
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- # GNU General Public License for more details.
- ## License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
- BB=/sbin/busybox;
- YAFF=/sbin/mkyaffs2image;
- DATA=/dev/block/stl10;
- DUMP=cat;
- SYS=/dev/block/stl9;
- CHE=/dev/block/stl11;
- SD=/dev/block/mmcblk0p1;
- BOOT=/dev/block/bml7;
- RECOV=/dev/block/bml8;
- DATE=`date +.%m.%d.%Y.%I:%M`;
- BU=/sdcard/clockworkmod/backup/$DATE;
- OUTFD=$(ps | grep -v "grep" | grep -o -E "update_binary(.*)" | cut -d " " -f 3);
- ui_print() {
- if [ $OUTFD != "" ]; then
- echo "ui_print ${1} " 1>&$OUTFD;
- echo "ui_print " 1>&$OUTFD;
- else
- echo "${1}";
- fi;
- }
- $BB mount $DATA /data;
- $BB mount $SD /sdcard;
- #exec > /sdcard/backup.log 2>&1
- $BB mount $SYS /system;
- $BB mount $CHE /cache;
- $BB test -d $BU || $BB mkdir $BU;
- $BB rm -rf $BU/*;
- cd $BU && ui_print "Backing up Boot Kernel" && $DUMP $BOOT > boot.img && ui_print "Backing up Recovery Kernel" && $DUMP $RECOVERY > recovery.img;
- ui_print "Backing up System" && $YAFF /system $BU/system.img && ui_print "Backing up Data" && $YAFF /data $BU/data.img && ui_print "Backing up Cache" && $YAFF /cache $BU/cache.img && ui_print "Backing up .android_secure" && $YAFF /sdcard/.android_secure $BU/.android_secure.img;
- ui_print "Generating MD5" && $BB md5sum *img > $BU/nandroid.md5;
Advertisement
Add Comment
Please, Sign In to add comment