在 x86_64 上使用 16 KB 頁面大小模擬 Cuttlefish

這項設定需要 x86_64 Linux 主機,本頁面說明如何建構 透過 x86_64 支援 16 KB 頁面大小的 Cuttlefish。有關 此頁面假設您已在機器中安裝 Cuttlefish 套件。適用對象 安裝操作說明,請參閱「安裝 Cuttlefish」的步驟 1。

您可以直接從 Android 持續整合服務下載預先建構的構件,藉此啟動 Cuttlefish 如需修改原始碼,或透過 Android 開放原始碼計畫建立 SDK 再也不是件繁重乏味的工作

下載構件即可啟動 Cuttlefish

前往 Android 持續整合網站, 輸入 aosp-main-throttled 做為分支版本名稱。點選最新版本的 aosp_cf_x86_64_phone_pgagnostic目標。接著,按照 第 5 頁的「Install Cuttlefish」

透過 Android 開放原始碼計畫建構 Cuttlefish

建構並啟動 Cuttlefish 是設定跨頁面目標:

$ mkdir main && cd main
$ repo init -u https://android.googlesource.com/platform/manifest -b main
$ repo sync -c -j32

# Build cf agnostic target.
$ source build/envsetup.sh
$ lunch aosp_cf_x86_64_phone_pgagnostic-trunk_staging-userdebug
$ m

# Launch cf with a kernel with 16 KB page size support.
$ launch_cvd
...
...
VIRTUAL_DEVICE_DISPLAY_POWER_MODE_CHANGED
virtio_input_hid_handle_status: unknown type 20
virtio_input_hid_handle_status: unknown type 20
virtio_input_hid_handle_status: unknown type 20
virtio_input_hid_handle_status: unknown type 20
Generating new secret with slot ID: 4
VIRTUAL_DEVICE_BOOT_STARTED
VIRTUAL_DEVICE_NETWORK_MOBILE_CONNECTED

驗證頁面大小和啟動

如何驗證頁面大小和開機狀態:

  1. 以根權限存取殼層:

    $ adb root
    adbd is already running as root
    $ adb shell
    vsoc_x86_64_pgagnostic:/ #
    
  2. 驗證頁面大小和啟動狀態:

    vsoc_x86_64_pgagnostic::/ # getconf PAGE_SIZE
    16384
    vsoc_x86_64_pgagnostic::/ # getprop | grep sys.boot.completed
    sys.boot_completed: 1