• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login
UBports Robot Logo UBports Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Register
  • Login

Porting Ubuntu Touch (@UBPorts) to tenshi (BQ Aquaris U Plus)

Scheduled Pinned Locked Moved BQ U Plus
56 Posts 11 Posters 15.7k Views 6 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G Offline
      Guf
      last edited by Guf 12 Dec 2020, 22:32 20 Jul 2019, 20:50

      Since early 2018, I've been working on porting Ubuntu Touch on tenshi, a mid range BQ Aquaris U Plus, commercialized with Android 6, thus suitable to work with Halium-7.1.
      See the HAL port specific details: https://github.com/Halium/projectmanagement/issues/54.

      The device is equipped with:

      • 5" HD 1280x720 screen, 294 HDPI
      • 3GB RAM,
      • 32 Gb ROM (in my case),
      • Qualcom(c) Snapdragon(c) 430 (msm8937) up to 1,4GHz

      as in his specs page (https://store.bq.com/en/aquaris-u-plus-2-gb).

      Nowadays the device has reached an interesting level of support, as the following features works well:

      • Kernel 3.18.31 for armv7l
      • Graphical User Interface, with unity8 (8.17+ubports5+0) and mir (0.24.20ubuntu11) for 32 bits libraries,
      • Data connection: up to 4G (depending on your Mobile Network Operator, but here in Spain tested either with Movistar, Orange and Vodafone),
      • wifi (embedded in the kernel)
      • Audio (and external output with jack): thanks to pulseaudio and recent pulseaudio-modules-droid-24 development,
      • GPS: it works
      • Screen rotation, using Ubuntu Touch Platform API, too. Rotation block also works,
      • SMS: inbound and outbound fully working, and notifications appear in the menu,
      • Ofono: audio in inbound and outbound calls work works out-of-the-box, now (2020-09-16) also hands-free speaker. It is able to mix well bluetooth headset output from speakers, but with handset it still works with both speakers and handset at the same time
      • test_sensors produces a congruent output,
      • Power, Volume up and down buttons
      • Printscreen by pressing at the same time Volume+ and Volume- during 2-3 seconds
      • Bluetooth: works
      • Dual SIM enabled
      • Notification partially works (for teleports, for instance, SMS, missed calls, SD storage)
      • Android alarms work
      • Hotspot works (tethering with linked devices)
      • Main and selfie cameras both work with @peat_psuwit's gst-droid and nemo-qtmultimedia-plugins. I kept on working with version in rootfs from reply #35
      • LED (white) when charging
      • Anbox (update 2020-03-03)
      • Apparmor (update 2020-03-26)

      Note: NOT NEEDED ANYMORE just before a call, manually run

      phablet@ubuntu-phablet:~$  pactl set-card-profile droid_card.primary voicecall && pactl set-sink-port sink.primary_output output-parking && pactl set-sink-port sink.primary_output output-speaker && pactl set-sink-volume sink.primary_output 200
      

      from terminal as phablet to activate audio in calls

      Lxc container works fine.

      Still to improve:

      • Fingerprint

      Tested and working (2020-09-16):

      • rootfs.img (2020-09-16): rootfs.img (with password: 1234)
      • system image (2020-09-16) system.img
      • system image: system.img
      • kernel image (2020-03-26): halium-boot.img

      At this moment it has been successfully tested with:

      • UT edge rootfs: http://ci.ubports.com/job/xenial-hybris-edge-rootfs-armhf/lastSuccessfulBuild/artifact/out/ubuntu-touch-hybris-xenial-edge-armhf-rootfs.tar.gz
      • Plasma Mobile https://images.plasma-mobile.org/caf-rootfs/pm-rootfs-20190703-055501.tar.gz. See also https://docs.halium.org/en/latest/porting/install-build/plasma-mobile.html
      • Halium-based rootfs https://docs.halium.org/en/latest/porting/install-build/reference-rootfs.html

      For those who want to test it, please, use JBBgameich's halium-install (latest version), to install it on your device, once you completed TWPR installation on recovery.

      Join us on Telegram's chat.

      Installing on systempart:

      Please, use the following images:
      halium-boot_tenshi_systempart.img
      halium-boot-20200326.img
      system_tenshi_bio.img
      Reboot the device to recovery and, from you pc:

      $ adb push system_tenshi_bio.img /data/system_tenshi_bio.img
      

      then you need to access to recovery for the following commands:

      guf@localhost:/media/gufdata/halium-7.1$ adb shell
      ~ # df
      Filesystem           1K-blocks      Used Available Use% Mounted on
      tmpfs                  1470252       152   1470100   0% /dev
      tmpfs                  1470252        20   1470232   0% /tmp
      /dev/block/mmcblk0p46
                            25473588  10236052  13920496  42% /data
      /dev/block/mmcblk0p46
                            25473588  10236052  13920496  42% /sdcard
      /dev/block/mmcblk0p25
                              253920       144    248536   0% /cache
      ~ # mount -o loop /data/rootfs.img /tmp/
      ~ # mount /dev/block/mmcblk0p24 /system/
      ~ # cp -a /tmp/* /system/ && sync
      ~ # rm /system/var/lib/lxc/android/system.img
      ~ # cp /data/system_tenshi_bio.img /system/var/lib/lxc/android/system.img
      ~ # umount /tmp && sync
      ~ # reboot
      

      Note: if systempart is already mounted in a directory, you don't need to exec the following mount /dev/block/mmcblk0p24 /system/. Just use the proper mount point instead of /system.
      At this point stop the bootstrap at bootloader, and from pc:

      sudo fastboot flash boot ~/Downloads/halium-boot-20200326.img && sudo fastboot reboot
      

      you can check from another tab of console if the system booted:

      guf@localhost:/media/gufdata/halium-7.1$ while : ; do lsusb -v 2>/dev/null | grep -Ee 'iSerial +[0-9]+ +[^ ]' ; done | uniq
        iSerial                 3 XXXXXXX
        iSerial                 3 (error)
        iSerial                 3 XXXXXXX
        iSerial                 3 (error)
        iSerial                 3 Unknown
        iSerial                 3 GNU/Linux Device on rndis0 10.15.19.82
        iSerial                 3 XXXXXXX
      

      and if you get this message GNU/Linux Device on rndis0 10.15.19.82 this is the good news that the device is correctly bootstrapping from userdata (in this moment).
      At this point, reboot in bootloader, then from pc:

      guf@localhost:/media/gufdata/halium-7.1$ sudo fastboot flash boot ~/Downloads/halium-boot_tenshi_systempart.img && sudo fastboot reboot
      target reported max download size of 535822336 bytes
      sending 'boot' (21030 KB)...
      OKAY [  0.665s]
      writing 'boot'...
      OKAY [  0.286s]
      finished. total time: 0.951s
      rebooting...
      finished. total time: 0.302s
      guf@localhost:/media/gufdata/halium-7.1$
      

      Always from the other console, check if you get the message GNU/Linux Device on rndis0 10.15.19.82 and if it appears, enjoy tenshi bootstrapping from systempart and celebrate it!
      It has just been tested on either 2GB ram and 3GB ram models.
      Note: keep end rootfs.img and system.img in datapart to be sure to have tenshi bootstrapping from there.

      1 Reply Last reply Reply Quote 8
      • J Offline
        Josele13
        last edited by 20 Jul 2019, 21:01

        thank you for your great work, is a good phone to port to UT, has many improvements over other phones already ported, thank you very much Guf...

        Regards...

        Xiaomi Redmi Note 9 pro
        Oneplus Nord 100
        Xiaomi Redmi Note 7
        Nexus 5
        Bq E4.5 Ubuntu edition .... is dead

        1 Reply Last reply Reply Quote 0
        • G Offline
          Guf
          last edited by Guf 12 Jul 2019, 23:27 20 Jul 2019, 21:02

          You can find the proper resources:
          * halium-boot
          * system.img (updated on 2019-07-29)

          I personalized JBBgameich's halium-install script to be functional for tenshi:
          * halium-install

          Feel free to provide any comment and to contribute, test, ...

          Please, use link from original message: I am keeping them up to date

          1 Reply Last reply Reply Quote 1
          • G Offline
            Guf
            last edited by Guf 20 Jul 2019, 21:57

            A small guide for dummies (like me) to install from those resources. Start at creating a directory where to store images and all the tool (halium-install, for instance) necessary to install UT on your tenshi:

            mkdir /home/guf/UT-tenshi
            cd /home/guf/UT-tenshi
            

            Get JBBgameich's halium-install script (latest version! it is now DEPRECATED my customized one). It will create a directory called halium-install.

            Fetching the official rootfs

            wget -c https://ci.ubports.com/job/xenial-rootfs-armhf/lastSuccessfulBuild/artifact/out/ubports-touch.rootfs-xenial-armhf.tar.gz
            

            Please, fetch halium-boot and system.img from my repository to $PROJECT_ROOT, too

            Then, let's start:
            Download TWPR from the following page: https://eu.dl.twrp.me/tenshi/twrp-3.3.1-0-tenshi.img.html
            Set developer mode and Unlock device: accordingly with https://wiki.lineageos.org/devices/tenshi/install#
            Connect your PC with tenshi using USB cable.
            From Android running (once a developer and enabled USB debugging:

            To reboot device to bootloader from PC terminal, run:

            adb reboot bootloader
            

            On bootloader, from terminal:

            sudo fastboot devices
            

            If it returns the serial number of your tenshi, then:

            sudo fastboot oem unlock
            

            Flashing TWPR into recovery

            sudo fastboot flash recovery twrp-3.3.1-0-$DEVICE.img
            

            Flashing halium-boot into the boot partition:

            sudo fastboot flash boot halium-boot.img
            
            sudo fastboot reboot
            

            Stop boot process to recovery by pushing Volume up and down at the black screen menu
            From within JBBgameich's halium-install directory:

            ./halium-install -v -p ut ../ubports-touch.rootfs-xenial-armhf.tar.gz ../system.img
            

            Manually insert password (for phablet) when asked

            If the process successfully end, you then can reboot to system from TWPR and enjoy UT on your device.

            Feel free to contact me in case of doubts.

            advocatuxA flohackF 2 Replies Last reply 21 Jul 2019, 14:39 Reply Quote 4
            • advocatuxA Offline
              advocatux @Guf
              last edited by advocatux 21 Jul 2019, 14:39

              @Guf thanks a million for your work!

              Just to be clear, when you say:

              Please, fetch halium-boot and system.img from my repository

              Can you paste the exact links for those packages? Thanks again !!

              Edit: I assume those links are these https://forums.ubports.com/post/21498 what I mean is that'd be nice if you include that info inside your how-to πŸ™‚

              1 Reply Last reply Reply Quote 1
              • InvyI Offline
                Invy
                last edited by 19 Dec 2019, 05:16

                Hello and thanks for the good work.
                I was able to install everything without any errors as described above. Unfortunately the phone gets stuck in the boot window after flashing with halium-install.

                1 Reply Last reply Reply Quote 0
                • C Offline
                  ComLarsic
                  last edited by ComLarsic 20 Dec 2019, 14:56

                  @Invy

                  i dont own the phone in quesion myself but i think this is normal with halium.
                  you have to give ubuntu touch the correct premissions.

                  you have to ssh or telnet into the phone and run these commands:

                  sudo mount -o remount,rw /
                  sudo -i # And enter your password
                  cat /var/lib/lxc/android/rootfs/ueventd*.rc|grep ^/dev|sed -e 's/^\/dev\///'|awk '{printf "ACTION==\"add\", KERNEL==\"%s\", OWNER=\"%s\", GROUP=\"%s\", MODE=\"%s\"\n",$1,$3,$4,$2}' | sed -e 's/\r//' >/usr/lib/lxc-android-config/70-[codename].rules
                  

                  and change the [codename] to your devices codename, then do a reboot.

                  As described in the docs:
                  https://docs.ubports.com/en/latest/porting/running-ut.html

                  1 Reply Last reply Reply Quote 1
                  • flohackF Offline
                    flohack @Guf
                    last edited by 20 Dec 2019, 22:22

                    @Guf I tried to follow those steps but what are you doing with that if statement there:

                    • The if statement does not work, you need blanks at the closing ] brace, otherwise bash breaks
                    • Why you need to use an if statement there, just tell people where to move the tar file
                    • Nandell told me the tar file is not available? Is it mandatory, how to get it?

                    If you want people to be able to follow that, it needs to be much clearer how to start. Also, why so many env variables? Thats confusing, just tell people which files to download from where into the same folder and then they should cd into that folder and run all commands form there.

                    My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                    G 1 Reply Last reply 27 Dec 2019, 22:14 Reply Quote 1
                    • G Offline
                      Guf @flohack
                      last edited by 27 Dec 2019, 22:14

                      @Flohack I updated the small guide since it used my old customized version of JBBgameich's halium-install. In the beginning, it was hard to fix ssh issues without personalized it, but now it works flawlessly.

                      flohackF 1 Reply Last reply 30 Dec 2019, 13:01 Reply Quote 0
                      • flohackF Offline
                        flohack @Guf
                        last edited by 30 Dec 2019, 13:01

                        @Guf Ok I will take a look. meanwhile, I see the post from @ComLarsic - did you not add the udev rules into the system.img? I can tell you how to do this really nicely. Also other configs, so people really only need to run halium-install and are done.

                        My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                        K 1 Reply Last reply 30 Dec 2019, 13:30 Reply Quote 0
                        • K Offline
                          keep37 @flohack
                          last edited by 30 Dec 2019, 13:30

                          @Flohack can you post here (ideally in the porting documentation) how to add udev rules and other configs in the system.img? I also need that for Redmi 4x (santoni).

                          C 1 Reply Last reply 30 Dec 2019, 15:51 Reply Quote 0
                          • C Offline
                            ComLarsic @keep37
                            last edited by ComLarsic 30 Dec 2019, 15:51

                            @keep37

                            i dont own the phone in quesion myself but i think this is normal with halium.
                            you have to give ubuntu touch the correct premissions.

                            you have to ssh or telnet into the phone and run these commands:

                            sudo mount -o remount,rw /
                            sudo -i # And enter your password
                            cat /var/lib/lxc/android/rootfs/ueventd*.rc|grep ^/dev|sed -e 's/^\/dev\///'|awk '{printf "ACTION==\"add\", KERNEL==\"%s\", OWNER=\"%s\", GROUP=\"%s\", MODE=\"%s\"\n",$1,$3,$4,$2}' | sed -e 's/\r//' >/usr/lib/lxc-android-config/70-[codename].rules
                            

                            and change the [codename] to your devices codename, then do a reboot.

                            As described in the docs:
                            https://docs.ubports.com/en/latest/porting/running-ut.html

                            I posted how to do it here ^^^

                            K flohackF 2 Replies Last reply 30 Dec 2019, 19:51 Reply Quote 0
                            • K Offline
                              keep37 @ComLarsic
                              last edited by 30 Dec 2019, 19:51

                              @ComLarsic I'm sorry I wasn't clear enough
                              I was asking a way to add the results of these commands in the system.img.
                              I thought it would be possible (and I think it is possible) to generate udev rules on the first installation and then copy the file somewhere in the build directory and integrate it into the build system so that it ends up in the system.img file.
                              So no need to execute these commands after every flash.

                              I assume that the rules for other devices found in /usr/lib/lxc-android-config/ come from the xenial rootfs.

                              C 1 Reply Last reply 30 Dec 2019, 20:19 Reply Quote 0
                              • C Offline
                                ComLarsic @keep37
                                last edited by 30 Dec 2019, 20:19

                                @keep37 maybe you could mount the system.img and run the command inside of the mountpoint?

                                flohackF 1 Reply Last reply 30 Dec 2019, 22:01 Reply Quote 0
                                • flohackF Offline
                                  flohack @ComLarsic
                                  last edited by 30 Dec 2019, 22:01

                                  @ComLarsic No this is not the right way to do this. It works like this:

                                  • Create a folder ubuntu in your device repo
                                  • Copy all relevant config files for your port there, in my case:
                                    ofono.override: Customizations for the ofono/RIL part
                                    70-hammerhead.rules: udev rules
                                    display.conf: Screen resolution settings
                                    config-default.xml: repowerd config
                                  • Open device.mk or similar file for your port
                                  • Add a section like this:
                                  # Ubuntu Touch
                                  PRODUCT_COPY_FILES += \
                                      $(LOCAL_PATH)/ubuntu/ofono.override:system/halium/etc/init/ofono.override \
                                      $(LOCAL_PATH)/ubuntu/70-hammerhead.rules:system/halium/lib/udev/rules.d/70-android.rules \
                                      $(LOCAL_PATH)/ubuntu/display.conf:system/halium/etc/ubuntu-touch-session.d/android.conf \
                                      $(LOCAL_PATH)/ubuntu/config-default.xml:system/halium/usr/share/repowerd/device-configs/config-default.xml
                                  

                                  You can also copy files into the system image if needed, firmware, startup scripts for Android init.rc - its very flexible.

                                  Note: Keep the names for those 4 files on the right side! They are overwriting existing files in the rootfs and its absolutely necessary to keep them like this, otherwise it wont work.

                                  You can add various files with this method. They will be dynamically mounted into the rootfs at boot time. Never touch the rootfs! It needs to stay clean for updates.

                                  My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                                  1 Reply Last reply Reply Quote 0
                                  • flohackF Offline
                                    flohack @ComLarsic
                                    last edited by 30 Dec 2019, 22:02

                                    @ComLarsic you posted a developers command from the docs, but thatΒ΄s not how it can be persisted correctly. Unfortunately our guide lacks a lot of informations.

                                    My languages: πŸ‡¦πŸ‡Ή πŸ‡©πŸ‡ͺ πŸ‡¬πŸ‡§ πŸ‡ΊπŸ‡Έ

                                    C 1 Reply Last reply 31 Dec 2019, 07:59 Reply Quote 0
                                    • C Offline
                                      ComLarsic @flohack
                                      last edited by 31 Dec 2019, 07:59

                                      @Flohack ah alright, sorry if i lead to any confusion. thanks for the help πŸ™‚

                                      1 Reply Last reply Reply Quote 0
                                      • InvyI Offline
                                        Invy
                                        last edited by 8 Jan 2020, 07:59

                                        Thanks for your help!
                                        In the meantime I was able to install UBports successfully with the new files.
                                        UBports runs really well on the Aquaris U Plus.
                                        After the standby, I always get the window with the selection to shutdown or restart, seems to be a bug.
                                        The media playback also works very bad.
                                        But otherwise I like this port very well.

                                        G 1 Reply Last reply 13 Jan 2020, 16:21 Reply Quote 0
                                        • G Offline
                                          Guf @Invy
                                          last edited by 13 Jan 2020, 16:21

                                          @Invy Still to fix audio and videoplayback, LEDs and compatibility with anbox, I know it. I hope to fix them ASAP.
                                          Regarding waking it up after standby, it might seems something recently introduced by some new package version, with new graphical version. Need to investigate about it, even though I doubt it is a bug.
                                          I keep on using tenshi as daily driver and it works fine

                                          1 Reply Last reply Reply Quote 0
                                          • InvyI Offline
                                            Invy
                                            last edited by 14 Jan 2020, 08:19

                                            With an anbox compatibility and without the bugs you mentioned, I would also use the phone as a daily driver. I'm available for testing or other support if I can help you with the development.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post