Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support vendors overriding desktop rootfs img #13

Merged
merged 1 commit into from
Apr 10, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion device-maru.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init.maru.rc:root/init.maru.rc

# container
PRODUCT_PACKAGES += rootfs.tar.gz
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/prebuilts/desktop-rootfs.tar.gz:system/maru/containers/default/rootfs.tar.gz \
$(LOCAL_PATH)/container/default/config:system/maru/containers/default/config \
$(LOCAL_PATH)/container/default/fstab:system/maru/containers/default/fstab \
$(LOCAL_PATH)/container/mcprepare.sh:system/bin/mcprepare
Expand Down
22 changes: 22 additions & 0 deletions prebuilts/Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,26 @@
#
LOCAL_PATH := $(call my-dir)

# TARGET_DESKTOP_ROOTFS can be set in vendor makefiles to override the default
# desktop rootfs image for Maru. Note that the path must be relative to the
# AOSP workspace root directory, which can easily be done by prefixing the path
# with $(LOCAL_PATH).
ifeq ($(TARGET_DESKTOP_ROOTFS),)
TARGET_DESKTOP_ROOTFS := $(LOCAL_PATH)/desktop-rootfs.tar.gz
endif

include $(CLEAR_VARS)
LOCAL_MODULE := rootfs.tar.gz
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_CLASS := ETC
LOCAL_MODULE_PATH := $(TARGET_OUT)/maru/containers/default

# Instead of using LOCAL_SRC_FILES and $(BUILD_PREBUILT), we explicitly set up
# the rule ourselves so that we can copy a rootfs path from outside of this
# directory if a vendor overrides TARGET_DESKTOP_ROOTFS.
include $(BUILD_SYSTEM)/base_rules.mk
$(LOCAL_BUILT_MODULE): $(TARGET_DESKTOP_ROOTFS)
@mkdir -p $(dir $@)
@cp $(TARGET_DESKTOP_ROOTFS) $@

include $(call all-makefiles-under, $(LOCAL_PATH))