[Nexus 5X Q&A, Help & Troubleshooting] DebianShaka:
Hi,

GOAL: I'm trying to flash Kali Nethunter on my Nexus 5X (bullhead)

MIDD: This boils down to try to disable dm-verity and force-encryption from my Nexus 5X (bullhead).

STEP: I have a rooted, TWRP'ed phone on (alledgedly) stock ROM, disabling both FAILs

Let's 1st state my safety nets

1. I went the safe route : Fastboot > Temporary TWRP through fastboot > Full backup

2. So I have carefully backed up every partition, literally boot.emmc.win, data.ext4.win, efs1.emmc.win, efs2.emmc.win, recovery.emmc.win, system.ext4.win000, system.ext4.win001, system_image.emmc.win, vendor.ext4.win, vendor_image.emmc.win

3. I can at any time restore my phone - it was a huge step, using fastboot + twrp + the backup above

4. Then I installed magisk, produced a dm-verity-enabled and encryption-enabled boot partition copy

5. Then flashed this boot, then had root, then added twrp app, and gained permanent TWRP

6. Now I'm fine with a safe backup at that point

That said (100% clear : I can try anything out of deleting fastboot - if that's even a thing :) )

Guys .. I have a real corner case :

1. I want to flash NetHunter .. brings error "Can't write to /system"

2. OK I (think I) know that one : mount -o remount,rw /system && touch /system/test # .. oh crap

3. It looks like dm-verity-plus-encrypt switches prevent me from tinkering with /system

And that's where it becomes furry

4. I adb push my boot.emmc.win as /sdcard/boot.emmc.win.img

5. I use magisk to "disable dm-verity" and "disable force-encrypt" [screenshot Screenshot_20210416-131341.png] .. and patch that boot image. The result is some magisk_patched_kSiHo.img [screenshot Screenshot_20210416-131422.png]

6. I rename this to /sdcard/TWRP/boot.emmc.NOVERITY.NOENCRYPTION.img and go to TWRP

7. In TWRP I use *this* image to flash boot, and *format* (not wipe) data and *format* cache

8. Cross fingers, pray, reboot .. FAIL : Google white logo doesn't move - no fancy colorful anim

9. I flash back my stuf, go to step 4 state again, and decide I may have made a typo

10. I triple check the original boot.emmc.win.img, put it again on sdcard, go through magisk again with the same options

11. I get a alledgedly bullet-proof BOOT image again [screenshot Screenshot_20210416-131841.png], copy it to /sdcard

12. I decide to do it hardcore-style [screenshot EXTRACT 2021-04-16 à 13.22.21.png] and issue a fastboot flash boot boot.emmc_nodmverity_noencryption.win && fastboot format userdata && fastboot format cache

Now I can't possibly have typed things wrong and I'm hoping to

* Have wiped all my data (format userdata)

* Have gotten RID OF dm-verity and encryption

* Be able to boot the partition without android needing to decrypt it

And the result is ... tadaa .. FAIL

RESULT: A white "Google" logo forever (1 night so > 6h) without Android booting. Time to restore.

So .. I don't have dm-verity and force-encryption disabled. The boot partition is (still, to date) dm-veritied and data encrypted and .. the Kali Nethunter zip fails to Install using TWRP because it fails to mountpoint /system || mount -o remount,rw,seclabel /system .. and in fact it mounts but then fails to write to any /system/some_file (and TWRP terminal show the impossibility to even touch /system/hello_world # readonly filesystem)

Any checklist/hint/manual/request_for_getprop_or_info is welcome !