Commit da7a4aa2 authored by Oliver Horst's avatar Oliver Horst
Browse files

[chg] First working dependency chain

parent 69c164ae
require recipes-core/freertos-plus/freertos-plus-common.inc
require app-config.inc
S = "${WORKDIR}/git/include"
inherit toki-externalsrc python3native native
EXTERNALSRC = "${@relative_externalsrc(d, "components/freertos-plus/include")}"
DEPENDS += "\
${TOKI_APPS} \
freertos-plus-headers \
python3-native \
python3-cffi-native \
"
do_compile () {
${CC} -DPYTHON_CFFI -E -P ${S}/freertos+/elfloader/app-config.h > ${B}/app-config.preprocessed.h
${PYTHON} \
${THISDIR}/python3/app-list-builder.py \
"${WORKDIR}/recipe-sysroot/usr/bin" \
"${B}" \
"${BIN_NAME}" \
"${@get_toki_deployment_config_base64encoded(d)}" \
"${TOKI_AMP_CORE}"
}
do_install () {
install -d ${D}${libdir}
install -m 644 ${BIN_NAME} ${D}${libdir}
}
sysroot_stage_all_append () {
#extend_recipe_sysroot () {
install -d ${SYSROOT_DESTDIR}/usr/lib
install -m 644 ${D}${libdir}/${BIN_NAME} ${SYSROOT_DESTDIR}/usr/lib/${BIN_NAME}
}
#PACKAGES = "${PN}"
FILES_${PN} += "${libdir}/*"
require recipes-core/freertos-plus/freertos-plus-common.inc
require app-config.inc
S = "${WORKDIR}/git/include"
LICENSE = "CLOSED"
LIC_FILES_CHKSUM = ""
inherit toki-externalsrc python3-dir python3native native
EXTERNALSRC = "${@relative_externalsrc(d, "components/freertos-plus/include")}"
DEPENDS += "app-config-native"
DEPENDS += "\
${TOKI_APPS} \
freertos-plus-headers \
python3-native \
python3-cffi-native \
"
FILES_${PN} += "${LIB_NAME}"
do_compile () {
${CC} -DPYTHON_CFFI -E -P ${S}/freertos+/elfloader/app-config.h > ${B}/app-config.preprocessed.h
${PYTHON} \
${THISDIR}/python3/app-list-builder.py \
"${WORKDIR}" \
"${B}" \
"${@get_toki_deployment_config_base64encoded(d)}" \
"${TOKI_AMP_CORE}"
cd ${B}
${OBJCOPY} -I binary -O elf64-littleaarch64 -B aarch64 ${RECIPE_SYSROOT_NATIVE}${libdir}/${BIN_NAME} ${LIB_NAME}
}
do_install() {
install -d ${D}${includedir}/freertos+/elfloader
install -m 0660 app-config.preprocessed.h ${D}${includedir}/freertos+/elfloader/
do_install () {
install -d "${D}/${libdir}"
install -m 644 "${B}/${LIB_NAME}" "${D}/${libdir}"
}
BIN_NAME = "applist.bin"
LIB_NAME = "libapplist.a"
......@@ -17,11 +17,12 @@ def transferconfig(ffi, cdata, struct, config):
setattr(struct, key, cdata.cast(ffi._typeoffsetof(cdata.typeof(struct), *[key])[0], config[key]))
work_dir = sys.argv[1]
bin_dir = sys.argv[1]
build_dir = sys.argv[2]
bin_name = sys.argv[3]
config = json.loads(base64.b64decode(sys.argv[3]).decode())
core = int(sys.argv[4])
config = json.loads(base64.b64decode(sys.argv[4]).decode())
core = int(sys.argv[5])
apps = config['cores'][core]["apps"]
......@@ -49,7 +50,7 @@ total_size = 0
apps_path = {}
for app_name in apps.keys():
app_path = os.path.join(work_dir, "recipe-sysroot", "usr", "bin", "{}.elf".format(app_name))
app_path = os.path.join(bin_dir, "{}.elf".format(app_name))
app_stat = os.stat(app_path)
app_size = app_stat.st_size
......@@ -99,7 +100,7 @@ for app_name in apps.keys():
# Write the app list structure into the desired 'app_list.bin' output file
out_path = os.path.join(build_dir, "app_list.bin")
out_path = os.path.join(build_dir, bin_name)
with open(out_path, "wb") as out_file:
out_file.write(cdata.buffer(block, total_size))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment