yashsingh1/xdaforums huggingface dataset:
[Xperia Z3 General] ondrejvaroscak:
I am having problem with the remountrebootfix. I have rooted Beta MM, during installation I confirm SuperSU dialog to allow root to ADB shell, but anyway getting error :

==============================================
= =
= [NUT]'s definitive Remount-Reboot fixer =
= A.K.A. 'the rootfix' =
= =
==============================================
[ 1. SuperSU ]
[ 2. SuperUser ]
[ 3. Abort ]
Which root app do you use? [1,2,3]?1
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
=============================================
Waiting for Device, connect USB cable now...
=============================================
Device found

=============================================
Sending the rootfix files.
=============================================
11 KB/s (560 bytes in 0.048s)
252 KB/s (1551 bytes in 0.006s)
14 KB/s (82 bytes in 0.005s)
2744 KB/s (657704 bytes in 0.234s)
785 KB/s (3217 bytes in 0.004s)

=============================================
Installing the rootfix.
NOTE: If your device reboots without prior
notification, the installation failed
Please take a screenshot or copy paste the
contents of this dosbox to the topic on XDA.
=============================================
Look at your device and grant supersu access
Press any key to continue AFTER granting root access.
-rwxr-xr-x shell shell 657704 2013-06-24 12:59 busybox
Press any key to continue . . .

=============================================
= STARTING ON DEVICE INSTALLATION! =
=============================================
= NOTE: YOUR DEVICE SHOULD NOT REBOOT =
= UNTIL THE INSTALLER SAYS IT WILL! =
=============================================

killing RIC, remount /system rw and temporarily disabling the RIC service...
mount: permission denied (are you root?)
chmod: chmod '/sbin/ric' to 100644: Read-only file system
mount: permission denied (are you root?)
Found busybox, checking if it supports nohup...
It does, EXCELLENT! :)
copying the rootfix files to /system/bin...
cp: can't create '/system/bin/killric.sh': File exists
rm: can't remove '/system/bin/ctrlaltdel': Read-only file system
cp: can't create '/system/bin/ctrlaltdel': File exists
chmod: /system/bin/killric.sh: Read-only file system
chmod: /system/bin/ctrlaltdel: Read-only file system

=============================================
= DONE WITH THE INSTALLATION! =
= NOTE: YOUR DEVICE WILL NOW REBOOT! =
=============================================

Waiting for your device to reconnect.

Seems like install.sh is called without being root

EDIT: So far found out, that busybox is executed without root...
[Xperia Z3 General] Marília de Oliveira:
I can not flashing anything, always gives error! even moving the file to internal memory gives the same error. You have some correction? :D
[Xperia Z3 General] GenesMan:
Exactly the same error here using a Z3 and Windows 7

Same error here as well

Trying to figure out why TWRP could not mount /system, I found that when it is initialized by boot_twrp_recovery.sh script it could not unmount /system in this line:

echo "unmount system." >> /cache/mm_twrp_recovery.log
busybox umount /system 2>> /cache/mm_twrp_recovery.log

The stderr dumped to mm_twrp_recovery.log is:

Can't unmount /system: Device or resource busy

I suppose that if TWRP is initialized with /system mounted it becomes locked and any zip files will not install since TWRP will not have read/write access to /system

Have to figure out why the initialization script could not unmount /system , Is there any services or executables still being running?
[Xperia Z3 General] ondrejvaroscak:
It should not be because separate processes can mount their own namespaces separately...
[Xperia Z3 General] shoey63:
Guys, MM- beta has RIC built into the kernel itself, not just the ramdisk like in LP. TWRP needs to be modified to accommodate this, as LB is running TWRP on top of stock mm kernel. I helped Gustavo with this (after he showed me the path to the RIC file in the kernel) and he incorporated it into his advanced stock kernels. I will post appropriate twrp. recovery.cpio.lzma files here later.
[Xperia Z3 General] ondrejvaroscak:
Yet it still doesn't quite explain the mystery of that busybox commands are executed without root even when ran from root shell....
[Xperia Z3 General] shoey63:
No time for mysteries, I have work tomorrow:p

[MENTION=2822871]Wolfbreak[/MENTION] [MENTION=2902434]Pandemic[/MENTION]

Here is the appropriate recovery.twrp.cpio.lzma for you guys to use in your LB recovery scripts (Rename it obviously to recovery.twrp.cpio.lzma)View attachment recovery.twrp.cpio.lzma.apk

Edit: TWRP is now 3.0.1-0 as per recent changes in the last 24 hours
[Xperia Z3 General] ondrejvaroscak:
I didn't wanted you to solve it :) just to point out that for some reason busybox fails to execute as root. Maybe somebody has a clue...

I am not sure, but have the feeling that lately are here some guys a bit feisty. It is not necessary.
[Xperia Z3 General] shoey63:
Yeah, no problem, not having a go at you. Just trying to get these builds up.

Sorry if I seemed a bit aggressive, wasn't the intention.
[Xperia Z3 General] GenesMan:
Ok, tried reinstall TWRP using shoey63´s file but the errors in remountrebootfix ondrejvaroscak has mentioned still presists. After replacing the recovery.twrp.cpio.lzma and reinstalling when reboot to TWRP I can see that it has updated to 3.0.1-0, now it asks if I want to allow system modifications, but after a few seconds it reboots :(

imgur[dot]com/L6rFCmp

(I cant post links to outside right now, but the screen is that above)
[Xperia Z3 General] mysara saad:
HI [MENTION=4675598]shoey63[/MENTION] is your recovery is compatible with Z2?
[Xperia Z3 General] shoey63:
OK, thanks for the report. I will try and see what the problem is.

Well I was about to release it, but apparently there are issues. I will do some testing over the next day or two on the z3.
[Xperia Z3 General] ondrejvaroscak:
So if I get it right, because of you integrated the RIC killing into TWRP, we should NOT try to install the [NUT]'s remountrebootfix...?
[Xperia Z3 General] shoey63:
You still need byelinux and ric killer for booting into system. My fix is for booting into twrp, and having r/w permissions in recovery.
[Xperia Z3 General] ondrejvaroscak:
That's what I get from it. There is no change into how root is obtained, users must flash byeselinux and ric killer to be able boot rooted system. But rickilling for booting TWRP is built in in your lzma. Thanks, great job, must try when I get home..
[Xperia Z3 General] mysara saad:
[MENTION=4675598]shoey63[/MENTION] actually I manged to boot to recovery with the.lzma file from xzdr with serajr fix but my problem was TWPR was unable to mount system so it wont flash anything so what I am asking is can your recovery mount system partition?
[Xperia Z3 General] Wolfbreak:
Here is the ROM Solution for LB/UB

http://xdaforums.com/z3/development/d6603-23-1-1-28-t3102271
[Xperia Z3 General] serajr:
Maybe I eat... so please my apologies!

As shoey mentioned, you will still need it! The weird part of this is that on my wife's z3 everything is working as expected as well.

My setup on two working phones:

- MM beta backup over latest LP fw (supersu >> byeselinux >> ricdefeat) and latest BusyBox (stericson) as well

- remountrebootfix (reboot)

- recovery installation
[Xperia Z3 General] GenesMan:
That´s exactly the point why [MENTION=4675598]shoey63[/MENTION] had to patch TWRP to be able to have r/w access to /system.

The problem is that after using the supplied recovery.twrp.cpio.lzma , after a few seconds device enters in recovery it reboot itself (kernel panic maybe?)

I may have done something wrong in the process , need someone else to test and verify.

Just to clarify, are you using Windows x64 or x86 to apply remountrebootfix ?

I´m using x64
[Xperia Z3 General] shoey63:
It will, when I release it for Z2. Just waiting for some confirmation from z3 testers
[Xperia Z3 General] Wolfbreak:
It works fine for me the only thing i needed to do is 2 changes.

First change i used this RIC Defeat instead of the one serajr posted. The only thing you need now is extract these 3 Files into the Folder where install.bat is and run it. Dont forget to swap your TWRP with the one for your Phone like serajr said.
[Xperia Z3 General] serajr:
Thank you bro for the feedback.

Yep, I just forgot to put adb files in there, my bad!
[Xperia Z3 General] serajr:
So am I
[Xperia Z3 General] ondrejvaroscak:
Ok, you have stericson's busybox, that may explain all, because it seems, that busybox included in the remountrebootfix is not working properly...
[Xperia Z3 General] GenesMan:
I´m a bit confused. How can you flash a RIC Defeat zip prior to having recovery installed, do you mean when we did the rooting process serarj said below?
[Xperia Z3 General] ondrejvaroscak:
Yes, that's why [MENTION=3989065]serajr[/MENTION] and some other's have successful installation, because they had busybox already installed, and my installation failed, because I had no busybox, so the included one was used leading to errors.
[Xperia Z3 General] Wolfbreak:
My ROM has Busybox preinstalled so that could be the Problem yes.
[Xperia Z3 General] serajr:
Z3

Edit:

V2 available here
[Xperia Z3 General] mysara saad:
Please make one for z2 too ?

And great job everyone
[Xperia Z3 General] Dilesh Perera:
[MENTION=3989065]serajr[/MENTION]

what changes need to do for Z2? only replace recovery.twrp.cpio.lzma for Z2 from Duelrecovery?
[Xperia Z3 General] juanpirulo:
I try your twrp 3 over rxsw flashable zip installed and after entering on twrp and trying to set lenguaje just boot again. cheers

I ve got my device again working. :)
[Xperia Z3 General] serajr:
I think so!

And if something goes wrong, you can delete the installation files with steps in the post #265
[Xperia Z3 General] NewBieSS:
Some file explorer apps as MiXplorer cannot write to system/app. I can delete file or folder but cannot copy file. It's normal with Root Explorer.

:)
[Xperia Z3 General] Dilesh Perera:
The new zip Xperia_Z3_MM_TWRP_Recovery_Installer_By_Serajr dose not work for me. when i run install it just hangs. but i tried with 1st zip of urs (Xperia_MM_TWRP_Recovery_Installer_By_Serajr) it install and reboot 1st time to TWRP. and i even created a full backup of my phone. but after reboot i cannot get in to recovery. i can see light blur led blink and vibrate but volume down key dose not works. it just reboot to the system :)

seems its almost there :) anyway u can help serajr?

btw many thanks for the good work
[Xperia Z3 General] serajr:
Yeah... so you got a working recovery! But your device has diff keyevent.

Please, plug it in and run this command:

adb shell getevent

Press vol down key once

And post the results! Also screenshot from your /sys/class/leds/ folder contents (from root explorer or any)

Is vibration working?
[Xperia Z3 General] Dilesh Perera:
yes vibrated

C:\adb>adb shell getevent

add device 1: /dev/input/event7

name: "system_als"

add device 2: /dev/input/event6

name: "msm8974-taiko-mtp-snd-card Headset Jack"

add device 3: /dev/input/event5

name: "msm8974-taiko-mtp-snd-card Button Jack"

add device 4: /dev/input/event4

name: "mhl-rcp"

add device 5: /dev/input/event1

name: "qpnp_pon"

add device 6: /dev/input/event0

name: "max1187x_touchscreen_0"

could not get driver version for /dev/input/mice, Not a typewriter

add device 7: /dev/input/event3

name: "qpnp_chg_unplug_key"

add device 8: /dev/input/event2

name: "gpio-keys"

/dev/input/event2: 0001 0072 00000001

/dev/input/event2: 0000 0000 00000000

/dev/input/event2: 0001 0072 00000000

/dev/input/event2: 0000 0000 00000000
[Xperia Z3 General] serajr:
Thank you, what about leds?
[Xperia Z3 General] ondrejvaroscak:
I have got problems with your zip until I copied over adb.exe and dll files from my own ADB installation. It also just hang-up and waited for device. As soon as I replaced your adb, it worked ok. Thanks for good job!
[Xperia Z3 General] GenesMan:
Same here, but the error was that there was a zombie adb.exe process running in background, just killed it and the .bat worked, BUT, still got no luck installing the rootfix and even after installing serarjr latest update the TWRP has no /system write privileges :crying:
[Xperia Z3 General] serajr:
That's a great news! Thank you guys!!!

Install.bat script must be improved!

So do you think the missing BusyBox at the start of the process was the culprit?
[Xperia Z3 General] GenesMan:
I couldn´t make it work, TWRP still has no rw privileges, can´t install any flashable zips.

Can´t understand why after granting root privileges to adb shell in NUT´s install.bat it still has no write privileges, thus fail to patch the RIC process and probably that is what is preventing us to use TWRP with root privileges.

Did it work to mount /system rw in TWRP? No more "E: unable do mount /system" error?
[Xperia Z3 General] juanpirulo:
Here you have a working services.jar with signature verification disable and Teleservices and com.android.phone-res-305.apk to disable data icon. cheers

Intruccions to install data icon disable. Estract zip

copy teleservices.apk in system/priv-app/Teleservices with 0644 permission

copy com.android.phone-res-305.apk in system/vendor/olverlay with 0644 permission.

for services.jar just copy in system/framework with 0644 permission

edit: forgot to say if you are on odex rom deleted services.odex
[Xperia Z3 General] Wolfbreak:
Guys if you want RW working and Recovery you can also use my MM ROM. Its Pure Sony with only light improvements. Check my Thread for more Information.
[Xperia Z3 General] ondrejvaroscak:
Yes, and also you should double check your shell scripts if they don't use hardcoded busybox in tmp but the correctly detected version (/sbin /xbin or wherever)
[Xperia Z3 General] Sherif Abdl-Naby:
Already using it, It do really feel pure sony, yet it also feel more snappier and more light.

But i can't reboot into recover (although the phone vibrates are booting), Can you please explain how to boot into recovery ?
[Xperia Z3 General] serajr:
Bro, this was my very first shell script, I'm a java dev as you know. I hope someone more experienced can improve them!!

Which device?
[Xperia Z3 General] mysara saad:
But the. Lzma from xzdr dont mount the system partition so is there is any changes should be made or should we try the TWPR 3.0?
[Xperia Z3 General] serajr:
Did you install the proper one I posted at Z2 thread?
[Xperia Z3 General] juanpirulo:
Full Deodex flahable mm zip

https://mega.nz/#!C9ZGGT5K!ATqT9DlLiALn_qNfCQ8lwdoBdo113vhMTf6I39l-Ht8

Thanks to [MENTION=5632076]Lordroid[/MENTION] for his tool deodexer

Enviado desde mi D6603 mediante Tapatalk
[Xperia Z3 General] PPJD:
Mount /System as R/W

Hi!

here is temporary solution for mount /system as r/w.

first , you have to mount system as read-only > in TWRP > Mount > check only mount system as read-only > check System

now get back to Main Menu and click Advance > Terminal Command > Click select on root directory.

type "mount -a" (without quote)

you will get error message can't mount /usb-otg but all partition has mounted

type "mount -o remount,rw /system"

and install whatever you want :D
[Xperia Z3 General] mysara saad:
:highfive: confirm working amazing bro :good:
[Xperia Z3 General] Wolfbreak:
Never had a Problem with RW, i dont know why everyone have Problems with RW or Recovery. It worked perfect from day one for me. Maybe its because my ROM use permissive SELinux and also has a RW Script included on Top of RIC Defeat. Like i said install my ROM to solve this Problems. The Marshmallow ROM is 100% Stock Sony so its the same like any MM ROM available for Z3. Its only debloated, prerooted with RIC Defeat, ByeSELinux and Recovery. All is tested by a good amount of People and its working fine. All deleted Apps are available either as Addon or in Play Store.
[Xperia Z3 General] mysara saad:
if you make a z2 version i will be very happy to try it :)
[Xperia Z3 General] Wolfbreak:
Will try once i have Time on PC.
[Xperia Z3 General] Pandemic:
Bro [MENTION=599722]niaboc79[/MENTION] is already working on it for Z2 !!
[Xperia Z3 General] mysara saad:
That's a great news thank you both for your contribution to the community [MENTION=599722]niaboc79[/MENTION] [MENTION=2902434]Pandemic[/MENTION]
[Xperia Z3 General] serajr:
Humm... great found! :good:

So I think you can just put these blue lines in the taimport script (/system/bin/taimport):

if [ $BOOTTWRP -eq 1 ]; then
echo "boot TWRP..." >> /cache/mm_twrp_recovery.log

export PATH="/system/bin:/system/xbin:/sbin"

/system/etc/mm_twrp_recovery/setdatefromhc

[COLOR="Blue"][B]echo "remount system rw" >> /cache/mm_twrp_recovery.log
mount -o remount,rw /system 2>> /cache/mm_twrp_recovery.log[/B][/COLOR]

echo "remount rootfs rw" >> /cache/mm_twrp_recovery.log
mount -o remount,rw rootfs / 2>> /cache/mm_twrp_recovery.log
cd /

That may fix the /system r/w issue, but you will still have the message: Unable to mount '/system' (only once)
[Xperia Z3 General] Marília de Oliveira:
It all worked, thanks :D
[Xperia Z3 General] serajr:
Great!! ;)
[Xperia Z3 General] ondrejvaroscak:
I knew you are a wizard :)
[Xperia Z3 General] dex87xda:
Guys help me ,it looks like I did something wrong. Can someone upload proper edited taimport.sh file with rw for system.

I think i ruined recovery, cannot boot to recovery.....cannot gain adb acess omg to reflash recovery files, adb kill server doesnt work..
[Xperia Z3 General] Melhisedek:
Everything worked just fine until I flashed Xposed v81, sdk 23.

Now I boot into OS, have a few seconds and than my phone reboots. Anything I can do? Remove Xposed or something?

*edit*

false alarm I disabled all modules and now it works, so it must be some of the modules
[Xperia Z3 General] Beetle84:
You answered your own question, download the xposed uninstaller if you havent already and flash that.

Try v80 sdk23, ive never had an issue with it.
[Xperia Z3 General] Jkay7:
Just reflash stock with flashtool :)
[Xperia Z3 General] dex87xda:
-_-
[Xperia Z3 General] serajr:
Thank you bro!

I wrote all the scripts completely from scratch this time, and ofc found some few mistakes. The system r/w issue was gone definitely (recovery message as well). The volume down key catch's process was automated, It is not hard coded into script anymore, that means... it will work across devices! Also, busybox is installed properly with all its symlinks applets.

I hope releasing it soon, with new threads at Z3C, Z3 and Z2 foruns!

Btw... do you (all of you) think that is possible packing the new TWRP with it? If so, it must be packed with cpio and then lzma!

Attached are the three possible logs (yep... chargemon binary instead of taimport):
[Xperia Z3 General] juanpirulo:
[MENTION=4675598]shoey63[/MENTION] build a 3.0 one . But i dont know why when i tried i get into recovery well but when try to past the unlocked i get bootloop. You can have a look here

http://xdaforums.com/showpost.php?p=66143479&postcount=243

Edit. if you want me to do some test just tell me. cheers

Edit2. I checked again it gets into recovery but after few seconds reboot the phone.
[Xperia Z3 General] serajr:
Thank you buddy! Got forced reboot as well!!

I think the recovery/kernel guys [MENTION=4102242]Gustavo RD78[/MENTION] and/or [MENTION=4675598]shoey63[/MENTION] (ofc) may have a look into it, and do some compares with NUT's one.
[Xperia Z3 General] shoey63:
So NUT'S recovery is ok now? If so., it should be a matter of building from sources without RIC disable modification, seeing as it's disabled already. Will build and test later.
[Xperia Z3 General] AkinFad09:
Can this work for Xperia z2 D6503?
[Xperia Z3 General] Wolfbreak:
NUT TWRP 2.7.0 Recovery works perfect yeah.
[Xperia Z3 General] juanpirulo:
Its the end lines which we have to changed in init.rc inside recovery.twrp.cpio.lzma because of yes i can do it on linux.

import /init.recovery.logd.rc
import /init.recovery.usb.rc
import /init.recovery.${ro.hardware}.rc

on early-init
# Apply strict SELinux checking of PROT_EXEC on mmap/mprotect calls.
write /sys/fs/selinux/checkreqprot 0

# Set the security context for the init process.
# This should occur before anything else (e.g. ueventd) is started.
setcon u:r:init:s0

start ueventd
start healthd

service set_permissive /sbin/permissive.sh
oneshot
seclabel u:r:recovery:s0

on init
export PATH /sbin:/system/bin
export LD_LIBRARY_PATH .:/sbin
export ANDROID_ROOT /system
export ANDROID_DATA /data
export EXTERNAL_STORAGE /sdcard

mkdir /boot
mkdir /recovery
mkdir /system
mkdir /data
mkdir /cache
mkdir /sideload
mount tmpfs tmpfs /tmp

chown root shell /tmp
chmod 0775 /tmp

write /proc/sys/kernel/panic_on_oops 1
write /proc/sys/vm/max_map_count 1000000

on fs
mount pstore pstore /sys/fs/pstore

mkdir /dev/usb-ffs 0770 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000

on boot
ifup lo
hostname localhost
domainname localdomain

class_start default

# SONY: Enable Sony RIC
mount securityfs securityfs /sys/kernel/security nosuid nodev noexec

# Load properties, pre-Android 6.0
on load_all_props_action
load_all_props

# Load properties, Android 6.0+
on load_system_props_action
load_system_props

# Load properties, Android 6.0+, vendor init lives here
on load_persist_props_action
load_persist_props

on firmware_mounts_complete
rm /dev/.booting

# Mount filesystems and start core system services.
on late-init
trigger early-fs
trigger fs
trigger post-fs
trigger post-fs-data

# Load properties, pre-Android 6.0
trigger load_all_props_action

# Load properties, Android 6.0+
trigger load_system_props_action

# Load properties, Android 6.0+, vendor init lives here
trigger load_persist_props_action

# Remove a file to wake up anything waiting for firmware
trigger firmware_mounts_complete

trigger early-boot
trigger boot

on property:sys.powerctl=*
powerctl ${sys.powerctl}

service ueventd /sbin/ueventd
critical
seclabel u:r:ueventd:s0

service healthd /sbin/healthd -r
critical
seclabel u:r:healthd:s0

service recovery /sbin/recovery

service adbd /sbin/adbd --root_seclabel=u:r:su:s0 --device_banner=recovery
disabled
socket adbd stream 660 system system
seclabel u:r:adbd:s0

# Always start adbd on userdebug and eng builds
on property:ro.debuggable=1
#write /sys/class/android_usb/android0/enable 1
#start adbd
setprop service.adb.root 1

# Restart adbd so it can run as root
on property:service.adb.root=1
write /sys/class/android_usb/android0/enable 0
restart adbd
write /sys/class/android_usb/android0/enable 1

[COLOR="Blue"]# SONY: Disable RIC
write /sys/kernel/security/sony_ric/enable 0
[/COLOR]
[Xperia Z3 General] serajr:
It is! Thank you!!

For sure!!
[Xperia Z3 General] caqo71:
so, wich is the package to install?, is there a modified one to install?
[Xperia Z3 General] shoey63:
Nope that doesn't do it :( Must be something to do with the "keep system read only" message. It always Bootloop on that screen. Need to try and revert that commit or find a flag to disable it (may or may not fix it)