diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-02-28 21:21:58 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-02-28 21:21:58 +0000 |
commit | 0f0e27fad4834e7b45e96b13cd190a3145d60647 (patch) | |
tree | b7ac0f3041be6071f44f794cedafc398cf833ec5 | |
parent | fd74d35fbccd56d47ccf2feceec2544d417f3438 (diff) | |
parent | f4080d63d1f4dca9925812fb2ef222d8334fa887 (diff) | |
download | goldfish-simpleperf-release.tar.gz |
Merge "Snap for 11510257 from 7c0386eb08d62bc60787ab317e76f37da05ea532 to simpleperf-release" into simpleperf-releasesimpleperf-release
-rw-r--r-- | data/empty_data_disk | 3 | ||||
-rwxr-xr-x | init.qemu-adb-keys.sh | 8 | ||||
-rwxr-xr-x | init.ranchu.adb.setup.sh | 10 | ||||
-rw-r--r-- | init.ranchu.rc | 16 | ||||
-rw-r--r-- | init.system_ext.rc | 9 | ||||
-rw-r--r-- | pc/config.ini.pc | 1 | ||||
-rw-r--r-- | product/generic.mk | 3 | ||||
-rw-r--r-- | sepolicy/vendor/file_contexts | 2 | ||||
-rw-r--r-- | sepolicy/vendor/goldfish_system_setup.te | 10 | ||||
-rw-r--r-- | sepolicy/vendor/property.te | 1 | ||||
-rw-r--r-- | sepolicy/vendor/property_contexts | 1 | ||||
-rw-r--r-- | sepolicy/vendor/qemu_export_property.te | 1 |
12 files changed, 28 insertions, 37 deletions
diff --git a/data/empty_data_disk b/data/empty_data_disk new file mode 100644 index 00000000..6ec0828a --- /dev/null +++ b/data/empty_data_disk @@ -0,0 +1,3 @@ +This special file tells the host side to keep the data partition empty. + +See b/326479561 for more details. diff --git a/init.qemu-adb-keys.sh b/init.qemu-adb-keys.sh deleted file mode 100755 index 8e304849..00000000 --- a/init.qemu-adb-keys.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/system/bin/sh - -if [[ -f /data/misc/adb/adb_keys ]]; then - echo "qemu-adb-setup: /data/misc/adb/adb_keys exists. Skipping qemu adb setup" > /dev/kmsg -else - echo "qemu-adb-setup: Copying over adb_keys" > /dev/kmsg - setprop vendor.qemu.adb.copykey 1 -fi diff --git a/init.ranchu.adb.setup.sh b/init.ranchu.adb.setup.sh new file mode 100755 index 00000000..383ec823 --- /dev/null +++ b/init.ranchu.adb.setup.sh @@ -0,0 +1,10 @@ +#!/system/bin/sh -e +ADB_KEYS_FILE="/data/misc/adb/adb_keys" + +if [[ -f "$ADB_KEYS_FILE" ]]; then + echo "$0: '$ADB_KEYS_FILE' already exists, skipping" +else + KEY=`getprop ro.boot.qemu.adb.pubkey` + echo "$KEY" > "$ADB_KEYS_FILE" + chmod 0640 "$ADB_KEYS_FILE" +fi diff --git a/init.ranchu.rc b/init.ranchu.rc index 982b452c..dfff0d47 100644 --- a/init.ranchu.rc +++ b/init.ranchu.rc @@ -62,7 +62,6 @@ on post-fs-data mkdir /data/vendor/var 0755 root root mkdir /data/vendor/var/run 0755 root root - start qemu-adb-keys start qemu-device-state on zygote-start @@ -91,11 +90,11 @@ service ranchu-setup /vendor/bin/init.ranchu-core.sh oneshot disabled -service qemu-adb-setup /system_ext/bin/init.qemu-adb-keys.sh - class core - user root +service ranchu-adb-setup /system_ext/bin/init.ranchu.adb.setup.sh + user system group shell - disabled # Started when qemu-adb-keys is stopped + stdio_to_kmsg + disabled oneshot on property:vendor.qemu.vport.gnss=* @@ -106,6 +105,7 @@ on property:vendor.qemu.timezone=* on property:dev.bootcomplete=1 && property:vendor.qemu.dev.bootcomplete=0 setprop vendor.qemu.dev.bootcomplete 1 + start ranchu-adb-setup start qemu-props-bootcomplete start ranchu-setup @@ -147,12 +147,6 @@ service qemu-props-bootcomplete /vendor/bin/qemu-props "bootcomplete" oneshot disabled -service qemu-adb-keys /vendor/bin/qemu-export-property qemu.adb.pubkey /data/vendor/adb/adb_keys - user root - group root - oneshot - disabled - service qemu-device-state /vendor/bin/qemu-export-property -f qemu.device_state /data/vendor/devicestate/device_state_configuration.xml user root group root diff --git a/init.system_ext.rc b/init.system_ext.rc index 5c2db835..a053c814 100644 --- a/init.system_ext.rc +++ b/init.system_ext.rc @@ -1,10 +1,5 @@ -on property:init.svc.qemu-adb-keys=stopped - start qemu-adb-setup - -on property:vendor.qemu.adb.copykey=1 - copy /data/vendor/adb/adb_keys /data/misc/adb/adb_keys - chown system shell /data/misc/adb/adb_keys - chmod 0640 /data/misc/adb/adb_keys +on property:init.svc.ranchu-adb-setup=stopped + start adbd on property:init.svc.qemu-device-state=stopped && property:ro.boot.qemu.device_state=* mkdir /data/system/devicestate/ 0755 system system diff --git a/pc/config.ini.pc b/pc/config.ini.pc index 977b69f1..c8744ea7 100644 --- a/pc/config.ini.pc +++ b/pc/config.ini.pc @@ -13,6 +13,7 @@ hw.cpu.ncore=4 hw.dPad=no hw.gps=no hw.gpu.enabled=yes +hw.initialOrientation=landscape hw.keyboard=yes hw.lcd.density=240 hw.mainKeys=no diff --git a/product/generic.mk b/product/generic.mk index f278aa3d..b1590015 100644 --- a/product/generic.mk +++ b/product/generic.mk @@ -289,6 +289,7 @@ ifneq ($(PRODUCT_IS_ATV_SDK),true) endif PRODUCT_COPY_FILES += \ + device/generic/goldfish/data/empty_data_disk:data/empty_data_disk \ device/generic/goldfish/data/etc/dtb.img:dtb.img \ device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \ device/generic/goldfish/emulator-info.txt:data/misc/emulator/version.txt \ @@ -298,7 +299,7 @@ PRODUCT_COPY_FILES += \ device/google/cuttlefish/host/commands/modem_simulator/files/iccprofile_for_sim0_for_CtsCarrierApiTestCases.xml:data/misc/modem_simulator/iccprofile_for_carrierapitests.xml \ device/generic/goldfish/data/etc/numeric_operator.xml:data/misc/modem_simulator/etc/modem_simulator/files/numeric_operator.xml \ device/generic/goldfish/data/etc/local.prop:data/local.prop \ - device/generic/goldfish/init.qemu-adb-keys.sh:$(TARGET_COPY_OUT_SYSTEM_EXT)/bin/init.qemu-adb-keys.sh \ + device/generic/goldfish/init.ranchu.adb.setup.sh:$(TARGET_COPY_OUT_SYSTEM_EXT)/bin/init.ranchu.adb.setup.sh \ device/generic/goldfish/init.ranchu-core.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.ranchu-core.sh \ device/generic/goldfish/init.ranchu-net.sh:$(TARGET_COPY_OUT_VENDOR)/bin/init.ranchu-net.sh \ device/generic/goldfish/init.ranchu.rc:$(TARGET_COPY_OUT_VENDOR)/etc/init/hw/init.ranchu.rc \ diff --git a/sepolicy/vendor/file_contexts b/sepolicy/vendor/file_contexts index 4333297a..f20af17d 100644 --- a/sepolicy/vendor/file_contexts +++ b/sepolicy/vendor/file_contexts @@ -31,7 +31,7 @@ /dev/bluetooth0 u:object_r:bt_device:s0 -/system_ext/bin/init\.qemu-adb-keys\.sh u:object_r:goldfish_system_setup_exec:s0 +/system_ext/bin/init\.ranchu\.adb\.setup\.sh u:object_r:goldfish_system_setup_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/dlkm_loader u:object_r:dlkm_loader_exec:s0 diff --git a/sepolicy/vendor/goldfish_system_setup.te b/sepolicy/vendor/goldfish_system_setup.te index 53934049..e57e0159 100644 --- a/sepolicy/vendor/goldfish_system_setup.te +++ b/sepolicy/vendor/goldfish_system_setup.te @@ -7,12 +7,10 @@ init_daemon_domain(goldfish_system_setup) allow goldfish_system_setup shell_exec:file { rx_file_perms }; # Allow write to /dev/kmsg -allow goldfish_system_setup kmsg_device:chr_file rw_file_perms; +allow goldfish_system_setup kmsg_debug_device:chr_file { getattr write }; -# Allow read /data/misc/adb/adb_keys -allow goldfish_system_setup adb_keys_file:file r_file_perms; -allow goldfish_system_setup adb_keys_file:dir search; +# Allow read/write /data/misc/adb/adb_keys +allow goldfish_system_setup adb_keys_file:file { create setattr rw_file_perms }; +allow goldfish_system_setup adb_keys_file:dir { search add_name write }; -# Set qemu.adb.copykey allow goldfish_system_setup toolbox_exec:file { getattr execute read open execute_no_trans map }; -set_prop(goldfish_system_setup, vendor_qemu_adb_prop); diff --git a/sepolicy/vendor/property.te b/sepolicy/vendor/property.te index 126fdb54..86632cac 100644 --- a/sepolicy/vendor/property.te +++ b/sepolicy/vendor/property.te @@ -1,4 +1,3 @@ -system_restricted_prop(vendor_qemu_adb_prop) vendor_restricted_prop(vendor_dlkm_prop) vendor_restricted_prop(vendor_qemu_prop) vendor_restricted_prop(vendor_net_wlan0_prop) diff --git a/sepolicy/vendor/property_contexts b/sepolicy/vendor/property_contexts index 1a7203ce..dd2142b5 100644 --- a/sepolicy/vendor/property_contexts +++ b/sepolicy/vendor/property_contexts @@ -1,5 +1,4 @@ vendor.dlkm.modules.ready u:object_r:vendor_dlkm_prop:s0 exact bool -vendor.qemu.adb.copykey u:object_r:vendor_qemu_adb_prop:s0 exact bool vendor.qemu.keyboard_layout u:object_r:vendor_qemu_prop:s0 exact string vendor.qemu.logcat_filter u:object_r:vendor_qemu_prop:s0 exact string vendor.qemu.sf.fake_camera u:object_r:vendor_qemu_prop:s0 exact string diff --git a/sepolicy/vendor/qemu_export_property.te b/sepolicy/vendor/qemu_export_property.te index 6ef121ab..e73589ea 100644 --- a/sepolicy/vendor/qemu_export_property.te +++ b/sepolicy/vendor/qemu_export_property.te @@ -1,4 +1,3 @@ -# qemu-adb-keys service: Writes host adb key for adbd on boot. type qemu_export_property, domain; type qemu_export_property_exec, vendor_file_type, exec_type, file_type; |