Create $OUT/{vendor,odm}/lib before symlink modules

Before creating symlinks $OUT/{vendor,odm}/lib/modules, make sure
parent directory exists first.

Test: build CF
Bug: 156020364
Change-Id: Id2a9e5273aae75944c1b31553fad3703540bf2f4
This commit is contained in:
Yifan Hong 2020-07-15 17:27:28 -07:00
parent 81a092ff88
commit 1e6d21787a
1 changed files with 2 additions and 0 deletions

View File

@ -2791,6 +2791,7 @@ endif
# are not guaranteed to exist on all devices. # are not guaranteed to exist on all devices.
ifdef BOARD_USES_VENDOR_DLKMIMAGE ifdef BOARD_USES_VENDOR_DLKMIMAGE
define create-vendor-vendor_dlkm-symlink define create-vendor-vendor_dlkm-symlink
$(hide) mkdir -p $(TARGET_OUT_VENDOR)/lib
$(hide) if [ -d $(TARGET_OUT_VENDOR)/lib/modules ] && [ ! -h $(TARGET_OUT_VENDOR)/lib/modules ]; then \ $(hide) if [ -d $(TARGET_OUT_VENDOR)/lib/modules ] && [ ! -h $(TARGET_OUT_VENDOR)/lib/modules ]; then \
echo 'Non-symlink $(TARGET_OUT_VENDOR)/lib/modules detected!' 1>&2; \ echo 'Non-symlink $(TARGET_OUT_VENDOR)/lib/modules detected!' 1>&2; \
echo 'You cannot install files to $(TARGET_OUT_VENDOR)/lib/modules while building a separate vendor_dlkm.img!' 1>&2; \ echo 'You cannot install files to $(TARGET_OUT_VENDOR)/lib/modules while building a separate vendor_dlkm.img!' 1>&2; \
@ -2819,6 +2820,7 @@ endif
# are not guaranteed to exist on all devices. # are not guaranteed to exist on all devices.
ifdef BOARD_USES_ODM_DLKMIMAGE ifdef BOARD_USES_ODM_DLKMIMAGE
define create-odm-odm_dlkm-symlink define create-odm-odm_dlkm-symlink
$(hide) mkdir -p $(TARGET_OUT_ODM)/lib
$(hide) if [ -d $(TARGET_OUT_ODM)/lib/modules ] && [ ! -h $(TARGET_OUT_ODM)/lib/modules ]; then \ $(hide) if [ -d $(TARGET_OUT_ODM)/lib/modules ] && [ ! -h $(TARGET_OUT_ODM)/lib/modules ]; then \
echo 'Non-symlink $(TARGET_OUT_ODM)/lib/modules detected!' 1>&2; \ echo 'Non-symlink $(TARGET_OUT_ODM)/lib/modules detected!' 1>&2; \
echo 'You cannot install files to $(TARGET_OUT_ODM)/lib/modules while building a separate odm_dlkm.img!' 1>&2; \ echo 'You cannot install files to $(TARGET_OUT_ODM)/lib/modules while building a separate odm_dlkm.img!' 1>&2; \