Flash LineageOS

Hi there,

I was able to compile the LineageOS by myself changing some desired things.

What should I do next to flash it to my Radxa Zero?

I don’t know how LineageOS’s build system packages its image, but the previous community release was done in aml format. You can refer to this guide if that is what you got.

I don’t think it’s the same.

This guide refers to a .img file and my building resulted in a .zip file.

Then unzip the file and see what’s inside. If it’s a big single image try aml-flash-tool, if it’s multiple smaller files maybe follow our official Android guide and see what happens? Worth a shot before you get anything back from @Stricted.

macOS doesn’t recognize the zip file but vim does.

So, what to try?

Doesn’t look like our Android image at all. You might as well throw it (the whole zip file) into aml-flash-tool and see what happens.

compile it with m aml_upgrade that will generate the flash package https://github.com/LineageOS/android_device_radxa_radxa0/blob/lineage-18.1/factory.mk#L36

you will need to provide it an u-boot image which you can either extract from the flash images i posted or build it from here https://github.com/Stricted/deadpool_u-boot_build (alternatively i can upload the bootloader images later)

1 Like

Compiled the u-boot using your repo and the image built with success for aml but booting does not work.

Here’s my lineage_radxa0.mk: https://gist.github.com/sobrinho/d37296f76f3ce0fbfa3cbf15730d639b

A “erasing” screen appear, then the device reboot, then it reboots again to the erasing screen and keeps in that loop.

from a quick glance you are missing this: $(call inherit-product, vendor/lineage/config/common_full_tablet_wifionly.mk)

Like this? https://gist.github.com/sobrinho/d37296f76f3ce0fbfa3cbf15730d639b

more like this https://gist.github.com/Stricted/ba08de125ddc8840dc7abdf489cb7222

Alright, let me try to compile and see what happens.

ExternalError: Failed to run command '['lpmake', '--metadata-size', '65536', '--super-name', 'super', '--metadata-slots', '2', '--device', 'super:1677721600', '--group', 'amlogic_dynamic_partitions:1673527296', '--partition', 'odm:readonly:880640:amlogic_dynamic_partitions', '--image', 'odm=out/target/product/radxa0/odm.img', '--partition', 'product:readonly:247799808:amlogic_dynamic_partitions', '--image', 'product=out/target/product/radxa0/product.img', '--partition', 'system:readonly:1317306368:amlogic_dynamic_partitions', '--image', 'system=out/target/product/radxa0/system.img', '--partition', 'system_ext:readonly:184832000:amlogic_dynamic_partitions', '--image', 'system_ext=out/target/product/radxa0/system_ext.img', '--partition', 'vendor:readonly:75022336:amlogic_dynamic_partitions', '--image', 'vendor=out/target/product/radxa0/vendor.img', '--sparse', '--output', 'out/target/product/radxa0/super.img']' (exit code 70):
lpmake I 12-29 07:29:46 137085 137085 builder.cpp:1031] [liblp]Partition odm will resize from 0 bytes to 880640 bytes
lpmake I 12-29 07:29:46 137085 137085 builder.cpp:1031] [liblp]Partition product will resize from 0 bytes to 247799808 bytes
lpmake I 12-29 07:29:46 137085 137085 builder.cpp:1031] [liblp]Partition system will resize from 0 bytes to 1317306368 bytes
lpmake E 12-29 07:29:46 137085 137085 builder.cpp:620] [liblp]Partition system_ext is part of group amlogic_dynamic_partitions which does not have enough space free (184832000 requested, 1565986816 used out of 1673527296)
Not enough space on device for partition system_ext with size 184832000

07:29:46 ninja failed with: exit status 1

My Radxa is 32GB eMMC, FWIW.

that is an odd error that shouldnt happen, not sure what causes it as i never ran into this compiling myself (the other maintainers on lineage who are working on amlogic devices also never ran into this error)

the emmc size does not matter, all emmc models are supported

it is possible that a tablet build would be too large for the allocated super partition

note that everything was configured with ATV in mind, increasing the super partition size to accomodate a tablet build would require to change the size in the kernel/dts (partition_mbox_dynamic_deadpool.dtsi) and in the BoardConfigCommon.mk

what you could try it to set the environment variable WITH_GMS to true, that will remove the space reservation we add to allow flashing gapps packages

The image compiled with WITH_GMS to true but the device is still in the boot loop issue.

Completely noob here but since the u-boot I compiled is related to ATV, it might be the issue? If so, what other option do we have?

the u-boot image is generic, doesnt matter if you try to boot ATV or a tablet build

best way to figure out what is going on would be to hook up uart and post the log

Tried different bootloaders but none worked:

u-boot compiled: boot loop
u-boot.bin from https://wiki.radxa.com/Zero/dev/maskrom#Enable_maskrom: does not flash at all
android-bootloader.img from https://wiki.radxa.com/Zero/dev/maskrom#Enable_maskrom: does not flash at all
bootloader.bin from radxa_zero_aosp_master_20210625_preview: does not flash at all
bootloader.img from radxa_zero_android_9_20211020-fastboot: does not flash at all

I will resort to the USB UART to grab the log.

none of the listed bootloaders except the self compiled one would be able to boot lineage anyway (for different reasons but the main one is:) because none of them will support the dynamic partition setup we are using

Flashed back the compiled u-boot.bin.

Here’s the UART output: https://gist.github.com/sobrinho/3f5ed11569e885eb121e8316cd44475e