Lk2nd/lk1st: Difference between revisions
https://github.com/msm8916-mainline/lk2nd |
Remove information that is not essential for introduction for new users |
||
Line 14: | Line 14: | ||
* '''lk1st:''' primary bootloader intended for single-board computers (SBCs) and expert users. In this case, it is the "first" bootloader responsible for loading the main operating system. | * '''lk1st:''' primary bootloader intended for single-board computers (SBCs) and expert users. In this case, it is the "first" bootloader responsible for loading the main operating system. | ||
For more information, please refer to the [https://github.com/msm8916-mainline/lk2nd lk2nd] project. | |||
== Supported SoCs == | == Supported SoCs == | ||
Line 23: | Line 23: | ||
See [https://github.com/efidroid/projectmanagement/wiki/%5BReference%5D-Chipsets Chipsets] page on the EFIDroid wiki for an exact mapping of LK targets to SoCs. | See [https://github.com/efidroid/projectmanagement/wiki/%5BReference%5D-Chipsets Chipsets] page on the EFIDroid wiki for an exact mapping of LK targets to SoCs. | ||
== Usage == | == Usage == | ||
Line 123: | Line 41: | ||
If the device shows up via fastboot you can get a log file from lk2nd using <code>fastboot oem lk_log && fastboot get_staged <output-file></code>, where <code><output-file></code> is either some text file to write to (e.g. <code>output.txt</code>) or <code>/dev/stdout</code> to write the log to standard output. | If the device shows up via fastboot you can get a log file from lk2nd using <code>fastboot oem lk_log && fastboot get_staged <output-file></code>, where <code><output-file></code> is either some text file to write to (e.g. <code>output.txt</code>) or <code>/dev/stdout</code> to write the log to standard output. | ||
Revision as of 18:55, 1 December 2022
What is lk2nd
lk2nd is a custom bootloader for many different devices based on Qualcomm system-on-chips (SoCs), including smartphones, tablets, smartwatches and a few single board computers (SBCs). It simplifies booting standard operating systems by providing:
- A unified boot and flashing interface (Android Fastboot), independent of device-specific modifications made to the boot chain (e.g. the proprietary flashing interface on Samsung devices)
- Automatic device and hardware detection (e.g. display panels, batteries, ...)
- Additional bootloader features (e.g. file system boot, booting from SD card)
- Additional firmware features (e.g. booting secondary CPU cores if the firmware lacks PSCI support)
- Workarounds for various device-specific issues (e.g. USB on some Samsung devices, modem on Motorola smartphones, ...)
- Various debugging commands that allow better understanding of the hardware for research and development purposes
There are two different configurations:
- lk2nd: "secondary" bootloader intended for devices where existing firmware cannot be replaced easily (most smartphones and tablets). In this configuration, lk2nd does not replace the stock bootloader. Instead, it is packed into an Android boot image, which is then loaded by the stock bootloader just like the original Android image. The real operating system can be placed in the boot partition with 512 KiB offset or stored in a ext2 file system. It does not have to be Android or even Linux, any kind of kernel can be packed into an Android boot image.
- lk1st: primary bootloader intended for single-board computers (SBCs) and expert users. In this case, it is the "first" bootloader responsible for loading the main operating system.
For more information, please refer to the lk2nd project.
Supported SoCs
lk2nd-msm8916
: APQ8016, MSM8216, MSM8916, MSM8929, MSM8939lk2nd-msm8974
: MSM8974lk2nd-msm8226
: APQ8026, MSM8226, MSM8926
See Chipsets page on the EFIDroid wiki for an exact mapping of LK targets to SoCs.
Usage
lk2nd provides the standard Android fastboot protocol for flashing/booting Android boot images.
Press Volume Down
while booting to enter Fastboot mode. Press Volume Up
while booting to boot into Recovery mode.
Note: If your stock bootloader uses the same key combinations, you need to wait a bit before pressing the volume keys. Usually, waiting until the screen turns on and/or the device vibrates should be enough to make the stock bootloader ignore the keys.
fastboot flash lk2nd lk2nd.img
can be used to update lk2nd directly from its fastboot interface.
Note: fastboot flash boot boot.img
will flash the actual boot image with 512 KiB offset into the boot partition. This is done to avoid replacing lk2nd (since it is also booted from the boot partition).
Other fastboot commands work normally.
Troubleshooting
If the device shows up via fastboot you can get a log file from lk2nd using fastboot oem lk_log && fastboot get_staged <output-file>
, where <output-file>
is either some text file to write to (e.g. output.txt
) or /dev/stdout
to write the log to standard output.