Halium / projectmanagement

143 stars 32 forks source link

[device-port] [oneplus3] Port to OnePlus 3(T) #63

Open vanyasem opened 6 years ago

vanyasem commented 6 years ago

Tree: halium-7.1

There are currently 2 builds of this port. One by @vanyasem, and one by @Vince1171.

UBports has OnePlus 3(T) builds available in the official installer. It's the easiest way to test the port for beginners.

UBports has a forum thread dedicated to OP3(T): forums.ubports.com/topic/3253/oneplus-3-3t

@Vince1171's image Working prebuilt images for OP3 / OP3T: OnePlus3-T-Halium-Prebuild Both Plasma Mobile and UBports work. Pretty much everything apart from Bluetooth works.

@vanyasem's image (outdated): Working prebuilt images for OP3 / OP3T: halium.mynameisivan.ru/op3 The kernel config of this build misses some important kernel flags and thus drops into telnet by default. If you tell it to continue booting, it successfully boots into the rootfs. UBports doesn't boot at all. Plasma Mobile boots, but touchscreen doesn't work.

Sidenote 0: OnePlus 3 and OnePlus 3T have a universal LineageOS build. The port was tested on both devices

Sidenote 1: As @UniversalSuperBox suggests me not to fork the vendor repo, it has to be manually patched. You need to remove vendor/oneplus/oneplus3/proprietary/etc/thermal-engine.conf:system/etc/thermal-engine.conf from vendor/oneplus/oneplus3/oneplus3-vendor.mk

Sidenote 2: Some tests are broken in Halium 7.1. They won't work until they get fixed

Sidenote 3: /dev/input/event0 - Power - qpnp_pon /dev/input/event1 - Nothing - hbtp_vm /dev/input/event2 - Mode switch - tri-state-key /dev/input/event3 - Nothing - fpc1020 /dev/input/event4 - Touchscreen - synaptics /dev/input/event5 - Volume buttons - gpio-keys /dev/input/event6 - Back and Recents buttons - synaptics /dev/input/event7 - Nothing (Doesn't exist on OP3) - msm8996-tasha-mtp-snd-card Headset Jack /dev/input/event8 - Nothing (Doesn't exist on OP3) - msm8996-tasha-mtp-snd-card Button Jack /dev/input/mouse0 - Nothing - Err: Inappropriate ioctl for device

Sidenote 4: You have to run echo sta > /sys/module/wlan/parameters/fwpath in order to enable Wi-Fi

This started as a co-op port by @vanyasem and @mariogrip @Vince1171 continued the port bringing UT fixes Thanks to @sk8higher, @Stefano0101, @TheBluestBird for helping with testing the port

Vince1171 commented 5 years ago

if anyone want to test UT on Oneplus3 https://github.com/Vince1171/OnePlus3-T-Halium-Prebuild/ It in early stage, so don't expect much I'll PR the changes soon

cheshirean commented 5 years ago

Hello! I am having problems installing UT on my device. Using the prebuild images, I followed the instructions from here - https://github.com/Vince1171/OnePlus3-T-Halium-Prebuild/ As a result, after a reboot, I get a screen with the words "charging ?? / 100" and that's it. There is no telnet, no ssh ... What am I doing wrong?

Vince1171 commented 5 years ago

@Cheshirean you are on charging mode (your phone is off and charging) so you just have to power it up. And I suggest you to use the v0.6 as I fixed the "charging ??/100". Now there is a proper charging animation

cheshirean commented 5 years ago

@Cheshirean you are on charging mode (your phone is off and charging) so you just have to power it up. And I suggest you to use the v0.6 as I fixed the "charging ??/100". Now there is a proper charging animation

It's strange, I just made a "reset" of the fastboot before this ... Nevertheless, the question remains the same. Trying yesterday again, I get either the same message or a hanging OnePlus logo. And I also do not have access to the device either on the ssh or telnet...

Vince1171 commented 5 years ago

@Cheshirean you are on charging mode (your phone is off and charging) so you just have to power it up. And I suggest you to use the v0.6 as I fixed the "charging ??/100". Now there is a proper charging animation

It's strange, I just made a "reset" of the fastboot before this ... Nevertheless, the question remains the same. Trying yesterday again, I get either the same message or a hanging OnePlus logo. And I also do not have access to the device either on the ssh or telnet...

there was an error in my docs the link to the rootfs was pointing to the edge rootfs (which is broken on OP3(t) ) this is link to the correct rootfs https://ci.ubports.com/job/xenial-rootfs-armhf/lastSuccessfulBuild/artifact/out/ubports-touch.rootfs-xenial-armhf.tar.gz

cheshirean commented 5 years ago

there was an error in my docs the link to the rootfs was pointing to the edge rootfs (which is broken on OP3(t) ) this is link to the correct rootfs https://ci.ubports.com/job/xenial-rootfs-armhf/lastSuccessfulBuild/artifact/out/ubports-touch.rootfs-xenial-armhf.tar.gz

I tried with the new rootfs, it worked. I am successfully connecting via ssh. But i have new problem:

phablet@ubuntu-phablet:~$ anbox-tool install
Anbox kernel is not installed! Please flash this first!

I also saw the update README.md, but have not yet had time to test them. Probably should build new images

cheshirean commented 5 years ago

Tried to build images with the manifest specified here. As a result:

$ breakfast oneplus3
build/core/product_config.mk:268: *** No matches for product "lineage_oneplus3".  Останов.
build/core/product_config.mk:268: *** No matches for product "cm_oneplus3".  Останов.
build/core/product_config.mk:268: *** No matches for product "lineage_oneplus3".  Останов.
Device oneplus3 not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Found repository: android_device_oneplus_oneplus3
Traceback (most recent call last):
  File "vendor/cm/build/tools/roomservice.py", line 263, in <module>
    default_revision = get_default_revision()
  File "vendor/cm/build/tools/roomservice.py", line 117, in get_default_revision
    return r.replace('refs/heads/', '').replace('refs/tags/', '')
AttributeError: 'NoneType' object has no attribute 'replace'
build/core/product_config.mk:268: *** No matches for product "lineage_oneplus3".  Останов.
build/core/product_config.mk:268: *** No matches for product "lineage_oneplus3".  Останов.

** Don't have a product spec for: 'lineage_oneplus3'
** Do you have the right repo manifest?
Vince1171 commented 5 years ago

@Cheshirean try with breakfast halium_oneplus3-userdebug

for the Anbox issue, are you sure you're using my prebuild boot image? anbox binder should be integrated

cheshirean commented 5 years ago

@Vince1171, i was sure to your answer... You can give a link to exactly the right images and I will recheck? Thanks)

Vince1171 commented 5 years ago

@Cheshirean https://github.com/Vince1171/OnePlus3-T-Halium-Prebuild/releases Anbox binder is integrated since v0.4 As there is an issue with the permission of anbox-tool, you'll need this command in order to install it sudo python3 /system/halium/usr/bin/anbox-tool install and be aware that anbox is not stable at all, even on officially supported device

cheshirean commented 5 years ago

@Vince1171, i'm trying v0.4 and etc., and all work fine. Thanks for your help

kiranreddyrebel commented 5 years ago

Hi, any new updates on this device please.

Vince1171 commented 5 years ago

@kiranreddyrebel You can find news/updates for Ubuntu Touch here For other OS's, there are no news unfortunately

ghost commented 5 years ago

I've been trying to build an image to use with plasma mobile, but something SELinux related is causing issues:

[ 17% 3845/22153] build /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates/sepolicy
FAILED: /bin/bash -c "(/home/user/halium/out/host/linux-x86/bin/checkpolicy -M -c 30 -o /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates/sepolicy.tmp /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates/policy.conf ) &&
(/home/user/halium/out/host/linux-x86/bin/checkpolicy -M -c 30 -o /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates//sepolicy.dontaudit /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates/policy.conf.dontaudit ) && (/hom
e/user/halium/out/host/linux-x86/bin/sepolicy-analyze /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates/sepolicy.tmp permissive > /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ) && (if [
\"userdebug\" = \"user\" -a -s /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains ]; then echo \"==========\" 1>&2;               echo \"ERROR: permissive domains not allowed in user builds\" 1>&2;             echo \"Li
st of invalid domains:\" 1>&2;          cat /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates/sepolicy.permissivedomains 1>&2;                exit 1;                 fi ) && (mv /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_inte
rmediates/sepolicy.tmp /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates/sepolicy )"
vendor/cm/sepolicy/qcom/mpdecision.te:2:ERROR 'unknown type sysfs_devices_system_iosched' at token ';' on line 40157:
allow mpdecision sysfs_devices_system_iosched:file { { getattr open read ioctl lock } { open append write lock } };
#line 1 "vendor/cm/sepolicy/qcom/mpdecision.te"
checkpolicy:  error(s) encountered while parsing configuration
/home/user/halium/out/host/linux-x86/bin/checkpolicy:  loading policy configuration from /home/user/halium/out/target/product/oneplus3/obj/ETC/sepolicy_intermediates/policy.conf
[ 17% 3845/22153] host C: sefcontext_compile <= external/libselinux/utils/sefcontext_compile.c
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/home/user/halium'

#### make failed to build some targets (08:01 (mm:ss)) ####

I've commented out the SELinux lines for now to get it to build, any ideas on how to fix it properly?

TheBluestBird commented 4 years ago

Hey everyone,is the project alive? I just got the device and wish to experiment/help

SohnyBohny commented 4 years ago

Hey everyone,is the project alive? I just got the device and wish to experiment/help

Yeah, maybe more than ever :tada:

See https://github.com/Vince1171/OnePlus3-T-Halium-Prebuild/ and https://forums.ubports.com/topic/3253/oneplus-3-3t for more details

linsmod commented 4 years ago

hi, I have compiled the halium project for op3 successfully , thank gentleman 's help (https://github.com/Halium/android_device_oneplus_oneplus3/issues/8) and thank @Vince1171 's document (https://github.com/Vince1171/OnePlus3-T-Halium-Prebuild#how-to-compile)

I noticed that the release page provides the armhf version of ubuntu touch rootfs, however the ubports-installer i tried previously is installed an arm64 edge version, i got confused. If installing the arm64 version of ubrootfs, how to?

I'm new here and I want to learn how to build the halium image (i made it) and install the ubuntu-touch on my device (oneplus3) step by step, thanks if any help. :)

linsmod commented 4 years ago

I know somewhere must has some docs about how-to,,, but not sure is it updated with the porting progress. So if we list it here, may help more people.

ernesst commented 4 years ago

For the UBports rootfs : https://ci.ubports.com/job/xenial-hybris-edge-rootfs-arm64/

linsmod commented 4 years ago

For the UBports rootfs : https://ci.ubports.com/job/xenial-hybris-edge-rootfs-arm64/

thanks, I'm trying to flush.

linsmod commented 4 years ago

an error:

tiny@tiny-Lenovo-V480:~/halium$ halium-scripts/halium-install ~/ubuntu-touch-rootfs/ubuntu-touch-hybris-xenial-edge-arm64-rootfs.tar.gz out/target/product/oneplus3/system.img 
please make sure the device is attched via USB in recovery mode

cleaning up
error: device unauthorized.
This adb server's $ADB_VENDOR_KEYS is not set
Try 'adb kill-server' if that seems wrong.
Otherwise check for a confirmation dialog on your device.
tiny@tiny-Lenovo-V480:~/halium$ 
linsmod commented 4 years ago

I resolved the problem by replace the ubports recovery to twrp recovery. :)

GetAGripGal commented 4 years ago

Heya, how well does plasma mobile work with this? If at all?

vanyasem commented 4 years ago

@ComLarsic please read the issue

GetAGripGal commented 4 years ago

@vanyasem I did, however there arent many updates on how it works, would like to install PM on my phone

vanyasem commented 4 years ago

@ComLarsic because it's not consumer ready frankly. and if you cannot read the docs, you probably shouldn't be playing with Halium

GetAGripGal commented 4 years ago

@vanyasem i can read the docs, was just looking for information about this specific device. But thx for your help I guess.

vanyasem commented 4 years ago

@ComLarsic well in that case the issue has all the information you might need, feel free to ask any specific questions if you get stuck

kozlovandrei commented 4 years ago

Plasma Mobile is not running. Help me. Ubuntu Touch is running.

kozlovandrei commented 4 years ago

phablet@localhost:~$ dmesg | grep .img [ 2.493268] initrd: Halium rootfs is /tmpmnt/rootfs.img [ 2.509579] initrd: mounting /tmpmnt/rootfs.img (user mode) [ 2.514577] initrd: mounting android system image (/tmpmnt/system.img) ro, in /android-system (system mode) [ 2.978920] systemd[1]: Mounting mount system.img... [ 2.986117] systemd[1]: Failed to mount mount system.img. [ 3.002077] systemd[1]: Mounting mount system.img... [ 3.007547] systemd[1]: Failed to mount mount system.img. [ 3.035222] systemd[1]: Mounting mount system.img...

kozlovandrei commented 4 years ago

Why system.img may not be mounted?

kozlovandrei commented 4 years ago

phablet@localhost:~$ dmesg | grep mount
[ 2.429140] Begin: Running /scripts/nfs-premount ... done. [ 2.429340] Begin: Running /scripts/local-premount ... done. [ 2.444134] EXT4-fs (sda15): couldn't mount as ext3 due to feature incompatibilities [ 2.444501] EXT4-fs (sda15): couldn't mount as ext2 due to feature incompatibilities [ 2.450505] EXT4-fs (sda15): mounted filesystem with ordered data mode. Opts: errors=remount-ro [ 2.475224] initrd: mounting /dev/sda15 [ 2.486967] EXT4-fs: Warning: mounting with data=journal disables delayed allocation and O_DIRECT support! [ 2.486985] EXT4-fs (sda15): couldn't mount as ext3 due to feature incompatibilities [ 2.490510] EXT4-fs (sda15): mounted filesystem with journalled data mode. Opts: discard,data=journal [ 2.493859] initrd: mounting system rootfs at /halium-system [ 2.495488] EXT4-fs (loop0): couldn't mount as ext3 due to feature incompatibilities [ 2.495853] EXT4-fs (loop0): couldn't mount as ext2 due to feature incompatibilities [ 2.499162] EXT4-fs (loop0): mounted filesystem with ordered data mode. Opts: (null) [ 2.509579] initrd: mounting /tmpmnt/rootfs.img (user mode) [ 2.512612] EXT4-fs (loop0): re-mounted. Opts: data=ordered [ 2.514577] initrd: mounting android system image (/tmpmnt/system.img) ro, in /android-system (system mode) [ 2.514633] initrd: mounting android system image from userdata partition [ 2.516658] EXT4-fs (loop1): couldn't mount as ext3 due to feature incompatibilities [ 2.516965] EXT4-fs (loop1): couldn't mount as ext2 due to feature incompatibilities [ 2.520051] EXT4-fs (loop1): mounted filesystem with ordered data mode. Opts: (null) [ 2.594062] mount: mounting /tmpmnt on /root/userdata failed: No such file or directory [ 2.594791] mount: mounting /android-rootfs on /root/var/lib/lxc/android/rootfs failed: No such file or directory [ 2.595530] mount: mounting none on /root/android failed: No such file or directory [ 2.596915] mount: mounting /root/userdata/android-data on /root/android/data failed: No such file or directory [ 2.605205] initrd: checking fstab /root/var/lib/lxc/android/rootfs/fstab* for additional mount points [ 2.608390] mount: mounting /root/userdata/cache on /root/android/cache failed: No such file or directory [ 2.609455] mount: mounting /android-system on /root/android/system failed: No such file or directory [ 2.833564] systemd[1]: Starting Remount Root and Kernel File Systems... [ 2.849017] systemd[1]: Started Remount Root and Kernel File Systems. [ 2.977146] systemd[1]: system.mount: Failed to check directory /system: No such file or directory [ 2.978920] systemd[1]: Mounting mount system.img... [ 2.984764] systemd[1]: system.mount: Mount process exited, code=exited status=32 [ 2.984777] systemd[1]: system.mount: Failed with result 'exit-code'. [ 2.986117] systemd[1]: Failed to mount mount system.img. [ 2.987007] systemd[1]: system.mount: Failed to check directory /system: No such file or directory [ 3.002077] systemd[1]: Mounting mount system.img... [ 3.006279] systemd[1]: system.mount: Mount process exited, code=exited status=32 [ 3.006293] systemd[1]: system.mount: Failed with result 'exit-code'. [ 3.007547] systemd[1]: Failed to mount mount system.img. [ 3.012382] systemd[1]: system.mount: Failed to check directory /system: No such file or directory [ 3.035222] systemd[1]: Mounting mount system.img...

vanyasem commented 4 years ago

@kozlovandrei please join https://t.me/halium to get support with your issue