OSDN Git Service

Copy firmwares into $(TARGET_OUT)/lib/firmware
authorChih-Wei Huang <cwhuang@linux.org.tw>
Thu, 5 May 2016 18:12:03 +0000 (02:12 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Sun, 5 Jun 2016 14:29:09 +0000 (22:29 +0800)
Keep the symbolic links as well.

Android.mk [new file with mode: 0644]
firmware.mk [new file with mode: 0644]

diff --git a/Android.mk b/Android.mk
new file mode 100644 (file)
index 0000000..1bf7c2b
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# Copyright (C) 2016 The Android-x86 Open Source Project
+#
+# Licensed under the GNU General Public License Version 2 or later.
+# You may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.gnu.org/licenses/gpl.html
+#
+
+LOCAL_PATH := $(my-dir)
+
+SYMLINKS := $(subst $(LOCAL_PATH),$(TARGET_OUT)/lib/firmware,$(shell find $(LOCAL_PATH) -type l))
+
+$(SYMLINKS): FW_PATH := $(LOCAL_PATH)
+$(SYMLINKS):
+       @link_to=`readlink $(subst $(TARGET_OUT)/lib/firmware,$(FW_PATH),$@)`; \
+       echo "Symlink: $@ -> $$link_to"; \
+       mkdir -p $(@D); ln -sf $$link_to $@
+
+ALL_DEFAULT_INSTALLED_MODULES += $(SYMLINKS)
diff --git a/firmware.mk b/firmware.mk
new file mode 100644 (file)
index 0000000..855e7a6
--- /dev/null
@@ -0,0 +1,15 @@
+#
+# Copyright (C) 2016 The Android-x86 Open Source Project
+#
+# Licensed under the GNU General Public License Version 2 or later.
+# You may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.gnu.org/licenses/gpl.html
+#
+
+LOCAL_FIRMWARES_DIR ?= $(LOCAL_PATH)
+LOCAL_FIRMWARES ?= $(filter-out .git/% %.mk,$(subst ./,,$(shell cd $(LOCAL_FIRMWARES_DIR) && find . -type f)))
+
+PRODUCT_COPY_FILES := \
+    $(foreach f,$(LOCAL_FIRMWARES),$(LOCAL_FIRMWARES_DIR)/$(f):system/lib/firmware/$(f))