[Magisk] Devo7v:
Thanks for your suggestion, I should have thought of that a lot sooner than I did. It looks like Magisk is failing to find necessary parts of the kernel to patch pretty much everywhere it turns (see the recovery log below). I've posted in the thread for my stock kernel (link to program for modifying the Z5 stock kernel), but maybe you can provide some insight to something that could be done. One thing that really concerns me, is that after Magisk fails in so many different places to patch the kernel, why does it go through with flashing a broken kernel? Shouldn't the installer be intelligent enough to realize that it's failed at patching the kernel properly and either abort flashing the modified kernel or restore the backup of the kernel?

Recovery Log

I:Set page: 'flash_zip'

I:operation_start: 'Flashing'

Installing zip file '/external_sd/ROMs/XperiaZ5/Stock/20161114 Root-Xposed/Magisk-v9.zip'

Checking for MD5 file...

Skipping MD5 check: no MD5 file found

I:Zip does not contain SELinux file_contexts file in its root.

I:Legacy property environment initialized.

Archive: /external_sd/ROMs/XperiaZ5/Stock/20161114 Root-Xposed/Magisk-v9.zip

inflating: META-INF/MANIFEST.MF

inflating: META-INF/CERT.SF

inflating: META-INF/CERT.RSA

inflating: META-INF/com/google/android/update-binary

inflating: META-INF/com/google/android/updater-script

inflating: arm/bootimgtools

inflating: arm/busybox

inflating: arm/magiskhide

inflating: arm/resetprop

inflating: arm/sepolicy-inject

inflating: arm64/bootimgtools

inflating: arm64/busybox

inflating: arm64/magiskhide

inflating: arm64/resetprop

inflating: arm64/sepolicy-inject

inflating: chromeos/futility

inflating: chromeos/kernel.keyblock

inflating: chromeos/kernel_data_key.vbprivk

inflating: common/custom_ramdisk_patch.sh

inflating: common/file_contexts_image

inflating: common/init.magisk.rc

inflating: common/magic_mask.sh

inflating: common/magiskhide/add

inflating: common/magiskhide/list

inflating: common/magiskhide/rm

inflating: x64/bootimgtools

inflating: x64/busybox

inflating: x64/magiskhide

inflating: x64/resetprop

inflating: x64/sepolicy-inject

inflating: x86/bootimgtools

inflating: x86/busybox

inflating: x86/magiskhide

inflating: x86/resetprop

inflating: x86/sepolicy-inject

*****************************

Magisk v9 Boot Image Patcher

*****************************

- Mounting /system(ro), /cache, /data

- Device platform: arm64

chmod: /futility: No such file or directory

- Constructing environment

- Creating /data/magisk.img

Creating filesystem with parameters:

Size: 67108864

Block size: 4096

Blocks per group: 32768

Inodes per group: 4096

Inode size: 256

Journal blocks: 1024

Label:

Blocks: 16384

Block groups: 1

Reserved block group size: 7

Created filesystem with 11/4096 inodes and 1294/16384 blocks

mknod: /dev/block/loop0: File exists

- Mounting /data/magisk.img to /magisk

- Found Boot Image: /dev/block/mmcblk0p29

- Unpacking boot image

CANNOT LINK EXECUTABLE: "/sbin/libc.so" is 32-bit instead of 64-bit

page record for 0x7f8c9bd050 was not found (block_size=64)

/tmp/updater: line 333: can't open /tmp/boottmp/bootunpack/ramdisk.gz: no such file

- Creating backups

131072+0 records in

131072+0 records out

67108864 bytes (64.0MB) copied, 1.229019 seconds, 52.1MB/s

- Patching ramdisk

grep: init*.rc: No such file or directory

sh: 0: unknown operand

sed: init.rc: No such file or directory

CANNOT LINK EXECUTABLE: "/sbin/libc.so" is 32-bit instead of 64-bit

page record for 0x7f9f315050 was not found (block_size=64)

cp: can't create 'sbin/magic_mask.sh': No such file or directory

chmod: sbin/magic_mask.sh: No such file or directory

- Repacking boot image

CANNOT LINK EXECUTABLE: "/sbin/libc.so" is 32-bit instead of 64-bit

page record for 0x7fa4a17050 was not found (block_size=64)

mv: can't rename 'new-boot.img': No such file or directory

CANNOT LINK EXECUTABLE: "/sbin/libc.so" is 32-bit instead of 64-bit

page record for 0x7fa9147050 was not found (block_size=64)

ls: /tmp/boottmp/new-boot.img: No such file or directory

sh: bad number

chmod: /tmp/boottmp/new-boot.img: No such file or directory

- Flashing new boot image

dd: can't open '/tmp/boottmp/new-boot.img': No such file or directory

- Unmounting partitions

losetup: /dev/block/loop0: No such device or address

- Done

I:Updater process ended with RC=0

I:Legacy property environment disabled.

Updating partition details...

I:Data backup size is 5321MB, free: 17238MB.

I:Unable to mount '/usb-otg'

I:Actual block device: '', current file system: 'vfat'

...done

I:Set page: 'flash_done'

I:operation_end - status=0

I:Set overlay: 'slideout'

I:Set overlay: ''

I:Set page: 'clear_vars'

I:Set page: 'install'

I:Set page: 'main'

I:Set page: 'clear_vars'

I:Set page: 'main2'

I:Set page: 'advanced'

I:Set page: 'confirm_action'

I:Set page: 'action_page'

I:operation_start: 'Copy Log'

I:Copying file /tmp/recovery.log to /external_sd/recovery.log