20130316

get permanent root on the motorola cliq

Get Permanent root on an android motorola cliq

See what is mounted.
$ adb shell
$ mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mtdblock1 /system yaffs2 ro 0 0
/dev/block/mtdblock2 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock5 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1000,fmask=0711,dmask=0700,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8 0 0
$


Make sure that your /dev/block/mtdblock1 partition is mounted on /system
/dev/block/mtdblock1 /system yaffs2 ro 0 0
If yes create the following script on your PC otherwise adjust it appropriately.
$ cat install-root.sh 
mount -o rw,remount /dev/block/mtdblock1 /system
cat /sdcard/su > /system/bin/su
chown root.root /system/bin/su
chmod 755 /system/bin/su
mount -o ro,remount /dev/block/mtdblock1 /system


Copy the needed files to your device.
$ adb push su /sdcard/su
$ adb push install-root.sh /data/local/tmp/install-root.sh
$ adb shell "chmod 755 /data/local/tmp/install-root.sh"


Fire up a Terminal Emulator on your cliq and execute the install-root script
#/data/local/tmp/install-root.sh


Try to su root from an adb shell
$ adb shell
$ ls /root
opendir failed, Permission denied
$ cd /root
cd: can't cd to /root
$ su
# cd /root
# pwd
/root
# exit
$ exit


Cool, from now on you have root at will.