diff --git a/conf/distro/include/openharmony.inc b/conf/distro/include/openharmony.inc index 2c679336dea1b0e8043acd312491953e60ec01df..0bf6204dc86b026314757cd552d689e695f7fc68 100644 --- a/conf/distro/include/openharmony.inc +++ b/conf/distro/include/openharmony.inc @@ -4,9 +4,20 @@ # OpenHarmony OS version OPENHARMONY_VERSION ?= "3.1" -OPENHARMONY_OVERRIDES = "openharmony-${OPENHARMONY_VERSION}:openharmony" OPENHARMONY_VERSION_FULL = "${OPENHARMONY_VERSION}" OPENHARMONY_VERSION_FULL:openharmony-3.0 = "3.0.1" OPENHARMONY_VERSION_FULL:openharmony-3.1 = "3.1.1" +# Generic and version specific OpenHarmony DISTROOVERRIDES +# Enabling "openharmony" distro feature activates the "df-openharmony" +# override, which can therefore be used for overriding stuff independent of +# OpenHarmony version. +# For overriding for a specific OpenHarmony version, use e.g. "openharmony-3.0" +# OpenHarmony 3.0 specific override, And similar for other supported versions. +INHERIT += "distrooverrides" +DISTRO_FEATURES_OVERRIDES += "openharmony" +OPENHARMONY_OVERRIDES = "" +OPENHARMONY_OVERRIDES:df-openharmony = ":openharmony-${OPENHARMONY_VERSION}" +DISTROOVERRIDES:append = "${OPENHARMONY_OVERRIDES}" + PREFERRED_VERSION_openharmony-standard = "${OPENHARMONY_VERSION}" diff --git a/conf/distro/oniro-openharmony-linux.conf b/conf/distro/oniro-openharmony-linux.conf index d75f9c54f954e0e1bc1bdb195410f1a0bcfcd447..69042a16249466d74f0de57f08a035a5a1b82793 100644 --- a/conf/distro/oniro-openharmony-linux.conf +++ b/conf/distro/oniro-openharmony-linux.conf @@ -8,7 +8,7 @@ DISTRO_VERSION = "1.99.99" # OpenHarmony OS version require include/openharmony.inc -DISTROOVERRIDES:append = ":${OPENHARMONY_OVERRIDES}" +DISTRO_FEATURES:append = " openharmony" # LLVM/Clang toolchain TOOLCHAIN = "clang" diff --git a/recipes-core/musl/musl_%.bbappend b/recipes-core/musl/musl_%.bbappend index 460b14ab8ca15677a550bf77af3e3714a8a992ce..4bbbd3fd06ebc2b08ae56e6f747143429c21bb1b 100644 --- a/recipes-core/musl/musl_%.bbappend +++ b/recipes-core/musl/musl_%.bbappend @@ -2,14 +2,14 @@ # # SPDX-License-Identifier: Apache-2.0 -BASEVER:openharmony = "1.2.0" -SRCREV:openharmony = "040c1d16b468c50c04fc94edff521f1637708328" -LIC_FILES_CHKSUM:openharmony = "file://COPYRIGHT;md5=f95ee848a08ad253c04723da00cedb01" -FILESEXTRAPATHS:prepend:openharmony := "${THISDIR}/openharmony-${OPENHARMONY_VERSION}:" -SRC_URI:append:openharmony = " file://openharmony-common.patch" -SRC_URI:append:openharmony = " file://openharmony-linux-user.patch" +BASEVER:df-openharmony = "1.2.0" +SRCREV:df-openharmony = "040c1d16b468c50c04fc94edff521f1637708328" +LIC_FILES_CHKSUM:df-openharmony = "file://COPYRIGHT;md5=f95ee848a08ad253c04723da00cedb01" +FILESEXTRAPATHS:prepend:df-openharmony := "${THISDIR}/openharmony-${OPENHARMONY_VERSION}:" +SRC_URI:append:df-openharmony = " file://openharmony-common.patch" +SRC_URI:append:df-openharmony = " file://openharmony-linux-user.patch" # This conflicts with libcap, so we have to go with libcap instead -#SRC_URI:append:openharmony = " file://openharmony-linux-user-capability_h.patch" +#SRC_URI:append:df-openharmony = " file://openharmony-linux-user-capability_h.patch" # As musl links with -nostdlib, we need to add linking with # libclang_rt.builtins.a manually as needed @@ -22,9 +22,9 @@ LDFLAGS:append:toolchain-clang = " ${@bb.utils.contains('COMPILER_RT', '-rtlib=c # with `-nostdinc` argument. # Possible fix is to rewrite the hooks implementation to use the musl internal # atomic.h functions instead. -#CFLAGS:append:openharmony = "-DHOOK_ENABLE" +#CFLAGS:append:df-openharmony = "-DHOOK_ENABLE" -do_install:append:openharmony () { +do_install:append:df-openharmony () { for folder in ${MUSL_LDSO_PATHS}; do echo "${libdir}/${folder}" >> ${D}${sysconfdir}/ld-musl-${MUSL_LDSO_ARCH}.path done diff --git a/recipes-devtools/gn/gn_%.bbappend b/recipes-devtools/gn/gn_%.bbappend index ecc3b2e44fead86d3f2b44a9fb9f9a4f18a457cf..60e626fdcb76e2c703bb0bb47c99c7c1ee6fcd78 100644 --- a/recipes-devtools/gn/gn_%.bbappend +++ b/recipes-devtools/gn/gn_%.bbappend @@ -6,4 +6,4 @@ # GN function which was recently dropped, therefore downgrading GN to revision # compatible with OpenHarmony -SRCREV:openharmony = "5da62d5e9d0f10cb8ece7c30563a6a214c78b68d" +SRCREV:df-openharmony = "5da62d5e9d0f10cb8ece7c30563a6a214c78b68d" diff --git a/recipes-kernel/linux-libc-headers/linux-libc-headers_%.bbappend b/recipes-kernel/linux-libc-headers/linux-libc-headers_%.bbappend index d6290f8afd1d76c171cd0e5e9cae8d9645d2fc4e..f8890da83ef389533a4b5b78048f622c24675393 100644 --- a/recipes-kernel/linux-libc-headers/linux-libc-headers_%.bbappend +++ b/recipes-kernel/linux-libc-headers/linux-libc-headers_%.bbappend @@ -4,6 +4,6 @@ # OpenHarmony relies on Android's ashmem, which is in staging and therefore # the header is not installed by default -do_install:append:openharmony() { +do_install:append:df-openharmony() { install ${S}/drivers/staging/android/uapi/ashmem.h ${D}${includedir}/linux } diff --git a/recipes-kernel/linux-yocto/linux-yocto_%.bbappend b/recipes-kernel/linux-yocto/linux-yocto_%.bbappend index 572820bd36383b6c6e175ab824b8f87fea75eb6b..942527449f9cdbd1275d1e7f12779e41b92da88e 100644 --- a/recipes-kernel/linux-yocto/linux-yocto_%.bbappend +++ b/recipes-kernel/linux-yocto/linux-yocto_%.bbappend @@ -4,10 +4,10 @@ FILESEXTRAPATHS:prepend := "${THISDIR}/linux-yocto:" -SRC_URI:append:openharmony = " file://ashmem.cfg" -SRC_URI:append:openharmony = " file://driver-add-hilog-and-hievent-buffer-management-drive.patch" -SRC_URI:append:openharmony = " file://driver-add-hilog-and-hievent-buffer-management-drive.cfg" -SRC_URI:append:openharmony = " file://android_binder_ipc.cfg" +SRC_URI:append:df-openharmony = " file://ashmem.cfg" +SRC_URI:append:df-openharmony = " file://driver-add-hilog-and-hievent-buffer-management-drive.patch" +SRC_URI:append:df-openharmony = " file://driver-add-hilog-and-hievent-buffer-management-drive.cfg" +SRC_URI:append:df-openharmony = " file://android_binder_ipc.cfg" # # QEMU ARM Cortex-A7