Custom Anbox installation files & patches, including patched Android OS image file.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.6 KiB

4 years ago
  1. post_install() {
  2. post_upgrade
  3. }
  4. post_upgrade() {
  5. # Provided by anbox-modules-dkms-git
  6. modprobe binder_linux ashmem_linux
  7. # Required by Anbox network bridge
  8. systemctl restart systemd-networkd
  9. systemctl enable lxc.service
  10. systemctl start lxc.service
  11. systemctl enable anbox-container-manager.service
  12. systemctl start anbox-container-manager.service
  13. echo "
  14. Add the following lines to /etc/subuid and /etc/subgid:
  15. root:100000:65536
  16. root:1000:2
  17. root:101001:99999
  18. This ensures that Android LXC container user & group mappings are isolated
  19. from the main OS.
  20. Enable Anbox to the current user by issuing:
  21. systemctl --user enable anbox-session-manager.service
  22. systemctl --user start anbox-session-manager.service
  23. - You must have kernel modules 'binder_linux' and 'ashmem_linux' enabled and in-use (provided by anbox-modules-dkms-git)
  24. - You must have proper 'android.img' Android image file for Anbox container manager system service (provided by anbox-image)
  25. - Default location: /var/lib/anbox/android.img
  26. - You find logs at /var/lib/anbox/logs/ folder for debugging
  27. - Also consider running Anbox managers with env var ANBOX_LOG_LEVEL=debug
  28. "
  29. }
  30. post_remove() {
  31. # Ensure Anbox network bridge is removed
  32. systemctl restart systemd-networkd
  33. # Delete LXC user & group mappings
  34. for file in subuid subgid; do
  35. sed -i 's/root:100000:65536//; s/root:1000:2//; s/root:101001:99999//' /etc/${file}
  36. done
  37. systemctl restart lxc.service
  38. echo "
  39. LXC service is still running. You may want to disable it by issuing
  40. sudo systemctl stop lxc.service && sudo systemctl disable lxc.service
  41. "
  42. }