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

Ensure recovery supports installing Ubuntu Touch #2505

Closed
amartinz opened this issue Mar 16, 2022 · 5 comments · Fixed by #2529
Closed

Ensure recovery supports installing Ubuntu Touch #2505

amartinz opened this issue Mar 16, 2022 · 5 comments · Fixed by #2529
Assignees
Labels
enhancement a new feature or an improvement of existing functionality

Comments

@amartinz
Copy link
Member

See: ubports/halium_bootable_recovery#22

@NeoTheThird NeoTheThird added the enhancement a new feature or an improvement of existing functionality label Mar 17, 2022
@NeoTheThird
Copy link
Member

recoveries are updated over systemimage, right? so we can assume it to be there after the next ota? we'll probably also have to update some configs (eg https://github.com/ubports/installer-configs/blob/master/v2/devices/FP2.yml#L48) to make sure we're downloading the right version.

@amartinz
Copy link
Member Author

this depends on the device.

what do you think about adding a new method to call in the installer config to verify recovery?
devices with supported recovery could then opt-in to check recovery.

until most devices are updated and we can move the check to be opt-out.

@NeoTheThird
Copy link
Member

Some prerequisites for this in ubports/promise-android-tools#61.

Making it opt-in during the rollout is a good idea. I can imagine two ways this could be done.

a) The systemimage:install step could be given an optional verify_recovery property, which could trigger a global handler

      - actions:
          - systemimage:install:
                verify_recovery: true

b) A special systemimage:assert_capable_recovery step or generic adb:assert_prop step

      - actions:
          - adb:assert_prop:
              property: "ro.ubuntu.recovery"
              value: "true"
          - systemimage:assert_capable_recovery:
        fallback:
          - <steps needed to install a capable recovery>

@amartinz
Copy link
Member Author

i really like the potential scaling and possibilities of an assert_prop call.
something like this would be really useful, especially if extented a bit, like being able to check if:

  • equal (every type, also allows for checking if empty)
  • greater than (numeric)
  • less than (numeric)
  • starts with
  • ends with
  • contains

then it we can also reuse that to also implement a), which does the ro.ubuntu.recovery check under the hood.

@NeoTheThird
Copy link
Member

i think we should be able to implement regex support there, that way all of those things could be done! Also, very good point, it doesn't have to be one or the other! the systemimage step is already implemented as a sort of meta-step that just "creates" steps to be executed by other plugins, so the actual logic does not need to be duplicated. kinda excited about the possibilities of this :]

@NeoTheThird NeoTheThird self-assigned this Mar 23, 2022
NeoTheThird added a commit that referenced this issue Mar 23, 2022
```yml
      - actions:
          - adb:assert_prop:
              prop: "ro.ubuntu.recovery"
              value: "true"
      - actions:
          - fastboot:assert_var:
              variable: "ro.ubuntu.recovery"
              value: "true"
```
NeoTheThird added a commit to ubports/installer-configs that referenced this issue Mar 24, 2022
Required for ubports/ubports-installer#2505.

Example:
```yml
        - adb:assert_prop:
            prop: "ro.ubuntu.recovery"
            value: "true"
        - fastboot:assert_var:
            variable: "ro.ubuntu.recovery"
            value: "true"
        - adb:assert_prop:
            prop: "ro.ubuntu.recovery"
            regex:
              pattern: "true"
              flags: "i"
        - fastboot:assert_var:
            variable: "ro.ubuntu.recovery"
            regex:
              pattern: "true"
              flags: "i"
        - systemimage:install:
              verify_recovery: true
```
NeoTheThird added a commit that referenced this issue Mar 24, 2022
Add fastboot:assert_var and adb:assert_prop actions for #2505
llewelld pushed a commit to llewelld/ubports-installer that referenced this issue Apr 26, 2022
```yml
      - actions:
          - adb:assert_prop:
              prop: "ro.ubuntu.recovery"
              value: "true"
      - actions:
          - fastboot:assert_var:
              variable: "ro.ubuntu.recovery"
              value: "true"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement a new feature or an improvement of existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants