[Moto X4 Questions & Answers] htsmi:
This is a question for those on the edge of ROM development (hoping to get in contact with sevenrock if they are still around there).

I have been trying for a while to work out a way to run LineageOS 16.0 with full disk encryption and adoptable storage rather than the funky FBE that this device ships with. I found this post by sevenrock with the patches to supposedly make that happen and compiled from scratch. I even build a rom using all of sevenrock's sources, since they appear to be more up to date. The build went fine and flashed it successfully, resized the filesystem as noted, but encryption fails. I set a PIN, tell it to encrypt, but the encryption screen never appears and the device reboots pretty quickly and then gets stuck in bootloop.

Oddly, I've found that if I encrypt with no PIN set, it will still boot, the device will say encrypted, and TWRP seems to indicate that it is actually encrypted somehow. But that's not very useful for me.

I've tried flashing different firmware, even tried going back to an old Pixel Experience rom with FDE enabled and it also failed to encrypt, but with some other errors. I tried manual vdc cryptfs enablecrypto and same results.

I'm not really sure what else to try. It seems like something must be setup up improperly somewhere but not sure where to look. I may try building 17.1 next, but I hear some reports of hardware problems and I don't want to give up LineageOS su. It seems like most people have moved on to it though.

sevenrock, if you are still around here, have you had success encrypting FDE with your sources lately?

Logcat items that may be relevant from the encryption attempt:

09-26 08:41:42.601 658 1867 D vold : fdeEnable(3, *, 0)
09-26 08:41:42.602 658 1867 D vold : !e4crypt_is_native, spawning fdeEnableInternal
09-26 08:41:42.608 658 4064 E Cryptfs : Bad magic for real block device /dev/block/bootdevice/by-name/userdata
09-26 08:41:42.614 658 4064 D Cryptfs : Just asked init to shut down class main
09-26 08:41:43.493 658 4064 I vold : List of Keymaster HALs found:
09-26 08:41:43.493 658 4064 I vold : Keymaster HAL #1: SoftwareWrappedKeymaster1Device from Google SecurityLevel: TRUSTED_ENVIRONMENT HAL: android.hardware.keymaster@3.0::IKeymasterDevice/default
09-26 08:41:43.493 658 4064 I vold : Using SoftwareWrappedKeymaster1Device from Google for encryption. Security level: TRUSTED_ENVIRONMENT, HAL: android.hardware.keymaster@3.0::IKeymasterDevice/default
09-26 08:41:43.500 658 4064 I vold : List of Keymaster HALs found:
09-26 08:41:43.500 658 4064 I vold : Keymaster HAL #1: SoftwareWrappedKeymaster1Device from Google SecurityLevel: TRUSTED_ENVIRONMENT HAL: android.hardware.keymaster@3.0::IKeymasterDevice/default
09-26 08:41:43.500 658 4064 I vold : Using SoftwareWrappedKeymaster1Device from Google for encryption. Security level: TRUSTED_ENVIRONMENT, HAL: android.hardware.keymaster@3.0::IKeymasterDevice/default
09-26 08:41:47.434 658 4064 I Cryptfs : Using scrypt with keymaster for cryptfs KDF
09-26 08:41:47.813 658 4064 I Cryptfs : Signing safely-padded object
09-26 08:41:47.817 658 4064 I vold : List of Keymaster HALs found:
09-26 08:41:47.817 658 4064 I vold : Keymaster HAL #1: SoftwareWrappedKeymaster1Device from Google SecurityLevel: TRUSTED_ENVIRONMENT HAL: android.hardware.keymaster@3.0::IKeymasterDevice/default
09-26 08:41:47.818 658 4064 I vold : Using SoftwareWrappedKeymaster1Device from Google for encryption. Security level: TRUSTED_ENVIRONMENT, HAL: android.hardware.keymaster@3.0::IKeymasterDevice/default
09-26 08:41:48.798 658 4064 I Cryptfs : Already have key
09-26 08:41:48.798 658 4064 I Cryptfs : Using scrypt with keymaster for cryptfs KDF
09-26 08:41:49.178 658 4064 I Cryptfs : Signing safely-padded object
09-26 08:41:49.181 658 4064 I vold : List of Keymaster HALs found:
09-26 08:41:49.182 658 4064 I vold : Keymaster HAL #1: SoftwareWrappedKeymaster1Device from Google SecurityLevel: TRUSTED_ENVIRONMENT HAL: android.hardware.keymaster@3.0::IKeymasterDevice/default
09-26 08:41:49.182 658 4064 I vold : Using SoftwareWrappedKeymaster1Device from Google for encryption. Security level: TRUSTED_ENVIRONMENT, HAL: android.hardware.keymaster@3.0::IKeymasterDevice/default

Full log attached.