我想在 ubuntu 18.04 上使用 qemu 和 kvm 在我的 Jetson nano(arm64)之上正确虚拟化 Android 10。这是我正在关注的教程:
https://github.com/antmicro/kvm-aosp-jetson-nano
一切顺利,直到这个命令:
sudo rsync -avxHAX system-r{o,w}/
有些东西不好,因为当我将文件和权限从源路径传输到目标路径时出现很多错误(两者都在同一个磁盘和同一个 ext4 分区上。您可以在此处查看带有错误的完整日志:
https://pastebin.ubuntu.com/p/W9GjPCt8G4/
这些错误的后果是,当我尝试像这样使用 qemu 模拟 android 时:
qemu-system-aarch64 \
-enable-kvm \
-smp 4 \
-m 2048 \
-cpu host \
-M virt \
-device virtio-gpu-pci \
-device usb-ehci \
-device usb-kbd \
-device virtio-tablet-pci \
-usb \
-serial stdio \
-display sdl,gl=on \
-kernel aosp/Image \
-initrd aosp/ramdisk.img \
-drive index=0,if=none,id=system,file=aosp/system.img \
-device virtio-blk-pci,drive=system \
-drive index=1,if=none,id=vendor,file=aosp/vendor.img \
-device virtio-blk-pci,drive=vendor \
-drive index=2,if=none,id=userdata,file=aosp/userdata.img \
-device virtio-blk-pci,drive=userdata \
-full-screen \
-append "console=ttyAMA0,38400 earlycon=pl011,0x09000000 drm.debug=0x0 rootwait rootdelay=5 androidboot.hardware=ranchu androidboot.selinux=permissive security=selinux selinux=1 androidboot.qemu.hw.mainkeys=0 androidboot.lcd.density=160"
这是我得到的错误:
[ 2.532754] init: init first stage started!
[ 2.535936] init: [libfs_mgr]ReadFstabFromDt(): failed to read fstab from dt
[ 2.540632] init: [libfs_mgr]ReadDefaultFstab(): failed to find device default fstab
[ 2.546246] init: Failed to fstab for first stage mount
[ 2.549616] init: Using Android DT directory /proc/device-tree/firmware/android/
[ 2.555116] init: [libfs_mgr]ReadDefaultFstab(): failed to find device default fstab
[ 2.560762] init: First stage mount skipped (missing/incompatible/empty fstab in device tree)
[ 2.566906] init: Skipped setting INIT_AVB_VERSION (not in recovery mode)
[ 2.571227] init: execv("/system/bin/init") failed: No such file or directory
[ 2.593768] init: #00 pc 00000000000e90a0 /init
[ 2.599958] reboot: Restarting system with command 'bootloader'
我刚刚编辑了我的 /etc/fstab 文件,如下所示:
UUID=84d024e0-c8c7-42c0-ad3e-c3e0c1cacdb7 / ext4 acl,user_xattr,noatime,errors=remount-ro 0 1
也像这样:
UUID=84d024e0-c8c7-42c0-ad3e-c3e0c1cacdb7 / ext4 defaults,acl,user_xattr,noatime,errors=remount-ro 0 1
但错误仍然存在:
sending incremental file list
rsync: [generator] failed to set permissions on "/home/ziomario/Scrivania/antmicro/aosp_images/system-rw/bin": Operation not supported (95)
rsync: [generator] failed to set permissions on "/home/ziomario/Scrivania/antmicro/aosp_images/system-rw/bugreports": Operation not supported (95)
rsync: [generator] failed to set permissions on "/home/ziomario/Scrivania/antmicro/aosp_images/system-rw/charger": Operation not supported (95)
rsync: [generator] failed to set permissions on "/home/ziomario/Scrivania/antmicro/aosp_images/system-rw/d": Operation not supported (95)
.....
rsync: [generator] failed to set permissions on "/home/ziomario/Scrivania/antmicro/aosp_images/system-rw/system/usr/icu": Operation not supported (95)
sent 109,493 bytes received 1,223 bytes 221,432.00 bytes/sec
total size is 1,354,488,586 speedup is 12,233.90
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1330) [sender=3.2.3]
这也很有趣:
root@Z390-AORUS-PRO:/home/ziomario/Scrivania/antmicro/aosp_images# sudo mount -o remount,acl /
root@Z390-AORUS-PRO:/home/ziomario/Scrivania/antmicro/aosp_images# sudo rsync -avxHAX system-r{o,w}/
sending incremental file list
rsync: [generator] failed to set permissions on "/home/ziomario/Scrivania/antmicro/aosp_images/system-rw/bin": Operation not supported (95)
rsync: [generator] failed to set permissions on "/home/ziomario/Scrivania/antmicro/aosp_images/system-rw/bugreports": Operation not supported (95)
rsync: [generator] failed to set permissions on "/home/ziomario/Scrivania/antmicro/aosp_images/system-rw/charger": Operation not supported (95)
等等。
有人知道为什么我会收到这些错误,我该如何解决?谢谢。