msm8916-mainline / lk2nd

Custom bootloader for Qualcomm MSM8916/MSM8226/MSM8974/... devices
Other
380 stars 329 forks source link

Instructions for using lk2nd together with lineageos for d855 #180

Open y0va opened 2 years ago

y0va commented 2 years ago

I couldn't figure out how to install lk2nd together with lineageos on a LG G3 D855. I always get this secure boot certificate error. From the [postmarketos] page on this device I can see that the boot image needs to be signed, but I didn't manage to transfer that to a lineageos setup.

Any hints?

ungeskriptet commented 2 years ago

To fix the secure boot error you have to remove the "SEANDROIDENFORCE" bytes with a hex editor at the end of the lk2nd-msm8974.img file and then bump it with this script. If you don't remove these bytes, the script will think that lk2nd is already bumped.

You have to remove these bytes: image

y0va commented 2 years ago

Thanks a lot, that works!
If I now dd this to boot and then exec fastboot flash boot boot.img with boot.img being from the lineageos build root or image, lineage boots fine, and fastboot mode and recovery can be started like stated in the readme.

One thing thats still strange is that fastboot mode now looks like the buildin black'n'white text only and not that colourful as expected, with those fancy lk2nd functions, like seen before when fastboot flashing the lineage boot.img. Should it be like that or is what I see the original fall back fastboot?

stephan-gh commented 2 years ago

You can check if fastboot oem lk_log && fastboot get_staged log.txt works to get a log. This command should only be supported by lk2nd. It might be that the display is initialized in "black'n'white" mode, not much lk2nd can do in that case.

y0va commented 2 years ago

fastboot oem lk_log freezes and does not return.

y0va commented 2 years ago

LineageOS becomes unstable when booted like that, sudden reboots, maybe related to bluetooth? logcat-lk2nd-boot.log