Differences between revisions 10 and 11
Revision 10 as of 2020-03-24 17:50:39
Size: 4348
Comment:
Revision 11 as of 2020-03-29 15:56:25
Size: 5001
Comment:
Deletions are marked like this. Additions are marked like this.
Line 7: Line 7:
 * pixel3_mainline-userdebug build target use mainline linux kernel and can boot to console right now with ADB. Work is going on to enable Display panel + Mesa/Freedreno support.  * pixel3_mainline-userdebug build target use mainline linux kernel and can boot to 'UI' right now with ADB - with garbled screen. Work is going on to enable DSC for the Display panel.
Line 13: Line 13:

{{{#!highlight bash
{{{
Line 25: Line 24:
{{{#!highlight bash {{{
Line 30: Line 29:
3. Build kernel image and boot.img: 3. Extract Adreno firmware from stock images
 * Unzip image-blueline-pq1a.181205.006.zip found in the stock image downloaded in step 2.
 * Extract vendor.img, and convert it to a mountable raw image.
{{{out/host/linux-x86/bin/simg2img vendor.img vendor.raw}}}
 * Mount vendor.raw and extract graphics firmware
{{{
mkdir mnt; sudo mount mnt vendor.raw
mkdir $ANDROID_BASE_DIR/device/linaro/dragonboard/pixel3_mainline/firmware
cp mnt/firmware/a630*
$ANDROID_BASE_DIR/device/linaro/dragonboard/pixel3_mainline/firmware
}}}
 * Copy firmware/device.mk
{{{
wget https://people.linaro.org/~sumit.semwal/pixel3/firmware_device.mk
-O $ANDROID_BASE_DIR/device/linaro/dragonboard/pixel3_mainline/firmware/device.mk
}}}
Line 32: Line 46:
Run the following commands to clone and build kernel Image:

{{{#!highlight bash
4. Build kernel image and boot.img:
 *
Run the following commands to clone and build kernel Image:
{{{
Line 41: Line 55:

Build boot.img by running following mkbootimg command:

{{{#!highlight bash
 * Build boot.img by running following mkbootimg command:
{{{
Line 50: Line 62:

where ramdisk.img is created as part of AOSP build for pixel3_mainline-userdebug.
    where ramdisk.img is created as part of AOSP build for pixel3_mainline-userdebug.
Line 55: Line 66:
4. Install:  5. Install:
Line 59: Line 70:
{{{#!highlight bash {{{
Line 88: Line 99:
 * Display is WIP - we get to a garbled UI, and Android reports boot_completed; DSC is in-progress to allow proper UI.  * Display is WIP - we get to a garbled UI, and Android reports boot_completed; DSC support enablement is in-progress to allow proper UI.
Line 91: Line 102:

{{{#!highlight bash
{{{

AOSP on Pixel3 running Mainline kernel


Not to be confused with AOSP's aosp_blueline-userdebug build target, goal of this project is to run AOSP on Pixel3 device with mainline linux kernel.

  • Upstream aosp_blueline-userdebug build target use Qcom prebuilt firmware and services binaries which only work with msm-android-4.9 kernel.
  • pixel3_mainline-userdebug build target use mainline linux kernel and can boot to 'UI' right now with ADB - with garbled screen. Work is going on to enable DSC for the Display panel.

Compile AOSP and kernel image from sources for pixel3_mainline


1. Download the AOSP source tree and build pixel3_mainline target:

repo init -u https://android.googlesource.com/platform/manifest -b master
repo sync -j`nproc`
source ./build/envsetup.sh
lunch pixel3_mainline-userdebug
make -j`nproc`

2. Download Android9.0 stock image from https://dl.google.com/dl/android/aosp/blueline-pq1a.181205.006-factory-af1829a6.zip, and run flash-all.sh. This ensures the currenly verified working bootloader is installed.

Verify that the bootloader version shows

ABL version: b1c1-0.1-5034669
ABL build time: Sep 27 2018 17:15:40

3. Extract Adreno firmware from stock images

  • Unzip image-blueline-pq1a.181205.006.zip found in the stock image downloaded in step 2.
  • Extract vendor.img, and convert it to a mountable raw image.

out/host/linux-x86/bin/simg2img vendor.img vendor.raw

  • Mount vendor.raw and extract graphics firmware

mkdir mnt; sudo mount mnt vendor.raw
mkdir $ANDROID_BASE_DIR/device/linaro/dragonboard/pixel3_mainline/firmware
cp mnt/firmware/a630*
$ANDROID_BASE_DIR/device/linaro/dragonboard/pixel3_mainline/firmware
  • Copy firmware/device.mk

wget https://people.linaro.org/~sumit.semwal/pixel3/firmware_device.mk
-O $ANDROID_BASE_DIR/device/linaro/dragonboard/pixel3_mainline/firmware/device.mk

4. Build kernel image and boot.img:

  • Run the following commands to clone and build kernel Image:

git clone https://git.linaro.org/people/sumit.semwal/linux-dev.git -b dev/p3-mainline-WIP
cd linux
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- blueline_defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image.gz qcom/sdm845-blueline.dtb -j`nproc`
cat arch/arm64/boot/Image.gz arch/arm64/boot/dts/qcom/sdm845-blueline.dtb > Image.gz-dtb
  • Build boot.img by running following mkbootimg command:

mkbootimg --kernel Image.gz-dtb --ramdisk \
out/target/product/pixel3_mainline/ramdisk.img \
--base 0x00000000 --pagesize 4096 \
--cmdline "" --output boot.img
  • where ramdisk.img is created as part of AOSP build for pixel3_mainline-userdebug.

Note: cmdline is hardcoded in kernel config (blueline_defconfig) so that bootloader appended bootargs do not crash our boot.

  1. Install:

Boot Pixel3 in fastboot mode by powering off the device and then hold VOL down button and press/hold POWER button until bootloader (fastboot) comes up. Download and unzip vbmeta.img from Pixel3 factory images, which is used to disable image verification. And then run following commands from HOST machine while Pixel3 is still booted in fastboot mode:

# unlock bootloader
fastboot oem unlock

# disable image verification if you haven't already
fastboot --disable-verity --disable-verification flash vbmeta_a vbmeta.img
fastboot --disable-verity --disable-verification flash vbmeta_b vbmeta.img

# set _b as active partition since we mount system_b as super partition
fastboot set_active b

# flash AOSP images and reboot
fastboot flash system out/target/product/pixel3_mainline/super.img
fastboot flash userdata out/target/product/pixel3_mainline/userdata.img
fastboot flash boot boot.img
fastboot reboot

# login to Android console
adb shell

ToDo / Known Issues


  • fastboot boot boot.img is broken

  • Android 10 bootloaders don't yet work
  • Display is WIP - we get to a garbled UI, and Android reports boot_completed; DSC support enablement is in-progress to allow proper UI.
  • bootctrl HAL is WIP. So if you run into FAILED (remote: 'Failed to load/authenticate boot image: Load Error'), then run following command:

fastboot fastboot set_active b

Need some help?


In addition to this wiki, we use various mailing lists, IRC, collaborate.linaro.org and projects.linaro.org/LCG to communicate.

  • LCG's public mailing lists
  • IRC via irc.freenode.net
    • #linaro-android
    • #linaro-lmg

You can use the web or your favourite IRC client.

AOSP/blueline (last modified 2020-03-29 15:56:25)