From 3cf7441dbe494d1a152bf2dc6b0d6d3b2d6efc1b Mon Sep 17 00:00:00 2001 From: Yahan Zhou Date: Fri, 21 Apr 2017 12:14:44 -0700 Subject: [PATCH 1/8] Build vendor image for emulator BUG: 37511975 Test: lunch sdk_gphone_x86-user, make with dist option, unzip sdk_gphone_x86-emulator-eng.xxxx.zip to system image folder, emulator can boot Change-Id: I75b9f0de17fece3dec5ae1662400808af321bd4d Merged-In: I75b9f0de17fece3dec5ae1662400808af321bd4d --- core/Makefile | 3 ++- target/board/generic/BoardConfig.mk | 5 +++++ target/board/generic_arm64/BoardConfig.mk | 5 +++++ target/board/generic_mips/BoardConfig.mk | 5 +++++ target/board/generic_mips64/BoardConfig.mk | 5 +++++ target/board/generic_x86/BoardConfig.mk | 5 +++++ target/board/generic_x86_64/BoardConfig.mk | 5 +++++ 7 files changed, 32 insertions(+), 1 deletion(-) diff --git a/core/Makefile b/core/Makefile index e0d02340e..889dbd1eb 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2761,7 +2761,8 @@ INTERNAL_EMULATOR_PACKAGE_FILES += \ prebuilts/qemu-kernel/$(TARGET_ARCH)/kernel-qemu \ $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_SYSTEMIMAGE) \ - $(INSTALLED_USERDATAIMAGE_TARGET) + $(INSTALLED_USERDATAIMAGE_TARGET) \ + $(INSTALLED_VENDORIMAGE_TARGET) name := $(TARGET_PRODUCT)-emulator-$(FILE_NAME_TAG) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 6267031ab..0a1531a63 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -51,6 +51,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 # 2 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index e6d741a6e..6d5ae5190 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -82,6 +82,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 # 2.5 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk index be9899861..87b1f0eea 100644 --- a/target/board/generic_mips/BoardConfig.mk +++ b/target/board/generic_mips/BoardConfig.mk @@ -59,6 +59,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 # 2 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 734003200 +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/generic_mips64/BoardConfig.mk b/target/board/generic_mips64/BoardConfig.mk index 7f35c8b2d..742803240 100644 --- a/target/board/generic_mips64/BoardConfig.mk +++ b/target/board/generic_mips64/BoardConfig.mk @@ -74,6 +74,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 1879048192 # 1.75 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 1610612736 # 1.5 GB, lots of space for running tests +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index fef2304ad..08d12b3a2 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -41,6 +41,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index 6e16f35bf..d07a14da7 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -44,6 +44,11 @@ USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 # 2.5 GB BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 +TARGET_COPY_OUT_VENDOR := vendor +# ~100 MB vendor image. Please adjust system image / vendor image sizes +# when finalizing them. +BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 +BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 From e3f4e9f025ec3ffd05a5ec8c985284a2b3b5a79e Mon Sep 17 00:00:00 2001 From: bohu Date: Fri, 26 May 2017 10:26:15 -0700 Subject: [PATCH 2/8] build-emulator: fully treblize emulator image Install emulator specific binaries and libraries to vendor partition; update selinux; add vndk. BUG: 37511975 Test: build user build, launch emualtor, run CTS. Change-Id: I70f58947e98b41b195d77b4347d2efdc09348392 Merged-In: I70f58947e98b41b195d77b4347d2efdc09348392 --- target/board/generic/sepolicy/adbd.te | 1 + target/board/generic/sepolicy/audioserver.te | 1 + target/board/generic/sepolicy/bootanim.te | 3 +- target/board/generic/sepolicy/cameraserver.te | 2 + target/board/generic/sepolicy/file.te | 1 - target/board/generic/sepolicy/file_contexts | 23 +++++- .../board/generic/sepolicy/goldfish_setup.te | 27 ++----- .../generic/sepolicy/hal_drm_widevine.te | 11 +++ .../generic/sepolicy/hal_gnss_default.te | 1 + .../sepolicy/hal_graphics_composer_default.te | 1 + target/board/generic/sepolicy/init.te | 1 + target/board/generic/sepolicy/mediacodec.te | 1 + target/board/generic/sepolicy/netd.te | 2 + target/board/generic/sepolicy/priv_app.te | 5 ++ target/board/generic/sepolicy/qemu_props.te | 5 +- target/board/generic/sepolicy/qemud.te | 8 -- target/board/generic/sepolicy/rild.te | 1 - .../board/generic/sepolicy/system_server.te | 1 - target/board/generic/sepolicy/vold.te | 1 + target/board/generic/sepolicy/zygote.te | 3 + target/product/emulator.mk | 81 +++++++++++++++---- 21 files changed, 124 insertions(+), 56 deletions(-) create mode 100644 target/board/generic/sepolicy/adbd.te create mode 100644 target/board/generic/sepolicy/audioserver.te create mode 100644 target/board/generic/sepolicy/cameraserver.te create mode 100644 target/board/generic/sepolicy/hal_drm_widevine.te create mode 100644 target/board/generic/sepolicy/hal_gnss_default.te create mode 100644 target/board/generic/sepolicy/hal_graphics_composer_default.te create mode 100644 target/board/generic/sepolicy/mediacodec.te create mode 100644 target/board/generic/sepolicy/priv_app.te delete mode 100644 target/board/generic/sepolicy/qemud.te delete mode 100644 target/board/generic/sepolicy/rild.te create mode 100644 target/board/generic/sepolicy/vold.te diff --git a/target/board/generic/sepolicy/adbd.te b/target/board/generic/sepolicy/adbd.te new file mode 100644 index 000000000..9546c1a47 --- /dev/null +++ b/target/board/generic/sepolicy/adbd.te @@ -0,0 +1 @@ +set_prop(adbd, ctl_mdnsd_prop); diff --git a/target/board/generic/sepolicy/audioserver.te b/target/board/generic/sepolicy/audioserver.te new file mode 100644 index 000000000..c3c4a3a3d --- /dev/null +++ b/target/board/generic/sepolicy/audioserver.te @@ -0,0 +1 @@ +allow audioserver bootanim:binder call; diff --git a/target/board/generic/sepolicy/bootanim.te b/target/board/generic/sepolicy/bootanim.te index b4b1eef83..4be1c8a20 100644 --- a/target/board/generic/sepolicy/bootanim.te +++ b/target/board/generic/sepolicy/bootanim.te @@ -1,4 +1,5 @@ allow bootanim self:process execmem; allow bootanim ashmem_device:chr_file execute; - +#TODO: This can safely be ignored until b/62954877 is fixed +dontaudit bootanim system_data_file:dir read; set_prop(bootanim, qemu_prop) diff --git a/target/board/generic/sepolicy/cameraserver.te b/target/board/generic/sepolicy/cameraserver.te new file mode 100644 index 000000000..6cf5d6ae4 --- /dev/null +++ b/target/board/generic/sepolicy/cameraserver.te @@ -0,0 +1,2 @@ +allow cameraserver system_file:dir { open read }; +allow cameraserver hal_allocator:fd use; diff --git a/target/board/generic/sepolicy/file.te b/target/board/generic/sepolicy/file.te index 9227f8018..f4ae9e43b 100644 --- a/target/board/generic/sepolicy/file.te +++ b/target/board/generic/sepolicy/file.te @@ -1,2 +1 @@ -type qemud_socket, file_type; type sysfs_writable, fs_type, sysfs_type, mlstrustedobject; diff --git a/target/board/generic/sepolicy/file_contexts b/target/board/generic/sepolicy/file_contexts index e9502d948..f550f4db2 100644 --- a/target/board/generic/sepolicy/file_contexts +++ b/target/board/generic/sepolicy/file_contexts @@ -7,14 +7,29 @@ /dev/block/vda u:object_r:system_block_device:s0 /dev/block/vdb u:object_r:cache_block_device:s0 /dev/block/vdc u:object_r:userdata_block_device:s0 +/dev/block/vdd u:object_r:metadata_block_device:s0 +/dev/block/vde u:object_r:system_block_device:s0 /dev/goldfish_pipe u:object_r:qemu_device:s0 /dev/goldfish_sync u:object_r:qemu_device:s0 /dev/qemu_.* u:object_r:qemu_device:s0 -/dev/socket/qemud u:object_r:qemud_socket:s0 /dev/ttyGF[0-9]* u:object_r:serial_device:s0 /dev/ttyS2 u:object_r:console_device:s0 -/system/bin/qemud u:object_r:qemud_exec:s0 /sys/qemu_trace(/.*)? u:object_r:sysfs_writable:s0 -/system/etc/init.goldfish.sh u:object_r:goldfish_setup_exec:s0 -/system/bin/qemu-props u:object_r:qemu_props_exec:s0 +/vendor/bin/init\.ranchu-core\.sh u:object_r:goldfish_setup_exec:s0 +/vendor/bin/init\.ranchu-net\.sh u:object_r:goldfish_setup_exec:s0 +/vendor/bin/qemu-props u:object_r:qemu_props_exec:s0 + +/vendor/bin/hw/android\.hardware\.drm@1\.0-service\.widevine u:object_r:hal_drm_widevine_exec:s0 + +/vendor/lib(64)?/hw/gralloc\.ranchu\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libEGL_emulation\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv1_CM_emulation\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv2_emulation\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libEGL_swiftshader\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv1_CM_swiftshader\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv2_swiftshader\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libOpenglSystemCommon\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/lib_renderControl_enc\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv1_enc\.so u:object_r:same_process_hal_file:s0 +/vendor/lib(64)?/libGLESv2_enc\.so u:object_r:same_process_hal_file:s0 diff --git a/target/board/generic/sepolicy/goldfish_setup.te b/target/board/generic/sepolicy/goldfish_setup.te index 78d20fca0..bcd49bdc4 100644 --- a/target/board/generic/sepolicy/goldfish_setup.te +++ b/target/board/generic/sepolicy/goldfish_setup.te @@ -1,29 +1,12 @@ # goldfish-setup service: runs init.goldfish.sh script type goldfish_setup, domain; -type goldfish_setup_exec, exec_type, file_type; +type goldfish_setup_exec, vendor_file_type, exec_type, file_type; init_daemon_domain(goldfish_setup) -# Inherit open file to shell (interpreter) for script. -allow goldfish_setup shell_exec:file rx_file_perms; - -# Run ifconfig, route commands to configure interfaces and routes. -allow goldfish_setup system_file:file execute_no_trans; -allow goldfish_setup toolbox_exec:file rx_file_perms; allow goldfish_setup self:capability { net_admin net_raw }; -allow goldfish_setup self:udp_socket create_socket_perms; +allow goldfish_setup self:udp_socket { create ioctl }; +allow goldfish_setup vendor_toolbox_exec:file execute_no_trans; allowxperm goldfish_setup self:udp_socket ioctl priv_sock_ioctls; - -wakelock_use(goldfish_setup) -net_domain(goldfish_setup) - -# Set net.eth0.dns*, debug.sf.nobootanimation -set_prop(goldfish_setup, system_prop) -set_prop(goldfish_setup, debug_prop) - -# Set ro.radio.noril -set_prop(goldfish_setup, radio_noril_prop) - -# Stop ril-daemon service (by setting ctl.stop to ril-daemon, which -# transforms to a permission check on ctl.ril-daemon). -set_prop(goldfish_setup, ctl_rildaemon_prop) +wakelock_use(goldfish_setup); +allow goldfish_setup vendor_shell_exec:file { rx_file_perms }; diff --git a/target/board/generic/sepolicy/hal_drm_widevine.te b/target/board/generic/sepolicy/hal_drm_widevine.te new file mode 100644 index 000000000..c1a63ca74 --- /dev/null +++ b/target/board/generic/sepolicy/hal_drm_widevine.te @@ -0,0 +1,11 @@ +# define SELinux domain +type hal_drm_widevine, domain; +hal_server_domain(hal_drm_widevine, hal_drm) + +type hal_drm_widevine_exec, exec_type, vendor_file_type, file_type; +init_daemon_domain(hal_drm_widevine) + +allow hal_drm mediacodec:fd use; +allow hal_drm { appdomain -isolated_app }:fd use; + +hal_client_domain(hal_drm_widevine, hal_graphics_composer); diff --git a/target/board/generic/sepolicy/hal_gnss_default.te b/target/board/generic/sepolicy/hal_gnss_default.te new file mode 100644 index 000000000..ddc68cc69 --- /dev/null +++ b/target/board/generic/sepolicy/hal_gnss_default.te @@ -0,0 +1 @@ +vndbinder_use(hal_gnss_default); diff --git a/target/board/generic/sepolicy/hal_graphics_composer_default.te b/target/board/generic/sepolicy/hal_graphics_composer_default.te new file mode 100644 index 000000000..40ecda659 --- /dev/null +++ b/target/board/generic/sepolicy/hal_graphics_composer_default.te @@ -0,0 +1 @@ +vndbinder_use(hal_graphics_composer_default); diff --git a/target/board/generic/sepolicy/init.te b/target/board/generic/sepolicy/init.te index 3aa81d1b5..84a4e8dbf 100644 --- a/target/board/generic/sepolicy/init.te +++ b/target/board/generic/sepolicy/init.te @@ -1 +1,2 @@ allow init tmpfs:lnk_file create_file_perms; +dontaudit init kernel:system module_request; diff --git a/target/board/generic/sepolicy/mediacodec.te b/target/board/generic/sepolicy/mediacodec.te new file mode 100644 index 000000000..acf4e59b9 --- /dev/null +++ b/target/board/generic/sepolicy/mediacodec.te @@ -0,0 +1 @@ +allow mediacodec system_file:dir { open read }; diff --git a/target/board/generic/sepolicy/netd.te b/target/board/generic/sepolicy/netd.te index 2b002ec9c..09a28b996 100644 --- a/target/board/generic/sepolicy/netd.te +++ b/target/board/generic/sepolicy/netd.te @@ -1 +1,3 @@ dontaudit netd self:capability sys_module; +#TODO: This can safely be ignored until b/62954877 is fixed +dontaudit netd kernel:system module_request; diff --git a/target/board/generic/sepolicy/priv_app.te b/target/board/generic/sepolicy/priv_app.te new file mode 100644 index 000000000..3d16f32b0 --- /dev/null +++ b/target/board/generic/sepolicy/priv_app.te @@ -0,0 +1,5 @@ +#TODO: b/62908025 +dontaudit priv_app firstboot_prop:file { getattr open }; +dontaudit priv_app device:dir { open read }; +dontaudit priv_app proc_interrupts:file { getattr open read }; +dontaudit priv_app proc_modules:file { getattr open read }; diff --git a/target/board/generic/sepolicy/qemu_props.te b/target/board/generic/sepolicy/qemu_props.te index d5571fd22..0f5ec8c94 100644 --- a/target/board/generic/sepolicy/qemu_props.te +++ b/target/board/generic/sepolicy/qemu_props.te @@ -1,12 +1,9 @@ # qemu-props service: Sets system properties on boot. type qemu_props, domain; -type qemu_props_exec, exec_type, file_type; +type qemu_props_exec, vendor_file_type, exec_type, file_type; init_daemon_domain(qemu_props) -# Set properties. set_prop(qemu_props, qemu_prop) set_prop(qemu_props, dalvik_prop) -set_prop(qemu_props, config_prop) -set_prop(qemu_props, opengles_prop) set_prop(qemu_props, qemu_cmdline) diff --git a/target/board/generic/sepolicy/qemud.te b/target/board/generic/sepolicy/qemud.te deleted file mode 100644 index eee21c406..000000000 --- a/target/board/generic/sepolicy/qemud.te +++ /dev/null @@ -1,8 +0,0 @@ -# qemu support daemon -type qemud, domain; -type qemud_exec, exec_type, file_type; - -init_daemon_domain(qemud) - -# Access /dev/ttyS1 and /dev/ttyGF1. -allow qemud serial_device:chr_file rw_file_perms; diff --git a/target/board/generic/sepolicy/rild.te b/target/board/generic/sepolicy/rild.te deleted file mode 100644 index e148b6c13..000000000 --- a/target/board/generic/sepolicy/rild.te +++ /dev/null @@ -1 +0,0 @@ -unix_socket_connect(rild, qemud, qemud) diff --git a/target/board/generic/sepolicy/system_server.te b/target/board/generic/sepolicy/system_server.te index f9e277b8a..906309563 100644 --- a/target/board/generic/sepolicy/system_server.te +++ b/target/board/generic/sepolicy/system_server.te @@ -1,3 +1,2 @@ -unix_socket_connect(system_server, qemud, qemud) get_prop(system_server, opengles_prop) get_prop(system_server, radio_noril_prop) diff --git a/target/board/generic/sepolicy/vold.te b/target/board/generic/sepolicy/vold.te new file mode 100644 index 000000000..5f3bdd446 --- /dev/null +++ b/target/board/generic/sepolicy/vold.te @@ -0,0 +1 @@ +dontaudit vold kernel:system module_request; diff --git a/target/board/generic/sepolicy/zygote.te b/target/board/generic/sepolicy/zygote.te index a90f02b1a..e97d895c3 100644 --- a/target/board/generic/sepolicy/zygote.te +++ b/target/board/generic/sepolicy/zygote.te @@ -1 +1,4 @@ set_prop(zygote, qemu_prop) +# TODO (b/63631799) fix this access +# Suppress denials to storage. Webview zygote should not be accessing. +dontaudit webview_zygote mnt_expand_file:dir getattr; diff --git a/target/product/emulator.mk b/target/product/emulator.mk index 04aae585f..00b353385 100644 --- a/target/product/emulator.mk +++ b/target/product/emulator.mk @@ -36,11 +36,13 @@ PRODUCT_PACKAGES += \ libGLESv2_emulation \ libGLESv1_enc \ qemu-props \ - qemud \ camera.goldfish \ camera.goldfish.jpeg \ camera.ranchu \ camera.ranchu.jpeg \ + keystore.goldfish \ + keystore.ranchu \ + gatekeeper.ranchu \ lights.goldfish \ gps.goldfish \ gps.ranchu \ @@ -56,8 +58,16 @@ PRODUCT_PACKAGES += \ android.hardware.biometrics.fingerprint@2.1-service \ sensors.ranchu \ android.hardware.graphics.composer@2.1-impl \ - hwcomposer.goldfish \ - hwcomposer.ranchu \ + android.hardware.graphics.composer@2.1-service \ + android.hardware.graphics.allocator@2.0-service \ + android.hardware.graphics.allocator@2.0-impl \ + android.hardware.graphics.mapper@2.0-impl \ + hwcomposer.goldfish \ + hwcomposer.ranchu \ + sh_vendor \ + vintf \ + toybox_vendor \ + CarrierConfig PRODUCT_PACKAGES += \ android.hardware.audio@2.0-impl \ @@ -66,36 +76,79 @@ PRODUCT_PACKAGES += \ android.hardware.soundtrigger@2.0-impl PRODUCT_PACKAGES += \ - android.hardware.keymaster@3.0-impl \ - android.hardware.keymaster@3.0-service + android.hardware.keymaster@3.0-impl \ + android.hardware.keymaster@3.0-service PRODUCT_PACKAGES += \ android.hardware.gnss@1.0-service \ android.hardware.gnss@1.0-impl PRODUCT_PACKAGES += \ - android.hardware.sensors@1.0-impl \ - android.hardware.sensors@1.0-service + android.hardware.sensors@1.0-impl \ + android.hardware.sensors@1.0-service + +PRODUCT_PACKAGES += \ + android.hardware.drm@1.0-service \ + android.hardware.drm@1.0-impl PRODUCT_PACKAGES += \ android.hardware.power@1.0-service \ android.hardware.power@1.0-impl -# camera service treble disable until all backwards compat is complete -PRODUCT_PROPERTY_OVERRIDES += \ - camera.disable_treble=1 +PRODUCT_PACKAGES += \ + camera.device@1.0-impl \ + android.hardware.camera.provider@2.4-service \ + android.hardware.camera.provider@2.4-impl \ + +PRODUCT_PACKAGES += \ + android.hardware.gatekeeper@1.0-impl \ + android.hardware.gatekeeper@1.0-service + +# need this for gles libraries to load properly +# after moving to /vendor/lib/ +PRODUCT_PACKAGES += \ + android.hardware.renderscript@1.0.vndk-sp\ + android.hardware.graphics.allocator@2.0.vndk-sp\ + android.hardware.graphics.mapper@2.0.vndk-sp\ + android.hardware.graphics.common@1.0.vndk-sp\ + libhwbinder.vndk-sp\ + libbase.vndk-sp\ + libcutils.vndk-sp\ + libhardware.vndk-sp\ + libhidlbase.vndk-sp\ + libhidltransport.vndk-sp\ + libutils.vndk-sp\ + libc++.vndk-sp\ + libRS_internal.vndk-sp\ + libRSDriver.vndk-sp\ + libRSCpuRef.vndk-sp\ + libbcinfo.vndk-sp\ + libblas.vndk-sp\ + libft2.vndk-sp\ + libpng.vndk-sp\ + libcompiler_rt.vndk-sp\ + libbacktrace.vndk-sp\ + libunwind.vndk-sp\ + libunwindstack.vndk-sp\ + liblzma.vndk-sp\ + libz.vndk-sp\ + PRODUCT_COPY_FILES += \ - device/generic/goldfish/fstab.goldfish:root/fstab.goldfish \ - device/generic/goldfish/init.goldfish.rc:root/init.goldfish.rc \ - device/generic/goldfish/init.goldfish.sh:system/etc/init.goldfish.sh \ - device/generic/goldfish/ueventd.goldfish.rc:root/ueventd.goldfish.rc \ + device/generic/goldfish/init.ranchu-core.sh:vendor/bin/init.ranchu-core.sh \ + device/generic/goldfish/init.ranchu-net.sh:vendor/bin/init.ranchu-net.sh \ device/generic/goldfish/init.ranchu.rc:root/init.ranchu.rc \ device/generic/goldfish/fstab.ranchu:root/fstab.ranchu \ + device/generic/goldfish/fstab.ranchu.early:root/fstab.ranchu.early \ device/generic/goldfish/ueventd.ranchu.rc:root/ueventd.ranchu.rc \ device/generic/goldfish/input/goldfish_rotary.idc:system/usr/idc/goldfish_rotary.idc \ + device/generic/goldfish/manifest.xml:$(TARGET_COPY_OUT_VENDOR)/manifest.xml \ + device/generic/goldfish/data/etc/permissions/privapp-permissions-goldfish.xml:system/etc/permissions/privapp-permissions-goldfish.xml \ + device/generic/goldfish/data/etc/config.ini:config.ini \ frameworks/native/data/etc/android.hardware.usb.accessory.xml:system/etc/permissions/android.hardware.usb.accessory.xml PRODUCT_PACKAGE_OVERLAYS := device/generic/goldfish/overlay PRODUCT_CHARACTERISTICS := emulator + +PRODUCT_FULL_TREBLE_OVERRIDE := true From ac0273f162d83738baaca3a2daf7d7a5ffa889f2 Mon Sep 17 00:00:00 2001 From: bohu Date: Thu, 15 Jun 2017 11:35:39 -0700 Subject: [PATCH 3/8] sdk:enable emulator to launch in build environment Recent changes in emulator requires advancedFeatures.ini, encryptionkey.img and new kernels (such as 3.18) at OUT directory so emulator can find them. This CL set those up as part of the build process. Change-Id: Ib3b7c4c48a22cecb44255e643402fd1c37797522 Merged-In: Ib3b7c4c48a22cecb44255e643402fd1c37797522 --- target/product/sdk_phone_arm64.mk | 9 +++++++++ target/product/sdk_phone_armv7.mk | 9 +++++++++ target/product/sdk_phone_x86.mk | 4 ++++ target/product/sdk_phone_x86_64.mk | 5 +++++ 4 files changed, 27 insertions(+) diff --git a/target/product/sdk_phone_arm64.mk b/target/product/sdk_phone_arm64.mk index a689475b3..3bab84d45 100644 --- a/target/product/sdk_phone_arm64.mk +++ b/target/product/sdk_phone_arm64.mk @@ -19,6 +19,15 @@ # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. +# Note: the following lines need to stay at the beginning so that it can +# take priority and override the rules it inherit from other mk files +# see copy file rules in core/Makefile +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \ + prebuilts/qemu-kernel/arm64/3.18/kernel-qemu2:kernel-ranchu \ + device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \ + device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early + $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) $(call inherit-product, $(SRC_TARGET_DIR)/board/generic_arm64/device.mk) diff --git a/target/product/sdk_phone_armv7.mk b/target/product/sdk_phone_armv7.mk index ebdd0e7f4..910692f92 100644 --- a/target/product/sdk_phone_armv7.mk +++ b/target/product/sdk_phone_armv7.mk @@ -14,6 +14,15 @@ # limitations under the License. # +# Note: the following lines need to stay at the beginning so that it can +# take priority and override the rules it inherit from other mk files +# see copy file rules in core/Makefile +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \ + prebuilts/qemu-kernel/arm/3.18/kernel-qemu2:kernel-ranchu \ + device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \ + device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early + $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) # AOSP emulator images build the AOSP messaging app. diff --git a/target/product/sdk_phone_x86.mk b/target/product/sdk_phone_x86.mk index 01c2e8339..90f4e164b 100644 --- a/target/product/sdk_phone_x86.mk +++ b/target/product/sdk_phone_x86.mk @@ -18,6 +18,10 @@ # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini:advancedFeatures.ini \ + device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \ + prebuilts/qemu-kernel/x86/3.18/kernel-qemu2:kernel-ranchu $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) diff --git a/target/product/sdk_phone_x86_64.mk b/target/product/sdk_phone_x86_64.mk index c3bc5e958..63e684337 100644 --- a/target/product/sdk_phone_x86_64.mk +++ b/target/product/sdk_phone_x86_64.mk @@ -19,6 +19,11 @@ # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini:advancedFeatures.ini \ + device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \ + prebuilts/qemu-kernel/x86_64/3.18/kernel-qemu2:kernel-ranchu + $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_base.mk) From bc43c4ec294324af981ae66f790db4cdedafcc31 Mon Sep 17 00:00:00 2001 From: bohu Date: Thu, 22 Jun 2017 22:03:32 -0700 Subject: [PATCH 4/8] emulator: move rild.libpath to vendor BUG: 62137708 Test: buld sdk_gphone_x86-user, launch emulator make sure radio works Change-Id: I4ef1483a8d95a74b54deb6f0d4b2461c733c8140 Merged-In: I4ef1483a8d95a74b54deb6f0d4b2461c733c8140 --- target/board/generic/BoardConfig.mk | 2 +- target/board/generic/system.prop | 3 +-- target/board/generic_arm64/BoardConfig.mk | 1 + target/board/generic_arm64/system.prop | 3 +-- target/board/generic_x86/BoardConfig.mk | 1 + target/board/generic_x86/system.prop | 3 +-- target/board/generic_x86_64/BoardConfig.mk | 1 + target/board/generic_x86_64/system.prop | 3 +-- target/product/sdk_phone_arm64.mk | 3 +++ target/product/sdk_phone_armv7.mk | 3 +++ target/product/sdk_phone_x86.mk | 3 +++ target/product/sdk_phone_x86_64.mk | 3 +++ 12 files changed, 20 insertions(+), 9 deletions(-) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 0a1531a63..543353007 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -62,4 +62,4 @@ BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy - +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic/system.prop b/target/board/generic/system.prop index f2424c970..ad8e5b806 100644 --- a/target/board/generic/system.prop +++ b/target/board/generic/system.prop @@ -2,5 +2,4 @@ # system.prop for generic sdk # -rild.libpath=/system/lib/libreference-ril.so -rild.libargs=-d /dev/ttyS0 +rild.libpath=/vendor/lib/libreference-ril.so diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index 6d5ae5190..e5c967194 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -92,4 +92,5 @@ BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy diff --git a/target/board/generic_arm64/system.prop b/target/board/generic_arm64/system.prop index 24578a9e3..5b0183a37 100644 --- a/target/board/generic_arm64/system.prop +++ b/target/board/generic_arm64/system.prop @@ -2,5 +2,4 @@ # system.prop for generic arm64 sdk # -rild.libpath=/system/lib64/libreference-ril.so -rild.libargs=-d /dev/ttyS0 +rild.libpath=/vendor/lib64/libreference-ril.so diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index 08d12b3a2..bb5c0b63b 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -42,6 +42,7 @@ TARGET_USERIMAGES_USE_EXT4 := true BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 TARGET_COPY_OUT_VENDOR := vendor +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true # ~100 MB vendor image. Please adjust system image / vendor image sizes # when finalizing them. BOARD_VENDORIMAGE_PARTITION_SIZE := 100000000 diff --git a/target/board/generic_x86/system.prop b/target/board/generic_x86/system.prop index 137a0f9b1..64829f3ce 100644 --- a/target/board/generic_x86/system.prop +++ b/target/board/generic_x86/system.prop @@ -2,5 +2,4 @@ # system.prop for generic sdk # -rild.libpath=/system/lib/libreference-ril.so -rild.libargs=-d /dev/ttyS0 +rild.libpath=/vendor/lib/libreference-ril.so diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index d07a14da7..0782bd09c 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -53,6 +53,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true BOARD_SEPOLICY_DIRS += \ build/target/board/generic/sepolicy \ diff --git a/target/board/generic_x86_64/system.prop b/target/board/generic_x86_64/system.prop index 43d4a88fa..ed9d1731c 100644 --- a/target/board/generic_x86_64/system.prop +++ b/target/board/generic_x86_64/system.prop @@ -2,5 +2,4 @@ # system.prop for generic sdk # -rild.libpath=/system/lib64/libreference-ril.so -rild.libargs=-d /dev/ttyS0 +rild.libpath=/vendor/lib64/libreference-ril.so diff --git a/target/product/sdk_phone_arm64.mk b/target/product/sdk_phone_arm64.mk index 3bab84d45..599673ae5 100644 --- a/target/product/sdk_phone_arm64.mk +++ b/target/product/sdk_phone_arm64.mk @@ -14,6 +14,9 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib64/libreference-ril.so + # This is a build configuration for a full-featured build of the # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be diff --git a/target/product/sdk_phone_armv7.mk b/target/product/sdk_phone_armv7.mk index 910692f92..e99f0f5b4 100644 --- a/target/product/sdk_phone_armv7.mk +++ b/target/product/sdk_phone_armv7.mk @@ -14,6 +14,9 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib/libreference-ril.so + # Note: the following lines need to stay at the beginning so that it can # take priority and override the rules it inherit from other mk files # see copy file rules in core/Makefile diff --git a/target/product/sdk_phone_x86.mk b/target/product/sdk_phone_x86.mk index 90f4e164b..1e827732f 100644 --- a/target/product/sdk_phone_x86.mk +++ b/target/product/sdk_phone_x86.mk @@ -14,6 +14,9 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib/libreference-ril.so + # This is a build configuration for a full-featured build of the # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be diff --git a/target/product/sdk_phone_x86_64.mk b/target/product/sdk_phone_x86_64.mk index 63e684337..a18c4f886 100644 --- a/target/product/sdk_phone_x86_64.mk +++ b/target/product/sdk_phone_x86_64.mk @@ -14,6 +14,9 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib64/libreference-ril.so + # This is a build configuration for a full-featured build of the # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be From b7e2fabe3881c3254d4172413a86dc4d0e92b040 Mon Sep 17 00:00:00 2001 From: bohu Date: Fri, 19 May 2017 15:07:02 -0700 Subject: [PATCH 5/8] emualtor: keep libopenjdkjvmti*.so on sdk images BUG: 38353037 Those libopenjdkjvmti*.so files are needed by profilers. Those files are shipped on real devices as well. Change-Id: Iac7dd2844b0f3ea5194dec8732fbaacf53c4bf4a Merged-In: Iac7dd2844b0f3ea5194dec8732fbaacf53c4bf4a --- core/main.mk | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/main.mk b/core/main.mk index 81bfae2e6..e967139a1 100644 --- a/core/main.mk +++ b/core/main.mk @@ -890,6 +890,8 @@ ifdef is_sdk_build $(TARGET_OUT_DATA)/%, \ $(sort $(call get-tagged-modules,gnu))) target_gnu_MODULES := $(filter-out $(TARGET_OUT_EXECUTABLES)/%,$(target_gnu_MODULES)) + target_gnu_MODULES := $(filter-out %/libopenjdkjvmti.so,$(target_gnu_MODULES)) + target_gnu_MODULES := $(filter-out %/libopenjdkjvmtid.so,$(target_gnu_MODULES)) $(info Removing from sdk:)$(foreach d,$(target_gnu_MODULES),$(info : $(d))) modules_to_install := \ $(filter-out $(target_gnu_MODULES),$(modules_to_install)) From 7b5e1abacb6b8e103a342cc02f16008a658850c2 Mon Sep 17 00:00:00 2001 From: bohu Date: Thu, 10 Aug 2017 00:20:01 -0700 Subject: [PATCH 6/8] emulator: squash misc modifications from oc-emu-dev Change-Id: I7380292cd4dc851a987683bdf61d511dbf74aff6 Merged-In: I7380292cd4dc851a987683bdf61d511dbf74aff6 --- core/Makefile | 3 +-- core/tasks/sdk-addon.mk | 4 +++- target/board/generic/BoardConfig.mk | 2 ++ target/board/generic/device.mk | 3 +-- target/board/generic_arm64/BoardConfig.mk | 2 ++ target/board/generic_arm64/device.mk | 3 +-- target/board/generic_mips/BoardConfig.mk | 2 ++ target/board/generic_mips/device.mk | 3 +-- target/board/generic_mips64/BoardConfig.mk | 2 ++ target/board/generic_mips64/device.mk | 3 +-- target/board/generic_mips64/system.prop | 2 +- target/board/generic_x86/BoardConfig.mk | 4 +++- target/board/generic_x86/device.mk | 3 +-- target/board/generic_x86_64/BoardConfig.mk | 2 ++ target/board/generic_x86_64/device.mk | 3 +-- target/product/aosp_arm.mk | 15 ++++++++++++++- target/product/aosp_arm64.mk | 16 ++++++++++++---- target/product/aosp_x86.mk | 13 +++++++++++++ target/product/aosp_x86_64.mk | 14 +++++++------- target/product/sdk_base.mk | 4 ++-- target/product/sdk_phone_arm64.mk | 2 ++ 21 files changed, 74 insertions(+), 31 deletions(-) diff --git a/core/Makefile b/core/Makefile index 889dbd1eb..e0d02340e 100644 --- a/core/Makefile +++ b/core/Makefile @@ -2761,8 +2761,7 @@ INTERNAL_EMULATOR_PACKAGE_FILES += \ prebuilts/qemu-kernel/$(TARGET_ARCH)/kernel-qemu \ $(INSTALLED_RAMDISK_TARGET) \ $(INSTALLED_SYSTEMIMAGE) \ - $(INSTALLED_USERDATAIMAGE_TARGET) \ - $(INSTALLED_VENDORIMAGE_TARGET) + $(INSTALLED_USERDATAIMAGE_TARGET) name := $(TARGET_PRODUCT)-emulator-$(FILE_NAME_TAG) diff --git a/core/tasks/sdk-addon.mk b/core/tasks/sdk-addon.mk index e3bd47d13..e26773ce8 100644 --- a/core/tasks/sdk-addon.mk +++ b/core/tasks/sdk-addon.mk @@ -64,6 +64,7 @@ endif # Files copied in the system-image directory files_to_copy += \ $(addon_dir_img):$(INSTALLED_QEMU_SYSTEMIMAGE):images/$(TARGET_CPU_ABI)/system.img \ + $(addon_dir_img):$(INSTALLED_QEMU_VENDORIMAGE):images/$(TARGET_CPU_ABI)/vendor.img \ $(addon_dir_img):$(BUILT_USERDATAIMAGE_TARGET):images/$(TARGET_CPU_ABI)/userdata.img \ $(addon_dir_img):$(BUILT_RAMDISK_TARGET):images/$(TARGET_CPU_ABI)/ramdisk.img \ $(addon_dir_img):$(PRODUCT_OUT)/system/build.prop:images/$(TARGET_CPU_ABI)/build.prop \ @@ -114,9 +115,10 @@ $(full_target): $(sdk_addon_deps) | $(ACP) $(hide) ( F=$$(pwd)/$@ ; cd $(PRIVATE_STAGING_DIR)/.. && zip -rqX $$F $(notdir $(PRIVATE_STAGING_DIR)) ) $(full_target_img): PRIVATE_STAGING_DIR := $(call append-path,$(staging),$(addon_dir_img))/images/$(TARGET_CPU_ABI) -$(full_target_img): $(full_target) $(addon_img_source_prop) +$(full_target_img): $(full_target) $(addon_img_source_prop) | $(ACP) @echo Packaging SDK Addon System-Image: $@ $(hide) mkdir -p $(dir $@) + $(ACP) -r $(PRODUCT_OUT)/data $(PRIVATE_STAGING_DIR)/data $(hide) ( F=$$(pwd)/$@ ; cd $(PRIVATE_STAGING_DIR)/.. && zip -rqX $$F $(notdir $(PRIVATE_STAGING_DIR)) ) diff --git a/target/board/generic/BoardConfig.mk b/target/board/generic/BoardConfig.mk index 543353007..8bb3ed0d9 100644 --- a/target/board/generic/BoardConfig.mk +++ b/target/board/generic/BoardConfig.mk @@ -39,6 +39,7 @@ ifeq ($(HOST_OS),linux) endif TARGET_USES_HWC2 := true +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation guest and host libraries BUILD_EMULATOR_OPENGL := true @@ -60,6 +61,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true diff --git a/target/board/generic/device.mk b/target/board/generic/device.mk index e56a4d1d3..e18c1652b 100644 --- a/target/board/generic/device.mk +++ b/target/board/generic/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/board/generic_arm64/BoardConfig.mk b/target/board/generic_arm64/BoardConfig.mk index e5c967194..2feba6b82 100644 --- a/target/board/generic_arm64/BoardConfig.mk +++ b/target/board/generic_arm64/BoardConfig.mk @@ -70,6 +70,7 @@ ifeq ($(HOST_OS),linux) endif TARGET_USES_HWC2 := true +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation host and guest libraries BUILD_EMULATOR_OPENGL := true @@ -91,6 +92,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy diff --git a/target/board/generic_arm64/device.mk b/target/board/generic_arm64/device.mk index 9647a4ebe..ca287eb8b 100644 --- a/target/board/generic_arm64/device.mk +++ b/target/board/generic_arm64/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/board/generic_mips/BoardConfig.mk b/target/board/generic_mips/BoardConfig.mk index 87b1f0eea..a9e46b42a 100644 --- a/target/board/generic_mips/BoardConfig.mk +++ b/target/board/generic_mips/BoardConfig.mk @@ -47,6 +47,7 @@ ifeq ($(HOST_OS),linux) endif TARGET_USES_HWC2 := true +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation guest and host libraries BUILD_EMULATOR_OPENGL := true @@ -68,5 +69,6 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy diff --git a/target/board/generic_mips/device.mk b/target/board/generic_mips/device.mk index 06a7d8a3e..a2633e187 100644 --- a/target/board/generic_mips/device.mk +++ b/target/board/generic_mips/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/board/generic_mips64/BoardConfig.mk b/target/board/generic_mips64/BoardConfig.mk index 742803240..6cb6c11a5 100644 --- a/target/board/generic_mips64/BoardConfig.mk +++ b/target/board/generic_mips64/BoardConfig.mk @@ -62,6 +62,7 @@ ifeq ($(HOST_OS),linux) endif TARGET_USES_HWC2 := true +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation guest and host libraries BUILD_EMULATOR_OPENGL := true @@ -83,6 +84,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += build/target/board/generic/sepolicy diff --git a/target/board/generic_mips64/device.mk b/target/board/generic_mips64/device.mk index 66ec9db9b..2ccbcbd18 100644 --- a/target/board/generic_mips64/device.mk +++ b/target/board/generic_mips64/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/board/generic_mips64/system.prop b/target/board/generic_mips64/system.prop index aa03eae52..4da69c092 100644 --- a/target/board/generic_mips64/system.prop +++ b/target/board/generic_mips64/system.prop @@ -2,5 +2,5 @@ # system.prop for generic mips64 sdk # -rild.libpath=/system/lib64/libreference-ril.so +rild.libpath=/vendor/lib64/libreference-ril.so rild.libargs=-d /dev/ttyS0 diff --git a/target/board/generic_x86/BoardConfig.mk b/target/board/generic_x86/BoardConfig.mk index bb5c0b63b..bb2166b53 100644 --- a/target/board/generic_x86/BoardConfig.mk +++ b/target/board/generic_x86/BoardConfig.mk @@ -26,6 +26,7 @@ WITH_DEXPREOPT_BOOT_IMG_ONLY ?= false endif TARGET_USES_HWC2 := true +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation host and guest libraries BUILD_EMULATOR_OPENGL := true @@ -39,7 +40,7 @@ BUILD_QEMU_IMAGES := true USE_OPENGL_RENDERER := true TARGET_USERIMAGES_USE_EXT4 := true -BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2147483648 +BOARD_SYSTEMIMAGE_PARTITION_SIZE := 2684354560 BOARD_USERDATAIMAGE_PARTITION_SIZE := 576716800 TARGET_COPY_OUT_VENDOR := vendor BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true @@ -51,6 +52,7 @@ BOARD_CACHEIMAGE_PARTITION_SIZE := 69206016 BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += \ build/target/board/generic/sepolicy \ diff --git a/target/board/generic_x86/device.mk b/target/board/generic_x86/device.mk index b5b0fafb0..24c39a5cc 100644 --- a/target/board/generic_x86/device.mk +++ b/target/board/generic_x86/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/board/generic_x86_64/BoardConfig.mk b/target/board/generic_x86_64/BoardConfig.mk index 0782bd09c..b49a10ca0 100755 --- a/target/board/generic_x86_64/BoardConfig.mk +++ b/target/board/generic_x86_64/BoardConfig.mk @@ -32,6 +32,7 @@ WITH_DEXPREOPT_BOOT_IMG_ONLY ?= false endif TARGET_USES_HWC2 := true +NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3 # Build OpenGLES emulation host and guest libraries BUILD_EMULATOR_OPENGL := true @@ -54,6 +55,7 @@ BOARD_CACHEIMAGE_FILE_SYSTEM_TYPE := ext4 BOARD_FLASH_BLOCK_SIZE := 512 TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true BOARD_PROPERTY_OVERRIDES_SPLIT_ENABLED := true +DEVICE_MATRIX_FILE := device/generic/goldfish/compatibility_matrix.xml BOARD_SEPOLICY_DIRS += \ build/target/board/generic/sepolicy \ diff --git a/target/board/generic_x86_64/device.mk b/target/board/generic_x86_64/device.mk index b5b0fafb0..24c39a5cc 100755 --- a/target/board/generic_x86_64/device.mk +++ b/target/board/generic_x86_64/device.mk @@ -19,8 +19,7 @@ PRODUCT_PROPERTY_OVERRIDES := \ ro.ril.hsxpa=1 \ - ro.ril.gprsclass=10 \ - ro.adb.qemud=1 + ro.ril.gprsclass=10 PRODUCT_COPY_FILES := \ device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \ diff --git a/target/product/aosp_arm.mk b/target/product/aosp_arm.mk index 781cae6a0..9ed528499 100644 --- a/target/product/aosp_arm.mk +++ b/target/product/aosp_arm.mk @@ -1,5 +1,5 @@ # -# Copyright 2013 The Android Open-Source Project +# Copyright 2017 The Android Open-Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -13,6 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib/libreference-ril.so + +# Note: the following lines need to stay at the beginning so that it can +# take priority and override the rules it inherit from other mk files +# see copy file rules in core/Makefile +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \ + prebuilts/qemu-kernel/arm/3.18/kernel-qemu2:kernel-ranchu \ + device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \ + device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early + include $(SRC_TARGET_DIR)/product/full.mk PRODUCT_NAME := aosp_arm diff --git a/target/product/aosp_arm64.mk b/target/product/aosp_arm64.mk index 98afe5f92..18d613bd8 100644 --- a/target/product/aosp_arm64.mk +++ b/target/product/aosp_arm64.mk @@ -1,5 +1,5 @@ # -# Copyright (C) 2013 The Android Open-Source Project +# Copyright (C) 2017 The Android Open-Source Project # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -14,14 +14,22 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib64/libreference-ril.so + # This is a build configuration for a full-featured build of the # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. -# This is for enabling ethernet support for ranchu. -# Consider removing this after RIL support is provided in ranchu. -PRODUCT_COPY_FILES += frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml +# Note: the following lines need to stay at the beginning so that it can +# take priority and override the rules it inherit from other mk files +# see copy file rules in core/Makefile +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini.arm:advancedFeatures.ini \ + prebuilts/qemu-kernel/arm64/3.18/kernel-qemu2:kernel-ranchu \ + device/generic/goldfish/fstab.ranchu.arm:root/fstab.ranchu \ + device/generic/goldfish/fstab.ranchu.early.arm:root/fstab.ranchu.early $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) diff --git a/target/product/aosp_x86.mk b/target/product/aosp_x86.mk index cba43c429..03203ced3 100644 --- a/target/product/aosp_x86.mk +++ b/target/product/aosp_x86.mk @@ -13,6 +13,19 @@ # See the License for the specific language governing permissions and # limitations under the License. # + +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib/libreference-ril.so + +# This is a build configuration for a full-featured build of the +# Open-Source part of the tree. It's geared toward a US-centric +# build quite specifically for the emulator, and might not be +# entirely appropriate to inherit from for on-device configurations. +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini:advancedFeatures.ini \ + device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \ + prebuilts/qemu-kernel/x86/3.18/kernel-qemu2:kernel-ranchu + include $(SRC_TARGET_DIR)/product/full_x86.mk PRODUCT_NAME := aosp_x86 diff --git a/target/product/aosp_x86_64.mk b/target/product/aosp_x86_64.mk index 4006346a8..693bdaf0b 100644 --- a/target/product/aosp_x86_64.mk +++ b/target/product/aosp_x86_64.mk @@ -14,18 +14,18 @@ # limitations under the License. # +PRODUCT_PROPERTY_OVERRIDES += \ + rild.libpath=/vendor/lib64/libreference-ril.so + # This is a build configuration for a full-featured build of the # Open-Source part of the tree. It's geared toward a US-centric # build quite specifically for the emulator, and might not be # entirely appropriate to inherit from for on-device configurations. -# If running on an emulator or some other device that has a LAN connection -# that isn't a wifi connection. This will instruct init.rc to enable the -# network connection so that you can use it with ADB - -# This is for enabling ethernet support for ranchu. -# Consider removing this after RIL support is provided in ranchu. -PRODUCT_COPY_FILES += frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml +PRODUCT_COPY_FILES += \ + development/sys-img/advancedFeatures.ini:advancedFeatures.ini \ + device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \ + prebuilts/qemu-kernel/x86_64/3.18/kernel-qemu2:kernel-ranchu $(call inherit-product, $(SRC_TARGET_DIR)/product/core_64_bit.mk) $(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk) diff --git a/target/product/sdk_base.mk b/target/product/sdk_base.mk index 0cdb05db4..93356d66c 100644 --- a/target/product/sdk_base.mk +++ b/target/product/sdk_base.mk @@ -24,11 +24,10 @@ PRODUCT_PACKAGES := \ Development \ Dialer \ EmulatorSmokeTests \ - Fallback \ Gallery2 \ GestureBuilder \ Launcher3 \ - LegacyCamera \ + Camera2 \ librs_jni \ libwnndict \ libWnnEngDic \ @@ -101,6 +100,7 @@ PRODUCT_COPY_FILES := \ frameworks/native/data/etc/android.hardware.touchscreen.multitouch.jazzhand.xml:system/etc/permissions/android.hardware.touchscreen.multitouch.jazzhand.xml \ frameworks/native/data/etc/android.hardware.camera.xml:system/etc/permissions/android.hardware.camera.xml \ frameworks/native/data/etc/android.hardware.fingerprint.xml:system/etc/permissions/android.hardware.fingerprint.xml \ + frameworks/native/data/etc/android.software.autofill.xml:system/etc/permissions/android.software.autofill.xml \ frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf \ device/generic/goldfish/audio_policy.conf:system/etc/audio_policy.conf diff --git a/target/product/sdk_phone_arm64.mk b/target/product/sdk_phone_arm64.mk index 599673ae5..2aa688b13 100644 --- a/target/product/sdk_phone_arm64.mk +++ b/target/product/sdk_phone_arm64.mk @@ -46,3 +46,5 @@ PRODUCT_BRAND := Android PRODUCT_NAME := sdk_phone_arm64 PRODUCT_DEVICE := generic_arm64 PRODUCT_MODEL := Android SDK built for arm64 + + From 913a990249bb9a04e8beb14d00b717495762cda4 Mon Sep 17 00:00:00 2001 From: bohu Date: Wed, 23 Aug 2017 23:42:33 -0700 Subject: [PATCH 7/8] emulator: fix selinux issues with cas/camera/drm hals BUG: 64726466 Test: build aosp_x86-eng, boot emulator without camera/drm hals killed by selinux avc denials; camera can take pictures Change-Id: I8a154fdb5d7aa7763aab2b912976eb9e1d329cdb Merged-In: I8a154fdb5d7aa7763aab2b912976eb9e1d329cdb --- target/board/generic/sepolicy/hal_camera_default.te | 3 +++ target/board/generic/sepolicy/hal_drm_default.te | 2 ++ 2 files changed, 5 insertions(+) create mode 100644 target/board/generic/sepolicy/hal_camera_default.te create mode 100644 target/board/generic/sepolicy/hal_drm_default.te diff --git a/target/board/generic/sepolicy/hal_camera_default.te b/target/board/generic/sepolicy/hal_camera_default.te new file mode 100644 index 000000000..eb88c36f0 --- /dev/null +++ b/target/board/generic/sepolicy/hal_camera_default.te @@ -0,0 +1,3 @@ +vndbinder_use(hal_camera_default); +allow hal_camera_default hal_graphics_mapper_hwservice:hwservice_manager find; +hal_client_domain(hal_camera_default, hal_graphics_composer) diff --git a/target/board/generic/sepolicy/hal_drm_default.te b/target/board/generic/sepolicy/hal_drm_default.te new file mode 100644 index 000000000..5a07433c8 --- /dev/null +++ b/target/board/generic/sepolicy/hal_drm_default.te @@ -0,0 +1,2 @@ +vndbinder_use(hal_drm_default); +hal_client_domain(hal_drm_default, hal_graphics_composer) From dc745a90903f8f82c0e3416d93ae59f0cc46648e Mon Sep 17 00:00:00 2001 From: bohu Date: Fri, 25 Aug 2017 11:15:03 -0700 Subject: [PATCH 8/8] emulator: fix widevine drm vndbinder denial [ 86.252399] type=1400 audit(1503684692.153:25): avc: denied { read write } for pid=4160 comm="android.hardwar" name="vndbinder" dev="tmpfs" ino=5163 scontext=u:r:hal_drm_widevine:s0 tcontext=u:object_r:vndbinder_device:s0 tclass=chr_file permissive=0 BUG: 64726466 Test: build sdk_gphone_x86-user target, launch it and the above denial should be fixed. Change-Id: Ied1268878236c42fbb0751a0f33014b332d78c32 Merged-In: Ied1268878236c42fbb0751a0f33014b332d78c32 --- target/board/generic/sepolicy/hal_drm_widevine.te | 1 + 1 file changed, 1 insertion(+) diff --git a/target/board/generic/sepolicy/hal_drm_widevine.te b/target/board/generic/sepolicy/hal_drm_widevine.te index c1a63ca74..42d462a75 100644 --- a/target/board/generic/sepolicy/hal_drm_widevine.te +++ b/target/board/generic/sepolicy/hal_drm_widevine.te @@ -8,4 +8,5 @@ init_daemon_domain(hal_drm_widevine) allow hal_drm mediacodec:fd use; allow hal_drm { appdomain -isolated_app }:fd use; +vndbinder_use(hal_drm_widevine); hal_client_domain(hal_drm_widevine, hal_graphics_composer);