Problem restore script - Android Q&A, Help & Troubleshooting

Hi, have problem with restore script. This script is for init.d. First boot with restore app and app data. Have problem with restore app data. If run script for restore app data then restore only from one tar.gz file, no from all. Where problem? Thanks
App restore:
#!/system/bin/sh
su
mount -o remount,rw /system
mount -o remount,rw /data
for filename in /system/app2/*.apk;
do
busybox install $filename /data/app;
done
busybox rm -rf /system/app2
busybox rm -rf /system/etc/init.d/90app​
App data restore:
#!/sbin/busybox sh
sleep 45
su
mount -o remount,rw /system
mount -o remount,rw /data
for filenamezip in /system/appdata/*.zip;
do
busybox chown -R root /data/data/${filenamezip%.zip}/*
busybox chmod -R 777 /data/data/${filenamezip%.zip}/*
busybox rm -rf /data/data/${filenamezip%.zip}
done
for izip in /system/appdata/*.zip;
do
busybox unzip -o $izip -d /;
done
for filenametar in /system/appdata/*.tar.gz;
do
busybox chown -R root /data/data/${filenametar%.tar.gz}/*
busybox chmod -R 777 /data/data/${filenametar%.tar.gz}/*
sleep 1
busybox rm -rf /data/data/${filenametar%.tar.gz}
done
for itar in /system/appdata/*.tar.gz;
do
busybox tar -xzf $itar -C /;
done
sleep 5
busybox rm -rf /system/appdata
busybox rm -rf /system/etc/init.d/95appdata
reboot​
For manual backup:
su
mount -o remount,rw /system
mount -o remount,rw /data
BACKUPDIR=/system/appdata
DATADIR=/data/data
echo
# create BACKUPDIR if necessary and modify ownership/permissions
if [ -d $BACKUPDIR ]; then
rm -rf $BACKUPDIR
mkdir $BACKUPDIR
else
mkdir $BACKUPDIR
fi
chown root $BACKUPDIR
chmod 777 $BACKUPDIR
# make
for name in $DATADIR/*; do
tar -cpvzf $BACKUPDIR/${name#/data/data/}.tar.gz $name
done;
# modify ownership/permissions of all archives
chown root $BACKUPDIR/*
chmod 777 $BACKUPDIR/*
echo​
Sorry my bad english

Any solution please?

Hi. Please help my with this problem.

Related

Rooted with mediascape

Many ppl seem to want to reinstall mediascape..
well as far as i know you can't reinstall mediascape after rooting; however, it is possible to NOT DELETE mediascape in Step 4.
You follow the root guide in the stick up to step 3, then before you run step 4 (well i guess it's better to do it before you start rooting) open cleanup.sh in step 4 and remove mediascape and mediascapeplugin from the list... so it should look like this
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
rm -R /sdcard/apps
mkdir /sdcard/apps
cd /system/app
cp AndroidQuadrapop* /sdcard/apps
cp docomo_market* /sdcard/apps
cp EManual* /sdcard/apps
cp LatinIME* /sdcard/apps
cp LatinImeTutorial* /sdcard/apps
cp Launcher* /sdcard/apps
cp LearningClient* /sdcard/apps
cp MixiPlugin* /sdcard/apps
cp moxiermail* /sdcard/apps
cp officesuite* /sdcard/apps
cp pocket_rashinban* /sdcard/apps
cp SemcIME* /sdcard/apps
cp trackid* /sdcard/apps
rm AndroidQuadrapop*
rm docomo_market*
rm EManual*
rm LatinIME*
rm LatinImeTutorial*
rm Launcher*
rm LearningClient*
rm MixiPlugin*
rm moxiermail*
rm officesuite*
rm pocket_rashinban*
rm SemcIME*
rm trackid*
rm /data/app/*.zip
rm /data/app-private/jp.*
rm -r /etc/semc/startupshow
rm -r /etc/semc/preset/app
rm -r /etc/*.iso
then run step 4..
personally i don't know exactly what's changed on my phone other than the fact that i now have a zeam home launcher instead, titanium backup says my phone's been rooted, i didn't have to restore anything because everything (all data/apps i installed personally) were kept the same, mediascape still there, and i lost korean keyboard/option to switch to korean menu which came with the R2BA020 update...
oh and my step 3a wasn't working properly so i just skipped it.. but regardless i can type 'su' into better terminal, and titanium backup says my phone's rooted so i don't really care..
although if the devs could release another one with the korean keyboard/menu from the new R2BA020 update, it'd be great
oh and i went from x10a(rogers 014) -> x10i (R2BA020) -> root
Thanks Dude!!! This is just what I needed. No timescape?? What if I wanted timescape, is there a way to prevent it from removing that?
Fuzalert2k said:
Thanks Dude!!! This is just what I needed. No timescape?? What if I wanted timescape, is there a way to prevent it from removing that?
Click to expand...
Click to collapse
it doesn't remove timescape..
Retrying for the fourth time, I managed to root the phone, then I saw you could keep mediascape, and the original keyboard... tried opening and saving the sh file with notepad, wordpad, write... don't know if it modifies something but once we get to the uninstalling part I get 'No such files or directory'...
found the solution, do not edit shell file in windows with notepad,
http://sourceforge.net/projects/eme...-editor-2.72-r286/cedt-286-setup.exe/download
works pretty well on windows, so you can decide to keep whatever you want
mayamo said:
Many ppl seem to want to reinstall mediascape..
well as far as i know you can't reinstall mediascape after rooting; however, it is possible to NOT DELETE mediascape in Step 4.
You follow the root guide in the stick up to step 3, then before you run step 4 (well i guess it's better to do it before you start rooting) open cleanup.sh in step 4 and remove mediascape and mediascapeplugin from the list... so it should look like this
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
rm -R /sdcard/apps
mkdir /sdcard/apps
cd /system/app
cp AndroidQuadrapop* /sdcard/apps
cp docomo_market* /sdcard/apps
cp EManual* /sdcard/apps
cp LatinIME* /sdcard/apps
cp LatinImeTutorial* /sdcard/apps
cp Launcher* /sdcard/apps
cp LearningClient* /sdcard/apps
cp MixiPlugin* /sdcard/apps
cp moxiermail* /sdcard/apps
cp officesuite* /sdcard/apps
cp pocket_rashinban* /sdcard/apps
cp SemcIME* /sdcard/apps
cp trackid* /sdcard/apps
rm AndroidQuadrapop*
rm docomo_market*
rm EManual*
rm LatinIME*
rm LatinImeTutorial*
rm Launcher*
rm LearningClient*
rm MixiPlugin*
rm moxiermail*
rm officesuite*
rm pocket_rashinban*
rm SemcIME*
rm trackid*
rm /data/app/*.zip
rm /data/app-private/jp.*
rm -r /etc/semc/startupshow
rm -r /etc/semc/preset/app
rm -r /etc/*.iso
then run step 4..
oh and i went from x10a(rogers 014) -> x10i (R2BA020) -> root
Click to expand...
Click to collapse
So what i understand is that If I want to keep the Default home then I should be removing the Launcher from the list as well. Also is Backup and Restore Included which is there in new firmware.... as I do not want to go for limited backup tool.
hotfile.com/dl/51161486/a67bb41/step4.zip.html
Click to expand...
Click to collapse
moded
step4 with mediaspace

Installing Apps on Sdcard ?

Hey Guys I Have Rooted My X10 Mini Kindly Let Me Know How To Install Applications on SDCARD
Sent from my E10i using XDA App
follow app2sd procedure.its given in this forum.
Thanks Bro
Sent from my E10i using XDA App
X10 Mini rooten.
ADB muß da sein.
busybox und dieses script auf /sdcard kopieren und script ausführen.
#!/system/bin/sh
cd /sdcard
su
mount -o rw,remount -t yaffs2 /dev/block/mtdblock0 /system
if !(type busybox) then
mkdir /system/xbin
cat /sdcard/busybox > /system/xbin/busybox
chmod 4755 /system/xbin/busybox
/system/xbin/busybox --install -s /system/xbin/
fi
mv /data/app /data/app0
mkdir /data/app
chmod 4777 /data/app
mount -t ext2 /dev/block//vold/179:2 /data/app
cp -a /data/app0/* /data/app/
rm /data/app0/*
umount /data/app
ln -s /data/app0 /data/app
rm /system/bin/mkdir
echo "#!/system/bin/sh" >/system/bin/mkdir
echo "if !(grep /data/app /proc/mounts >/dev/null) then mount -t ext2 /dev/block//vold/179:2 /data/app;fi" >>/system/bin/mkdir
echo "busybox mkdir \"\[email protected]\"" >>/system/bin/mkdir
chmod 4755 /system/bin/mkdir
reboot

[Q] Problem mounting partition through a script

Hello everybody.
First, I have searched a lot and I haven't found any solution of my problem, but sorry if this is already answered and I didn't found it.
I own a Meizu MX4 running 4.4.2 with FlymeOS with locked bootloader and a recovery that only allows to install official roms.
So I am making a big Mod that is flasheable through FlashGordon, but now I'm facing a problem and I don´t know to solve.
In the main updater_script I want to run other script that erase some files in this path:
/custom/3rd-party
So I have to mount RW the path /custom
I have tried this comands, and I have executed throught a terminal and always says: rm failed for /custom/3rd-party, Read only file system.
Code:
#!/system/bin/sh
mount -o remount,rw /custom
rm -rf /custom/3rd-party
#
Code:
#!/system/bin/sh
busybox mount -0 remount,rw /custom
rm -rf /custom/3rd-party
#
Code:
#!/system/bin/sh
mount ext4 /dev/block/platform/mtk-msdc.0/by-name/custom /custom relatime rw wait commit=1,noauto_da_alloc
rm -rf /custom/3rd-party
#
Code:
#!/system/bin/sh
mount -o remount,rw -t ext4/dev/block/platform/mtk-msdc.0/by-name/custom
rm -rf /custom/3rd-party
#
Sorry for my english
What do you think?
Thanks in advance :good:

[Q] rm / chown -> "Operation not permitted" on my rooted device

HI,
I can't delete "/system/etc/install-recovery.sh" on my rooted device.
Code:
[email protected]:/ $ su
su
[email protected]:/ # mount -o remount,rw /system
mount -o remount,rw /system
[email protected]:/ # cd /system/etc
cd /system/etc
[email protected]:/system/etc # rm install-recovery.sh
rm install-recovery.sh
rm failed for install-recovery.sh, Operation not permitted
255|[email protected]:/system/etc # chown shell install-recovery.sh
chown shell install-recovery.sh
Unable to chown install-recovery.sh: Operation not permitted
10|[email protected]:/system/etc #
Anyone knows why ?
(My device is Redmi 1 by the way)
Thanks.
Slash

Tank Fire tv stick 2 : Mount ext4 as sdcard1 without disabling selinux.

Enable init.d, if not already enabled
add the following script in init.d
Code:
#!/system/bin/sh
sleep 25
DRIVE_PATH=$(blkid /dev/block/s* |grep -m 1 "{uuid of ur device}"| grep -oe '[^:]*')
echo "Mounting $DRIVE_PATH to /storage/sdcard1"
su -c mount -t ext4 -o rw,context=u:object_r:fuse:s0,noatime,nodiratime,nosuid,nodev,noauto_da_alloc $DRIVE_PATH /storage/sdcard1;
su -c chown -R 0:1028 /storage/sdcard1;
su -c chmod -R 771 /storage/sdcard1;

Categories

Resources