[Preview] Lineage Android OS for the AGX Xavier

LineageOS is a free, community built, aftermarket firmware distribution of Android, which is designed to increase performance and reliability over stock Android for your device.

LineageOS is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google applications installed. Linked in the instructions is a package that has come from another Android project that restores the Google parts. LineageOS does still include various hardware-specific prebuilts for which source is not available.

All the source code for LineageOS is available in the LineageOS Github repo. And if you would like to contribute to LineageOS, please visit out Gerrit Code Review.

Instructions:
Since these are not official builds, the Lineage wiki does not have instructions for installation, nor do they host the builds. Another Lineage dev has hosted a copy of the instructions, which are linked below. The unofficial builds are available here.
Android TV
Tablet

Notes:

  • These builds have known issues which will be described in detail below. But they may still be of use or interest to people, so I am posting unofficial builds. But while they are unofficial builds, they are fully built from the official Lineage source org, and meet all the charter requirements, the same as an official build.
  • The AGX Xavier devkit does not have built in wireless, so ethernet is expected to be connected. The setup wizard for both build variants needs an internet connection to complete.
  • These builds use the A/B update system, allowing for updates to run in the background while doing other things.
  • The boot stack is mostly from the L4T r32.5.1 release, except for cboot, which is source built with android support enabled and many fixes and modifications for android.

Known Issues:

  • Intermittent hangs during first boot and the setup wizard. Many times during first boot or the setup wizard, the system will soft hang. Things like uart console and adb are still accessible, but normal input stops working. There is nothing in the logs to indicate why and I have been unable to track down the cause. If the system stops responding or the boot logo runs for more than five minutes, the power will have to be cycled. Once the setup wizard is complete, I have observed no further stability issues.
  • Nvmm corruption. Hardware accelerated video looks checkerboxed, like blocks have an off by one error. It is assumed this is an issue with the handling of t194s dual nvdec nodes in the android nvmm prebuilts, since this issue does not occur on t186. This is worked around on these unofficial builds by disabling nvmm / hardware accelerated omx.

Cool! Thanks for your sharing to community!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.

@Steel01 ,

We are trying to build the Lineage OS 19.1 for AGX Xavier devkit.

We want to extract proprietary blobs from LineageOS zip files. Could you please guide us from where we can get this zip files for LineageOS 19.1 for AGX Xavier device.

Regards,
Ann Rose

The ‘extract prebuilts from a lineageos zip’ is a standard boilerplate thing on the lineage wiki. I set tegra up somewhat differently. It extracts the prebuilts directly from nvidia hosted archives. So you can just run the extract script with no parameters and it will handle everything for you.

That said, 19.1/20.0 for t194 is not in great shape. It’s still a work in progress to boot android from edk2 on the 5.10 kernel. I can boot recovery, but haven’t gotten android itself to boot to launcher yet. The latest publicly available hwcomposer has a bug in initializing nvdc, and t194 uses that path. Plus I still haven’t quite gotten the boot control hal to work properly with the new a/b redundancy. I’m actually actively working on this this week, but who knows if I’ll be able to make it work properly.

Hi @Steel01 ,

Thanks for the fast response.

Could you please me to know the progress in the 19.1/20/0 for t194.

Thanks and Regards
Ann Rose Antony

Hi @Steel01 ,

I set tegra up somewhat differently. It extracts the prebuilts directly from nvidia hosted archives.

Could you please let us know the steps to extract the prebuilts directly from the nvidia hosted archives.

Regards,
Ann Rose Antony

Just run ./extract-files.sh in the galen folder. It’s the same as the Lineage wiki describes, just without needing an existing device plugged in.

Okay, We will try it. Thanks for the information.

@Steel01 ,

We have tried to extract the files using the script and we got the below error:

inflating: /tmp/tmp.M79k0UnOmj/extract/stock-t210/META-INF/com/android/otacert  
python: can't open file '/home/shivashankar/deepika/lineage_19.1/device/nvidia/galen/../tegra-common/extract/../../../../vendor/lineage/build/tools/sdat2img.py': [Errno 2] No such file or directory

Could you please help me to resolve this error

Regards,
Ann Rose

https://review.lineageos.org/c/LineageOS/android_device_nvidia_tegra-common/+/352494

Please cherry-pick and test this change. Report if it fixes your problem.

Sure. We will cherrypick this change and will update the status

Regards,
Ann Rose Antony

@Steel01 ,

We have observed the below error after cherrypicking the patch :

Saving to: ‘[libc6_2.31-0ubuntu9_arm64.de](http://libc6_2.31-0ubuntu9_arm64.de/)b’ libc6_2.31-0ubuntu9_arm64.de 100%[============================================>] 2.16M 509KB/s in 4.3s 2023-03-28 12:56:29 (509 KB/s) - ‘libc6_2.31-0ubuntu9_arm64.deb’ saved [2265152/2265152] ~/deepika/lineage_19.1/device/nvidia/galen /tmp/tmp.9viqgvToTd ~/deepika/lineage_19.1/device/nvidia/galen tar: This does not look like a tar archive tar: Skipping to next header tar: ./usr/sbin/nvpmodel: Not found in archive tar: Exiting with failure status due to previous errors

Regards,
Ann Rose

This part is working fine for me. The relevant part of the script that is failing is:

  ar x ${LINEAGE_ROOT}/${OUTDIR}/common/nvpmodel/nvidia-l4t-nvpmodel_arm64.deb data.tar.zst
  tar -xf data.tar.zst ./usr/sbin/nvpmodel
  cp usr/sbin/nvpmodel ${LINEAGE_ROOT}/${OUTDIR}/common/nvpmodel/bin64/nvpmodel

Based on the log, I’m not certain what the operable issue is. Potentially ar not being available, but that should specifically log if so. The other possibility is that tar on that host cannot decompress the zst format. Is unzstd installed? If so, maybe try adding --use-compress-program=unzstd to the failing tar line in device/nvidia/tegra-common/extract/patches.sh.

Let me try to give some context into just how bad a shape public android support on t194 is right now.

First, nvidia does not support android on Jetson anymore. This was stated in response to some questions I asked about r35.1. This means any such support must be fully developed by third parties.

The best I have been able to manage is booting recovery on the AGX Xavier devkit. I am linking a flash package to demo that. Instructions are on the Lineage wiki, quill would be close enough.
p2972_flash_package.tar.xz

There are several things to note here:

  1. The bootloader has graphics support disabled. For some reason I have been unable to determine, my source built edk2 fails to finish booting unless I disable graphical console dxe.
  2. A/B boot control is enabled. However, not everything works as expected yet. The boot control hal is in mostly working shape, like using fastbootd to switch slots works. However, since my flash package puts recovery on the normal boot partition, and recovery does not reset the scratch register retry count, if you reboot a few times, the bootloader will think the boot failed and will switch slots.
  3. There’s no way to reboot to actual recovery partition. Support for reading scratch0 needs added to the custom efi launcher.
  4. Booting to android doesn’t work at all. The graphics userspace fails to initialize on t194. The t194 support in hwcomposer appears to have bitrotted, since the platform has not been supported on android in some time.
  5. USB device mode does not work properly on boot. ADB/fastbootd cannot connect unless the usb c cable is unplugged and replugged, and sometimes that doesn’t even work. This is potentially an issue with the ucsi driver, but since this works correctly in l4t, I’m not entirely certain. This is not a problem on usb micro b such as on the xavier nx devkit carrier.
  6. There are a lot of these changes that are not merged to the main lineage org yet, because they’re not done or can’t be verified. Like edk2 isn’t forked at all. Dynamic partitions are only in my staging repos. Partition xmls to match the r34/r35 changes are still pending. Etc, etc.

All in all, it’s unlikely that this will ever work in a usable manner unless nvidia releases graphics userspace with t194+ support fixed. What does work is just due to the sheer persistence of one or two people in their spare time working for free, for the community. If someone really wanted to use this, there’s a lot of work to be done, and even then it’s probably not usable without support from nvidia. And such support would be indirect, as they have stated that there is no direct support for this.

Hi @Steel01 ,
I am working with lineage 17.1. I am making some changes in the sources . I would like to know the steps to build image for android tablet. Please guide me to the document for the same

Thanks
Deepika

For mobile/tablet, you want the galen_tab build target. Same steps as building galen.

As mentioned in the opening post, 17.1 on t194 is pretty unstable. If you are able to solve the stability issues, submitting the relevant changes to the Lineage gerrit would be appreciated.

Edit: There is a link to wiki build instructions in the opening post.

Thanks @Steel01

@Steel01

Is Lineage Android OS for AGX Orin Available?