[7" Kindle Fire HD Q&A, Help & Troubleshooting] matthewl77:
I was able to restore factory ROM. I will try to install Cyanomodgen using the official instructions from CM website. Something from the LineageOS github site linked above seemed to break it, so I will not be doing that again. Anyway, I have no idea for sure what recovered it, but this is what I did.

I put Kindle in fastboot mode with factory cable.

But I had problems with USB connection: The Kindle would not connect via fastboot or adb. There was no yellow triangle exclamation in Device Manager in Windows, so I gave up on Windows because Linux allows easier access to errors. I used various forms of linux, including Mint, Porteus, and lubuntu.

Getting Linux to recognize the Kindle Fire through USB

I had to set udev rules in order to recognize the Kindle Fire. Copy (or add)

SUBSYSTEM=="usb", ATTR{idVendor}=="1949", MODE="0666", GROUP="plugdev"

to the file “51-android.rules” in /etc/udev/rules.d/, and reboot

Now Linux would recognize the device, at least sometimes. The USB connection in fastboot mode was very finicky. Sometimes it would work and sometimes not. Here are tips:

Troubleshooting

Use “lsusb” to determine whether Linux is recognizing the device. This would reveal the device if I could access it.

Use “sudo dmesg -w” to determine what error occurs when connecting the Kindle

Note that if it fails to connect upon first connecting the device, then I would have to put it in fastboot mode again before trying again. It would not show any sign of attempting to connect if it already failed in fastboot, even though the green light was still blinking.

Try different cables. I found some seemed to work better than others.

I did not see any particular USB ports as better than others.

Low power or bad cable seemed to cause the “device descriptor read/64, error -71” in dmesg and it would fail to connect. I'm not 100% this was the sole cause of that error.

Update usbcore autosuspend: (This seemed to help at one point, but it continued to fail later, possibly due to low power on Kindle). Edit the /etc/default/grub file and change the GRUB_CMDLINE_LINUX_DEFAULT line to add the usbcore.autosuspend=-1 option: GRUB_CMDLINE_LINUX_DEFAULT="quiet splash usbcore.autosuspend=-1" Note that quiet splash were already present options. So keep other options you have too. After save the file, update grub: sudo update-grub And reboot. Now check autosuspend value: cat /sys/module/usbcore/parameters/autosuspend -- And it should display -1.

Ultimately I think it was low power in the Kindle causing the failure to connect.

Once connected I tried to restore stock ROM. However, the stock system file did not work, and gave the following error because it was not a “sparse” image.

$ fastboot flash system system.bin

Invalid sparse file format at header magic

Sending sparse 'system' 1/2 (470546 KB) OKAY [ 31.389s]

Writing 'system' FAILED (remote: ': Sparsed Write')

fastboot: error: Command failed

I had to create a “sparse” version of the stock backup.

This site tells how to create the spares image:

https://xdaforums.com/t/kindle-fire-2-restore-working-12-7-2012.2035047/

And this site includes a download link of the antiquated tool make_ext4fs:

https://xdaforums.com/t/new-file_contexts-bin-format-and-make_ext4fs.3538321/

Then flash the “sparse version”

$ fastboot flash system new_system.bin

Sending sparse 'system' 1/2 (470124 KB) OKAY [ 32.680s]

Writing 'system' OKAY [ 51.440s]

Sending sparse 'system' 2/2 (395124 KB) OKAY [ 27.156s]

Writing 'system' OKAY [ 46.352s]

Finished. Total time: 159.070s

$ fastboot --skip-reboot flash recovery recovery.bin

Sending 'recovery' (8192 KB) OKAY [ 0.916s]

Writing 'recovery' OKAY [ 0.869s]

Finished. Total time: 2.079s

$ fastboot --skip-reboot flash boot boot.bin

Warning: skip copying boot image avb footer (boot partition size: 0, boot image size: 8388608).

Sending 'boot' (8192 KB) OKAY [ 0.852s]

Writing 'boot' OKAY [ 0.852s]

Finished. Total time: 2.259s

$ fastboot reboot

Rebooting OKAY [ 0.004s]

Finished. Total time: 0.005s

Then I got power low power sign after rebooting. And I was unable to connect in fastboot mode.

After flashing the stock ROM and charging the device (which didn’t seem to work with certain cables or plugs—the cable that worked consistently to connect also worked to charge):

It then rebooted to the red triangle (failed boot) screen. It prompts “press power 5 times to factory reset” which I did and it eventually reset after waiting a while. Note: I had done that before and it was still in boot loop, so I suspect it was flashing the factory image back which allowed it to factory reset.

Now I will try to install Cyanomodgen (instead of LineageOS) as per the official CM website, which I have successfully done on other devices.

The bottom line is that you need the right cable, powered up device, probably Linux and reflash the stock ROM that you backed up before modifying anything, and that seemed to fix it.

I might have missed some steps. I also tried so many things along the way that I'm not sure what the real solution was. But hopefully this will help someone in the same boat.