[Q] clockwork 3 with linux - Epic 4G Q&A, Help & Troubleshooting

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

Related

A2SD APPS2SD 40a2sd init startup script editing

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;

[Q] Script Error

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

My contribution to Bin4ry tool (aka Root MANY ANDROID! post)

Note to moderation team: I wanted to post my contribution directly into the author's thread but I'm not allowed to do so.
If my post is right, maybe you could merge my post with the original discussion.
Hi everyone,
I'd like to to provide my feedback regarding the following tool written by Bin4ry.
Tool is available here:
http://forum.xda-developers.com/showthread.php?t=1886460
First of all, I'd like to thank Bin4ry for his job, because with the help of his tool, I have successfully rooted my noname (*) tablet, running ICS 4.0.4.
However, it did not work out at the very first try: the tool said everything went fine but after reboot, my tablet was still not rooted.
Actually, I entered the guts of Bin4ry's script, and find out this trick.
The original script contains this section:
Code:
:NORMAL
IF %ric% == 1 GOTO RICSTUFF
echo Going to copy files to it's place
stuff\adb.exe shell "/data/local/tmp/busybox mount -o remount,rw /system && /data/local/tmp/busybox mv /data/local/tmp/su /system/xbin/su && /data/local/tmp/busybox mv /data/local/tmp/Superuser.apk /system/app/Superuser.apk && /data/local/tmp/busybox cp /data/local/tmp/busybox /system/xbin/busybox && chown 0.0 /system/xbin/su && chmod 06755 /system/xbin/su && chmod 655 /system/app/Superuser.apk && chmod 755 /system/xbin/busybox && rm /data/local.prop && reboot"
GOTO FINISH
Actually, I think that the command "/data/local/tmp/busybox" is missing at some locations.
So I rewrote the script as follows and got my tablet rooted !!
Code:
:NORMAL
IF %ric% == 1 GOTO RICSTUFF
echo Going to copy files to it's place
stuff\adb.exe shell "/data/local/tmp/busybox mount -o remount,rw /system"
stuff\adb.exe shell "/data/local/tmp/busybox mv /data/local/tmp/su /system/xbin/su"
stuff\adb.exe shell "/data/local/tmp/busybox mv /data/local/tmp/Superuser.apk /system/app/Superuser.apk"
stuff\adb.exe shell "/data/local/tmp/busybox cp /data/local/tmp/busybox /system/xbin/busybox"
stuff\adb.exe shell "/data/local/tmp/busybox chown 0.0 /system/xbin/su"
stuff\adb.exe shell "/data/local/tmp/busybox chmod 06755 /system/xbin/su"
stuff\adb.exe shell "/data/local/tmp/busybox chmod 655 /system/app/Superuser.apk"
stuff\adb.exe shell "/data/local/tmp/busybox chmod 755 /system/xbin/busybox"
stuff\adb.exe shell "/data/local/tmp/busybox rm /data/local.prop"
stuff\adb.exe shell "/data/local/tmp/busybox reboot"
GOTO FINISH
Note: I'm typing from memory because sadly, I erased my own modified file hope I'm not typing too much stupid things because my memory might play me some tricks. But the general idea is here.
Said differently, I simply added the command "busybox" before "chmod" and "chown" commands.
Don't ask me why but it did work. Actually, I discovered this trick by typing the aformentionned commands one a time and find out that simply chmoding a file did not actually change its properties.
I did not rewritte the entire script, but it might be necessary to add the "busybox" command prior to any other "chmod" or "chown" commands (in the ":RICSTUFF" for instance. My tablet did not require to enter this section so I did not bother modify it).
Hope this trick will help someone. If someone finds out it solves its issue, it might be useful to modify Bin4ry's script in a next version of the tool.
(*) more precisely, my tablet is a Finetech by Akor, model TG166.
Want to try to use this method to root Docomo P-02E but something concern.
If rooting is not success, it must be kept unrooted. But will it brick the phone?
Thank you and regards,

Busybox command softlinker

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

rbox boot menu

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

Categories

Resources