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

feat: support waydroid #687

Merged
merged 3 commits into from
Feb 16, 2024
Merged

feat: support waydroid #687

merged 3 commits into from
Feb 16, 2024

Conversation

SteveLauC
Copy link
Member

Standards checklist:

  • The PR title is descriptive.
  • I have read CONTRIBUTING.md
  • The code compiles (cargo build)
  • The code passes rustfmt (cargo fmt)
  • The code passes clippy (cargo clippy)
  • The code passes tests (cargo test)
  • Optional: I have tested the code myself

For new steps

  • Optional: Topgrade skips this step where needed
  • Optional: The --dry-run option works with this step
  • Optional: The --yes option works with this step if it is supported by
    the underlying command

If you developed a feature or a bug fix for someone else and you do not have the
means to test it, please tag this person here.

What does this PR do

Support a new step Waydroid, closes #684.

@SteveLauC
Copy link
Member Author

Here is a build for x86_64-unknown-linux-musl, @w568w, welcome to give it a test:

  1. The --dry-run option works with this step:

    $ ./topgrade --only waydroid --dry-run
  2. The --yes option works with this step:

    1. Make sure the container is running, then

      You should not enable assume yes in your config file

      $ ./topgrade --only waydroid

      You should receive a prompt asking if you want to do the update:

      Going to execute waydroid update, which would STOP the running container, is this ok?

    2. Make sure the container is running, and the --yes option is passed (or it is enabled in your config file):

      $ ./topgrade --only waydroid --yes

      That prompt should not appear.

@w568w
Copy link

w568w commented Feb 15, 2024

Thanks for your work!

Container detection works well, but I think you need root access to run # waydroid upgrade, as I stated in #684:

$ ./topgrade --only waydroid 

── 21:56:36 - Sudo ─────────────────────────────────────────────────────────────
Going to execute `waydroid update`, which would STOP the running container, is this ok? (y)es/(N)o y
── 21:56:42 - Waydroid ─────────────────────────────────────────────────────────
[21:56:43] ERROR: Action "upgrade" needs root access
[21:56:43] See also: <https://github.com/waydroid>
Run 'waydroid log' for details.
Waydroid failed: 
   0: Command failed: `/usr/bin/waydroid upgrade`
   1: `/usr/bin/waydroid` failed: exit status: 1

Location:
   src/steps/os/linux.rs:1060
Retry? (y)es/(N)o/(s)hell/(q)uit

Edit: Also, there is a typo in message Going to execute waydroid update..., which should be waydroid upgrade.

@SteveLauC
Copy link
Member Author

  1. you need root access to run # waydroid upgrade
  2. there is a typo in message Going to execute waydroid update..., which should be waydroid upgrade.

They are fixed, and I adjusted the location of the separator so that the prompt won't be printed before it:

Going to execute waydroid update, which would STOP the running container, is this ok? (y)es/(N)o y
── 21:56:42 - Waydroid ─────────────────────────────────────────────────────────


Binary updated, welcome to give it another try.

@w568w
Copy link

w568w commented Feb 16, 2024

Confirmed that it works. Thanks!

With container running:

$ ./topgrade --only waydroid
── 10:27:23 - Sudo ─────────────────────────────────────────────────────────────

── 10:27:26 - Waydroid ─────────────────────────────────────────────────────────
Going to execute `waydroid upgrade`, which would STOP the running container, is this ok? (y)es/(N)o [y] [10:27:35] Stopping container
[10:28:22] Downloading https://sourceforge.net/projects/waydroid/files/images/system/lineage/waydroid_x86_64/lineage-18.1-20240210-VANILLA-waydroid_x86_64-system.zip/download

[^C]

With container stopped:

$ ./topgrade --only waydroid
── 10:30:25 - Sudo ─────────────────────────────────────────────────────────────

── 10:30:25 - Waydroid ─────────────────────────────────────────────────────────
[10:30:26] Stopping container
[10:30:32] Downloading https://sourceforge.net/projects/waydroid/files/images/system/lineage/waydroid_x86_64/lineage-18.1-20240210-VANILLA-waydroid_x86_64-system.zip/download
[Downloading] 769.39 MB/769.43 MB     2903.3 kbps(approx.)[10:35:49] Validating system image
[10:35:50] Extracting to /var/lib/waydroid/images
[10:38:13] Downloading https://sourceforge.net/projects/waydroid/files/images/vendor/waydroid_x86_64/lineage-18.1-20240210-MAINLINE-waydroid_x86_64-vendor.zip/download
[Downloading] 180.62 MB/180.62 MB    11439.41 kbps(approx.)[10:41:15] Validating vendor image
[10:41:15] Extracting to /var/lib/waydroid/images
 
── 10:41:18 - Summary ──────────────────────────────────────────────────────────
Waydroid: OK

@SteveLauC SteveLauC merged commit 7a3f3a8 into topgrade-rs:main Feb 16, 2024
9 checks passed
@SteveLauC SteveLauC deleted the feat/waydroid branch February 16, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for waydroid's image upgrade
2 participants