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

Bringing FP3 to the Ubports Installer

Scheduled Pinned Locked Moved Fairphone 3
21 Posts 5 Posters 4.3k Views 2 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.
    • L Offline
      Luksus
      last edited by 24 Jan 2021, 20:39

      I created a ubports-installer configuration file for the FP3, which can be tested locally.
      However, it is not working yet. It breaks the device slot (A/B), which is currently active and where the installer is doing its magic.
      As a result, the phone immediately falls back to the other slot, when booting the broken slot.

      I also encountered the same problem, when I tried to switch from the dev to the RC channel within System-Settings. In this case, the updater is downloading a full system image.
      So I believe, that the main-issue is not the installer-config but the fact, that a full system image gets installed by the recovery.

      So I am not shure how to proceed from here... OTA updates in general work, as long as they are "diff-updates".

      Perhaps someone has some suggestions, what is happening here.

      Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

      F 1 Reply Last reply 26 Jan 2021, 13:11 Reply Quote 0
      • K Offline
        Keneda
        last edited by 25 Jan 2021, 13:04

        Not any prog skill here, but FP3 in the installer would be great, so hope you'll have help to solve this.

        2015-2023 : Meizu MX4 ☠️⚰️✝️
        2023-2024 : Nexus 5 ☠️⚰️✝️
        2024-***** : FPOS Fairphone 5 waiting UT for freedom 😉
        🇲🇫🇬🇧

        1 Reply Last reply Reply Quote 0
        • F Offline
          fredldotme @Luksus
          last edited by 26 Jan 2021, 13:11

          @luksus How many tries does the bootloader give you until it falls back to the other slot? I have successfully enabled booting on an A/B device so I'm surprised it's not working.

          F 1 Reply Last reply 26 Jan 2021, 13:56 Reply Quote 0
          • F Offline
            flohack @fredldotme
            last edited by 26 Jan 2021, 13:56

            @fredldotme Did he maybe forget "mark boot as successful" patch?

            My languages: 🇦🇹 🇩🇪 🇬🇧 🇺🇸

            1 Reply Last reply Reply Quote 0
            • L Offline
              Luksus
              last edited by 26 Jan 2021, 14:10

              @fredldotme
              It reboots immediately (lets say half of a second since turning on) and already switched the slot, so that the second boot is working (on the other slot).

              @Flohack : Not sure wich patch you are referring to... But yesterday evening I encountered, that my system-updater-script indeed was missing some A/B script lines.

              I made a new build, but it was the same behavior as before. But maybe this was caused by a not up to date device tarball...

              Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

              F F 2 Replies Last reply 26 Jan 2021, 14:12 Reply Quote 0
              • F Offline
                flohack @Luksus
                last edited by 26 Jan 2021, 14:12

                @luksus See this commit, last files: https://github.com/Flohack74/android_device_google_wahoo/commit/b69b770da153b368a976d5666feff2ed1dca882c

                You basically need a job in the Android container that signals the bootloader: Ok this boot was successful.

                My languages: 🇦🇹 🇩🇪 🇬🇧 🇺🇸

                1 Reply Last reply Reply Quote 1
                • F Offline
                  fredldotme @Luksus
                  last edited by 26 Jan 2021, 16:40

                  @luksus What do you mean "your" system-image-upgrader, any reason not to use our regular recovery with it's upstream system-image-upgrader?

                  K 1 Reply Last reply 26 Jan 2021, 17:02 Reply Quote 0
                  • K Offline
                    Keneda @fredldotme
                    last edited by 26 Jan 2021, 17:02

                    @fredldotme
                    He said "my system-updater-script", not "system-image-upgrader", or i missed something?

                    2015-2023 : Meizu MX4 ☠️⚰️✝️
                    2023-2024 : Nexus 5 ☠️⚰️✝️
                    2024-***** : FPOS Fairphone 5 waiting UT for freedom 😉
                    🇲🇫🇬🇧

                    L 1 Reply Last reply 26 Jan 2021, 18:23 Reply Quote 0
                    • L Offline
                      Luksus @Keneda
                      last edited by 26 Jan 2021, 18:23

                      @keneda @fredldotme : sorry for the confusion.
                      I was indeed talking of the "system-image-upgrader" script.

                      But somehow I got an outdated version, there were some lines missing.
                      See: https://gitlab.com/ubports/community-ports/android9/fairphone-3/fairphone-fp3/-/commit/d0ff22967525dc3f434d156dcc315e88eac9a810#8127353120ea022e70e597a4db201595406c862e

                      Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                      1 Reply Last reply Reply Quote 0
                      • L Offline
                        Luksus
                        last edited by 26 Jan 2021, 18:37

                        So I just switched from dev to rc channel (in system settigs) and let the phone reboot and install, but it is still the same issue, also with the fix of system-image-upgrader. 😞

                        Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                        F 1 Reply Last reply 26 Jan 2021, 19:18 Reply Quote 0
                        • F Offline
                          fredldotme @Luksus
                          last edited by 26 Jan 2021, 19:18

                          @luksus possibly need to set the bootctl flag from within the recovery too? It would need a few components not shipped by default in the recovery though.

                          L 1 Reply Last reply 26 Jan 2021, 19:24 Reply Quote 0
                          • L Offline
                            Luksus @fredldotme
                            last edited by Luksus 26 Jan 2021, 19:24

                            @fredldotme what I don't understand, what is different here from a diff-update (OTA) which is working.
                            And also the strange fact, that flashing the stock system-image and after it my ubports system image fixes the issue. I mean both images are overriding the system partition, but only flashig the ubports system image again isnot enough.

                            What is so special about the stock image?

                            Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                            1 Reply Last reply Reply Quote 0
                            • L Offline
                              Luksus
                              last edited by 16 Feb 2021, 19:50

                              Hi again,
                              could someone tell me, if that ubuntu-updater.log looks as expected?

                              root@FP3:/ # cat /cache/ubuntu_updater.log                                                                           
                              Loading keyring: archive-master.tar.xz
                              A/B slot system detected! Slot suffix is _b
                              Formating: system
                              system partition: /dev/block/bootdevice/by-name/system_b
                              umount: /system_root: Invalid argument
                              mke2fs 1.43.3 (04-Sep-2016)
                              Discarding device blocks: done                            
                              Creating filesystem with 786432 4k blocks and 196608 inodes
                              Filesystem UUID: c69adf87-fcbb-4cfd-9694-e76bed943e8d
                              Superblock backups stored on blocks: 
                              	32768, 98304, 163840, 229376, 294912
                              
                              Allocating group tables: done                            
                              Writing inode tables: done                            
                              Creating journal (16384 blocks): done
                              Writing superblocks and filesystem accounting information: done 
                              
                              Loading keyring: image-master.tar.xz
                              Loading keyring: image-signing.tar.xz
                              umount: /dev/block/mmcblk0p31: Invalid argument
                              umount: /cache/system: Invalid argument
                              umount: /system_root: Invalid argument
                              e2fsck 1.43.3 (04-Sep-2016)
                              Pass 1: Checking inodes, blocks, and sizes
                              Pass 2: Checking directory structure
                              Pass 3: Checking directory connectivity
                              Pass 4: Checking reference counts
                              Pass 5: Checking group summary information
                              /dev/block/bootdevice/by-name/system_b: 11/196608 files (0.0% non-contiguous), 29884/786432 blocks
                              Applying update: ubports-345e286684f401e201b71f66e70d2745ac0e54e131a4e9e575d8490fea83e687.tar.xz
                              mv: bad 'data/*': No such file or directory
                              Applying update: device-577af01d6b138075ac0a105109e228004712d5a7f9daaae3322a1feb61213036.tar.xz
                              mv: bad 'data/*': No such file or directory
                              Applying update: boot-c11b3194655f04c18c04bbe40983921c29ede3e72766ebf611c781d352229fef.tar.xz
                              mv: bad 'data/*': No such file or directory
                              Flashing boot at /dev/block/bootdevice/by-name/boot_b
                              Applying update: keyring-4c4e7ef380ebcfa2c31084efa199138e93bfed8fc58aa3eb06bdf75a78af9b57.tar.xz
                              mv: bad 'data/*': No such file or directory
                              Applying update: version-162.tar.xz
                              mv: bad 'data/*': No such file or directory
                              root@FP3:/ # 
                              

                              Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                              F 1 Reply Last reply 18 Feb 2021, 08:45 Reply Quote 0
                              • F Offline
                                flohack @Luksus
                                last edited by 18 Feb 2021, 08:45

                                @luksus not sure whats up with data... Are you sure its mounted correctly in recovery?

                                My languages: 🇦🇹 🇩🇪 🇬🇧 🇺🇸

                                L 1 Reply Last reply 18 Feb 2021, 08:54 Reply Quote 0
                                • L Offline
                                  Luksus @flohack
                                  last edited by Luksus 18 Feb 2021, 08:54

                                  @flohack userdata does not seem to be mounted correctly as it does not show any content, when I do ls data.

                                  But I am not sure, if that is really the issue, because I got the same lines with an incremental update, which is working fine.

                                  The only difference, as far as I can see, is the previously formatting of the system partition on a full update.
                                  And perhaps that is leading again to the bootctl flag, which you already mentioned and which must be set.

                                  Edit:
                                  But data is mountable. If I do mount -a then data gets mounted correctly.

                                  Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                                  F 1 Reply Last reply 18 Feb 2021, 09:14 Reply Quote 0
                                  • F Offline
                                    flohack @Luksus
                                    last edited by 18 Feb 2021, 09:14

                                    @luksus Ok I think the upgrader mounts data partition to be sure, but we would need to check still why this error appears, it feels wrong 😉

                                    My languages: 🇦🇹 🇩🇪 🇬🇧 🇺🇸

                                    1 Reply Last reply Reply Quote 0
                                    • L Offline
                                      Luksus
                                      last edited by Luksus 18 Feb 2021, 19:48

                                      So it turns out, that the issue is caused by the formatting of the system partition.
                                      If I execute mkfs.ext4 /dev/block/bootdevice/by-name/system_b manually from within recovery, the next boot fails.

                                      Which sets this values (slot b):

                                      (bootloader) slot-count:2
                                      (bootloader) slot-retry-count:b:0
                                      (bootloader) slot-success:b:No
                                      (bootloader) slot-active:b:No
                                      (bootloader) slot-unbootable:b:Yes
                                      (bootloader) slot-retry-count:a:6
                                      (bootloader) slot-success:a:No
                                      (bootloader) slot-active:a:Yes
                                      (bootloader) slot-unbootable:a:No
                                      

                                      It is not needed to have a slot-success, to get a successful boot, for example I could boot slot a successfully afterwards, though it had no slot-success previously.

                                      Setting slot b active again, resets the slot-retry-count:b to 7 and slot-unbootable:b to No
                                      Therefor I don't think, that marking the slot as boot-successful will make a difference.

                                      So perhaps formatting with mkfs.ext4 breaks some kind of partition table or something similar?

                                      Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                                      F 1 Reply Last reply 18 Feb 2021, 21:28 Reply Quote 0
                                      • F Offline
                                        flohack @Luksus
                                        last edited by 18 Feb 2021, 21:28

                                        @luksus You need to enter a job into Ubuntu Touch to mark the boot as successful, did you do that?
                                        Otherwise every 2 or 3 boots the slot will change

                                        My languages: 🇦🇹 🇩🇪 🇬🇧 🇺🇸

                                        L 1 Reply Last reply 18 Feb 2021, 21:32 Reply Quote 0
                                        • L Offline
                                          Luksus @flohack
                                          last edited by Luksus 18 Feb 2021, 21:32

                                          @flohack not actively, but slot a (where I always keep a working ubports) for example gets a slot-success after I booted UT on it. So somehow it seems to be set.
                                          I am using the device daily for some month now and did not have unwanted slot-switches.

                                          Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                                          1 Reply Last reply Reply Quote 0
                                          • L Offline
                                            Luksus @Janez
                                            last edited by 18 Jan 2023, 21:02

                                            @janez said in Bringing FP3 to the Ubports Installer:

                                            Even with stock FPOS the installer (appimage) did not recognize connected phone. I had to reboot it manually to bootloader.

                                            Did you activate adb debugging in developer settings before?

                                            Devices: BQ e4.5, Fairphone 2, Fairphone 3, Lenovo X605F, Pinephone, Moto Z2 Force, OnePlus5T

                                            J 1 Reply Last reply 20 Jan 2023, 10:01 Reply Quote -1
                                            • First post
                                              Last post