[Kindle Fire HDX 7" & 8.9" General] draxie:
Mission accomplished

Report on my planned items:

flash repacked FireOS, make sure everything works

I did this yesterday.

flash stock boot and recovery from fastboot

After flashing stock recovery, my Thor booted into *system* just fine with 'fastboot -i 0x1949 reboot',

as expected. Either you have a *strange* device, or your story was inaccurate...

verify that all three boot options end up in fastboot

Once *both* stock recovery *and* stock boot got flashed, the device only ever boots to the [fastboot] prompt

(no matter which combination of buttons I press). Again, that's exactly as expected.

flash stock aboot and verify that everything works

After flashing emmc_appsboot.mbn, my Thor booted into FireOS on reboot.

I powered off and pressed Power+VolumeUp and entered stock recovery. "Joy!"

reinstall old aboot + TWRP via bulk mode

That was easy.

flash renamed stock update from TWRP

This didn't work "as is", due to what I think is an intentional safeguard in this TWRP build:

This package is for "thor" products; this is a "cm_thor".
[COLOR="Red"]Updater process ended with ERROR: 7[/COLOR]

Of course, that's easily remedied by simply unzipping, removing the first two lines

of the updater-script, and zipping back again. That minimally modded stock ROM

flashed from TWRP without a hitch.

hope that I still have a working test device ;^)

Rebooting from TWRP got me back to official stock FireOS (supposedly with

*everything* including all firmware) stock. Strangely enough, booting to recovery

just hangs at the grey 'kindle fire' logo, but booting to system and bootloader (via 'adb')

both work fine.

Trying to figure out what happened, I re-did the dance via bulk mode and found that

the recovery partition still had TWRP on it!! Come to think of it, the updater-script

only puts everything in place for patching recovery, but doesn't actually *run* the

install script. That's why! I wonder when would that be triggered...

In any case, I reflashed stock recovery and stock aboot from bulk mode and got back

a fully stock device with both system and recovery working (and fastboot accessible

via 'adb reboot bootloader').

In conclusion, here's the recommended path from unlocked bootloader + TWRP to full stock:

generate a repacked stock ROM (*with all the firmware* to avoid stability issues)

since you have an Ubuntu laptop, you should be able to do so using my upHDX script from my tools thread.

generate the stock 'recovery.img' as described earlier in this thread

flash repacked ZIP from TWRP

flash the generated stock recovery.img, the stock boot.img, and the stock emmc_appsboot.mbn from fastboot

make sure all three items are _stock_ and are flashed in the same session with no intermittent reboots

reboot and hold your breath

A somewhat simpler and potentially less nervous alternative is *almost* full stock:

generate a repacked stock ROM (*with all the firmware* to avoid stability issues) using the 'upHDX' script from my tools thread

flash repacked ZIP from TWRP

generate the stock 'recovery.img' as described earlier in this thread

fake-sign (and adjust for the old aboot) that 'recovery.img' using 'cuboot.py' from my tools thread

flash the "signed" 'recovery.img' from fastboot

reboot and enjoy, you still have the old unlocked bootloader, but everything else is stock

(except that both 'boot.img' and 'recovery.img' are adjusted to boot with the old aboot)

That's all folks...