Lk2nd Msm8916 Secrets

08 Oct 2023 - Secondary Little Kernel

When I learned about mainline kernel running on mobile chipsets, I used tegra on grate-driver. Previously tegra on nexus 7 2012 grouper in kernel 3.1.10 (downstream) had Dualboot Android and GNU/Linux via MultiROM, basically patching kexec to kernel 3.1.10 to boot another kernel, so Ubuntu on Nexus 7 2012 and it’s using kernel 3.1.10-8-28 again.

Lk2nd on msm8916
Lk2nd on msm8916

After reading the documentation on how to create initramfs on msm8916, I saw kexec again, proving that lk2nd not only brings back fastboot for Android devices that can boot GNU/Linux, but also switches to booting a new kernel. On msm8916 it is somewhat more difficult than tegra but core devs can still do it even though secureboot still works.

Ubuntu on Samsung Galaxy Tab A 8.0 LTE
Ubuntu on Samsung Galaxy Tab A 8.0 LTE

Dualboot operation:

  1. Insert the Micro SDcard into the device, go to TWRP. Select Install → Install image (click the Install zip button, below the right corner, to switch to), navigate to /sdcard/TWRP, select lk2nd-msm8916.img and select Boot, to flash lk2nd, the purpose is for Android to boot.img will load lk2nd first, find /boot partition of postmarketOS root filesystem (pmOS_boot) to boot GNU/Linux boot.img (similar to kexec Android kernel of MultiROM). Then go to Mount, uncheck System, Data, Cache, etc., leaving only Micro SDcard. Restarting the device will boot into postmarketOS on the Micro SDcard.

  2. Go back to Android, go to TWRP. Select Install → Install image (click the Install zip button, bottom right corner, to change to), navigate to /sdcard/TWRP, select Android boot.img (Get from AP_Stock_Samsung_Firmware.tar.md5) and select Boot, to flash again stock Android kernel, Android will now receive normal System, Data, Cache, Micro SDcard and boot into Android on the device.

  3. Go back to postmarketOS, perform steps 1, return to Android and perform step 2.

Reference links:

Project-DragonPi/DragonRoot

Use PostmarketOS Community pre-built image on your device

 

Recent Posts:

Liquid And Jekyll

07 Oct 2023 - jekyll

When I write code for websites, I often use for..end... more

Preparing softwares to compile the mainline kernel (grate-kernel). Using git... more

When I want to write an image slideshow for card... more

Usually people reading Initramfs or initrd will immediately think it... more

When I went through writing cpu throttle code for tegra,... more

They Did It

30 Apr 2023 - linuxmobile

After Google, Apple and smartphone companies successfully built geo location-based... more

Because when the user buys the devices, in addition to... more

When Android and ARM were in early time, there was... more

The reason I write this article because some people asked... more

Initially, when I stepped foot in GNU/Linux, I realized that... more

If you have armhf or arm64 GNU/Linux available, it’s quite... more

First of all, GNU/Linux running mainline kernel has 2 main... more

Because Android is a fork of GNU/Linux, that means only... more

When I created my personal blog from basic jekyll barebone,... more

U Boot On Tegra Soc

12 Feb 2023 - tegra

As mentioned in the previous post, Nexus 7 2012 grouper/tilapia... more

Fosdem 2023

05 Feb 2023 - linuxmobile

This event could view online at this link. They... more

I finished barebone static blog from Jekyll documents and... more

This is hard part about Tegra 3 T30L, which I... more

This post, I share my experiences from I/O and CPU... more

I wrote some lk2nd experiences at previous post. Xiaomi Redmi... more

How the system booting!? Let’s start, since Google created compatible... more

This is the first SoC on ARM. Nvidia made ULP... more

When I wanna push source code to git, I saw... more

When I was online, I saw some github.io website. I’ve... more

 
More articles