Skip to content
Snippets Groups Projects
Commit 91827b46 authored by Thierry Escande's avatar Thierry Escande
Browse files

openharmony-standard: Add a sanity check function for lib paths


This change adds a post do_install() function that checks if all
subfloders copied from system/lib/module are set in the distro variable
MUSL_LDSO_PATHS and thus are part of the ld-musl-${MUSL_LDSO_ARCH}.path
file.

Signed-off-by: default avatarThierry Escande <thierry.escande@huawei.com>
parent fd1df244
No related branches found
No related tags found
1 merge request!24Add MUSL_LDSO_PATHS distro variable
Pipeline #5548 passed
# SPDX-FileCopyrightText: Huawei Inc.
#
# SPDX-License-Identifier: Apache-2.0
# This post do_install() function checks if all subfloders copied from
# system/lib/module are set in the distro variable MUSL_LDSO_PATHS.
#
# This variable is used to generate the content of the file
# /etc/ld-musl-${MUSL_LDSO_ARCH}.path so this function stops bitbake
# if one of the coipied folder from /system/lib/module/* is not in
# MUSL_LDSO_PATHS.
musl_ldso_paths_sanity_check() {
cd "${D}/${libdir}"
MODULE_LIB_PATHS="$(find module -type d)"
for folder in ${MODULE_LIB_PATHS}; do
PAT="(^|[[:space:]])${folder}([[:space:]]|$)"
if [[ ! "${MUSL_LDSO_PATHS}" =~ ${PAT} ]]; then
echo
echo "'${folder}' not in MUSL_LDSO_PATHS"
echo "Add it in conf/distro/include/musl-ldso-paths.inc"
echo
return 1
fi
done
}
do_install[postfuncs] += "musl_ldso_paths_sanity_check"
......@@ -17,6 +17,7 @@ DEPENDS += "bison-native"
DEPENDS += "ruby-native"
require ${PN}-sources-${OPENHARMONY_VERSION}.inc
require musl-ldso-paths-sanity-check.inc
FILESEXTRAPATHS:prepend := "${THISDIR}/openharmony-${OPENHARMONY_VERSION}:"
FILESEXTRAPATHS:prepend := "${THISDIR}/openharmony-standard-${OPENHARMONY_VERSION}:"
......
......@@ -23,6 +23,7 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/openharmony-standard-${OPENHARMONY_VERSIO
require ${PN}-sources-${OPENHARMONY_VERSION}.inc
require java-tools.inc
require musl-ldso-paths-sanity-check.inc
SRC_URI += "${@bb.utils.contains('PTEST_ENABLED', '1', 'file://run-ptest', '', d)}"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment