Inject custom content described in a manifest into waydroid's data.
- No need to modify
system.img
orvendor.img
to inject your content.
-
Python >= 3.12
-
Waydroid with overlay enabled
-
Root privilege
Check waydroid
section for key mount_overlays
in /var/lib/waydroid/waydroid.cfg
.
Most of newly initialized installations of waydroid should have enabled this automatically.
Remove /var/lib/waydroid
and init waydroid again if not enabled.
Note
Removing /var/lib/waydroid
and initializing waydroid again should not destroy your user data.
As it is usually storaged at ${XDG_DATA_HOME:-$HOME/.local/share}/waydroid/data
.
-
Insall pdm. See here if you need help.
-
Install dependencies. Run
pdm install
to install them. If you need to run tests, runpdm install --dev
instead. -
Build. Run
pdm build
in the repository. -
Get wheel. Go to
dist
folder and you will find wheel file.
This is optional, run pdm run pytest
and we will check code with tests defined in tests folder and ruff.
You need to run pdm install --dev
in Step 2 of Build to install extra dependencies required by testing.
After you Installed this package, you will find a new command waydroid-injector
available in your PATH
.
You can also choose to run this project directly, running directly does not need install wheel, but this is just for test purpose.
If you still need run this project directly, simply run pdm run waydroid-injector
should be fine.
$ pdm run waydroid-injector --help
usage: waydroid-injector [-h] [-v] [-d] [-e] [-s DESTDIR] {install,uninstall} ...
Inject custom content described in a manifest into waydroid's data.
options:
-h, --help show this help message and exit
-v, --version show program's version number and exit
-d, --dry-run install contents into ./slash directory.
-e, --debug enable debug mode.
-s DESTDIR, --destdir DESTDIR
destination to rootfs.
operations:
available operations:
{install,uninstall}
install Install the manifest into waydroid's data.
uninstall Uninstall the manifest from waydroid's data.
- This script does not record which manifest the file belongs to, for example, if you have installed
manifest-a.toml
andmanifest-b.toml
, both of them have a/var/lib/waydroid/overlay/example.file
in contents, after you installedmanifest-b.toml
, the file created bymanifest-a.toml
will be replaced with the one frommanifest-b.toml
. If you uninstallmanifest-a.toml
after this, the file created bymanifest-b.toml
will also be removed.