refine product make scripts

- allow enable overlayfs data partiton
- stub to extend product definition
- auto detect GPU
This commit is contained in:
Ziyang Zhou
2021-06-24 11:48:36 +00:00
parent 2179c87d1a
commit 3de95cfc55
4 changed files with 66 additions and 51 deletions

View File

@@ -1,10 +1,9 @@
on early-init on early-init
mount debugfs debugfs /sys/kernel/debug mode=755
mount none /system/etc /etc bind rec # docker fix mount none /system/etc /etc bind rec # docker fix
mount sysfs sysfs /sys rw remount # ueventd fix mount sysfs sysfs /sys rw remount # ueventd fix
write /data/.empty 0
mount none /data/.empty /proc/vmallocinfo bind # lxcfs?
# Mount binderfs # Mount binderfs
mkdir /dev/binderfs mkdir /dev/binderfs
mount binder binder /dev/binderfs stats=global mount binder binder /dev/binderfs stats=global
@@ -21,7 +20,22 @@ on early-init
# fix for WSL2 # fix for WSL2
mkdir /dev/input mkdir /dev/input
setprop gralloc.gbm.device /dev/dri/renderD128 exec - root root -- /vendor/bin/gpu_config.sh
# setup overlay data partition
on early-init && property:ro.kernel.redroid.overlay=1
mkdir /data-diff/upper
rmdir /data-diff/work
mkdir /data-diff/work
mount overlay overlay /data lowerdir=/data-base,upperdir=/data-diff/upper,workdir=/data-diff/work
on init
write /data/.empty 0
mount none /data/.empty /proc/vmallocinfo bind # lxcfs?
on post-fs-data on post-fs-data
# fix for static IP, must after post-fs-data and before netd # fix for static IP, must after post-fs-data and before netd

View File

@@ -12,6 +12,8 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
$(call inherit-product-if-exists, product.mk)
PRODUCT_SOONG_NAMESPACES += external/mesa3d PRODUCT_SOONG_NAMESPACES += external/mesa3d
# Arm64 linker failed, complain unsupported TLS DT entry # Arm64 linker failed, complain unsupported TLS DT entry
@@ -20,71 +22,72 @@ PRODUCT_SOONG_NAMESPACES += external/mesa3d
# ? # ?
PRODUCT_PROPERTY_OVERRIDES += \ PRODUCT_PROPERTY_OVERRIDES += \
ro.radio.noril=yes ro.radio.noril=yes
PRODUCT_PROPERTY_OVERRIDES += \ PRODUCT_PROPERTY_OVERRIDES += \
debug.sf.nobootanimation=1 debug.sf.nobootanimation=1
# required by sync.sh script # required by sync.sh script
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
fs_config fs_config
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
hwcomposer.redroid \ hwcomposer.redroid \
gralloc.redroid \ gralloc.redroid \
gralloc.gbm \ gralloc.gbm \
gatekeeper.ranchu \ gatekeeper.ranchu \
libEGL_swiftshader \ libEGL_swiftshader \
libGLESv1_CM_swiftshader \ libGLESv1_CM_swiftshader \
libGLESv2_swiftshader \ libGLESv2_swiftshader \
libGLES_mesa \ libGLES_mesa \
ipconfigstore \ ipconfigstore \
PRODUCT_PROPERTY_OVERRIDES += \ PRODUCT_PROPERTY_OVERRIDES += \
ro.hardware=redroid \ ro.hardware=redroid \
ro.hardware.gatekeeper=ranchu \ ro.hardware.gatekeeper=ranchu \
ro.sf.lcd_density=320 \ ro.sf.lcd_density=320 \
# Phone App required # Phone App required
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
rild rild
# WiFi required by SystemUI # WiFi required by SystemUI
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
android.hardware.wifi@1.0-service android.hardware.wifi@1.0-service
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \ frameworks/native/data/etc/android.hardware.wifi.xml:system/etc/permissions/android.hardware.wifi.xml \
# required HIDL # required HIDL
PRODUCT_PACKAGES += \ PRODUCT_PACKAGES += \
audio.r_submix.default \ audio.r_submix.default \
android.hardware.audio@2.0-service \ android.hardware.audio@2.0-service \
android.hardware.audio@2.0-impl \ android.hardware.audio@2.0-impl \
android.hardware.audio.effect@2.0-impl \ android.hardware.audio.effect@2.0-impl \
android.hardware.configstore@1.1-service \ android.hardware.configstore@1.1-service \
android.hardware.drm@1.0-service \ android.hardware.drm@1.0-service \
android.hardware.drm@1.0-impl \ android.hardware.drm@1.0-impl \
android.hardware.drm@1.1-service.clearkey \ android.hardware.drm@1.1-service.clearkey \
android.hardware.gatekeeper@1.0-service \ android.hardware.gatekeeper@1.0-service \
android.hardware.gatekeeper@1.0-impl \ android.hardware.gatekeeper@1.0-impl \
android.hardware.graphics.allocator@2.0-service \ android.hardware.graphics.allocator@2.0-service \
android.hardware.graphics.allocator@2.0-impl \ android.hardware.graphics.allocator@2.0-impl \
android.hardware.graphics.composer@2.1-service \ android.hardware.graphics.composer@2.1-service \
android.hardware.graphics.composer@2.1-impl \ android.hardware.graphics.composer@2.1-impl \
android.hardware.graphics.mapper@2.0-impl \ android.hardware.graphics.mapper@2.0-impl \
android.hardware.keymaster@3.0-service \ android.hardware.keymaster@3.0-service \
android.hardware.keymaster@3.0-impl \ android.hardware.keymaster@3.0-impl \
PRODUCT_COPY_FILES += \ PRODUCT_COPY_FILES += \
device/generic/goldfish/camera/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \ device/generic/goldfish/camera/media_codecs.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \ frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_audio.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \ frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_telephony.xml \
frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \ frameworks/av/media/libstagefright/data/media_codecs_google_video.xml:$(TARGET_COPY_OUT_VENDOR)/etc/media_codecs_google_video.xml \
frameworks/av/media/libeffects/data/audio_effects.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.conf \ frameworks/av/media/libeffects/data/audio_effects.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_effects.conf \
frameworks/native/data/etc/android.hardware.ethernet.xml:/system/etc/permissions/android.hardware.ethernet.xml \ frameworks/native/data/etc/android.hardware.ethernet.xml:/system/etc/permissions/android.hardware.ethernet.xml \
device/generic/goldfish/audio_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy.conf \ device/generic/goldfish/audio_policy.conf:$(TARGET_COPY_OUT_VENDOR)/etc/audio_policy.conf \
vendor/redroid/gpu_config.sh:$(TARGET_COPY_OUT_VENDOR)/bin/gpu_config.sh \
# Extend heap size we use for dalvik/art runtime # Extend heap size we use for dalvik/art runtime

View File

@@ -11,8 +11,7 @@ BUILD_EMULATOR_OPENGL := false
# use seperate vendor partition # use seperate vendor partition
TARGET_COPY_OUT_VENDOR := vendor TARGET_COPY_OUT_VENDOR := vendor
# TODO add panfrost BOARD_GPU_DRIVERS := virgl radeonsi
BOARD_GPU_DRIVERS := freedreno lima virgl radeonsi
DEVICE_MANIFEST_FILE := device/redroid/manifest.xml DEVICE_MANIFEST_FILE := device/redroid/manifest.xml
PRODUCT_ENFORCE_VINTF_MANIFEST := true PRODUCT_ENFORCE_VINTF_MANIFEST := true

View File

@@ -9,8 +9,7 @@ MINIMAL_FONT_FOOTPRINT := false
# use seperate vendor partition # use seperate vendor partition
TARGET_COPY_OUT_VENDOR := vendor TARGET_COPY_OUT_VENDOR := vendor
# i915g soong build error BOARD_GPU_DRIVERS := i915 i965 r300g r600g virgl iris radeonsi
BOARD_GPU_DRIVERS := i915 i965 nouveau kmsro r300g r600g virgl vmwgfx etnaviv iris tegra radeonsi
DEVICE_MANIFEST_FILE := device/redroid/manifest.xml DEVICE_MANIFEST_FILE := device/redroid/manifest.xml
PRODUCT_ENFORCE_VINTF_MANIFEST := true PRODUCT_ENFORCE_VINTF_MANIFEST := true