Makefile: Get private overlay resource when resource/ does not exist.
The factory makefile ignores private overlay resources when the directory
`chromeos-base/factory-board/files/resources/` does not exist. The CL
changes the makefile to always find resource files even if the directory
does not exist.
BUG=chromium:865866
TEST=Find an overlay with py/config/cutoff.json and without resource/;
`emerge-<board> chromeos-base/factory`;
`emerge-<board> chromeos-base/factory_installer`;
`script/build_image --board=<board> factory_install`;
Mount factory shim, see cutoff.json in /usr/share/cutoff/
Change-Id: I081183a5dfebb3a5031d801b21c85a45dc385cf7
Reviewed-on: https://chromium-review.googlesource.com/1144815
Commit-Ready: Cheng-Han Yang <chenghan@chromium.org>
Tested-by: Cheng-Han Yang <chenghan@chromium.org>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
diff --git a/Makefile b/Makefile
index 6face56..6d9ada7 100644
--- a/Makefile
+++ b/Makefile
@@ -206,8 +206,7 @@
tar -Af $(RESOURCE_PATH) $(file)${\n})
$(MK_DIR)/create_resources.py -v --output_dir $(RESOURCE_DIR) \
--sysroot $(SYSROOT) --resources $(RESOURCE_SRC_DIR) \
- $(if $(wildcard $(BOARD_FILES_DIR)/$(RESOURCE_SRC_DIR)), \
- --board_resources $(BOARD_FILES_DIR)/$(RESOURCE_SRC_DIR))
+ --board_resources $(BOARD_FILES_DIR)/$(RESOURCE_SRC_DIR)
# Apply files from BOARD_RESOURCES_DIR to particular folder.
# Usage: $(call func-apply-board-resources,RESOURCE_TYPE,OUTPUT_FOLDER)
diff --git a/devtools/mk/create_resources.py b/devtools/mk/create_resources.py
index 3be6439..9ffb1aa 100755
--- a/devtools/mk/create_resources.py
+++ b/devtools/mk/create_resources.py
@@ -47,9 +47,9 @@
if os.path.isabs(src):
src_list = [os.path.join(args.sysroot, '.' + src)]
else:
- src_list = [os.path.join(args.resources, src)]
+ src_list = [os.path.normpath(os.path.join(args.resources, src))]
if args.board_resources:
- src_list += [os.path.join(args.board_resources, src)]
+ src_list += [os.path.normpath(os.path.join(args.board_resources, src))]
found = 0
for src_path in src_list: