https://github.com/alula/alu-lk2nd
Shitty lk2nd-based bootloader for santoni with multiboot support and random things for debugging. Certified by Huong Tram.
https://github.com/alula/alu-lk2nd
Last synced: 3 months ago
JSON representation
Shitty lk2nd-based bootloader for santoni with multiboot support and random things for debugging. Certified by Huong Tram.
- Host: GitHub
- URL: https://github.com/alula/alu-lk2nd
- Owner: alula
- License: other
- Created: 2020-07-04T00:22:40.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-07-04T00:25:04.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T15:57:43.631Z (3 months ago)
- Language: C
- Homepage:
- Size: 10.5 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# lk2nd
lk2nd is a bootloader for Qualcomm MSM devices (at the moment only MSM8916),
based on the [CodeAurora Little Kernel fork](https://source.codeaurora.org/quic/la/kernel/lk/).
It provides an Android Fastboot interface on devices where the stock bootloader
does not provide Fastboot (e.g. Samsung).On MSM8916 it is also used for some quirks for mainline devices, e.g. to set
a proper WiFi/BT MAC address in the device tree.lk2nd does not replace the stock bootloader. It is packaged into an Android
boot image and then loaded by the stock bootloader as a "secondary" bootloader.
The real Android boot image is placed into the boot partition with 1 MB offset,
and then loaded by lk2nd.## Supported SoCs
- MSM8916
- MSM8953 (SDM450,SDM625)
- MSM8952 (MSM8940)### Supported devices
- Motorola Moto G4 Play (harpia)
- Samsung Galaxy A3 (2015) - SM-A300FU
- Samsung Galaxy A5 (2015) - SM-A500FU
- Samsung Galaxy J5 (2016) - SM-J510FN
- Samsung Galaxy S4 Mini Value Edition - GT-I9195I
- Samsung Galaxy Tab A 8.0 LTE (2015) - SM-T357W
- Samsung Galaxy Tab A 9.7 WiFi (2015) - SM-T550
- Wileyfox Swift
- Samsung Galaxy A6+ (2018) - SM-A605FN
- Xiaomi Redmi 4X - santoni
- Xiaomi Redmi Note 4X Snapdragon - mido## Installation
1. Download `lk2nd.img` (available in [Releases](https://github.com/msm8916-mainline/lk2nd/releases)(MSM8916))
2. Flash `lk2nd.img` using the stock flashing procedure:
- Fastboot: `fastboot flash boot lk2nd.img`
- Samsung: `heimdall flash --BOOT lk2nd.img`## 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 directory from its
fastboot interface.**Note:** `fastboot flash boot boot.img` will flash the actual boot image with 1 MB 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.
## Building
```
$ make TOOLCHAIN_PREFIX=arm-none-eabi- -secondary
```**Requirements:**
- ARM (32 bit) GCC tool chain
- Arch Linux: `arm-none-eabi-gcc`
- [Device Tree Compiler](https://git.kernel.org/pub/scm/utils/dtc/dtc.git)
- Arch Linux: `dtc`Replace `TOOLCHAIN_PREFIX` with the path to your tool chain.
`lk2nd.img` is built and placed into `build--secondary/lk2nd.img`.## Porting
### To other devices with supported Socs
- Add a simple device tree to `dts/`. You just need `model` and the
`qcom,msm-id`/`qcom,board-id` from downstream.### To other SoCs
- Cherry-pick changes
- Make some changes
- Add secondary project config(TODO: Document this properly)
## Contact
Ping `minecrell`/`Mis012`/`Junak` on [`#postmarketos-mainline`](https://wiki.postmarketos.org/wiki/Matrix_and_IRC).