Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[device-port] [tenshi] BQ Aquaris U Plus #54

Open
stefanomelchior opened this issue Jan 31, 2018 · 5 comments

Comments

@stefanomelchior
Copy link

commented Jan 31, 2018

This port is based on the 7.1 branch of Halium:

  • Create mainfest
  • Build hybris-boot, systemimage (at the moment working with Halium's rootfs)
  • Initial flash and boot
  • Format data to remove android encryption
  • Boot into rootfs usb 2-2: Manufacturer: GNU/Linux Device (Please read the notes next to this checklist)
  • Get ssh connection with PC
  • Get wifi connect working
  • Get LXContainer running
  • libhybris tests
    • test_gps
    • test_hwcomposer
    • test_lights
    • test_vibrator
    • test_wifi
    • test_sensors
    • test_audio
    • test_camera
    • test_input
    • test_nfc
    • test_recorder

What works?

Hybris-boot/recovery can be compiled
It can work with either

  • hybris-boot.img
  • and hybris-recovery.img
  • echo "continue" >> /init-ctrl/stdin and then connect via ssh.

Lxc container works

  • lxc@android container starts and works well:
root@localhost:~# systemctl status lxc@android
● lxc@android.service - LXC Container: android
   Loaded: loaded (/lib/systemd/system/lxc@.service; enabled; vendor preset: ena
   Active: active (running) since Thu 2016-02-11 16:28:03 UTC; 46 years 1 months
     Docs: man:lxc-start
           man:lxc
 Main PID: 1241 (lxc-start)
   Memory: 2.8M
      CPU: 523ms
   CGroup: /system.slice/system-lxc.slice/lxc@android.service
           └─1241 /usr/bin/lxc-start -F -n android

Feb 11 16:28:03 localhost.localdomain systemd[1]: Started LXC Container: android
Feb 11 16:28:03 localhost.localdomain lxc-start[1241]: 5645 blocks

Light and leds control work

  • echo 10 > /sys/class/leds/green/blink made led blink 10 times!`
  • EGL_PLATFORM=hwcomposer test_hwcomposer works, even though sometimes it is possible to view the spiral when you before run echo 200 > /sys/class/leds/lcd-backlight/brightness
  • Vol + and -
root@guf-uplus:~# evtest /dev/input/event5
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 115 (KEY_VOLUMEUP)
Properties:
Testing ... (interrupt to exit)
Event: time 1518218262.741282, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 1518218262.741282, -------------- SYN_REPORT ------------
Event: time 1518218262.921282, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1518218262.921282, -------------- SYN_REPORT ------------
Event: time 1518218266.921287, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 1
Event: time 1518218266.921287, -------------- SYN_REPORT ------------
Event: time 1518218267.121256, type 1 (EV_KEY), code 115 (KEY_VOLUMEUP), value 0
Event: time 1518218267.121256, -------------- SYN_REPORT ------------
root@guf-uplus:~# evtest /dev/input/event0
Input driver version is 1.0.1
Input device ID: bus 0x0 vendor 0x0 product 0x0 version 0x0
Input device name: "qpnp_pon"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 116 (KEY_POWER)
Properties:
  Property type 6 (?)
Testing ... (interrupt to exit)
Event: time 1518218511.753288, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 1
Event: time 1518218511.753288, -------------- SYN_REPORT ------------
Event: time 1518218511.933583, type 1 (EV_KEY), code 114 (KEY_VOLUMEDOWN), value 0
Event: time 1518218511.933583, -------------- SYN_REPORT ------------
Event: time 1518218513.941987, type 1 (EV_KEY), code 116 (KEY_POWER), value 1
Event: time 1518218513.941987, -------------- SYN_REPORT ------------
Event: time 1518218514.088121, type 1 (EV_KEY), code 116 (KEY_POWER), value 0
Event: time 1518218514.088121, -------------- SYN_REPORT ------------

Plasma mobile works
You can boot Plasma mobile generic rootfs. You can:

  • connect with ssh
  • activate wifi,
  • manage display brightness
  • trigger vibration through test_vibration.

Halium-boot works and on top of that UBports (CAF-Edge) rootfs

  • boot Halium-boot
  • connect to BusyBox (telnet)
  • connect with ssh
  • connect with usb-tethering (RNDIS)
  • trigger vibration through test_vibration

When you also install system.img and you boot UBports (CAF-Edge) rootfs, it is possible to:

  • connect with ssh
  • lxc-checkconfig output correct
  • make lxc@android container work
  • connect to internet via usb tethering (RNDIS)
  • connect with wi-fi via wpa_supplicant
  • trigger vibration through test_vibration.
  • update and upgrade the system (sudo apt-get update && sudo apt-get upgrade)
  • launch unity8+mir for UI and log-in
  • manage display brightness

Still to be improved

root@localhost:~# test_lights 
test_lights: test_lights.c:31: main: Assertion `hwmod != NULL' failed.
Aborted
root@guf-uplus:~# test_camera
library "libcamera_compat_layer.so" not found
dlsym failed: library handle is null
Segmentation fault
root@localhost:~# test_nfc
Starting test_nfc.
Finding NFC hardware module.
test_nfc: test_nfc.c:156: testNfc: Assertion `hwModule != NULL' failed.
Aborted
root@localhost:~# test_egl
Segmentation fault
root@guf-uplus:~# test_audio
library "vendor/lib/libhwdaphal.so" not found
Audio device API version 0200 doesn't match platform current 3004.test_audio: test_audio.c:71: main: Assertion `audiohw->common.version == AUDIO_DEVICE_API_VERSION_CURRENT' failed.
Aborted
root@localhost:~# test_glesv2
Segmentation fault
root@localhost:~# test_input
library "libis_compat_layer.so" not found
Segmentation fault
root@localhost:~# test_nfc
Starting test_nfc.
Finding NFC hardware module.
test_nfc: test_nfc.c:156: testNfc: Assertion `hwModule != NULL' failed.
Aborted
root@localhost:~# test_recorder
Test application for video recording using the camera
Recording start with volume up button. And stops with volume down.
The result is stored to /root/test_video.avi
library "libcamera_compat_layer.so" not found
Segmentation fault

** Tests that seem to work**

root@ubuntu-phablet:~# test_gps 
*** setup signal handler
*** get gps interface
*** device info
 id = gps
 name = loc_api GPS Module
 author = Qualcomm USA, Inc.
*** init gps interface
 ** Creating thread: 'Loc_hal_worker' (start=0xaf829e75, arg=0xad9b90)
 ** After thread_create: 'Loc_hal_worker', error=0 (start=0xaf829e75, arg=0xad9b90)
 **** Thread wrapper start (start=0xaf829e75, arg=0xad9b90) ****
library "libizat_api_pds.so" not found
*** setting positioning mode
*** start gps track
*** gps tracking started
*** tracking.... 
*** set capabilities
capability is 00000007
*** nmea info
timestamp:	-205556847
nmea (30): 	$GPGSA,A,1,,,,,,,,,,,,,,,*1E

*** nmea info
timestamp:	-205556846
nmea (30): 	$GNGSA,A,1,,,,,,,,,,,,,,,*00

*** nmea info
timestamp:	-205556846
nmea (25): 	$GPVTG,,T,,M,,N,,K,N*2C

*** nmea info
timestamp:	-205556845
nmea (25): 	$GPRMC,,V,,,,,,,,,,N*53

*** nmea info
timestamp:	-205556845
nmea (26): 	$GPGGA,,,,,,0,,,,,,,,*66

*** nmea info
timestamp:	-205556845
nmea (30): 	$GPGSA,A,1,,,,,,,,,,,,,,,*1E

*** nmea info
timestamp:	-205556845
nmea (30): 	$GNGSA,A,1,,,,,,,,,,,,,,,*00

*** nmea info
timestamp:	-205556845
nmea (25): 	$GPVTG,,T,,M,,N,,K,N*2C

*** nmea info
timestamp:	-205556844
nmea (25): 	$GPRMC,,V,,,,,,,,,,N*53

*** nmea info
timestamp:	-205556844
nmea (26): 	$GPGGA,,,,,,0,,,,,,,,*66

*** status callback
*** engine on
*** status callback
*** session begin
*** nmea info
timestamp:	-205556049
nmea (30): 	$GPGSA,A,1,,,,,,,,,,,,,,,*1E

*** nmea info
timestamp:	-205556049
nmea (30): 	$GNGSA,A,1,,,,,,,,,,,,,,,*00

*** nmea info
timestamp:	-205556049
nmea (25): 	$GPVTG,,T,,M,,N,,K,N*2C

*** nmea info
timestamp:	-205556049
nmea (25): 	$GPRMC,,V,,,,,,,,,,N*53

*** nmea info
timestamp:	-205556049
nmea (26): 	$GPGGA,,,,,,0,,,,,,,,*66

*** nmea info
timestamp:	-205555049
nmea (30): 	$GPGSA,A,1,,,,,,,,,,,,,,,*1E

*** nmea info
timestamp:	-205555049
nmea (30): 	$GNGSA,A,1,,,,,,,,,,,,,,,*00

*** nmea info
timestamp:	-205555049
nmea (25): 	$GPVTG,,T,,M,,N,,K,N*2C

*** nmea info
timestamp:	-205555049
nmea (25): 	$GPRMC,,V,,,,,,,,,,N*53

*** nmea info
timestamp:	-205555049
nmea (26): 	$GPGGA,,,,,,0,,,,,,,,*66

*** cleanup
root@ubuntu-phablet:~#
root@ubuntu-phablet:~# test_sensors 
Hardware module ID: sensors
Hardware module Name: MultiHal Sensor Module
Hardware module Author: Google, Inc
Hardware module API version: 0x1
Hardware HAL API version: 0x1
Poll device version: 0x1040001
API VERSION 0.1 (legacy): 0x1
API VERSION 0.1: 0x65537
API VERSION 1.0: 0x16777217
API VERSION 1.1: 0x16842753
API VERSION 1.2: 0x16908289
API VERSION 1.3: 0x16973825
API VERSION 1.4: 0x17039361
Got 39 sensors
=== Sensor 0 ==
Name: LSM6DS3 Accelerometer
Vendor: STMicroelectronics
Version: 0x1
Handle: 0x1
Type: 1
maxRange: 39
resolution: 0
power: 1 mA
minDelay: 5000



=== Sensor 1 ==
Name: ST480 ST480
Vendor: SENODIA
Version: 0x1
Handle: 0x2
Type: 2
maxRange: 4912
resolution: 0
power: 0 mA
minDelay: 20000



=== Sensor 2 ==
Name: ST480 ST480 Uncalibrated
Vendor: SENODIA
Version: 0x1
Handle: 0x3
Type: 14
maxRange: 4912
resolution: 0
power: 0 mA
minDelay: 20000



=== Sensor 3 ==
Name: LSM6DS3 Gyroscope
Vendor: STMicroelectronics
Version: 0x1
Handle: 0x4
Type: 4
maxRange: 35
resolution: 0
power: 1 mA
minDelay: 5000



=== Sensor 4 ==
Name: LSM6DS3 Gyroscope Uncalibrated
Vendor: STMicroelectronics
Version: 0x1
Handle: 0x5
Type: 16
maxRange: 35
resolution: 0
power: 1 mA
minDelay: 5000



=== Sensor 5 ==
Name: EPL259x ALS/PS EPL259x
Vendor: Eminent
Version: 0x2
Handle: 0x6
Type: 8
maxRange: 5
resolution: 0
power: 0 mA
minDelay: 0



=== Sensor 6 ==
Name: EPL259x ALS/PS EPL259x
Vendor: Eminent
Version: 0x1
Handle: 0x7
Type: 5
maxRange: 10000
resolution: 0
power: 0 mA
minDelay: 0



=== Sensor 7 ==
Name: LSM6DS3 Accelerometer -Wakeup Secondary
Vendor: STMicroelectronics
Version: 0x1
Handle: 0x8
Type: 1
maxRange: 39
resolution: 0
power: 1 mA
minDelay: 5000



=== Sensor 8 ==
Name: ST480 ST480 -Wakeup Secondary
Vendor: SENODIA
Version: 0x1
Handle: 0x9
Type: 2
maxRange: 4912
resolution: 0
power: 0 mA
minDelay: 20000



=== Sensor 9 ==
Name: ST480 ST480 Uncalibrated -Wakeup Secondary
Vendor: SENODIA
Version: 0x1
Handle: 0xa
Type: 14
maxRange: 4912
resolution: 0
power: 0 mA
minDelay: 20000



=== Sensor 10 ==
Name: LSM6DS3 Gyroscope -Wakeup Secondary
Vendor: STMicroelectronics
Version: 0x1
Handle: 0xb
Type: 4
maxRange: 35
resolution: 0
power: 1 mA
minDelay: 5000



=== Sensor 11 ==
Name: LSM6DS3 Gyroscope Uncalibrated -Wakeup Secondary
Vendor: STMicroelectronics
Version: 0x1
Handle: 0xc
Type: 16
maxRange: 35
resolution: 0
power: 1 mA
minDelay: 5000



=== Sensor 12 ==
Name: EPL259x ALS/PS EPL259x -Non Wakeup Secondary
Vendor: Eminent
Version: 0x2
Handle: 0xd
Type: 8
maxRange: 5
resolution: 0
power: 0 mA
minDelay: 0



=== Sensor 13 ==
Name: EPL259x ALS/PS EPL259x -Wakeup Secondary
Vendor: Eminent
Version: 0x1
Handle: 0xe
Type: 5
maxRange: 10000
resolution: 0
power: 0 mA
minDelay: 0



=== Sensor 14 ==
Name: Gravity
Vendor: QTI
Version: 0x2
Handle: 0xf
Type: 9
maxRange: 39
resolution: 0
power: 2 mA
minDelay: 5000



=== Sensor 15 ==
Name: Linear Acceleration
Vendor: QTI
Version: 0x2
Handle: 0x10
Type: 10
maxRange: 39
resolution: 0
power: 2 mA
minDelay: 5000



=== Sensor 16 ==
Name: Rotation Vector
Vendor: QTI
Version: 0x2
Handle: 0x11
Type: 11
maxRange: 1
resolution: 0
power: 1 mA
minDelay: 5000



=== Sensor 17 ==
Name: Step Detector
Vendor: QTI
Version: 0x2
Handle: 0x12
Type: 18
maxRange: 1
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 18 ==
Name: Step Counter
Vendor: QTI
Version: 0x2
Handle: 0x13
Type: 19
maxRange: 1
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 19 ==
Name: Significant Motion Detector
Vendor: QTI
Version: 0x2
Handle: 0x14
Type: 17
maxRange: 1
resolution: 1
power: 1 mA
minDelay: -1



=== Sensor 20 ==
Name: Game Rotation Vector
Vendor: QTI
Version: 0x2
Handle: 0x15
Type: 15
maxRange: 1
resolution: 0
power: 2 mA
minDelay: 5000



=== Sensor 21 ==
Name: GeoMagnetic Rotation Vector
Vendor: QTI
Version: 0x2
Handle: 0x16
Type: 20
maxRange: 1
resolution: 0
power: 1 mA
minDelay: 20000



=== Sensor 22 ==
Name: Orientation
Vendor: QTI
Version: 0x2
Handle: 0x17
Type: 3
maxRange: 360
resolution: 0
power: 1 mA
minDelay: 5000



=== Sensor 23 ==
Name: Tilt Detector
Vendor: QTI
Version: 0x2
Handle: 0x18
Type: 22
maxRange: 1
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 24 ==
Name: Gravity -Wakeup Secondary
Vendor: QTI
Version: 0x2
Handle: 0x19
Type: 9
maxRange: 39
resolution: 0
power: 2 mA
minDelay: 5000



=== Sensor 25 ==
Name: Linear Acceleration -Wakeup Secondary
Vendor: QTI
Version: 0x2
Handle: 0x1a
Type: 10
maxRange: 39
resolution: 0
power: 2 mA
minDelay: 5000



=== Sensor 26 ==
Name: Rotation Vector -Wakeup Secondary
Vendor: QTI
Version: 0x2
Handle: 0x1b
Type: 11
maxRange: 1
resolution: 0
power: 1 mA
minDelay: 5000



=== Sensor 27 ==
Name: Step Detector -Wakeup Secondary
Vendor: QTI
Version: 0x2
Handle: 0x1c
Type: 18
maxRange: 1
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 28 ==
Name: Step Counter -Wakeup Secondary
Vendor: QTI
Version: 0x2
Handle: 0x1d
Type: 19
maxRange: 1
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 29 ==
Name: Game Rotation Vector -Wakeup Secondary
Vendor: QTI
Version: 0x2
Handle: 0x1e
Type: 15
maxRange: 1
resolution: 0
power: 2 mA
minDelay: 5000



=== Sensor 30 ==
Name: GeoMagnetic Rotation Vector -Wakeup Secondary
Vendor: QTI
Version: 0x2
Handle: 0x1f
Type: 20
maxRange: 1
resolution: 0
power: 1 mA
minDelay: 20000



=== Sensor 31 ==
Name: Orientation -Wakeup Secondary
Vendor: QTI
Version: 0x2
Handle: 0x20
Type: 3
maxRange: 360
resolution: 0
power: 1 mA
minDelay: 5000



=== Sensor 32 ==
Name: AMD
Vendor: QTI
Version: 0x2
Handle: 0x21
Type: 33171006
maxRange: 1
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 33 ==
Name: RMD
Vendor: QTI
Version: 0x2
Handle: 0x22
Type: 33171007
maxRange: 1
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 34 ==
Name: Basic Gestures
Vendor: QTI
Version: 0x2
Handle: 0x23
Type: 33171000
maxRange: 7
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 35 ==
Name: Facing
Vendor: QTI
Version: 0x2
Handle: 0x24
Type: 33171002
maxRange: 3
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 36 ==
Name: Pedometer
Vendor: QTI
Version: 0x2
Handle: 0x25
Type: 33171009
maxRange: 1
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 37 ==
Name: Motion Accel
Vendor: QTI
Version: 0x2
Handle: 0x26
Type: 33171011
maxRange: 1
resolution: 1
power: 1 mA
minDelay: 0



=== Sensor 38 ==
Name: Coarse Motion Classifier
Vendor: QTI
Version: 0x3
Handle: 0x27
Type: 33171012
maxRange: 2147483648
resolution: 1
power: 1 mA
minDelay: 0

root@ubuntu-phablet:~# 

Testing rootfs:

  • Halium Reference rootfs

    • Wifi
    • Sound (Volume buttons)
    • Touchscreen
    • Powerbutton
  • UBPorts (mainstream xenial-edge) rootfs

    • Gui (spinner)
    • Gui (unity8 and mir 1.0)
    • Wifi
    • GSM (outbound started, but crashed)
    • SMS inbound and outbound
    • 4G
    • test_sensors
    • test_gps
    • test_vibrator
    • GPS
    • Sound and Jack output (Volume buttons works as well)
    • Touchscreen
    • Powerbutton, Vol.+ and Vol.-
  • Plasma Mobil rootfs

    • Wifi
    • Sound (Volume buttons)
    • Touchscreen
    • Powerbutton
    • GUI (spinner)
    • GUI (login)

Documentation
Manifest: https://github.com/Halium/halium-devices/blob/halium-7.1/manifests/bq_tenshi.xml
Kernel config v0.6:
lineage_tenshi_defconfig_v6.txt
vendor/bq/tenshi/Android.mk (commented all the references to apks): Android.mk
Fixup mountpoints: fixup-mountpoints.txt
To build UBports's rootfs:
ubports-boot.xml: ubports-boot.xml.txt

Udev-rules:
ueventd.rc ueventd.rc.txt
ueventd.qcom.rc ueventd.qcom.rc.txt
70-tenshi.rules 70-tenshi.rules.txt
Note: the latest file is the udev-rules essential to run lxc Android container and it was created on BQ U Plus device (that is why it was renamed with its codename "tenshi")

OLD:
Kernel config v0.5: lineage_tenshi_defconfig-v0.5.txt
Kernel config v0.4: lineage_tenshi_defconfig.v0.4.txt
Kernel config v0.3 lineage_tenshi_defconfig-v0.3
Kernel config v0.2 (lxc-checkconfig): lineage_tenshi_defconfig
Kernel config v0.1: lineage_tenshi_defconfig.txt

@stefanomelchior stefanomelchior changed the title [porting-dev] BQ Aquaris U Plus (tenshi) [device-port] [tenshi] BQ Aquaris U Plus Jan 31, 2018
@110101011

This comment has been minimized.

Copy link

commented Jan 31, 2018

Add 'audit=0 selinux=0' to your kernel cmdline, and see if it boots. When it boots disable audit and selinux throght defconfig.

Edit: i see that audit is already set to 'n', try the same for CONFIG_SECURITY_SELINUX=n

@lnjX

This comment has been minimized.

Copy link
Contributor

commented Feb 1, 2018

I think @JBBgameich solved the problem on his device (chaozu), maybe he can also help.

@lnjX lnjX added the Ports label Feb 1, 2018
@stefanomelchior

This comment has been minimized.

Copy link
Author

commented Feb 2, 2018

FIXED - SOLVED
I work with hybris-recovery right now, because after continue, the device is not accessible neither via telnet.
Accordingly with the analysis we (JBB and I) did: probably the rootfs doesn't boot fully or correctly, even though I am only in the initrd currently, the problem might be that it could not switch_root to /target and start the init system.
Roots is mounted and ls -la /target seems to show all the files and directories.

Before "continue" it correctly set up configuration for telnet, and after it also set enp0s20u1u1u1 correctly:

[ 5461.429094] usb 1-1.1.1: Manufacturer: GNU/Linux Device
[ 5461.429097] usb 1-1.1.1: SerialNumber: GNU/Linux Device on rndis0 10.15.19.82
[ 5461.431456] rndis_host 1-1.1.1:1.0 usb0: register 'rndis_host' at usb-0000:00:14.0-1.1.1, RNDIS device, f6:61:8c:5a:02:f1
[ 5461.451209] rndis_host 1-1.1.1:1.0 enp0s20u1u1u1: renamed from usb0

I can also ping to 10.15.19.82. But after I launched connect.py script:
[ 5461.472776] IPv6: ADDRCONF(NETDEV_UP): enp0s20u1u1u1: link is not ready

@kuramaluka

This comment has been minimized.

Copy link

commented Aug 15, 2018

Hello everyone, I have an Aquaris U Plus. May I help with the port, and if yes, how can I start?

@JBBgameich

This comment has been minimized.

Copy link
Member

commented Aug 15, 2018

If you want to help, rebasing the port on the lineageOS tree would help. You can checkout the existing port using the halium-devices script mentioned in the porting guide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.