[SuperR Kitchen] Captain_Throwback:
v0.9.5.8

Ubuntu 15.10, 64-bit

HTC One (M8)

boot.img from firmware, system.img dd'ed while in TWRP recovery

6.0

set_metadata (initially - see results below). sparse_dat appears to be working fine.

Unpacked boot.img, replaced zImage & dtb, replaced fstab.qcom and init.project.rc to support f2fs on system, cache & data

Replaced framework-res.apk with CDMA-compatible version

Replaced build.prop with Sprint-compatible version

Replaced gps.conf with CDMA-compatible version

No

EDIT: I did get an error for the by-name detection - the kitchen was unable to detect it from the boot.img (probably permissions related). Entering manually worked fine.

HTC_One_M8_GPE_Android_6.0_5.07.1700.6_boot_system.zip

MD5: 1a5852a8ee184ec23ffdf1305a0e6c82

So my initial build using set_metadata did not boot. This is related to ramdisk permissions. I had to use Android Image Kitchen with the --sudo option to unpack the boot.img as root, and then use a root File Explorer to navigate and modify the files so that the proper permissions were maintained. Using that boot.img rather than the one unpacked/repacked by the kitchen, I was able to get the ROM to boot.

First boot using set_metadata resulted in no data and no WiFi. Looking at the permissions created in the updater-script by the kitchen versus the permissions from a known working build for this device, there are quite a few differences, both in the contexts being set and the files included.

Kitchen-generated updater-script permissions:

http://pastebin.com/aN00myNQ

Known working updater-script permissions:

http://pastebin.com/z8PW6qQX

Additionally, the kitchen generated the same permissions in the updater-script twice - one right after the other. I deleted the duplicate permissions prior to building the ROM.

The updater-script formats system as ext4 by default, but I didn't see an option to change that. The system partition for my ROM could be ext4 or f2fs, so I prefer the "delete_recursive" method to avoid changing the existing format on the device.

Overall, not bad for my first attempt on this device. The one I really have trouble with the the A9, which is an arm64 device - when I tried to flash the sparse_dat for that one, recovery just stuck during the flash. And that ROM also didn't boot when using set_metadata, though I imagine that might be because of the same issue with the boot.img (which I didn't discover until recently). I'll try to create a flashable ROM zip for A9 next and see if I can provide some additional feedback to help you troubleshoot the issues I'm having there as well.

---------- Post added at 05:22 PM ---------- Previous post was at 04:22 PM ----------

Just some info now on my current A9 build -

First, tried using sparse_dat - source was TWRP backups of boot and system image, emmc/image format. When attempting to flash the created zip, recovery log reported the below errors:

Installing '/external_sd/01_Aero/A9_stock_CPTB.zip'...
Checking for MD5 file...
Skipping MD5 check: no MD5 file found
I:Zip contains SELinux file_contexts file in its root. Extracting to /file_contexts
I:Legacy property environment initialized.
minzip: Extracted 2 file(s)
unmount of /system failed; no such volume

A9_stock_CPTB Installer
Built with SuperR's Kitchen

about to run program [/tmp/install/bin/backuptool.sh] with 2 args
cp: can't stat '/system/addon.d/*': No such file or directory
chmod: /tmp/addon.d/*.sh: No such file or directory
Extracting system...

blockimg version is 1
erasing 888832 blocks
script aborted: blkdiscard failed: Invalid argument

blkdiscard failed: Invalid argument
E:Updater process ended with ERROR=7
I:Legacy property environment disabled.
Error flashing zip '/external_sd/01_Aero/A9_stock_CPTB.zip'
Updating partition details...

I used the system.img as the basis for creating the sparse_dat.

EDIT: Just realized I have system mounted as read-only. I bet that's why this isn't working. Let me uncheck that option and try again.

EDIT 2: Nope, that had no effect. Back to trying the below.

Trying set_metadata now, which, if it boots, I'm sure will at least have data and WiFi issues with the existing permissions. Unfortunately in this case I have no ROM from which to extract permissions.

EDIT: set_metadata results in a reboot loop at splash screen. So definitely not working on the A9. Any idea where to start troubleshooting?