"Failed to load kernel" after flashing LineageOS 17.1 on Moto G6


Question

I purchased a new Motorola Moto G6 with the intention to try out using LineageOS instead of the stock rom.


Here's everything that used to appear in the About section of the Settings. Keep in mind I selected Portuguese so I'll be translating some labels:



Software channel: retin


Android version: 8.0.0


Android security patch level: 2018-04-01


Base band version: M450_03.08.10.51R ALI_INDIADSDS_CUST


Kernel version: 3.18.71-perf-ga4749e5


hudsoncm@ilclbld32 #1


Fri Mar 30 11:53:22 CDT 2018


Version number: OPS27.82-45



This is my first time messing with phones like this. I am a Computer Engineer, though.


I started following the instructions here. I enabled developer options in the settings, enabled USB debugging and allowed OEM unlocking.


Then I unlocked the bootloader. I'm using ADB and Fastboot that came with Android Studio.


I ran fastboot oem get_unlock_data, got the code, inserted in on the Motorola website, got the email with the unlock key and unlocked it with fastboot oem unlock UNIQUE_KEY.


Then I installed TWRP 3.3.1-0. No problems there.


Then I had to search for the link to download LineageOS and GApps because it looked like the steps I was following were incomplete.


I downloaded LineageOS from here and GApps from here. For the latter, I chose ARM64, Android 10.0 and full. I transfered them to the internal storage using Android Studio Device File Explorer.


Then I followed the YouTube video from the first link. I had trouble wiping because of encryption, so it seems. I followed this to proceed. Using a pass or a pin didn't work. The next solution, Repair File System, was unavailable. I could only see Change File System. Then I formatted /data to EXT2 then back to EXT4 and it worked.


Then I tried to flash LineageOS. I got error 255. I looked here. Apparently, I should have used a 64 bit TWRP. I found one here and flashed it. Then I was able to flash both LineageOS and GApps. No error messages here.


Then I rebooted without installing the TWRP app. I got the following:


Start Up Failed:

Your device didn't start up successfully.
Use the Software Repair Assistant on computer
to repair your device.
Connect you device to your computer to get
the Software Repair Assistant.

AP Fastboot Flash Mode (Secure)
Error: failed to load kernel!
Fastboot Reason: Fall-through from normal boot mode
USB connected

I searched and didn't find much. I looked for the Software Repair Assistant but it seems it's only good to reinstall the stock ROM. I still want to install LineageOS, though.


I found some results about flashing boot.img and some other stuff, but I'm too afraid to hard brick my phone to follow any instructions that haven't been written specifically for my situation.


I still can access TWRP. I wiped and installed again to double check that there wasn't any error messages during flashing and then again to try installing the TWRP app, but the prompt for that didn't show up.


Please advise on what to do to complete installing LineageOS on my Moto G6.


Thanks in advance.


Update 2020-12-15: It seems that the tutorial I followed has been updated. Now there are no steps missing. I'll try again using the files provided there.


Update 2020-12-16: I'm currently trying to flash stock ROM in order to follow the latest instructions. I'm using Lenovo Rescue and Smart Assistant but it's been on Wait for matching firmware, don't unplug your device for quite a while now. In the meanwhile, I'm downloading a stock ROM that more closely matches my device. I found out about the command fastboot getvar all so I'll post the output here:


(bootloader) version: 0.5
(bootloader) version-bootloader: moto-sdm450-C3.09
(bootloader) product: ali
(bootloader) board: ali
(bootloader) secure: yes
(bootloader) hwrev: PVT2
(bootloader) radio: 5
(bootloader) storage-type: emmc
(bootloader) emmc: 32GB SAMSUNG GD6BMB RV=08 PV=01 FV=0000000000000001
(bootloader) ram: 3GB SAMSUNG LP3 DIE=8Gb M5=01 M6=06 M7=00 M8=5F
(bootloader) cpu: SDM450
(bootloader) cid: 0x0032
(bootloader) channelid: 0xc0
(bootloader) securestate: flashing_unlocked
(bootloader) iswarrantyvoid: yes
(bootloader) max-download-size: 534773760
(bootloader) reason: Fall-through from charger boot mode
(bootloader) imei: [REDACTED]
(bootloader) meid:
(bootloader) date: 08-11-2018
(bootloader) sku: XT1925-13
(bootloader) carrier_sku: XT1925-13
(bootloader) battid: SB18C18509
(bootloader) iccid:
(bootloader) cust_md5:
(bootloader) max-sparse-size: 268435456
(bootloader) current-time: "Tue May 9 7: 0:46 UTC 1972"
(bootloader) ro.build.fingerprint[0]: motorola/ali/ali:8.0.0/OPS27.82-45
(bootloader) ro.build.fingerprint[1]: /56:user/release-keys
(bootloader) poweroffalarm: 0
(bootloader) ro.build.version.full[0]: Blur_Version.27.81.56.ali.retail.
(bootloader) ro.build.version.full[1]: en.US
(bootloader) ro.build.version.qcom: LA.UM.6.6.r1-04400-89xx.0
(bootloader) version-baseband: M450_03.08.10.51R ALI_INDIADSDS_CUST
(bootloader) kernel.version[0]: Linux version 3.18.71-perf-ga4749e5 (hud
(bootloader) kernel.version[1]: soncm@ilclbld32) (gcc version 4.9.x 2015
(bootloader) kernel.version[2]: 0123 (prerelease) (GCC) ) #1 SMP PREEMPT
(bootloader) kernel.version[3]: Fri Mar 30 11:53:22 CDT 2018
(bootloader) sbl1.git: git=MBM-NG-VC3.09-0-g4650d8f
(bootloader) rpm.git: git=MBM-NG-VC3.04-0-g02798db
(bootloader) tz.git: git=827710b-dirty
(bootloader) devcfg.git: git=827710b-dirty
(bootloader) keymaster.git: git=827710b
(bootloader) cmnlib.git: git=827710b
(bootloader) cmnlib64.git: git=827710b
(bootloader) prov.git: git=827710b-dirty
(bootloader) aboot.git: git=MBM-NG-VC3.09-0-g225f207
(bootloader) frp-state: no protection (0)
(bootloader) ro.carrier: retin
(bootloader) current-slot:
(bootloader) slot-suffixes: _a
(bootloader) slot-count: 1
(bootloader) slot-successful:_a: INVALID
(bootloader) slot-successful:_b: INVALID
(bootloader) slot-bootable:_a: INVALID
(bootloader) slot-bootable:_b: INVALID
(bootloader) slot-retry-count:_a: unknown
(bootloader) slot-retry-count:_b: unknown
all: listed above
Finished. Total time: 0.082s

I thought I had 1925-3 but it's a XT1925-13... Explains why I received a charger with India standard pins in Brazil... At least it came with an adapter.


Later today, the Lenovo tool worked (I closed it, opened it again and followed the instructions to the letter).


I got the screenshot from Magisk Manager as requested.


MagiskManager


Answer


  • install stock ROM + firmware (do not accidentially re-lock bootloader)



  • make sure device is working fine before trying to install custom ROM



  • boot custom recovery from fastboot


    fastboot boot mali.img


  • format userdata partition from TWRP menu



  • reboot bootloader



  • boot custom recovery from fastboot (again)



  • backup boot, recovery, system, vendor (just in case)



  • copy backup to PC


    adb pull /sdcard/TWRP


  • wipe system, vendor



  • install LineageOS flashable zip



  • reboot and wait for LineageOS is booted successfully






After this, try to install GApps



  • reboot bootloader

  • boot custom recovery from fastboot (again)

  • install OpenGApps flashable zip

  • format userdata partition from TWRP menu

  • reboot and wait for LineageOS is booted successfully




If all wents well, done.


If device goes into boot-loop it must be related to GApps. start again by wiping system, vendor and install LineageOS again. In Magisk Manager check the SAR (system-as-root) section.


Only if your device is SAR (system-as-root) that workaround may help



  • bind mount /system_root/system


    adb shell
    mount -w /system
    mkdir /system_root
    mount -o bind /system /system_root
    umount /system
    mount -o bind /system_root/system /system


  • install GApps flashable zip






If still not working flash another stock ROM+firmware (Android 8.1.0 or Android 9.0) and try again.


Also try other custom ROMs. I recommend to only flash official custom ROMs with Status: Stable (for example RevengeOS or Resurrection Remix)


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes