Google Pixel XL 2 porting thread

323 views
Skip to first unread message

bootlessxfly

unread,
Apr 23, 2019, 9:12:11 PM4/23/19
to Maru OS dev
Im saving this post for any future device specific instructions and links. 

bootlessxfly

unread,
Apr 23, 2019, 9:12:29 PM4/23/19
to Maru OS dev
@utzcoz wang, 
thanks for the suggestion, I am going to go ahead and start a seperate thread for this so we dont hijack the 6p thread.

On Tuesday, April 23, 2019 at 7:20:37 AM UTC-5, utzcoz wang wrote:
@bootlessxfly When I port MaruOS to Pixel, I have found the Pixel's prebuild vendor.img has the fstab file to configure data partition. If I use prebuild vendor.img, my modification for data partition to support MaruOS's root will effect nothing. So I use vendor built from code, which supports Project Treble also. Maybe it will help for your porting to pixel 2 XL.

On Tue, Apr 23, 2019 at 11:54 AM Preetam D'Souza <preetam...@gmail.com> wrote:
Excellent, I am looking forward to seeing Maru running on the Pixel 2 XL!

Once you get vanilla Lineage 15.1 built and booting on your device, go ahead and just repo init our official maru-0.6 manifest branch (which is also based on Lineage 15.1) and includes all the Maru patches so you do not need to manually add the Maru repos. You'll just need to add some device-specific stuff to your device repo (essentially the same as you did for the 6P previously) and update the kernel config, and you should have a build up and running with all the Maru bits on top of Lineage 15.1. We can discuss more specifics in your porting thread as needed.

On Monday, April 22, 2019 at 6:35:39 PM UTC-4, bootlessxfly wrote:
Sorry for the silence on this, I do have an update though.

I am going to hold off buying a 6p. I can still set up a build server for this and maintain the builds, but as far as having a device to test with, I will be holding off.

Today I took advantage of the 50 percent off Google Pixel 3 and purchased myself a new phone(I just couldn't pass up on that deal).

So, with a new phone, I can officially move my pixel 2 XL into Dev status and fully commit it as a Dev device. This weekend, I plan on setting up a dev VM on my desktop and building cynogenmod 15.1 for my pixel 2 XL. Once I have this baseline build booting, I will move to add the Maruos framework and kernel patches. At this point I'll start a Google pixel 2 XL device porting thread. My next update will go there.

Next month, if we still do not have a maintainer, I can look back into purchasing a Nexus 6p, but for now I am going to focus on the pixel 2 XL.

bootlessxfly

unread,
Apr 23, 2019, 9:26:24 PM4/23/19
to Maru OS dev
@utzocz wang,
Thanks for the suggestion. Ive heard that pixel phones have the ability to switch between different systems by leveraging project treble's dual partition schema. Let me know if I misunderstand what you are trying to say: Are you saying you have leveraged the double data partitions to have one partition with maruos system,kernel, ect. and one partition with stock everything. Creating a dual boot of sorts?

Wouldn't this setup share the user partition? And does sharing this cause problems between the two? 

If I misunderstood you and your trying to point me into a different direction, please let me know.

utzcoz wang

unread,
Apr 24, 2019, 2:06:41 AM4/24/19
to bootlessxfly, Maru OS dev
Hi @bootlessxfly, I mean when we port MaruOS to a device, we must modify the data partition mount option to allow Linux can root in data partition, but if we use prebuild vendor.img of Pixel, our modification of data partition mount options in code device directory is not useful because prebuild vendor.img also has the fstab to define the data partition mount options, which will be used finally, instead of our modification version in code device directory.

--
You received this message because you are subscribed to the Google Groups "Maru OS dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maru-os-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/maru-os-dev/9c2f97b7-92bf-4f49-86a8-bcb886ab483b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

bootlessxfly

unread,
Apr 25, 2019, 6:52:17 PM4/25/19
to Maru OS dev
@utzcoz, thanks for the advice. When I get around to booting the first time, Ill circle back around to this post to modify the fstab.

I built the patched wahoo (unified kernel for pixel 2/XL) kernel last night. I am about to start building maru now, and Ill post with updates as they come.
To unsubscribe from this group and stop receiving emails from it, send an email to maru-...@googlegroups.com.

bootlessxfly

unread,
May 7, 2019, 12:30:09 AM5/7/19
to Maru OS dev
I started a build last weekend, making it halfway through before getting an error:
system/libhidl/transport/include/hidl/HidlTransportSupport.h:84:6: note: candidate function not viable: requires 2 arguments, but 1 was provided
bool setRequestingSid(const sp<::android::hidl::base::V1_0::IBase>& service, bool requesting);
I haven't had to much of a chance to look since I ran into it. But figured Id post it on here in case someone had any suggestions. Ill attach my log too.

This seems to be some kind of library mismatch? Which makes me wonder if there is an issue with my project structure(Using wrong library files). I am using ccache. I would think ccache could possibly cause something like this also? I was thinking about running a lineageOS build when I get a chance to see if it also fails for that build. Maybe this weekend Ill be able to attempt another build. 
taimen_build_taimen.txt

bootlessxfly

unread,
Sep 7, 2020, 2:16:33 PM9/7/20
to Maru OS dev
Finally got some free time to start playing around with this project again last week.

I was able to compile maru0.6 for the pixel 2 XL. Unfortunately, I wont have a device to test it out on until I get my pixel 2 XL back at the end of the month, so this is very much so untested.

I wanted to post this here in case any one wanted to try it out. If so, I can upload an image.

Here is the source:
# Kernel
# Taimen Device
# Wahoo Device

Preetam D'Souza

unread,
Sep 8, 2020, 9:25:12 AM9/8/20
to Maru OS dev
Nice to have you back @bootlessxfly! Looking forward to a Pixel 2 XL port!

bootlessxfly

unread,
Sep 10, 2020, 8:46:58 PM9/10/20
to Maru OS dev
Thanks Preetam. Excited to back working with the project. Im pretty rusty, so learning as I go. :)

Before I go into details, wanted to send a quick thanks to @utzcoz for pointing out I needed to manually modify the fstab in the extracted vendor folder before packaging it to remove "nosuid" from the data partition.
Also, wanted to thank Georgian for putting together a patch set for maru on lineage16!

While this is slightly off topic, I attempted to do a build for my Pixel 3XL running on lineageos 16. I unfortunately was not able to get it to boot. This included a stock lineageos ROM I built, an unofficial lineage16 ROM, and a lineageOS ROM with Georgian's patchset plus my device specific changes. Upon further research, neither the Pixel 2 series or the Pixel 3 series are supported before Lineage17.1. My understanding is that a recovery did properly work with the devices until LineageOS recovery 17.1 (Although I did not dig much into that claim).


So as it is, I have doubts that my builds will boot on the Pixel XL 2. I will still try of course.

I did test LineageOS on my pixel 3 and it works pretty much out of the box. No surprise there though since it is officially supported.

Right now, I think I am going to spend time exploring getting Maru on lineage 17.1. I've seen a little uhh chatter on this matter, but nothing concrete.

Anyways, Ill keep this post updated as I go along.

bootlessxfly

unread,
Sep 12, 2020, 7:37:51 PM9/12/20
to Maru OS dev
Okay. So I figured out the issue. It was with my kernel. For some reason the lineageOS kernel(Even without the LXC patches) for 16.0 will not boot for me. Ill installed a different kernel and the system booted fine. Ill continue to look into this. I have a hunch that there is something wrong with the kernel config from the crosshatch 16.0 lineageos repo. So I may find a different source tree and see if that boots.

Preetam D'Souza

unread,
Sep 13, 2020, 8:27:57 PM9/13/20
to Maru OS dev


On Saturday, September 12, 2020 at 7:37:51 PM UTC-4, bootlessxfly wrote:
Okay. So I figured out the issue. It was with my kernel. For some reason the lineageOS kernel(Even without the LXC patches) for 16.0 will not boot for me. Ill installed a different kernel and the system booted fine. Ill continue to look into this. I have a hunch that there is something wrong with the kernel config from the crosshatch 16.0 lineageos repo. So I may find a different source tree and see if that boots.


Nice, thanks for sharing your work here as your progress - I'm sure it'll be useful for anyone else doing a similar port.

bootlessxfly

unread,
Sep 29, 2020, 2:52:45 PM9/29/20
to Maru OS dev
I have not gotten around on testing a new kernel for the Pixel 3XL. But I do have an update for the Pixel 2XL.

I was able to successfully boot maru running both lineageos15.1(Although I have a vendor mismatch I need to fix) and lineageos16. I am running into an issue with starting the LXC container. This issue is two fold:
1) The desktop tarball is not extracting properly, this is fixed by removing the maru container folder and running mcprepare. I will have to look into this.
2) The second issue is I am unable to start LXC as a nonroot user. The error message I get is:

Now I noticed that one other person had this issue from the following post:
https://groups.google.com/g/maru-os-dev/c/WZB-oWXDFiE/m/0kkOyf4YBwAJ

I wonder if anyone in the community can point me to the solution for this?

But I was unable to see what the resolution was in the thread.

LXC starts just fine as root.

bootlessxfly

unread,
Sep 29, 2020, 4:31:34 PM9/29/20
to Maru OS dev
For whatever reason, my screenshot was not sent in the last message:


lxc-start: external/lxc/src/lxc/utils.c: mkdir_p: 203 Read-only file system - failed to create directory '//.cache/'
failed to create
lock
lxc
-start: external/lxc/src/lxc/lxc_start.c: main: 268 Failed to create lxc_container

bootlessxfly

unread,
Sep 29, 2020, 9:23:23 PM9/29/20
to Maru OS dev
Based on these two commits by pintaf, I am thinking that this is an SELinux issue. I am going to patch the sepolicy based on the following commits:
https://github.com/pintaf/android_system_sepolicy/commit/ffcf3df7ed9fd9ff86e46c549d90f102d984a693

bootlessxfly

unread,
Sep 30, 2020, 10:06:58 AM9/30/20
to Maru OS dev
Okay, good news. I got pintaf's maru0.7(lineage16) working on my Pixel 2XL. The init issue with maru was resolved, I fixed the invalid vendor, and applied the SELinux change to my device change. I tested that the container started and coneccting to a wireless display earlier today. I am going to try this on maru0.6 later. I can upload images in the next couple days.

I wonder if this is a way to add sepolicies to allow the container to launch rather than disabling it system wide?

loicp...@gmail.com

unread,
Sep 30, 2020, 10:47:01 AM9/30/20
to Maru OS dev
Hey.

Great that you could get a port working with my los16 version.
Normally if we add all sepolicies correctly, we should be able to launch the container and enable again selinux.
I remember I tried to solve some SE policies in the past when proting to HTC 10, and ended up in disabling it system wide...

Tell me if you get to something. On my side, I did not give up, I'm working on BQ Aquaris X2 to bring it to maru 0.7. I'm lacking time lately unfortunately. A little confinment would help me hahahaha.

bootlessxfly

unread,
Sep 30, 2020, 10:00:49 PM9/30/20
to Maru OS dev
I don't blame you, SE policies can be a bit of a pain in my experience. I may take a look at it in the future, and if I do find anything I will certainly let you know.

Thanks again for your work!


The link includes both the ota update and full image. I prefer flashing the full image myself,  however the ota image is the official method. Regardless of which you choose, make sure you do a factory wipe before flashing.

For the Pixel 2, I do not have a device to test on and I would have to downport most of the lineage config from lineage17.1. If someone is interested in offering to test, I can attempt to build it.

I am going to do a new build with an updated kernel for the Pixel 3XL now.

loicp...@gmail.com

unread,
Oct 1, 2020, 2:49:24 AM10/1/20
to Maru OS dev
When you're happy with stability and/or finished testing with other kernels, tell me, and I can integrate your device sources in maru-0.7 manifest so that anyone checking out the repo can build Pixel 2XL out of the box.

bootlessxfly

unread,
Oct 16, 2020, 2:46:49 PM10/16/20
to Maru OS dev
You can feel free to add the sources. I've tested it and it works pretty good with casting.

With Displaylink. it's a different story. But given Display link's proprietary nature, this may not bother people. With displaylink, two issues occur:
The virtual framebuffer is hardcoded to 720p(The maximum supported resolution of casting). Unfortunately with displaylink, it will not signal the monitor to also change to 720p and instead displays 1280x720 pixels on a 1080p(In other words roughly 60 percent of the screen shows maru and the other bits are black)
I created a build where I modified mflinger to default to 1080p instead of 720p. This breaks casting, but allows for displaylink to work. We may be able to leverage a config file to give us the ability to switch between 720p and 1`080p, and not have this hardcoded. But I am going to leave it alone unless someone wants both displaylink and casting support.

The other issue is an occasional kernel panic when watching a full screen 1080p video from the LXC container. I am wondering if this is due to graphics being accelerated by software(CPU). I did not see this issue when casting at 720p.

Another note, I was able to boot using a hallium patched kernel. For those unfamiliar, halium is a implementation of libhybris that is supposed to provide an framework for different projects to load libhybris. When time permits, I may try to get the rest of this build ported over to halium. One big difference is the approach would be that the android userspace would be loaded in LXC, and not linux. But, in my opinion, this may be to Maru's advantage. When trying to run docker or KVM out of a LXC container, you start needing to provide root permissions to the container. Switch android into a LXC container and assigning the container the phone screen's framebuffer should allow android to perform as a rootless container as normal. Running the linux userspace outside of a container allows us native access to docker and other virtualization software.

The biggest advantage of course, would be hardware acceleration through libhybris.

Anyways, when/if time permits, I'll continue to work on porting maruos over to halium.

loicp...@gmail.com

unread,
Oct 18, 2020, 5:39:47 AM10/18/20
to Maru OS dev
Hey, Yes, perfect, I'll add this into the maru 0.7 repo when I'll get the time.
Good work ! You lost me in your tech talks, I'm a front end dev trying to survive in the Android dev porting environment.
Great to have you supporting maru !
Reply all
Reply to author
Forward
0 new messages