[LB] The definitive root Remount-Reboot fix!

Search This thread

[NUT]

Senior Member
1. Yes
2. Yes
3. If it returns 1 it runs, right?

Could it have something to do with the exFAT patch (for 64GB sd cards)?

No, tbh... If it returns 1 it didn't find it.

I don't know about how the exfat patch works... So I'm not in the position to answer that question... Yet. I'll be working on exfat support for XZDualRecovery in the coming week, so I'll know more about it then.

Sent from my C6603 using xda app-developers app
 

FSN

Senior Member
Mar 14, 2012
166
41
Zurich, Switzerland
No, tbh... If it returns 1 it didn't find it.

I don't know about how the exfat patch works... So I'm not in the position to answer that question... Yet. I'll be working on exfat support for XZDualRecovery in the coming week, so I'll know more about it then.

Sent from my C6603 using xda app-developers app
so strange..

well the exFAT patch (http://xdaforums.com/showthread.php?t=2189991) is for sony stock rom to read my 64GB exFAT sd card..
 

[NUT]

Senior Member

[NUT]

Senior Member
Yes it does. 0.0B, empty file.

Huh, lol... Here we have assumption again as the mother of all f*ckups... I assumed it never fired... Duh.

Can you use a terminal app and type 'busybox --list | grep nohup'?

When it returns anything else but 'nohup' can you then type just busybox and hand me the version you have so I can check it out?

Sent from my C6603 using xda app-developers app
 

FSN

Senior Member
Mar 14, 2012
166
41
Zurich, Switzerland
Huh, lol... Here we have assumption again as the mother of all f*ckups... I assumed it never fired... Duh.

Can you use a terminal app and type 'busybox --list | grep nohup'?

When it returns anything else but 'nohup' can you then type just busybox and hand me the version you have so I can check it out?

Sent from my C6603 using xda app-developers app
Nohup returns 1...

Busybox version is:
1.20.2-Stericson
 
  • Like
Reactions: [NUT]

[NUT]

Senior Member
Updated correctly now. Remountedrootfs exists, but still 0.0B
grep nohup still returns 1. :(

Rah :mad:

Why would someone create a busybox without the nohup applet :eek:

Let me redo the flashable zip, I'll update it with a check if the nohup applet is in the busybox which is found and will install a correct version of busybox when it's not.

Give me 15 minutes and I'll have a version for you to test :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 101
    As I've been working on the Stock ROM release of 10.1.1.A.1.307 some of my users started reporting that the issues I fixed for my 10.1.1.A.1.253 release started popping up again: whenever anyone with a locked bootloader tried to remount /system writable (remount,rw) it spontaneously sprung a reboot... very annoying, to say the least! :mad:

    It gets even better (or worse, depends on how you look at it) when you consider any CWM version ever released for our Z/ZL models will ask us if we want it to prevent the ROM from flashing STOCK recovery...  /system/etc/install-recovery.sh is the culprit here as it is what CWM disables by making it non-executable when you say YES to the question 'ROM may flash stock recovery on boot, fix?'. It actually is an important part of the rooting process we all know. It stopped the RIC service and prevented the reboots from happening. If someone said YES, the issue mentioned in the previous paragraph would also start happening and some users have even reported loss of root and even bootloops because of this... :eek:

    I've set out to find a fix for it, one that eliminates the chance a regular run-of-the-mill CWM user will ever encounter the question ever again.

    For all of the regular users, download one of these:

    Warning for Xperia T [ALL VERSIONS] Users: There is a problem with this patch combined with the CWM package for your phones, it seems to be busybox related. @garik.007 found the solution to this issue: BusyBox by Robert Nediyakalaparambil. Install that app, update your busybox and it will fix CWM and the remount-reboot fix :)

    WINDOWS INSTALLER: [NUT]'s definitive remount-reboot fixer!

    1. Make sure you have USB debugging turned ON.
    2. Download the package, save it somewhere you remember
    3. Unzip it somewhere you remember
    4. Run the install.bat file and choose the superuser app you are using.
    5. Done!

    The phone should do what the installer tells you it's doing, so if it says your phone will reboot, it will. If it did NOT explicitly say that it would then something went wrong!

    RECOVERY FLASHABLE: [NUT]'s definitive remount-reboot fixer!

    This is a flashable ZIP, install using CWM or TWRP and you're done!

    It is safe to use on any STOCK (Read: NOT CM Based) ROM version released for all Xperia phones with the ric binary incorporated in the ramdisk (/sbin/ric) up to now. To see if this fix will work for your device, check if the 'ctrlaltdel' command is executed from the init.sony[anything].rc scripts. If it is, this will work!

    NOTE: As this fix needs busybox to function and will install or update busybox in /system/xbin if no busybox or no busybox binary which supports the 'nohup' applet was found in /system/bin, /system/xbin or /sbin.

    NOTE 2: As soon as you have installed this rootfixer and you saw it replace the already installed busybox, remove any and all busybox installer apps you have, it will probably break the rootfixer if you update busybox using that app. The version this rootfixer installs is rock solid and is used by most if not every kernel dev working on Xperia line kernels.

    NOTE 3: If you have an unlocked bootloader, you can actually also install it, it won't hurt and you'll be protected from the reboots if you re-lock your phone!

    XDA:DevDB Information
    The definitive root Remount-Reboot fix!, Tool/Utility for the Sony Xperia Z

    Contributors
    [NUT]

    Version Information
    Status: Stable
    Stable Release Date: 2013-06-25

    Created 2013-06-27
    Last Updated 2015-02-05
    16
    Reserved

    For the ROM chefs and other devs on XDA:

    I'm proud to donate the following to the dev-community on XDA, for anyone who wants to integrate it in his/her ROM or rooting tool, there is no need to ask for permissions: you can!

    This hijacks the toolbox command 'ctrlaltdel' executed from init.sony-platform.rc line 13. It will take it's place in a similar way as the chargemon gets replaced to make the recoveries possible on locked bootloaders. As it is a symlink to /system/bin/toolbox there is NO need to create a copy to something else to make this work. The script that takes it's place is this:

    Code:
    #!/system/bin/sh
    
    #####
    #
    # Completely demolish the RIC service and make sure the phone will survive a remount of /system
    #
    # Author: [NUT] from XDA
    #
    
    ARGS="$1 $2"
    
    # Check busybox path and export it
    if [ -x "/system/xbin/busybox" ]; then
           export BUSYBOX="/system/xbin/busybox"
    elif [ -x "/system/bin/busybox" ]; then
           export BUSYBOX="/system/bin/busybox"
    elif [ -x "/sbin/busybox" ]; then
           export BUSYBOX="/sbin/busybox"
    fi
    
    # Mount rootfs rw, if it isn't already
    ROOTFSMOUNTEDRO=`$BUSYBOX grep "rootfs ro,relatime" /proc/mounts | $BUSYBOX wc -l`
    if [ "$ROOTFSMOUNTEDRO" = "1" ]; then
           $BUSYBOX touch /tmp/remountedrootfs
           $BUSYBOX mount -o remount,rw /
    fi
    
    # Edit the init.rc so the service never gets to start
    $BUSYBOX sed -i '/"# Start RIC"/N;s/service ric /sbin/ric/#service ric /sbin/ric/g' /init.sony.rc
    $BUSYBOX sed -i '/"#service ric /sbin/ric"/N;s/    class main/#    class main/g' /init.sony.rc
    $BUSYBOX sed -i '/"#    class main"/N;s/    user root/#    user root/g' /init.sony.rc
    $BUSYBOX sed -i '/"#    user root"/N;s/    group root/#    group root/g' /init.sony.rc
    
    # chmod the ric binaries so they can't start anymore, as a failsafe
    if [ -x "/sbin/ric" ]; then
           $BUSYBOX chmod 644 /sbin/ric
    fi
    if [ -x "/system/bin/ric" ]; then
           $BUSYBOX chmod 644 /system/bin/ric
    fi
    
    # Make sure the RIC service gets killed if it manages to start up...
    # This process will drop in the background and keeps running untill it did!
    $BUSYBOX nohup /system/bin/killric.sh &
    
    # Execute the actual command now
    exec /system/bin/toolbox ctrlaltdel $ARGS

    As you can see I'm spawning a process into the background to kill the RIC service. Even though I commented out the service in init.sony.rc it still manages to start up as init reads and buffers all of it's scripting before it actually starts to do anything... so the service will run regardless of the changes we make to it. This step was just for any form of runlevel change to prevent that from triggering a restart. As a secondary measure it disables the binary all the way by setting 644 permissions on it.

    Code:
    #!/system/bin/sh
    
    #####
    #
    # Check RIC looper, it will exit as soon as it found and killed it!
    #
    # Author: [NUT] from XDA
    #
    
    DoesFileExist() {
           if [ -f "/tmp/killedric" ]; then
                   return 0
           else
                   return 1
           fi
    }
    
    # As the init.rc scripts seem to be running parallel, lets kill ric if it got started.
    until DoesFileExist
    do
    
           RICCHECK=`$BUSYBOX ps | $BUSYBOX grep "/sbin/ric" | $BUSYBOX wc -l`
    
           if [ $RICCHECK -gt 1 ]; then
    
                   $BUSYBOX pkill -f /sbin/ric
    
           fi
    
           if [ $RICCHECK -eq 1 ]; then
    
                   $BUSYBOX touch /tmp/killedric
    
           fi
    
           $BUSYBOX sleep 2
    
    done
    
    exit 0

    This does a loop every 2 seconds and tries to pkill /sbin/ric. When successful it will exit.
    To double check if these 2 scripts did their job you can check /tmp for 2 empty files:
    - /tmp/remountedrootfs
    and
    - /tmp/killedric
    If they exist, checking the processlist should end up empty when trying to find killric.sh, ctrlaltdel and /sbin/ric. If so, on a locked bootloader, you can now safely remount /system and rootfs (/) and survive it :)

    This is my gift to the community, enjoy a trouble free root experience with it!

    Thanks go to:
    @DooMLoRD for the chat about the init process
    @RoberM for testing and suggestions, he found out pkill does successfully kill the ric process in .307
    @fards for the brainstorming in my .307 ROM thread
    @Carceri for the brainstorming in my .307 ROM thread
    4
    Has this fix been implemented in latest dual boot recovery for locked boatloader?

    Sent from my C6603 using xda app-developers app

    No, but it will :)

    XZDualRecovery 2.4 will get this fix as well.

    In the mean time you can flash this just as well :)
    4
    Ok, as per request by DooMLoRD, a windows installer:

    Mind you, I did not test this windows installation procedure yet, as i am currently at work and working from a Linux PC :)


    Tested and confirmed working by me and DooMLoRD :)

    remountrebootfix-windows.zip (0.93MB)
    SHA1hash: 88003e9c00562589ac4eb86271007ba43dad1dea

    1. Download the package, save it somewhere you remember
    2. Unzip it somewhere you remember
    3. run the appropriate batch file (superuser.bat or supersu.bat) depending on the root app you are using.
    4. Done!

    The phone should do what the installer tells you it's doing, so if it says your phone will reboot, it will. If it did NOT explicitly say that it would then something went wrong!

    If you are curious, using this while already fixed should at least not change that, but it can help me debug the installation scripts!

    Let me know if it works ok!
    4
    something wrong with windows installation file, the file is flashable

    The links [NUT] posted need to be corrected.
    The correct link to INSTALLER is remountrebootfix-windows.zip
    The correct link to FLASHABLE is remountrebootfix.zip

    [EDIT] [NUT] has corrected the links.