Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 51 additions & 0 deletions classes/source-info.bbclass
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@

python do_collect_source_info() {
import json

log_file = f"{d.getVar('T')}/source-info.json"

source_info = d.getVar("EMLINUX_SOURCE_FROM")
if source_info is None:
distro = d.getVar("DISTRO").split("-")[1]
source_info = distro

data = {
"source_package_name": d.getVar("PN"),
"source_from": source_info,
}

with open(log_file, "w") as f:
json.dump(data, f, indent=4)
}

python do_merge_source_info() {
import glob
import json

distro = d.getVar("DISTRO")
distro_arch = d.getVar("DISTRO_ARCH")

tmpdir = d.getVar("TMPDIR")

basepath = f"{tmpdir}/work/{distro}-{distro_arch}"
search_path = f"{basepath}/*/*/temp/source-info.json"

source_info = {}

for file in glob.glob(search_path):
with open(file) as f:
data = json.load(f)
pkg = data["source_package_name"]
source_info[pkg] = data

source_info = dict(sorted(source_info.items(), key=lambda x: x[0], reverse=False))

source_info_file = d.getVar("DEPLOY_DIR_IMAGE") + "/all-source-info.json"

with open(source_info_file, "w") as f:
json.dump(source_info, f, indent=4)

}

addtask collect_source_info after do_dpkg_source before do_dpkg_build
addtask merge_source_info after do_image before do_deploy
2 changes: 1 addition & 1 deletion conf/distro/emlinux-common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

require include/security_flags.inc

INHERIT += "sdk-installer"
INHERIT += "sdk-installer source-info"

DISTRO_KERNELS ?= "linux-cip"
KERNEL_NAME ?= "cip"
Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ RUN bash -c 'if test -n "$no_proxy"; then git config --global core.noproxy "$no_
RUN pip install --user 'cyclonedx-python-lib>=7.3.2,<=7.5.1' --break-system-packages --no-warn-script-location
RUN pip install --user jsonschema==4.21.1 --break-system-packages --no-warn-script-location
RUN pip install --user spdx-tools==0.8.2 --break-system-packages --no-warn-script-location
RUN pip install --user looseversion==1.3.0 --break-system-packages --no-warn-script-location

RUN mkdir work
WORKDIR /home/build/work
4 changes: 2 additions & 2 deletions recipes-core/emlinux-customization/emlinux-customization.bb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
#
FILESEXTRAPATHS:prepend := "${FILE_DIRNAME}/files:"

EMLINUX_SOURCE_FROM="non-debian"
DESCRIPTION = "EMLinux 3.x specific customization"

LICENSE = "MIT"
DEBIAN_DEPENDS = "netbase"

inherit dpkg-raw
Expand All @@ -26,4 +27,3 @@ do_install:append() {
echo "PS1=\"${EMLINUX_ENVIRONMENT_VARIABLE_PS1}\"" > "${D}/etc/profile.d/ps1.sh"
fi
}

2 changes: 2 additions & 0 deletions recipes-kernel/linux/linux-cip-rt_6.1.bb
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,5 @@ SRC_URI += " file://preempt-rt.cfg"
SRC_URI:append:generic-x86-64 = " file://generic-x86-64_defconfig"
SRC_URI:append:raspberrypi3bplus-64 = " file://raspberrypi3-64_defconfig"
SRC_URI:append:raspberrypi4b-64 = " file://raspberrypi4-64_defconfig"

EMLINUX_SOURCE_FROM="non-debian"
2 changes: 2 additions & 0 deletions recipes-kernel/linux/linux-cip_6.1.bb
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ SRC_URI:append:qemu-amd64 = " file://qemu-amd64_defconfig"
SRC_URI:append:generic-x86-64 = " file://generic-x86-64_defconfig"
SRC_URI:append:raspberrypi3bplus-64 = " file://raspberrypi3-64_defconfig"
SRC_URI:append:raspberrypi4b-64 = " file://raspberrypi4-64_defconfig"

EMLINUX_SOURCE_FROM="non-debian"
2 changes: 2 additions & 0 deletions recipes-kernel/linux/linux-cip_6.12.bb
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ SRC_URI:append:qemu-arm = " file://qemu-arm_defconfig"
SRC_URI:append:qemu-amd64 = " file://qemu-amd64_defconfig"
SRC_URI:append:generic-x86-64 = " file://generic-x86-64_defconfig"
SRC_URI:append:raspberrypi4b-64 = " file://raspberrypi4-64_defconfig"

EMLINUX_SOURCE_FROM="non-debian"
Loading