Hello forums, I've got an annoying problem I've stumbled into. I wanted to download and install KBOX2 onto my OPO for the sake of being able to play gblorb files, I download the OneBox Package Manager that should do that automatically by executing a script in Terminal Emulator and instantly an error pops up as seen in the title of the thread, the whole PIE thing. Now, after extensive googling it seemed like a very early problem that eventually either got patched, or it was exclusive to early nexus models and fixed but some zip.
I have found no info on PIE in Lollipop 5.0 or 5.1, or for my OPO, outside of one website having an article on how to run python in the terminal - it had a subsection devoted to bypassing PIE, which included renaming your original linker to linker.old and then substituting in a patched linker in /system/bin/ that would avoid the whole PIE thing. The next problem I have stumbled into is that even after unlocking my boot, installing TWRP and rooting the device after a lot of hassle with drivers:
Whenever I would mount my /system for the sake of modifying the linker file, it would either keep trying indefinitely or fail promptly, after which I all of the sudden had no root access anymore, root checker showed I didn't have root anymore, and upon restarting my device it would be unable to boot into the OS, and instead boot into TWRP. After even more hassle I have some backups ready to easily mitigate all that but I simply cannot comprehend what the problem is. Seemingly I rooted the phone correctly yet when I want to execute a root action like changing something in /system/bin, it just unroots itself and bam. I have also tried doing all of the above through TWRP itself, mounting system, changing the files (successfully), and then unmounting it / leaving it mounted, it would still not be able to boot into the OS.
Bumping.
exactly the same.
i cant flash anything into /system/bin
i also want to patch linker file, to use SSHTunnel properly in Lollipop.
i use CyanogenOS (CM12S), and TWRP.
how to flash it?
Bumping once more. Does no one have this problem at all ?
I mean fine, PIE might not be common now, or the linker file I have might be the fix i need, but what about the system partition thing ?
Related
Hi all,
I am trying to make sense of how the android system is made up w.r.t to boot/kernel.
I have been looking at the .img files in the build (I built for the "passion" device), and have been googling around to find some more information about the various .img files.
I ran into a nice HOWTO in android-dls.com 's WIKI, titled HOWTO:_Unpack%2C_Edit%2C_and_Re-Pack_Boot_Images (I'm sorry, I'm a new user so XDA won't allow me to post links. I will try to modify my post a soon as I'm granted permission for that)
but I am afraid it is a little outdated:
I have several questions, but I will try to be brief, so I'll focus on
one of them, and if that works I'll proceed to the next questions, all related to "Android bringup for dummy embedded linux kernel experts".
I am fairly aware of differences between different linux
configurations, and I am very familiar with linux bringup concepts, so I will just use common examples from the linux world as my terminology. Hope it will be clear enough.
I understood that boot.img a combination of a kernel (e.g. bzImage in linux) and an initial ramdisk (e.g. initrd.gz), wrapped by some header, as in common linux kernel loading practice (piggy.o etc.).
Now, the aforementioned HOWTO says that the "recovery" image is built on
the same way, and that it is stored on the target's /system/
recovery.img .
I would assume that this would be compound of the ramdisk-
recovery.img, and some other kernel.
Now, the problem is that:
1. This /system/recovery.img does not exist from what I saw (on my
Motorola XOOM tablet)
2. What does exist is /system/boot-from-recovery.p , which is
created during the boot process in obj/PACKAGING/
recovery_patch_intermediates/recovery_from_boot.p .
I saw tons of posts referring to the files, all said that "in order to
replace the rescue disk image, this file needs to be renamed" - but I
am looking for a way to figure out what it is, and how to extract its
contents.
I assume /system/recovery.img is deprecated, is that correct?
3. I did not see any flash devices in /proc/mtd (which is strange).
I searched for hours before sending this post, so I would appreciate
your help. I also posted a similar message at the google android-building group, but it has not been answered yet, and I got the impression that these forums are more active and can help me get where I need.
If it is not the right place to ask the question please let me know -
I just assume this is a general android concept and not device
specific.
Thanks,
Ron
I meant of course /system/recovery-from-boot.p , and not recovery-from.boot.p
-R
Hi,
I don't know if you managed to find out what "recovery-from-boot.p" is, since this is quite an old post, but I think I'll try to help anyway.
recovery.img is not deprecated at all. From my own experience, it looks like "recovery-from-boot.p" is a protection measure introduced in Gingerbread, but not the recovery itself. What it does is replacing any recovery currently installed on the phone with the default one on every boot.
I discovered it after flashing a custom recovery on my Android 2.3.4 phone. It worked, but just during the first boot. The next time I rebooted the phone, the default recovery image was there again. After browsing several sites, I found that "recovery-from-boot.p" is responsible for that.
So, if you flash a custom recovery image on a Gingerbread phone and want to keep it forever, you must delete this "recovery-from-boot.p" from /system, or at least rename it. That way, your new custom recovery will never get overwritten buy the default one, unless you do it yourself.
I hope this helps you and clarifies this question.
Well, it helped me. I'm new to rooting and just came across mention of this file. I am trying to learn 'why' as well as 'how'', so your post was informative.
Was going to ask a dumb question but I figured it out
i need to delet those files
bigrammy said:
Was going to ask a dumb question but I figured it out
Click to expand...
Click to collapse
Hello
can't delete those files >> i am rooted but every time i delete or rename it take permission then nothing happen >> how i can delete them plsssssssssssssssssssssssssssssssssssssss
recovery from boot p
ahmed morsy said:
Hello
can't delete those files >> i am rooted but every time i delete or rename it take permission then nothing happen >> how i can delete them plsssssssssssssssssssssssssssssssssssssss
Click to expand...
Click to collapse
Hey good day. Did you get your problem fixed...? I have an xt912 it has the same file. For days I've been trying to wipe the phone. Tryed rooting it. I tryed reprogramming it. And I got through with all of that. But everytime the phone boots up it goes back to the same state. Then I used a root browser and while exploring I saw this recovery from boot file. I need help. And I don't think I can downgrade the Motorola phones. Thanks in advance.
jman0 said:
Hi,
I don't know if you managed to find out what "recovery-from-boot.p" is, since this is quite an old post, but I think I'll try to help anyway.
recovery.img is not deprecated at all. From my own experience, it looks like "recovery-from-boot.p" is a protection measure introduced in Gingerbread, but not the recovery itself. What it does is replacing any recovery currently installed on the phone with the default one on every boot.
I discovered it after flashing a custom recovery on my Android 2.3.4 phone. It worked, but just during the first boot. The next time I rebooted the phone, the default recovery image was there again. After browsing several sites, I found that "recovery-from-boot.p" is responsible for that.
So, if you flash a custom recovery image on a Gingerbread phone and want to keep it forever, you must delete this "recovery-from-boot.p" from /system, or at least rename it. That way, your new custom recovery will never get overwritten buy the default one, unless you do it yourself.
I hope this helps you and clarifies this question.
Click to expand...
Click to collapse
i have deleted it . then flash recovery ,, but it failed .. it wont even now go to stock recovery itself.. any help..
Does recovery from boot has to do anything with ota update applying ? or it will cause issues in system update ?
I have recovery-from-boot.p in my system and i cant root my phone i cant change the recovery img ... Help?
I hadn't had to deal with this for some time, perhaps because I've updated my devices (Nexus 4, Nexus 5, Nexus 7 '13) with the factory images, with "-w" removed from flash-all, then flashing CWM's recovery, ensure SuperSU was installed, then continuing. Today, I used the new OTA image on my Hammerhead/N5, and recovery-from-boot.p seems to be up to its old tricks again.
Solution is simple.
Flash your alternate Recovery in fastboot, fastboot flash recovery [recovery image file] . Boot into Recovery. Apply/install root app (typically via sideload). Mount /system. adb shell mv /system/recovery-from-boot.p /system/recovery-from-boot.p.bak. Reboot. Done. (If you're unfamiliar with fastboot, adb, and flashing new recovery partitions, you have some reading to do. Commence RTFM.)
I also used to have to move /system/etc/install-recovery.sh but that seems to be gone in Marshmallow. :} Or moved...?
well, after following a guide I have extracted the system.img from a pure-nexus ROM(The ROM I'm currently using), now I can see that "recovery-from-boot.p" file is responsible for recovery lock in my phone. I'll keep it short and straight to the question
"Can I remove this file and rebuild the .dat file and flash it?, so that I won't have any other problems at all"
I want to know if recovery-from-boot.p file is linked to anything other than just locking the recovery or re-flashing it innumerable times.
Hello! So this should be an interesting first post. First, a little background:
I'm relatively new to this, and I've been trying to root my NEC Terrain for a little while now. I've followed the instructions on numerous pages in order to understand how to do things. And now I have been able to rip any partition from the phone. I've looked through everything I could in both the boot and recovery partitions but I haven't found anything I can use (I also explored /system but there doesn't seem to be anything in there either). Also, I tried to do everything on this page: http://forum.xda-developers.com/showthread.php?t=2337642 but I can't get SuperSU or TiBu to work. (As an aside, if anybody can point me in the right direction for the most recent su binary, that would be awesome). SuperSU wants to update the binary but fails. I would assume it's because it tries to install it directly into /system/bin, which isn't writable. If I could make it install it into /data/sbin, it might work, but that's off topic right now.
I would like to explore more of the partitions to understand what they are and what they do (I can't seem to find much information about them anywhere). I'm hoping to find something in the code to give a hint as to how to get into the bootloader. So, I have things like "aboot", "firmware", "MM", and "GROW", among others. Is there any way to decode or decompile those images so I can see what coding goes into them? Am I going about this the wrong way?
Thanks in advance to anyone that can help!
Maybe this will help you
In this post by E:V:A you can find some information about partitions and links to more!
I think latest SuperSU should be with latest SU binary (I can be wrong about this), so you could download "CWM / TWRP / MobileODIN installable ZIP" from this post and take one from "x86" folder.
Good luck.
Thanks for the links! Some of these may be very helpful. However, the su binary I got from that link was much older than the other most recent I had. It's a version 2.0 and they're up to at least 3.2 (I'll check the link again to see if I missed something). Also, for these phones, if anybody is wondering, they are ARM, not x86.
There seems to be only one direction I can go with this: Find an exploit that can run at boot that will interrupt it at the right time and allow editing of the /system partition. I can get a root shell with that script and a bind mount, but it's not enough to get anything else to work (ro.secure is still active, so there's no way to change it after the system is booted). Root is granted to root, and that's all. Any app requesting root does not get it.
The guys on that other thread said they got SuperSU and TiBu to work, but they provided very limited information and I can't seem to make them work. I wonder though, if that would matter as long as ro.secure is still enabled.
Edit: SOLVED
Hoping someone can roughly point me in the right direction. I'm not very savvy in flashing new ROM's, but I had success with my phone recently, so I decided to try and update my tablet and it's not going so well. It's a Samsung Galaxy Tab 10.1, model GT-P7510MA, which I believe is wifi only. I started off by following the youtube tutorial: 0eAQzxwEVjY
I did *not* make a backup, so shame on me right off the bat, but at least now I've learned this lesson.
There is no OS, but TWRP v2.2.0 is installed and I'm able to boot into it just fine. I'm able to transfer/push files via command line on my windows machine, but I did find something that seemed odd, which is that the top level directory is not named "/sdcard", instead it's just "/". When I transfer files, I have to name the the path "/" for them to show up in the top level directory. If I use "/sdcard", it looks like they upload, but I have no idea where they go. Not sure if there's any significance there, but figured I'd mention it.
The problem is that I can't seem to install any OS. I've tried Nameless 4.4.4, Clockworkmod 10.1, and AOSP 6.0. They all fail the same way, I'll type out what it says below:
--Install /aosp-6.0-p4-20151211.zip ...
Finding update package...
E:unknown volume for path [/aosp-6.0-p4-20151211.zip]
E:Can't mount '/aosp-6.0-p4-20151211.zip'
* Verifying filesystems...
* Verifying partition sizes
Error flashing zip '/aosp-6.0-p4-20151211.zip'
Another strange thing is that when I tried the aosp-6.0-p4wifi, it said that this device was a p4, which I don't think is correct, but that's why I tried the p4 version. It errors just the same. I've also tried to update TWRP, but I'm not sure you can update TWRP from within TWRP? I've tried using the file "twrp-2.8.7.-picassowifi.zip" and it errors the same as the OS'.
Edit: It's been sitting here powered on for a bit and then went to the blue teamwin screen and would flash off every five seconds or so. I figured this was maybe a screensaver? Next it powered off and on restart, all the files I've uploaded are no longer visible.
Any guidance is much appreciated.
Final edit: Kind of embarrassing...all I needed to do to find the /sdcard directory was just scroll down a little through the folders on the left (I thought it was supopsed to be the top directory). I'm pretty sure the 7510 is a wifi only version, but for some reason, none of the wifi ROM's I've tried will work. It gives an error and says my device is a p4 and not a p4wifi. Anyway, neither of the wifi/p4 Marshmallow ROM's will work, but all I had to do was wipe cache/delvic/system (I did do this several times) and factory reset (had not done this before) and install Cyanogenmod for p4 with the recommended Google Apps and all is working well.
Man, TWRP just refuses to flash root to my phone (L29c567b190) I've been able to get twrp on there with no issues, but I can't seem to get /system write access.
Flashing SuperSU reboots halfway through the process, and phh's Superuser simply fails with error 1.
Flashing an unencrypted boot img gets me a bootloop.
I've formatted data and reinstalled data files many a time, and no matter what I do, I can't seem to get the root to take.
I'm fairly happy with stock EMUI, It's nice. I just want the root for simple little things like forcing immersive mode, but mainly I want root on principle! It's my pocket computer and I WILL have administrator rights, you know?
Anyway, I've always had Samsung products and have a little experience in HTC stuff, but this issue is really throwing me for a loop!
dm-verity and decrypting my partitions are all new to me... What am I missing here?
Afaik, phhSuperUser method works by following algorithm.
- When installing it unpacks current boot image, makes changes in fstab, copies su binary, then repacks boot and flashes it onto the phone.
Script doesn't have checks. If you have modified boot already, script will fail. So you have to flash original boot before trying to get root/system writable.
Another note, Huawei can change something in boot in new versions of ROM, so script may fail where did not fail before.
Additionally, script works with one TWRP and fails with other.
So I actually got it using the files from this thread:
forum... xda---developers.. .com/mate-9/how-to/hacking-customizing-managing-huawei-t3589996
I had to downgrade twrp from 3.0.3-1 to 3.0.2-2, and it took the binaries from this person's Dropbox. I guess it was just a matter of finding the right files.
So, yeah, I guess you're absolutely right. Failed with one and not the other.
TL;DR, I'm having 'SIM not detected' issues and my laptop will crash if I open another tab, please help I've attached output of `locat -b radio`
SOURCES
https://sourceforge.net/projects/an...8-UNOFFICIAL-treble_arm64_bvS.img.xz/download
https://github.com/topjohnwu/Magisk/releases/tag/v23.0
open_gapps-arm64-10.0-nano-20211021.zip from https://opengapps.org/
https://unofficialtwrp.com/twrp-3-3-1-root-doogee-s68-pro/
PREVIOUS EXPERIENCE:
I believe about two years back I had already installed an earlier build of LineageOs v17 Magisk v19 using fastboot. This was a trial and error kind of thing as I'm only a fanatic when I have to be. After a long time I finally had a working combination; sort of. Soon about every month or so, or after a couple of restarts, my SIM card would not get detected. Though different behaviors would occur, like 'Emergency calls only', 'No Service' or SMS suddenly not coming through. Since then one time or two a restart fixed the issue until the next month or so. I tried inserting the SIM in every order of events, wiping cache/ dalvik, switching airplain mode, resetting network settings, uninstalling magisk and so on. Then I read somewhere I can't remember about draining the battery capacitors(?) by turning the device on and off on an empty battery until there's no power left and the screen doesn't light up. So I did that and that worked! After a couple of times running into this issue on a fully charged 6300mah battery I downloaded 'generic battery drainer' from the GPlayStore and that app is still on my main screen. Apparently when the device shuts down as the app is draining it, the SIM is detected again when I power up after that, so no need too drain completely... I couldn't find answers anywhere and I like Lineage so much that I just accepted it :')
RECENT EXPERIENCE:
This weekend I decided to give it another try and went for LineageOs v18 but TWRP wouldn't go any further than 'Failed to mount /system/<something>' and I finally went for the above mentioned sources. I patched TWRP recovery using the Magisk app (though I get the impression that this was designed out of necessity, I kinda like being able to switch between Magisk like this). It took me a while to understand that using wipe and decrypting data in TWRP before flashing system (fastboot) has the result of adjusting the system partition to the size of system image when flashing, leaving no space for gapps. Then I flashed stock rom, started device and let it encrypt, then flash the new system image. This kept the original system size with enough space. System started up nicely after, except for: In magisk I got "abnormal state, other su detected". After much reading I could link it to the /system/xbin/su binary. Renaming this (scared to remove) fixed that and $PATH was even appended with ":/sbin:/sbin/.magisk/busybox:". And then, the SIM card issues started after my first couple of reboots :') When it works, so far it's only when I boot without magisk.
QUESTIONS:
Whenever I use the wipe option in TWRP that will also decrypt the device, I can wipe whatever I want. But as soon as system starts it's encrypting data again and I have to use adb for example. Isn't this a generic thing? I get confused about reading so much to use TWRP for this.
Can anyone shed light on the effects of what I'm describing with "draining the battery"? And how running the drainer app might have similar effects?
What is a better approach to configure the size of the system partition? Cause now it's basically twice as big as it has to be
Is the /system/xbin/su in the Lineage build? Is that the built-in root that was/ is/ will be deprecated?
And the GOLDEN question, how can I fix these SIM issues? My head is exploding with information trying to figure out what apps and processes are involved in this. As a logcat first-timer I managed to get the output of `logcat -b radio`, see attached file. This line caught extra attention "Failed getting samsung hardware radio", but I'm out of my territory.
THANKS in advance for any input,
greetings, from a little experienced flasher
RUNNING WITH MAGISK
Further inspecting the lines of logcat -b radio, it seams that ril-daemon isn't started when I'm booting with Magisk/ root, like in the previously attached file. Also getprop shows way fewer props with 'ril' in the value than starting non-root, though altering in count between boots. Reading this https://wladimir-tm4pda.github.io/porting/telephony.html and under RIL Initialization "RIL daemon reads rild.lib path and rild.libargs system properties to determine the Vendor RIL library to use and any initialization arguments to provide to the Vendor RIL" I'm wondering, can it be something as simple as a missing PATH or env value? Anyone have the same experience?
RUNNING WITHOUT MAGISK
logcat -b radio shows way more output and many more things happening. I get the impression that the issue is in or close to the application framework layer... I'm now, still hopeful, attaching two files of logcat radio output. One after boot, up to the login screen and one after login.
Between my post and now, I did however "Remove Telephony Subsystem" through setting => Phh Treble Settings => Misc features, (just trying things out as I read stuff) and I haven't been able to get SIM working again, also not after draining the battery as previously worked. Can this be related? How do I get it back (without reflashing)?
Finally some time to update again. As I have understood, Lineageos18 seems to have an extra level of complexity with the need for mounting system as rw and gets more complex if it is encrypted, so I'm still with magisk patched twrp and GSI Lineageos17.
My SIM still isn't working while booted as root, and I can at least determine that rild is not started and also not present/ available through the terminal. As to why and how to fix that, please let me know if you do! I read some places that PATH has to be inserted with the value of PATH from the non-root env in the init.environ.rc file. That did not make a noticable difference for me. I have not installed the magisk app. So far my SIM is working better than before in non-root/ normal system boot, even after restarts and switching to and back from root.
Some (trivial) things I found many questions and few answers about so far on my quest, in case it might help someone:
I could get rid of "too many symbolic links encountered" in the twrp terminal by setting PATH to just one bin location like '/sbin'. I also had this ld.config.txt error in the terminal (which indeed did not exist on my phone) and was able to trace it back to the /system/system/bin/dlinker64 binary trying to mount that file. I just renamed that and that resolved the error. Then I was able to use the terminal to edit the init.environ.oc file (I could not get adb to work in twrp mode). Not anything specifically, but I found this (among many posts on this forum) quite helpful https://www.didgeridoohan.com/magisk/MagiskInstallationIssues.