Skip to content
Snippets Groups Projects
Commit a1040926 authored by Bernhard Rosenkränzer's avatar Bernhard Rosenkränzer
Browse files

openharmony: Support qemuarm-efi, qemuarm64-efi and raspberrypi4-64


Add support for qemuarm-efi, qemuarm64-efi and raspberrypi4-64 target
machines, and create some symlinks to work with Oniro's filesystem
layout (read-only / and writable partitions under /run/mount)

Signed-off-by: default avatarBernhard Rosenkränzer <bernhard.rosenkraenzer.ext@huawei.com>
parent 0a5d9fea
No related branches found
No related tags found
No related merge requests found
...@@ -71,9 +71,29 @@ inherit python3native gn_base ptest ...@@ -71,9 +71,29 @@ inherit python3native gn_base ptest
B = "${S}/out/ohos-arm-release" B = "${S}/out/ohos-arm-release"
COMPATIBLE_MACHINE = "qemuarm" COMPATIBLE_MACHINE = "(qemuarm|qemuarm-efi|qemuarm64-efi|raspberrypi4-64)"
OHOS_DEVICE_CPU_ARCH = "arm" def get_ohos_arch(d):
arch = get_musl_loader_arch(d)
if arch.startswith("aarch64"):
return "arm64"
elif arch.startswith("arm"):
return "arm"
return arch
def get_ohos_libdir(d):
if get_ohos_arch(d).endswith("64"):
return "lib64"
else:
return "lib"
def get_ohos_libdirs(d):
if get_ohos_arch(d).endswith("64"):
return "/system/lib64 /system/lib"
else:
return "/system/lib"
OHOS_DEVICE_CPU_ARCH = "${@get_ohos_arch(d)}"
OHOS_DEVICE_NAME = "qemuarm" OHOS_DEVICE_NAME = "qemuarm"
OHOS_DEVICE_COMPANY = "oniro" OHOS_DEVICE_COMPANY = "oniro"
OHOS_PRODUCT_NAME = "yocto-ohos-${OHOS_DEVICE_NAME}" OHOS_PRODUCT_NAME = "yocto-ohos-${OHOS_DEVICE_NAME}"
...@@ -157,10 +177,14 @@ do_install () { ...@@ -157,10 +177,14 @@ do_install () {
# then setup /system/lib and /system/bin symlinks to avoid breaking use of # then setup /system/lib and /system/bin symlinks to avoid breaking use of
# hard-coded paths. # hard-coded paths.
mkdir -p ${D}/system ${D}${libdir} ${D}${bindir} mkdir -p ${D}/system ${D}${libdir} ${D}${bindir}
cp -r ${OHOS_PACKAGE_OUT_DIR}/system/lib/* ${D}${libdir}/ cp -r ${OHOS_PACKAGE_OUT_DIR}/system/${@get_ohos_libdir(d)}/* ${D}${libdir}/
install -m 755 -t ${D}${bindir}/ ${OHOS_PACKAGE_OUT_DIR}/system/bin/* install -m 755 -t ${D}${bindir}/ ${OHOS_PACKAGE_OUT_DIR}/system/bin/*
ln -sfT ..${libdir} ${D}/system/lib ln -sfT ..${libdir} ${D}/system/${@get_ohos_libdir(d)}
ln -sfT ..${bindir} ${D}/system/bin ln -sfT ..${bindir} ${D}/system/bin
# FIXME this is not really the right thing to do, but OpenHarmony hardcodes
# /system/lib in some places and uses /system/lib64 in a few others.
# For now, this fix is sufficient.
[ "${@get_ohos_libdir(d)}" != "lib" ] && ln -s ${@get_ohos_libdir(d)} ${D}/system/lib
# system ability configurations # system ability configurations
mkdir -p ${D}${libdir}/openharmony/profile mkdir -p ${D}${libdir}/openharmony/profile
...@@ -180,6 +204,10 @@ do_install () { ...@@ -180,6 +204,10 @@ do_install () {
# Avoid file-conflict on /usr/bin/udevadm with //third_party/eudev and udev # Avoid file-conflict on /usr/bin/udevadm with //third_party/eudev and udev
# recipe # recipe
rm ${D}${bindir}/udevadm rm ${D}${bindir}/udevadm
# OpenHarmony needs a writable /data, which doesn't exist in the normal
# Oniro filesystem layout - but appdata is a good match
ln -s /run/mount/appdata ${D}/data
} }
PACKAGES =+ "${PN}-configs ${PN}-fonts" PACKAGES =+ "${PN}-configs ${PN}-fonts"
...@@ -204,10 +232,12 @@ FILES:${PN}:remove = "${libdir}/${BPN}/*" ...@@ -204,10 +232,12 @@ FILES:${PN}:remove = "${libdir}/${BPN}/*"
FILES:${PN}-configs = "${sysconfdir}" FILES:${PN}-configs = "${sysconfdir}"
FILES:${PN}-fonts = "${datadir}/fonts" FILES:${PN}-fonts = "${datadir}/fonts"
FILES:${PN} += "/system/bin /system/lib /system/profile" FILES:${PN} += "/system/bin ${@get_ohos_libdirs(d)} /system/profile"
FILES:${PN}-configs += "/system/etc" FILES:${PN}-configs += "/system/etc"
FILES:${PN}-fonts += "/system/fonts" FILES:${PN}-fonts += "/system/fonts"
FILES:${PN} += "/data"
generate_build_config_json_file() { generate_build_config_json_file() {
mkdir -p "${OHOS_PRELOADER_BUILD_CONFIG_DIR}" mkdir -p "${OHOS_PRELOADER_BUILD_CONFIG_DIR}"
......
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