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 (cherry-pick to maru-0.6) #14

Open
wants to merge 1 commit into
base: maru-0.6
Choose a base branch
from
Open
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
10 changes: 1 addition & 9 deletions device-maru.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
# limitations under the License.
#

# lazy set prebuilt rootfs to maru if empty
PREBUILT_REPO ?= maruos

# early build definitions for maru
include $(LOCAL_PATH)/maru_build.mk

Expand All @@ -26,17 +23,12 @@ PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/init.maru.rc:root/init.maru.rc

# container
PRODUCT_PACKAGES += rootfs.tar.gz
PRODUCT_COPY_FILES += \
$(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

# prebuilt rootfs
ifeq ($(PREBUILT_REPO),maruos)
PRODUCT_COPY_FILES += \
$(LOCAL_PATH)/prebuilts/desktop-rootfs.tar.gz:system/maru/containers/default/rootfs.tar.gz
endif

# LXC
PRODUCT_PACKAGES += \
liblxc \
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))