Hi all,
Can you help me checking the script? I'm testing in adb sheel not work.
a.sh
#!/system/bin/sh
for i in \
`busybox find /data -iname "*.db"`;
do \
/system/xbin/sqlite3 $i 'VACUUM;';
/system/xbin/sqlite3 $i 'REINDEX;';
done;
Click to expand...
Click to collapse
E:\adb>adb push a.sh /data/local/tmp
10 KB/s (156 bytes in 0.015s)
E:\adb>adb shell
[email protected]:/ $ su
su
[email protected]:/ # sh /data/local/tmp/a.sh
sh /data/local/tmp/a.sh
/data/local/tmp/a.sh[3]: syntax error: '$(busybox find /data -iname "*.db")' unexpected
1|[email protected]:/ #
E:\adb>
Click to expand...
Click to collapse
Related
i am trying to change the init script for APP2SD by [email protected] (cyanogen). it is the standard script for all custom roms.
i want move dalvik cache back to phone memory and app, app-private and data to system/sd. data/data/ is normally moved back to phone memory by the script if someone moves it to system/sd/ due to "compatibility" reasons.
i have edited the script and removed this part.
the problem is that after installing some apps, etc. phone memory is at 13mb and one cant install any additional apps.
also, how do i replace the previous 40a2sd script? i ran into a wall when trying...
THX
------------------------------------------------------------------------------------------------------------------------------------------------
#!/system/bin/sh
#
# Apps2SD using symlinks and bind mounts
# [email protected] (cyanogen)
# Adapted for Modaco Custom Rom by Teknologist
#Removed this as there is no /etc/sysctl.conf as of now in MCR
#sysctl -p
# execute any postinstall script then kill it
if [ -e /dev/block/mmcblk0p2 ];
then
# mount and set perms
busybox mount -o noatime,nodiratime -t auto /dev/block/mmcblk0p2 /system/sd;
busybox chown 1000:1000 /system/sd;
busybox chmod 771 /system/sd;
# clean up any old symlinks, create data directories
for i in data;
do
if [ -h /data/$i ];
then
rm /data/$i;
fi;
if [ ! -d /data/$i ];
then
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
# move apps from internal memory to sdcard
for i in app app-private dalvik-cache;
do
if [ ! -d /system/sd/$i ];
then
mkdir /system/sd/$i;
fi
busybox chown 1000:1000 /system/sd/$i;
busybox chmod 771 /system/sd/$i
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox cp -a /data/$i/* /system/sd/$i/;
busybox rm -f /data/$i/*;
fi;
done;
# symlink app dirs - they must be on the same filesystem
for i in app app-private dalvik-cache;
do
if [ -d /data/$i ] && [ ! -h /data/$i ];
then
busybox rm -rf /data/$i;
busybox ln -s /system/sd/$i /data/$i;
fi;
done;
# clean up old whiteouts
for i in local misc property system tombstones data;
do
if [ -h /system/sd/$i ]; then rm -f /system/sd/$i; fi
done;
# please don't put odex files in the app directory people!
# it causes dexopt to crash when switching builds!
busybox rm -f /system/sd/app/*.odex
setprop cm.a2sd.active 1;
echo "+++ Apps-to-SD successfully enabled";
else
# replace symlinks with directories so we can boot without sd
for i in app app-private dalvik-cache;
do
if [ -h /data/$i ];
then
rm -f /data/$i;
mkdir /data/$i;
busybox chown 1000:1000 /data/$i;
busybox chmod 771 /data/$i;
fi;
done;
setprop cm.a2sd.active 0;
fi;
sync;
i currently have the old clockwork 2.5.1.0 and ready to move to ext4 and flash most likely viperrom or srf. the problem im encountering is when i extract the cwm3 zip and click run.sh like instructed it just opens up this with gedit:
#!/bin/bash
platform=`uname`;
adb="./adb";
if [ $(uname -p) == 'powerpc' ]; then
echo "Sorry, this won't work on PowerPC machines."
exit 1
fi
cd "$(dirname "$0")"
echo "Original one click made by joeykrim and one click installer made by noobnl and firon"
echo "busybox by skeeterslint"
read -n1 -s -p "Press any key to continue..."
which adb > /dev/null 2>&1
if [ $? -eq 0 ]; then
adb="./adb";
if [ "$platform" == 'Darwin' ]; then
mv adb.osx $adb > /dev/null 2>&1
fi
fi
chmod +x $adb
echo -e "Starting adb server"
$adb kill-server
which sudo > /dev/null 2>&1
if [ $? -eq 0 ]; then
$adb start-server
else
sudo $adb start-server
if [ $? -ne 0 ]; then
$adb start-server
fi
fi
state=$($adb get-state | tr -d '\r\n[:blank:]')
while [ "$state" != device ]; do
state=$($adb get-state | tr -d '\r\n[:blank:]')
read -n1 -s -p "Phone is not connected. Press any key to continue."
done
root=$($adb shell id | grep uid=0)
if [ -z "$root" ]; then
echo -e "Copy and run the exploit (may take up to two minutes)"
$adb push rageagainstthecage-arm5.bin /data/local/tmp/rageagainstthecage-arm5.bin
$adb push root.sh /data/local/tmp/root.sh
$adb shell chmod 755 /data/local/tmp/rageagainstthecage-arm5.bin
$adb shell chmod 755 /data/local/tmp/root.sh
$adb shell /data/local/tmp/root.sh
echo Wait for phone to reconnect...
sleep 20;
i=0;
state=$($adb get-state | tr -d '\r\n[:blank:]')
while [[ "$state" != device && $i -lt 30 ]]; do
state=$($adb get-state | tr -d '\r\n[:blank:]')
let i=i+1;
sleep 1;
done
if [ "$state" != "device" ]; then
echo "Phone did not reconnect after 30 seconds."
read -n1 -s -p "Pausing script. Unplug and replug USB cable and check the connection (verify with adb shell)."
fi
state=$($adb get-state | tr -d '\r\n[:blank:]')
if [ "$state" != "device" ]; then
echo "Aborting script. Phone is still not connected. Reboot the phone and try again.";
exit 1;
fi
root=$($adb shell id | grep uid=0)
if [ -z "$root" ]; then
echo "Root was not obtained. Please re-run the script."
exit 1;
fi
fi
echo "Mount system as r/w, cleanup old files, do some basic configuration"
$adb shell mount -t rfs -o remount,rw /dev/block/stl9 /system
oldroot=$($adb shell "if [ -f /system/bin/joeykrim-root.sh ]; then echo -n 'exists'; fi");
if [ -z "$oldroot" ]; then
$adb shell rm /system/bin/playlogo
$adb shell mv /system/bin/playlogo-orig /system/bin/playlogo
$adb shell chmod 755 /system/bin/playlogo
fi
$adb push rootsetup /data/local/tmp/rootsetup
$adb shell chmod 755 /data/local/tmp/rootsetup
$adb shell /data/local/tmp/rootsetup
$adb shell rm /data/local/tmp/rootsetup
$adb shell rm /system/app/Asphalt5_DEMO_ANMP_Samsung_D700_Sprint_ML.apk
$adb shell rm /system/app/FreeHDGameDemos.apk
echo "Copying files onto phone..."
$adb push su /system/xbin/su
$adb push Superuser.apk /system/app/Superuser.apk
$adb push busybox /system/xbin/busybox
$adb push remount /system/xbin/remount
echo "Setting permissions..."
$adb shell chmod 755 /system/xbin/busybox
$adb shell chmod 755 /system/xbin/remount
$adb shell chown root.shell /system/xbin/su
$adb shell chmod 4755 /system/xbin/su
$adb shell ln -s /system/xbin/su /system/bin/su
echo "Installing busybox..."
$adb shell /system/xbin/busybox --install -s /system/xbin
osversion=$(./adb shell getprop ro.build.id | tr -d '\r\n[:blank:]')
if [ "$osversion" == "FROYO" ]; then
echo Installing clockworkmod redirector
$adb push recovery /system/bin/recovery
$adb push recoveryfiles /system/bin/recoveryfiles/
$adb push recoveryres /system/bin/recoveryres/
$adb shell busybox chmod -R 0755 /system/bin/recoveryfiles/*
$adb shell busybox chmod -R 0755 /system/bin/recoveryres/*
$adb shell chmod 0755 /system/bin/recovery
$adb shell sync
fi
echo "Installing clockworkmod recovery..."
$adb push redbend_ua /data/local
$adb shell chmod 755 /data/local/redbend_ua
$adb push zImage /data/local/tmp/zImage
$adb shell /data/local/redbend_ua restore /data/local/tmp/zImage /dev/block/bml8
echo "Waiting for phone to reboot..."
sleep 5;
i=0;
state=$($adb get-state | tr -d '\r\n[:blank:]')
while [[ "$state" != device && $i -lt 45 ]]; do
state=$($adb get-state | tr -d '\r\n[:blank:]')
let i=i+1;
sleep 1;
done
echo "Cleaning up files..."
sleep 5;
$adb shell rm /data/local/redbend_ua
$adb shell rm /data/local/tmp/zImage
$adb shell rm /data/local/tmp/rageagainstthecage-arm5.bin
$adb shell rm /data/local/tmp/root.sh
if [ -z $(which sudo 2>/dev/null) ]; then
$adb kill-server
else
sudo $adb kill-server
fi
read -n1 -s -p "Press any key to exit the script."
anyone know the command in terminal to possibly run this. thanks!
It's run.bat you are supposed to run in either a command box or just double click on it in Windows. Remember the 1st time you go into Clockwork it will immediately convert you to EXT4 file system. You need to have the EXT4 compatible ROM on your sd card and flash it before rebooting from the conversion or you will get stuck at the Samsung screen.
this is for linux os though. according to the instructions im suppose to click the shell file not the batch file.
mk4cam said:
this is for linux os though. according to the instructions im suppose to click the shell file not the batch file.
Click to expand...
Click to collapse
I'm not quite sure, but as an alternate suggestion, try out heimdall in linux and flash the image file here. Also listed in my signature
Which distro are you running? You need to make the script executable and then run the script from a terminal.
Open a terminal where you extracted the cwm3.zip and run the following commands;
Code:
chmod +x run.sh
Code:
./ run.sh
You may need to run this as root or sudo.
ironlineage said:
Which distro are you running? You need to make the script executable and then run the script from a terminal.
Open a terminal where you extracted the cwm3.zip and run the following commands;
Code:
chmod +x run.sh
Code:
./ run.sh
You may need to run this as root or sudo.
Click to expand...
Click to collapse
tried it and now this:
Original one click made by joeykrim and one click installer made by noobnl and firon
busybox by skeeterslint
Press any key to continue...Starting adb server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Phone is not connected. Press any key to continue.
im lost cause i had no issues rooting the older version via http://forum.xda-developers.com/showthread.php?t=808103. ive tried every usb port i have on this comp and every cable i have and it still cant see the phone. i think ill just have to try this when im around a windows comp next time.
If I remember correctly you need to have USB Debugging enabled on your phone and make sure it is not mounted on the computer but still charging.
ok ill try it cause i have had it mounted. ill let you know
Edit: ran it w/o mounting and same results
Have busybox? Wish you could type "grep foo" instead of "busybox grep foo" ? This simple shell script checks your busybox for supported commands and softlinks them from /system/bin to wherever the first busybox it finds in the $PATH is.
Since I screwed up my links a couple times making this, there's also a script that strips every link to busybox out of /system/bin.
These scripts do basically no error checking. They require root access, but they don't check for it. If you don't know how to read a script to see what it does before you run it, don't run it.
That said, it's handy.
Code:
#!/system/bin/sh
# linky.sh: softlink busybox to all the commands it supports
# Now with zero error checking! Beware :P
# -speef
busybox &>/dev/null || exit 1
bbl=`busybox which busybox`
ready=0
busybox mount -o rw,remount /system
>./linky.log
for cmd in `busybox`
do
cmd=`echo $cmd|busybox awk -F, '{print $1}'`
if [ $ready -eq 0 ]
then
if [ $cmd == "functions:" ]
then
ready=1
continue
else
continue
fi
fi
echo ln -s $bbl /system/bin/$cmd
busybox ln -s $bbl /system/bin/$cmd &>> linky.log
done
busybox mount -o ro,remount /system
echo "see ./linky.log for errors!"
And its counterpart, which removes all links to busybox from /system/bin:
Code:
#!/system/bin/sh
# delinky.sh: remove all busybox links from /system/bin
# Now with zero error checking! Beware :P
# -speef
busybox &>/dev/null || exit 1
busybox mount -o rw,remount /system
for cmd in `busybox find /system/bin -type l -exec ls -l \{\} \; | busybox grep busybox|busybox awk '{print $6}'`
do
echo rm /system/bin/$cmd
busybox rm /system/bin/$cmd
done
busybox mount -o ro,remount /system
Hello there,
I am attempting to downgrade my rooted (w/BusyBox) Fire TV 51.1.1.0_511070220 to 510058520, in order to eventually install pre-rooted firmware by rbox. However, I continue to get the "downgrade install failed" message upon reboot. I read all of the comments in the downgrade post at AFTVnews, and still can't figure it out. I know that some people have had this same problem going from 70220 to 58520. Can anyone please help?
Here is my log:
User-1s-MacBook-Pro:~ user1$ ./adb push /Users/user1/APK\ Files/recovery.img /sdcard/
940 KB/s (10485760 bytes in 10.886s)
User-1s-MacBook-Pro:~ user1$ ./adb shell
[email protected]:/ $ su
dev/block/platform/msm_sdcc.1/by-name/recovery <
20480+0 records in
20480+0 records out
10485760 bytes transferred in 1.587 secs (6607284 bytes/sec)
[email protected]:/ # rm -f /cache/*.bin
[email protected]:/ # rm -f /cache/*.zip
[email protected]:/ # rm -f /cache/recovery/command
[email protected]:/ # rm -f /sdcard/recovery.img
[email protected]:/ # chmod 777 /cache
[email protected]:/ # chmod 777 /cache/recovery
[email protected]:/ # cd /cache/recovery
cache/update.zip > command <
[email protected]:/cache/recovery # exit
[email protected]:/ $ exit
User-1s-MacBook-Pro:~ user1$ ./adb push /Users/user1/APK\ Files/update.zip /cache
1017 KB/s (415956067 bytes in 399.180s)
User-1s-MacBook-Pro:~ user1$ ./adb reboot recovery
Do you see anything that I am doing wrong? I followed the instructions very carefully, including the steps where the install fails, and have attempted this like 5 times. I am using a Mac computer, so am I missing something in front of the "rm" lines? There is no visible response when I enter the rm lines. I'm at a loss! Thanks.
hi had to restore everything and going through stages have installed busybox and unblocked bootloader but cant get rbox boot menu to install i follow all the stages but on last stage i get cannot open for read: No such file or directory any ideas? here is full commands and response:
is is possible to ubgrade without boot menu or install twrp instead or must i go through the stages
adb push c:\users\paul\desktop\bootmenu.img /sdcard
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
cannot stat 'c:userspauldesktopbootmenu.img': No such file or directory
1|[email protected]:/ # adb shell
adb shell
[email protected]:/ # su
su
[email protected]:/ # su
su
[email protected]:/ # /system/xbin/busybox md5sum /sdcard/bootmenu.img
/system/xbin/busybox md5sum /sdcard/bootmenu.img
a8a3c28baafe43f354d92e6cc8b392d3 /sdcard/bootmenu.img
[email protected]:/ # rm -f /sdcard/bootmenu.img
rm -f /sdcard/bootmenu.img
[email protected]:/ # exit
exit
[email protected]:/ # exit
exit
[email protected]:/ # mount -o remount,rw /system
mount -o remount,rw /system
[email protected]:/ # mkdir /system/boot
mkdir /system/boot
[email protected]:/ # dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/system/boot/boot.img
dcc.1/by-name/boot of=/system/boot/boot.img <
20480+0 records in
20480+0 records out
10485760 bytes transferred in 0.422 secs (24847772 bytes/sec)
[email protected]:/ # mount -o remount,ro /system
mount -o remount,ro /system
[email protected]:/ # dd if=/sdcard/bootmenu.img of=/dev/block/platform/msm_sdcc.1/by-name/boot
dev/block/platform/msm_sdcc.1/by-name/boot <
/sdcard/bootmenu.img: cannot open for read: No such file or directory
paulsavo said:
hi had to restore everything and going through stages have installed busybox and unblocked bootloader but cant get rbox boot menu to install i follow all the stages but on last stage i get cannot open for read: No such file or directory any ideas? here is full commands and response:
is is possible to ubgrade without boot menu or install twrp instead or must i go through the stages
adb push c:\users\paul\desktop\bootmenu.img /sdcard
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
cannot stat 'c:userspauldesktopbootmenu.img': No such file or directory
1|[email protected]:/ # adb shell
adb shell
[email protected]:/ # su
su
[email protected]:/ # su
su
[email protected]:/ # /system/xbin/busybox md5sum /sdcard/bootmenu.img
/system/xbin/busybox md5sum /sdcard/bootmenu.img
a8a3c28baafe43f354d92e6cc8b392d3 /sdcard/bootmenu.img
[email protected]:/ # rm -f /sdcard/bootmenu.img
rm -f /sdcard/bootmenu.img
[email protected]:/ # exit
exit
[email protected]:/ # exit
exit
[email protected]:/ # mount -o remount,rw /system
mount -o remount,rw /system
[email protected]:/ # mkdir /system/boot
mkdir /system/boot
[email protected]:/ # dd if=/dev/block/platform/msm_sdcc.1/by-name/boot of=/system/boot/boot.img
dcc.1/by-name/boot of=/system/boot/boot.img <
20480+0 records in
20480+0 records out
10485760 bytes transferred in 0.422 secs (24847772 bytes/sec)
[email protected]:/ # mount -o remount,ro /system
mount -o remount,ro /system
[email protected]:/ # dd if=/sdcard/bootmenu.img of=/dev/block/platform/msm_sdcc.1/by-name/boot
dev/block/platform/msm_sdcc.1/by-name/boot <
/sdcard/bootmenu.img: cannot open for read: No such file or directory
Click to expand...
Click to collapse
You deleted the file you're trying to dd. might want to double check the instructions.
Lol seen that cheers