chenxiaolong / DualBootPatcher

Patches Android ROMs for dual boot support
https://dbp.noobdev.io
Other
530 stars 467 forks source link

MIUI/OmniROM Issue #270

Open Chevelle opened 8 years ago

Chevelle commented 8 years ago

While installing OmniROM on my N5X the first boot works just fine. I can setup the phone and everything, but once I reboot, it either does not boot or I get nothing but force closes.

I think I tracked it down to this: 10-26 11:15:01.941 911 911 E keystore: open: /dev/urandom: Permission denied

This is it during the first boot: dave@EliteBook:~/$ adb shell ls -al /dev/urandom crw-rw-rw- root root 1, 9 1970-01-01 16:23 urandom

Now after a reboot: dave@EliteBook:~/$ adb shell ls -al /dev/urandom -rw-rw---- root root 512 1970-01-01 16:31 urandom

Now just to verify I did a complete nandroid of my main rom. Factory reset, flash OmniROM. Again first boot works. Then reboot, checked '/dev/urandom' and it remained the same and no force closes.

I also have Pure Nexus installed and it does not do it with that rom.

Attached is the OmniROM boot.img

Any ideas? boot.zip

webmaster33 commented 8 years ago

Which MIUI and OmniROM version?

Chevelle commented 8 years ago

Official OmniROM 6.0.1 https://dl.omnirom.org/bullhead/omni-6.0.1-20160830-bullhead-NIGHTLY.zip The MIUI is based off of it.

webmaster33 commented 8 years ago

Do you have a MIUI version & url, too?

chenxiaolong commented 8 years ago

@Chevelle Is your primary ROM also patched? If not, booting into the primary ROM may mess up the SELinux labels for other ROMs' data files.

This may cause the incorrect permissions on /dev/urandom because /init.rc has the following line:

copy /data/system/entropy.dat /dev/urandom
webmaster33 commented 8 years ago

It means, that we can not have original stock (unpatched) rom kept as primary, and having other patched rom as secondary rom on extsd slot?

chenxiaolong commented 8 years ago

@webmaster33 Correct. Ever since Android 5.0 (and some 4.4 ROMs), the /init.rc file contains:

restorecon_recursive /data

which will reset the SELinux labels in /data for every ROM. Thus, using an unpatched primary ROM will likely cause issues for other ROMs.

EDIT: This is because the patcher cannot block an unpatched ROM from performing this operation.

webmaster33 commented 8 years ago

This is a very important information, that I wasn't aware of. I think this info was not described anywhere, but should be highlighted around the download link & install description...

Chevelle commented 8 years ago

All ROM's are patched. Using Dirty Unicorns (6.0.1) as my primary. Running Pure Nexus (7.0.0) in a data-slot works perfectly.

Something else I will try is flashing a different kernel (not boot.img) and see if it makes a difference.

webmaster33 commented 8 years ago

Could you post the MIUI version & download URL?

wazeeahmed commented 8 years ago

@Chevelle this won't make any difference . unless you have a boot.img in your pached file .

Chevelle commented 8 years ago

Ok, tried flashing: Elite Kernel Does the samething. First boot is fine. Second boot, FC's or doesn't boot.

Any idea what is going on? Pure Nexus does not do this.

Going to try another 6.0.X rom.

Flashed Resurrection Remix. Again first boot and reboots work fine. Seem to be only with OmniROM. Unless its my phone.

DeicPro commented 8 years ago

@chenxiaolong I don't patch primary boot.img because I can't play Pokemon GO when patched, I guess is because SafetyNet detect the mount point in /raw (obviously secondaries ROMs have this problem too).

Chevelle commented 8 years ago

@chenxiaolong why is it messing with the permissions for /dev/urandom on just OmniROM?