为 Ubuntu Touch 20.04 更新移植¶
Ubuntu Touch 20.04引进了许多底层修改,这需要移植者相应修改这个文档的目的是作为一个概述关于如何使你的移植上运行Ubuntu Touch 20.04。但是,每个移植都是不同的,可能需要比这个文档概述更多的内容。我们将在 UBports 移植 Telegram 群组 中回答过程中可能出现的任何问题。
对于基于 GitLab CI 的移植: 检查在安卓分区内的覆盖文件¶
许多移植会覆盖 Android 分区中的文件,以使移植正常工作。这通常是通过覆盖 mount-android.conf Upstart 任务来实现的,要么包含代码本身,要么调用另一个脚本。由于 Ubuntu Touch 20.04 不再使用 Upstart(见下文),代码将不再运行。如果您的移植将覆盖文件存放在 /opt/halium-overlay 或 /usr/share/halium-overlay ,新的覆盖系统会自动处理这些文件,只是在添加新文件时需要 .halium-overlay-dir (请参阅 Overlay file method)。
或者,您也可以考虑完全迁移您的移植,使用 overlaystore 系统。不过迁移并不简单,而且会导致您的移植与 16.04 不兼容(除非您有其他分支)。请联系 UBports 移植小组的 @peat-psuwit 以获取更多信息。
基于Halium 7 或更旧版本的移植: 更新 bluetooth-touch 脚本¶
bluetooth-touch 脚本过去的工作方式与 Upstart 有内在联系。在 Ubuntu Touch 20.04 中,bluetooth-touch 被迁移到使用 Systemd。因此,你必须覆盖 /usr/share/bluetooth-touch/android.sh,而不是覆盖 bluetooth-touch-android.conf Upstart 任务。请注意,脚本将由 /bin/sh 运行,因此请避免使用 Bash-ism
Halium 9 移植不需要这样做,因为 Bluebinder 直接与 HIDL 服务对话,提供蓝牙主机接口,从而取代了 bluetooth-touch。
对于所有移植: 配置usb-moded¶
usb-moded 代替 setupusb 脚本设置和管理 USB 模式。我们为此专门编写了一个页面。请参阅 Configuring usb-moded。
对于所有移植: 检查自定义 Upstart 任务¶
Some ports has custom Upstart jobs to do certain things on boot. Those jobs has to be converted to Systemd units in order to run at all in Ubuntu Touch 20.04. One may find Ubuntu’s guide on this topic <https://wiki.ubuntu.com/SystemdForUpstartUsers#Job_vs._unit_keywords> useful.
或者,与其编写自定义 Systemd 单元,不如使用 devicehack 脚本,它将在 Android 容器运行后的每次启动时运行。路径为 /usr/libexec/lxc-android-config/device-hacks,脚本将使用 /bin/sh 运行。