[Q] Superboot image for Motorola Moto G

Search This thread

brushmate

Member
Dec 31, 2010
15
0
I'm trying to root my german Motorola Moto G using a superboot image. This topic is very new for me so I followed the Instructions of Mikael Q Kuisma using the original boot.img from the stock ROM. In addition I want to have my image to install a superuser App. So I registered a service in the `init.rc` file which just runs the installer shell script. I register the service like this:

Code:
service installsu /system/bin/sh /superuser/install.sh
    class main
    user root
    group root
    oneshot

As far as i understood this service is run once as root when all other services of the class main are run. Am I right?

The superuser app I want to install is the one from Koushik Doutta. My install.sh script looks like this:

Code:
#!/system/bin/sh
    
mount -o remount,rw /system
   
chattr -i /system/bin/su
chattr -i /system/xbin/su
    
rm -f /system/bin/su
rm -f /system/xbin/su
rm -f /system/app/Superuser.*
rm -f /system/app/Supersu.*
rm -f /system/app/superuser.*
rm -f /system/app/supersu.*
rm -f /system/app/SuperUser.*
rm -f /system/app/SuperSU.*
    
cp /superuser/su /system/xbin/su
chown 0:0 /system/xbin/su
chmod 6755 /system/xbin/su
ln -s /system/xbin/su /system/bin/su
    
cp /superuser/Superuser.apk /system/app
chmod 644 /system/app/Superuser.apk
    
chattr -i /system/etc/install-recovery.sh
cp /superuser/install-recovery.sh /system/etc/install-recovery.sh
chmod 755 /system/etc/install-recovery.sh
touch /system/etc/.installed_su_daemon
    
mount -o remount,ro /system

This is basically the update-android script from the archive but without all the conditionals.

"ls -l" inside the superuser folder gives:

Code:
-rw-rw-r-- 1 root root      44 Nov 30 22:18 install-recovery.sh
-rwxr-x--- 1 root root     737 Jan  7 11:29 install.sh
-rwxr-xr-x 1 root root  283084 Nov 30 22:25 reboot
-rwxr-xr-x 1 root root  311872 Nov 30 22:25 su
-rw-rw-r-- 1 root root 2025538 Nov 30 22:25 Superuser.apk

I think this are the correct permissions?!

The image splitting tool of Mikael Q Kuisma warned me that a different version of mkbootimg was used to create the original boot image an suggested which variables I had to change in the source code. I did this and compiled my own version. The unmkbootimg tool also gave me the complete command including parameters to build the new image. I used it without any modifications.

Finally, the problem: It doesn't root my phone.

It seems like the installer script is never run, because I can't find the su binary using "adb shell ls /system/xbin/". Also the phone does not boot directly into Android. It shows me the Motorola logo, turns black, shows the unlock warning, shows boot animation and then Android is loaded. I don't have a reboot command inside the script, so shouldn't it boot straight to Android when I boot with "fastboot boot <new boot.img>"?

Is it possible to get kernel logs without being root?
 
Last edited: