Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to remove root verification on Chrome OS v70 #10

Open
Giinx opened this issue Nov 17, 2018 · 54 comments
Open

Unable to remove root verification on Chrome OS v70 #10

Giinx opened this issue Nov 17, 2018 · 54 comments

Comments

@Giinx
Copy link

Giinx commented Nov 17, 2018

I would like some help because I am unable to remove root verification on this version, when I run the command: sudo /usr/share/vboot/bin/make_dev_ssd.sh --remove_rootfs_verification --partitions $(( $(rootdev -s | sed -r 's/.*(.)$/\1/') - 1)) everythings appears to be okay but when I restart my chromebook and try to run RootandSEpatch.sh I get the error "Error!
Unable to modify system!
In order to modify system files, the Chrome OS system partition needs to have been mounted writeable (i.e. rootfs verification disabled).
"

I would like some help with this please.

@nolirium
Copy link
Owner

Yes, the rootfs verification check in the script got broken due to a change in Chrome OS. The RootandSEpatch.sh script has just been updated with a fix - if you try it again now, it should work this time.

@Giinx
Copy link
Author

Giinx commented Nov 17, 2018

Yes, the rootfs verification check in the script got broken due to a change in Chrome OS. The RootandSEpatch.sh script has just been updated with a fix - if you try it again now, it should work this time.

chronos@localhost / $ curl -Ls https://raw.githubusercontent.com/nolirium/aroc/onescript/RootandSEpatch.sh | sudo sh
sh: 118: Syntax error: "fi" unexpected (expecting "then")

@nolirium
Copy link
Owner

Should be fixed now.

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

Should be fixed now.

cheers, so I did that and it still didnt work the chromebook running chromeos v70 is still unrooted for some reason even after doing this.

@nolirium
Copy link
Owner

Did you happen to notice if there were any error messages in the script's output?

Are Android apps working now (but no root), or not loading at all, or ...?

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

Did you happen to notice if there were any error messages in the script's output?

Are Android apps working now (but no root), or not loading at all, or ...?

normal android apps that require no root work fine, everything is still working just fine as normal but everything that requires root and any root checks come up as device unrooted still, and there were no error messages but I can do it again now and screenshot the logs for you

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

Got an error
ERROR: No running Android system found. Unable to patch sepolicy.

@nolirium
Copy link
Owner

Yeah, that'll happen if for example you try to run the script twice over without rebooting between times. It's expected, in that case.

Try rebooting again, and if still working and unrooted, can you paste the following into the Chrome OS shell and see if anything comes up:

sudo su -
printf "ps | grep daemon" | android-sh

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

I ran the script the first time then I rebooted and it wasnt rooted so I went in shell and tried again so I can check if there were any errors for you and thats the error that I got :) But I did reboot right away the first time I ran the script

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

Yeah, that'll happen if for example you try to run the script twice over without rebooting between times. It's expected, in that case.

Try rebooting again, and if still working and unrooted, can you paste the following into the Chrome OS shell and see if anything comes up:

sudo su -
printf "ps | grep daemon" | android-sh

infinite loading on apps now wont seem to work anymore

@nolirium
Copy link
Owner

nolirium commented Nov 18, 2018

OK well, give it a couple of minutes (it takes some time after the first reboot), and then if apps are still not loading, the command to restore the unrooted Android container is

sudo mv /opt/google/containers/android/system.raw.img.bk /opt/google/containers/android/system.raw.img

If you paste that into the Chrome OS shell and then reboot, you should have the normal unrooted Android system back.

I may not be able to respond back until tomorrow now, but if you do end up unrooting and running the script again, it might be useful if you could copy the script's output to text (or screengrab), so we could check if there were any errors running the script.

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

I keep getting ERROR: No running Android system found. Unable to patch sepolicy. thats the only error

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

screenshot 2018-11-18 at 4 28 35 am

@nolirium
Copy link
Owner

But everything else (file copying etc) looks like it worked OK. Hmm...

If you do

sudo android-sh

does it get you into an Android shell like it's supposed to? (you would see the prompt change from "chronos@localhost: " to "something_cheets:")

Or does it just give an error message?

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

it takes me to edgar_sheets:/

@nolirium
Copy link
Owner

OK that's good. Now, at the edgar_cheets prompt, can you put in
ps | grep daemon
and tell me what, if anything, shows up?

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

screenshot 2018-11-18 at 2 57 31 pm

@nolirium
Copy link
Owner

So daemonsu isn't running. Can you try to start it (see if it is present)? Again in the edgar_cheets prompt, do

daemonsu --auto-daemon

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

screenshot 2018-11-18 at 4 04 03 pm

@nolirium
Copy link
Owner

Try a root app now - see if it asks for permission.

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

opening root checkers and supersu and theyre all still saying that device is unrooted, should I try to reboot and then check?

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

screenshot 2018-11-18 at 4 28 34 pm

@nolirium
Copy link
Owner

Something's not right, clearly. Maybe we should try to patch the SE Linux policy file manually, to rule out SE Linux being the problem (since one of your screenshots showed the rooting script erroring out at the point, right near the end where it's supposed to patch the sepolicy file).

Here's a script which is just the SE Linux policy patching part. (you can run it in the Chrome OS shell)

curl -Ls https://raw.githubusercontent.com/nolirium/aroc/master/Test/sepatchtest.sh | sudo sh

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

screenshot 2018-11-18 at 5 13 33 pm

@nolirium
Copy link
Owner

Maybe you could double check the contents of /system/xbin in Android:

sudo android-sh
ls -alt /system/xbin

Also in the Android shell (the edgar_cheets prompt), could you do

su --version

(It should say "2.82:SUPERSU")

And also at the edgar_cheets prompt, if you just do

su

and see if you get an error there or if the edgar_cheets prompt changes at all (if any number shows up).

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

Would turning this on make a difference? Just wondering.
screenshot 2018-11-18 at 5 27 39 pm

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

update on your last comment btw
screenshot 2018-11-18 at 5 29 52 pm

@nolirium
Copy link
Owner

Would turning this on make a difference? Just wondering.
screenshot 2018-11-18 at 5 27 39 pm

It shouldn't do any harm, but unless something has changed very recently, it shouldn't affect Android either way.

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

would turning that on fix our issue or what do you recommend?

@nolirium
Copy link
Owner

would turning that on fix our issue or what do you recommend?

At the moment we don't know what the exact cause of the issue is, but turning on Linux apps is unlikely to affect it. Feel free to try it though, it shouldn't do any harm...

update on your last comment btw
screenshot 2018-11-18 at 5 29 52 pm

So, it looks like the files for SuperSU are all present and correct. The "1|edgar_cheets" that appears at the front of your last command indicates an error, but at least Android is booting and the files appear to be in the right place.

I'm going to go look through some of the comments from my blog, as I remember some people had similar problems a while ago, with various causes (and resolutions). I'm thinking perhaps the modification to init.rc is at fault, but perhaps it's something else entirely.

One last easy thing that comes to mind to maybe try is to disable enforcing SELinux completely (then reboot).

sed -i 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/selinux/config

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

screenshot 2018-11-18 at 5 57 41 pm
sed: couldn't open temporary file /etc/selinux/sedczIHPC: Permission denied

@nolirium
Copy link
Owner

Oh, forgot to mention that you'll need to sudo su beforehand for that one to work

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

sweet dude it's working now we got it done!! 👍
screenshot 2018-11-18 at 6 28 33 pm
after running that command I rebooted got back on opened supersu updated the packages rebooted once again and now it's working fine it seems like I'll keep u updated, let me know if u want me to test out some more stuff tho

@nolirium
Copy link
Owner

Good stuff! Glad we could get it sorted.

I'll still have to try and work out out why it wasn't working initially. Possibly the script still needs tweaking somewhat.

For the moment though, it might be helpful towards figuring out the initial cause if you could do one more thing now, which is to redo the SE Linux patching command mini script in the Chrome OS shell, and see if it succeeds this time :

curl -Ls https://raw.githubusercontent.com/nolirium/aroc/master/Test/sepatchtest.sh | sudo sh

(If it tells you to reboot, just ignore that).

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

OK just an update before I do what you told me to do, after I took the screenshot that I showed u I rebooted and now that I'm back on it it seems like apps aren't opening anymore it's just an infinite loading loop

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

Just ran the script that u sent me btw
screenshot 2018-11-18 at 7 38 01 pm

@nolirium
Copy link
Owner

Just ran the script that u sent me btw
screenshot 2018-11-18 at 7 38 01 pm

Well, that appears to have worked, which is something.

Did the previous command stick? If you type

sudo su
grep SELINUX= /etc/selinux/config 

into the Chrome OS shell, does it show 'Permissive' or 'Enforcing'?

How are you rebooting, by the way? I mean, are you just typing reboot into the shell, or using the power button, or something else? (I only ask as I remember one person who was pressing Esc+Refresh+Power instead of a regular reboot every time, which was messing things up in strange ways).

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

I reboot by pressing the power button + the spin button on my keyboard and I did what u told me ran the command it says permissive

@nolirium
Copy link
Owner

When you say the spin button, do you mean the 'refresh' key (F3)? If so... Don't do that.

Just use the power button (or type reboot in a root shell).

Pressing the power and refresh keys both together can potentially do a hard reset if you keep them held down for too long, which can really mess things up if you've just made some changes, as the system will completely 'forget' the changes.

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

I didn't hold it down for too long though I only pressed them twice together once and it restarts, what should I do now though? because when I do reboot in a root shell it says command not found

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

after checking im pretty sure power button + refresh key is fine btw Im only clicking it for a millisecond

@nolirium
Copy link
Owner

after checking im pretty sure power button + refresh key is fine btw Im only clicking it for a millisecond

Yeah, it was probably fine then - you would have had to have been holding them down for a moment to hard reset, and IIRC the screen normally flashes white briefly, so you'd have probably noticed. But there's no need to press the refresh button anyway, so...

when I do reboot in a root shell it says command not found

Were you doing it in a root shell, or as chronos@localhost, though?

Just to clarify, within the Chrome OS shell terminal:

This is the Chrome OS regular user shell prompt:
chronos@localhost / $

This is the Chrome OS root user shell prompt:
localhost / #

(If you try to run a command and you get a permission error, or if it says command not found, sometimes it's because you're in the shell as a regular user (in this case, chronos). If so, you can change to root with sudo su).

Apologies if this is all stating the obvious.

Anyway... Are you still in the same situation? Have you rebooted (either way) since you ran the last script?

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

yup still having the same issue guess its time to reset and start over.. god.

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

did a powerwash and now I cant get playstore working again it's getting really annoying, even though I ran the command to restore the unrooted android container

@nolirium
Copy link
Owner

did a powerwash and now I cant get playstore working again it's getting really annoying, even though I ran the command to restore the unrooted android container

So Android isn't loading at all after a powerwash? What is happening, just the loading graphic constantly spinning?
You might try taking a look at logcat if you can get into android-sh from the Chrome OS root shell

printf logcat | android-sh

just to see if it is looping or frozen (normally it's constantly updating).

You could also try double checking that the restore command worked (by listing the files in /opt/google/containers/android)

ls -alt /opt/google/containers/android/

The nuclear option would be to either switch release channel, or do a restore with the Recovery Utility. Recovery should pretty much always work, as it'll download the whole OS again, and the release channel change usually works (but in certain situations can fail). A powerwash only deletes user files, mainly.

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

google services just wont work anymore for some reason I attached 2 pictures of how the playstore is behaving, if I close it and try to reopen it, it simply doesnt open and goes into infinite loop
screenshot 2018-11-18 at 10 20 05 pm
screenshot 2018-11-18 at 10 20 00 pm

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

Should I try going into the dev channel?

@nolirium
Copy link
Owner

nolirium commented Nov 18, 2018

In your first image there, you are trying to run the command printf logcat | android-sh as chronos, but it needs to be done in a root Chrome OS shell (do sudo su first).

Should I try going into the dev channel?

That should work, but first you could maybe just try toggling between Enforcing and Permissive SELinux again, then rebooting.

Again in a root Chrome OS shell, If you do grep SELINUX= /etc/selinux/config again, if it still shows as 'Permissive', you can change it back to 'Enforcing' (its original state) with:

sed -i 's/SELINUX=permissive/SELINUX=enforcing/g' /etc/selinux/config

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

alright give me a bit I'll get it sorted now I'll go into dev channel then back to stable that should work and then when google services work again I'll go through all the steps again to root it okay? I'll keep you updated

@nolirium
Copy link
Owner

nolirium commented Nov 18, 2018

alright give me a bit I'll get it sorted now I'll go into dev channel then back to stable that should work and then when google services work again I'll go through all the steps again to root it okay? I'll keep you updated.

Seems like a good plan. Although, without wanting to add a whole other layer of potential confusion, I should also just mention in case you weren't aware that Chrome OS uses an A/B partition system for updates, i.e. lets say you start off on partition 3, the next update sets a kernel flag so you will be using partition 5 after rebooting, and after the next update on partition 3, and so on.

They do this so they can apply updates smoothly, and in normal use for the most part it works fine, but occasionally it can lead to messed up/confusing situations when removing root verification/modifying system files & rebooting. Going stable>dev>stable should be fine, but I thought I'd mention the A/B partition system just in case.

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

ok man its all good now I went stable>dev>stable and then ran the rootandsepatch script rebooted and it just worked this time didnt have to do anything else, and also about the A/B partition how will this affect me in the future? and is there anyway I can just make it go back to normal or something

@Giinx
Copy link
Author

Giinx commented Nov 18, 2018

I'm too scared to restart or turn off my chromebook now btw. lol :D

@nolirium
Copy link
Owner

ok man its all good now I went stable>dev>stable and then ran the rootandsepatch script rebooted and it just worked this time didnt have to do anything else,

Good. That's how it's supposed to work.

and also about the A/B partition how will this affect me in the future? and is there anyway I can just make it go back to normal or something

Oh, it is normal, it's how they've designed the update system. It most likely won't affect you ever unless if, for instance, you were running the rooting script while you had an update waiting, or maybe you are hacking around on the OS, changing other stuff around, then e.g. you change channel a few times real quickly. Even in that case, all that would likely happen would you'd need to re-do the thing you changed (it's just that if it does happen, it can be completely confusing at the time).

I'm too scared to restart or turn off my chromebook now btw. lol :D

haha, yeah I can understand that after all of this. Although if you reboot it once, and everything still works, then at least you'll know it'll be OK from there on. Normally once it works, that's it, everything's fine (until the next major Chrome OS update, anyway).

@gyit918
Copy link

gyit918 commented Jun 10, 2021

when i do sudo android-sh
it gives me this sudo
:/ #

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants