diff --git a/recipes-openharmony/tools/openharmony-tools.bb b/recipes-openharmony/tools/openharmony-tools.bb index 49e3a402446922458f83527424765f2066c38bd4..b23171cf53b8e85c5a4c6caf64508fa5703320bc 100644 --- a/recipes-openharmony/tools/openharmony-tools.bb +++ b/recipes-openharmony/tools/openharmony-tools.bb @@ -4,6 +4,7 @@ SUMMARY = "OpenHarmony development tools" LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" require sanity-check.inc @@ -61,6 +62,28 @@ EOF fi } +do_populate_sdk[depends] += "${DEPENDS_QEMU_IMAGES}" +DEPENDS_QEMU_IMAGES = "" +DEPENDS_QEMU_IMAGES:qemuarma7 += "openharmony-standard-image:do_image_complete virtual/kernel:do_deploy" +addtask populate_sdk after do_unpack before do_build +SRC_URI:append:qemuarma7 = " file://post-relocate-setup.sh" +create_sdk_files:append:qemuarma7 () { + mkdir -p ${SDK_OUTPUT}${SDKPATH}/images/${MACHINE} + cp ${DEPLOY_DIR_IMAGE}/openharmony-standard-image-${MACHINE}.ext4 \ + ${DEPLOY_DIR_IMAGE}/zImage-${MACHINE}.bin \ + ${SDK_OUTPUT}${SDKPATH}/images/${MACHINE}/ + cat ${DEPLOY_DIR_IMAGE}/openharmony-standard-image-${MACHINE}.qemuboot.conf | \ + sed -e 's|^\(deploy_dir_image\) = .*|\1 = @SDKPATH@/images/${MACHINE}|' \ + -e 's|^\(qb_default_kernel\) = .*|\1 = zImage-${MACHINE}.bin|' \ + -e 's|^\(staging_bindir_native\) = .*|\1 = @SDKPATH@/sysroots/${SDK_SYS}/usr/bin|' \ + -e 's|^\(staging_dir_host\) = .*|\1 = @SDKPATH@/sysroots/foobar|' \ + -e 's|^\(staging_dir_native\) = .*|\1 = @SDKPATH@/sysroots/${SDK_SYS}|' \ + -e 's|^\(uninative_loader\) = .*|\1 = @SDKPATH@/sysroots/${SDK_SYS}/lib/ld-linux-${SDK_ARCH}.so.2|' \ + > ${SDK_OUTPUT}${SDKPATH}/images/${MACHINE}/openharmony-standard-image-${MACHINE}.qemuboot.conf + mkdir -p ${SDK_OUTPUT}${SDKPATHNATIVE}/post-relocate-setup.d + install -m 0755 ${WORKDIR}/post-relocate-setup.sh ${SDK_OUTPUT}${SDKPATH}/post-relocate-setup.sh +} + TOOLCHAIN_TARGET_TASK:append:df-acts = " openharmony-standard-acts" create_sdk_files:append:df-acts () { pwd diff --git a/recipes-openharmony/tools/openharmony-tools/post-relocate-setup.sh b/recipes-openharmony/tools/openharmony-tools/post-relocate-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..54f68d4c2434f11e92fe0151fda23b8bc6fe814c --- /dev/null +++ b/recipes-openharmony/tools/openharmony-tools/post-relocate-setup.sh @@ -0,0 +1,15 @@ +#! /bin/sh +# SPDX-FileCopyrightText: Huawei Inc. +# +# SPDX-License-Identifier: Apache-2.0 + +echo -n "Fixing qemuboot.conf files..." + +sdkpath="${1:?}" +sdkpath_build="${2:?}" + +for f in $sdkpath/images/*/*qemuboot.conf ; do + sed -i $f -e "s|@SDKPATH@|$sdkpath|" +done + +echo "done"