ใช้ปลาหมึกที่มีขนาดหน้า 16KB บน ARM64

หน้านี้แสดงวิธีการสร้างและเริ่ม Cuttlefish ด้วยการสนับสนุนขนาดหน้า 16KB บน ARM64 คำแนะนำในหน้านี้ถือว่ามีการติดตั้ง Cuttlefish ในเครื่องของคุณแล้ว สำหรับคำแนะนำในการติดตั้ง โปรดดู ที่ ติดตั้ง 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_arm64_phone_pgagnostic-trunk-userdebug
$ m

# Launch cf with a kernel with 16KB 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_arm64_pgagnostic:/ #
    
  2. ตรวจสอบขนาดหน้าและสถานะการบูต:

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

ใช้ปลาหมึกกับเคอร์เนลขนาดหน้า 16KB แบบกำหนดเอง

หากต้องการใช้เคอร์เนลแบบกำหนดเอง แทนเคอร์เนลที่สร้างไว้ล่วงหน้า:

  1. สร้างไดเร็กทอรี repo สำหรับเคอร์เนลทั่วไปของ Android และซิงค์ไดเร็กทอรี:

    $ mkdir common-android14-6.1 && cd common-android14-6.1
    $ repo init -u https://android.googlesource.com/kernel/manifest -b common-android14-6.1
    $ repo sync -c -j$(nproc)
    
  2. สร้างเคอร์เนลขนาดหน้า 16KB:

    $ tools/bazel run --lto=none //common:kernel_aarch64_16k_dist
    $ tools/bazel run --lto=none //common-modules/virtual-device:virtual_device_aarch64_16k_dist -- \
        --dist_dir=out/android14-6.1/dist
    
  3. ตรวจสอบว่าบิลด์ดำเนินการสำเร็จ:

    # Generated files
    $ ls out/android14-6.1/dist/Image
    $ ls out/android14-6.1/dist/initramfs.img
    

เริ่ม Cuttlefish ด้วยเคอร์เนลขนาดหน้า 16KB ที่กำหนดเอง

วิธีใช้เคอร์เนลที่สร้างขึ้นใหม่ใน Cuttlefish:

$ launch_cvd -kernel_path ~/common-android14-6.1/out/android14-6.1/dist/Image \
      -initramfs_path ~/common-android14-6.1/out/android14-6.1/dist/initramfs.img \
      --resume=false --userdata_format=ext4 \
      --data_policy=always_create --blank_data_image_mb=8000
      -userdata_format=ext4