[Nexus 6P] Porting Thread

2494 views
Skip to first unread message

chev droid

unread,
Sep 23, 2016, 9:54:01 AM9/23/16
to Maru OS dev

#Moving over from "Device Porting Thread"#


bootlessxfly


I should have mentioned. Display link works just fine with the nexus 6p. That was my plan for the port




chev droid


 @bootlessxfly okay good to know the 6p supports at least Displaylink, I didn't find any HDMI-Out support, since it uses usb 2.0 with just the usb-c type connector not usb 3.0 or 3.1.

The only bad thing about display link is, you need special hardware, even on the display/monitor side (or a dock/adapter) to get it work. But if it really support displaylink it would be amazing!
Another cool protocoll which hopefully future phone'll support is thunderbolt 3, which uses the usb-c connector.
You could connect up to two 4k monitors and deliver up to 100 watts of power :)




bootlessxfly

I have a USB type c to USB 2.0 adapter. I also have a display link adapter I plug that into. And this combination with the display link driver from the play store allows me to hook my phone up to a moniter. Here is a link.
http://www.displaylink.com/downloads/android

One downside right now is that the nexus 6p does not support being in USB host mode while also charging. A possible fix to this would be to add ACA_host mode to the kernel. I believe there is an aca_host mode path for the nexus 7 kernel. I may look into porting this over in the future.

Anyways, when I get a chance either today or this weekend. I'll move all of this over to a nexus 6p porting thread.



bootlessxfly

unread,
Sep 25, 2016, 7:46:55 PM9/25/16
to maru-...@googlegroups.com
@chev droid. Thanks for making this thread.


The following contains all of the nexus 6p builds.

I have uploaded new working builds. Each one comes with a set of install scripts. I will give some example uses below.
There are two builds based on maru0.4. One build for both jessie and debian sid. In the future I would like to include one for ubuntu.
To install maru on your nexus 6p,
unzip th zip file and go to the root of that directory
use ./flashall.sh to install. Example uses are given below.
./flashall.sh -h yes will display help menu
./flashall.sh -r yes will install twrp recovery. Must have run gapps install script first
./flashall.sh -f. This will fix any vendor fingerprint issues when downgrading/upgrading new nexus and pixel devices.
For full install with gapps
./flashall.sh -t full -g yes 
For full install with gapps and twrp recovery
./flashall.sh -t full -g yes -r yes
For full install with gapps, twrp recovery, and fingerprint fix
./flashall.sh -t full -g yes -r yes -f yes

For the nexus6p you will need to either install displaylink adapter or google home(For chromecast support). Without these you will not be able to post a linux desktop to a monitor. These require gapps and need to be installed via the playstore.

Let me know if anyone finds any bugs and I will start reporting my own

Preetam

unread,
Sep 27, 2016, 8:17:18 PM9/27/16
to Maru OS dev
I'll take a look at this. It looks like the Android.mk needs some changes to make it work for arm64.

bootlessxfly

unread,
Sep 30, 2016, 6:35:17 PM9/30/16
to Maru OS dev
Thanks Preetam,
I will also keep on looking into this and see if I can solve it.
I'll post on here if I find a fix

Preetam

unread,
Sep 30, 2016, 7:30:34 PM9/30/16
to Maru OS dev
Alright, I took a look and made some pretty big changes to the way LXC is built for Maru OS. Hopefully this new way is more robust across architectures and future versions of Android. Read the last commit description if you are curious.

 I tested this quickly with hammerhead and it works fine. I also did an arm64 compile by selecting angler and it appears to build lxc fine without any errors, although I can't actually test it without the device.

You can pull the changes to your external/lxc repository by checking out the 'arm64-workaround' branch:

$ cd external/lxc
$ git fetch github && git checkout arm64-workaround

I recommend doing a clean rebuild with the new branch.

Note that you'll need to explicitly build lxc since the product dependencies in the device repos aren't updated yet. From root of workspace:

$ mmma external/lxc

Make sure to rebuild system.img afterwards:

$ make snod

Then flash as usual.

This should get you past this snag so you can continue the port. Let me know how it goes!

P.S. This will eventually move to mainline after I'm confident everything works as expected.

bootlessxfly

unread,
Oct 2, 2016, 9:00:43 PM10/2/16
to Maru OS dev
Thanks. I'll give the compile a try when I get back to my computer and let you know how it goes.

Daniel Hancock

unread,
Oct 9, 2016, 12:05:50 AM10/9/16
to Maru OS dev
I'm using the old build environment setup through arch linux and mmma external/lxc gives me command not found. My googlefu was not up to the task either. Something I'm missing?

bootlessxfly

unread,
Oct 9, 2016, 12:18:22 AM10/9/16
to Maru OS dev
You'll need to run
. build/envsetup
lunch

This will allow you to use mmma.
I've gotten this to compile and boot, however I am getting msm driver errors in my dmesg. Ill work on fixing these probably tomorrow.

Daniel Hancock

unread,
Oct 9, 2016, 12:27:45 AM10/9/16
to maru-...@googlegroups.com
Been awhile, thanks completely forgot about running that first. Got this.

prebuilts/clang/linux-x86/host/3.6/bin/clang++: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
make: *** [build/core/binary.mk:706: out/host/linux-x86/obj/EXECUTABLES/validatekeymaps_intermediates/Main.o] Error 127
make: Leaving directory '/home/pheoxy/maruos'

#### make failed to build some targets (54 seconds) ####



bootlessxfly

unread,
Oct 9, 2016, 12:31:09 AM10/9/16
to Maru OS dev
Which prebuilt library are you using? I'm using aarch64. Also, you'll need to have some Android.Mk files for the angler build. I can provide the files I used maybe tomorrow.

Daniel Hancock

unread,
Oct 9, 2016, 12:32:31 AM10/9/16
to Maru OS dev
Ran it again and got further bot got another error.

including ./vendor/maruos/Android.mk ...
*** Overlay change detected, clean shared intermediate files...
*** rm -rf out/target/common/obj/APPS/SystemUITests_intermediates out/target/common/obj/APPS/Contacts_intermediates out/target/common/obj/APPS/framework-res_intermediates out/target/common/obj/APPS/Settings_intermediates out/target/common/obj/APPS/Bluetooth_intermediates out/target/common/obj/APPS/Telecom_intermediates out/target/common/obj/APPS/TeleService_intermediates out/target/common/obj/APPS/SettingsProvider_intermediates out/target/common/obj/APPS/SystemUI_intermediates
PRODUCT_COPY_FILES device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml ignored.
No private recovery resources for TARGET_DEVICE angler
build/core/tasks/vendor_module_check.mk:70: *** Error: vendor module "libperspective" in  vendor/maruos/perspective with unknown owner "" in product "aosp_angler".  Stop.
make: Leaving directory '/home/pheoxy/maruos'

#### make failed to build some targets (31 seconds) ####



bootlessxfly

unread,
Oct 9, 2016, 12:39:57 AM10/9/16
to Maru OS dev
Run this command:
export USER=$(whoami)

should fix it

Daniel Hancock

unread,
Oct 9, 2016, 12:45:17 AM10/9/16
to Maru OS dev
OK just running without changes at the moment to see what needs doing. Been awhile to so I'm remembering things as I go.
You can just upload changes to your personal github?

Daniel Hancock

unread,
Oct 9, 2016, 12:51:35 AM10/9/16
to Maru OS dev
Noticed https://github.com/maruos/android_platform_build branch was set to android 5.0 instead of android-6.0.

Would that affect something?

bootlessxfly

unread,
Oct 10, 2016, 6:59:55 PM10/10/16
to Maru OS dev
Sorry for the delay. 
On the link provided there is a branch for android 6.0.
Also, as to your question about putting it on my github page, sure.
I'd like to check a few things, as I think one of my additions may be whats causing me problems right now. Once I finish looking at that though, I'll upload my changes to git and post a link.

Bart Vdpt

unread,
Nov 1, 2016, 8:43:55 AM11/1/16
to Maru OS dev
Hi

No activity anymore, are you still working on this or is it not possible to get MaruOS on the Nexus 6p?
I ask this because i have found a good priced second hand Nexus 6p but the seller doesn't want to wait.


When i can buy it, i become a tester.
But then i need fast an answere that MaruOS will work the upcoming months on the N6p.

I switch from ios to android special for MaruOS.

Regards

Bart Vdpt

unread,
Nov 1, 2016, 8:46:56 AM11/1/16
to Maru OS dev
The Nexus 6p has no OTG support but USB-C 2.0 with DisplayLink support.
Can this work with MaruOS?

chev droid

unread,
Nov 2, 2016, 5:38:00 AM11/2/16
to Maru OS dev
The 6p doesn't support Slimport or MHL, USB OTG is supported and yes DisplayLink would work.
A Port to the 6p is for sure possible, with the current version of maru os, you wouln't be able to stream debian on a big screen (no display link or any other slimport alternative currently supported). With future versions of maru os it is (I think) very likely to work!

Sadly I have sold my 6p (to upgrade to the Pixel) so I can't help with testing :(

To answer your question, at the moment you won't get a fully functional Maru OS on the 6p, but Maru OS on the 6p is possible, but as said at the moment not with all functionalities.

Hope thats helps somehow.

Bart Vdpt

unread,
Nov 3, 2016, 8:56:52 AM11/3/16
to Maru OS dev
Thanks. 

So, it will be only the Nexus 5 that will work with MaruOS for a long time? 
Or wil the next port be the Pixel? ;-) To expensive for me, but ok, then i know. 


"A Port to the 6p is for sure possible, ..." but will never be done, seams me. 
Because when you stop with the port, nobody can/will continue to finish it. 

The porting seams all really difficult, it seams that a lot of people never finish it. 
Pity i understand nothing of that. 

Regards 
Bart 




Op woensdag 2 november 2016 10:38:00 UTC+1 schreef chev droid:

bootlessxfly

unread,
Nov 13, 2016, 9:25:42 AM11/13/16
to Maru OS dev
Sorry I have been missing in action the last couple of months, I got a new job which took up a lot of time at first.

I just started working on the port again. And I have maruos and the kernel built and booting on my nexus 6p. I have not been able to test out if lxc is launching and posting properly to hdmi. I will test this feature when I get back to my workstation tonight.

Now that my schedule is not as hectic, I plan on spending much more time on this project.

Dionis L

unread,
Nov 13, 2016, 11:34:04 AM11/13/16
to Maru OS dev
Ok , very intresting ,I'm very interested how is harware acelaration going , no matter if is a nexus 5 or other phone .Yesterday O got sound working on debian , but my hdmi cable is on the way so I just tested youtube over vnc.Is for you the youtube in firefox videos playing fine?

Dionis L

unread,
Nov 13, 2016, 5:49:36 PM11/13/16
to Maru OS dev
Hello gain ,

How is all doing ? Maybe we can help you cause I'm also interested of this port .

I think you need a USB Type-C to HDMI ?

I'm very interested if you got the debian to start and if you get something over hdmi .
Have a good day!

bootlessxfly

unread,
Nov 13, 2016, 5:53:09 PM11/13/16
to Maru OS dev
Dionis,
Like I said, I will not have the chance to try it out in till I return home later.
As far as hdmi, I have an displaylink adapter and a USB C to usb A cord. Android supports display link for anything 5.0.0 and later.

bootlessxfly

unread,
Nov 13, 2016, 5:58:48 PM11/13/16
to Maru OS dev
As for hardware acceleration, we are going to need to implement libhybris. This is something I was thinking of working on after I finished tile initial port.

Dionis L

unread,
Nov 13, 2016, 6:06:14 PM11/13/16
to Maru OS dev
if you copy .so files from android /system/lib/ for example libOmxCore.so
Do you think it will work ,we to build on debian c++ apps that will be able to use H/W acceleration linking to this libraries we copy from android to debian?

bootlessxfly

unread,
Nov 13, 2016, 10:52:17 PM11/13/16
to Maru OS dev
If I'm understanding you correctly, then you are not far off.
The main thing that you are missing are the bindings that allow for c++ code to work with android libraries.
Libhybris mounts /system and uses these bindings to allow our linux container to run off these android libraries.

bootlessxfly

unread,
Nov 14, 2016, 11:05:00 PM11/14/16
to maru-...@googlegroups.com
So, I have played around a little more with my build.
I ran:
1|shell@angler:/ # su
1|root@angler:/ # lxc-start -n jessie  

I get the following error message.
lxc-start: external/lxc/src/lxc/lxc_start.c: main: 296 Executing '/sbin/init' with no configuration file may crash the host

Any ideas?
I'll look around to see if I can find anything.

Running 
130|root@angler:/ # find / | grep "jessie"  

returns me
/system/maru/containers/jessie
/system/maru/containers/jessie/config
/system/maru/containers/jessie/fstab
/system/maru/containers/jessie/jessie-rootfs.tar.gz

/data/maru/containers/ is missing the jessie folder.

I've attached my lxc-start log file


lxc-start.txt

Preetam

unread,
Nov 15, 2016, 2:20:21 PM11/15/16
to Maru OS dev
Same issue as Stefan was having on his port: https://groups.google.com/d/msg/maru-os-dev/tjJvMHP-_OI/sbrDyZx3AAAJ

You'll need to make sure you add this line to your device init file to make sure those lxc directories are synced over: https://github.com/maruos/android_device_lge_hammerhead/blob/3f343180d2d122a3969bd880c6761afe6579de7a/init.hammerhead.rc#L23.

And make sure that device-maru.mk is being included in your product configuration makefile, use hammerhead's as a guide: https://github.com/maruos/android_device_lge_hammerhead/blob/dcbf00e4e2731a593d81dcc563766d187e7144f5/maru_hammerhead.mk#L18

Dionis L

unread,
Nov 15, 2016, 2:34:37 PM11/15/16
to Maru OS dev
Very interesting .And if we do a at compile : lunch 1 , (or lunch and select first option mot the hamerhead option) ,where we must add this ,for option 1 of lunch to work ?

bootlessxfly

unread,
Nov 16, 2016, 12:11:48 AM11/16/16
to maru-...@googlegroups.com
It appears i missed import init.maru.rc. Thanks for pointing that out
I am now able to start the container; however, I am now having trouble logging in,
I referenced:

User=maru, pass=maru and user=root, pass=root would not allow me to log in.
Are these still the correct username/password combinations?

I have also tried this with the 0.3 prebuilt rootfs and the 0.3 arm64 rootfs i compiled.
I'll attach a log of my lxc-start output
I will point out that I do not have the same error as in the above post.

On another note.
When I have my phone plugged into the hdmi, is it supposed to post the linux environment or are we supposed to envoke a command to launch this?
lxc-login-incorrect.txt

Preetam

unread,
Nov 17, 2016, 6:12:22 PM11/17/16
to Maru OS dev
Yup, those are the right user/pass combos. This is a weird error...something is messing up the login process. I don't see anything wrong in your startup logs. I need to look into this more closely and try to repro on my end.

Regarding HDMI, yes, the desktop will boot automatically when it detects an HDMI screen. But the Nexus 6P doesn't have HDMI, so you'll have to start it manually.

bootlessxfly

unread,
Nov 17, 2016, 7:34:17 PM11/17/16
to maru-...@googlegroups.com
On a additional note,
I had to keep CONFIG_USER_NS disabled to get the kernel to compile. Don't know if this could be causing the problem or not.

After a quick google search, I found this page

The description of CONFIG_USER_NS provided
"This allows containers, i.e. vservers, to use user namespaces to provide different user info for different servers."

This seems to be the problem. I may have to find a way to get the kernel compiled with this feature enabled.

Dionis L

unread,
Nov 17, 2016, 7:46:13 PM11/17/16
to maru-...@googlegroups.com
No no no ....
Do not stress about that! ,android is not running debian in a userspace .Wedo not need taht kernel option now.
Debian is run in a container that have full acess is not in a userspace .So do not worry about that.If only lose time if you care about that now

By the way ... how did you created your boot.img ?