From 5cab13fe5c092ac22c98ac7540cbbe7acd8dc858 Mon Sep 17 00:00:00 2001 From: Vaughn Varma Date: Fri, 9 Oct 2026 14:35:23 -0400 Subject: [PATCH] added rt-run script, bundled with lat-plot (now plcos-util-scripts) --- classes/gen-vendor-revision.bbclass | 174 -------- classes/sls-purl.bbclass | 41 -- classes/wrlinux-installer-banner.bbclass | 27 -- conf/distro/plcos.conf | 1 + recipes-core/images/plcos-image-base.bb | 6 +- recipes-utils/lat-plot/lat-plot_0.0.bb | 47 --- recipes-utils/rt-setup/rt-setup_0.0.bb | 58 --- recipes-utils/rt-setup/rt-setup_0.1.bb | 36 ++ recipes-utils/util-scripts/files/LICENSE | 373 ++++++++++++++++++ .../{lat-plot => util-scripts}/files/lat-plot | 0 recipes-utils/util-scripts/files/rt-run | 6 + .../util-scripts/plcos-util-scripts_0.1.bb | 30 ++ 12 files changed, 450 insertions(+), 349 deletions(-) delete mode 100644 classes/gen-vendor-revision.bbclass delete mode 100644 classes/sls-purl.bbclass delete mode 100644 classes/wrlinux-installer-banner.bbclass delete mode 100644 recipes-utils/lat-plot/lat-plot_0.0.bb delete mode 100644 recipes-utils/rt-setup/rt-setup_0.0.bb create mode 100644 recipes-utils/rt-setup/rt-setup_0.1.bb create mode 100644 recipes-utils/util-scripts/files/LICENSE rename recipes-utils/{lat-plot => util-scripts}/files/lat-plot (100%) create mode 100644 recipes-utils/util-scripts/files/rt-run create mode 100644 recipes-utils/util-scripts/plcos-util-scripts_0.1.bb diff --git a/classes/gen-vendor-revision.bbclass b/classes/gen-vendor-revision.bbclass deleted file mode 100644 index 73dcf26..0000000 --- a/classes/gen-vendor-revision.bbclass +++ /dev/null @@ -1,174 +0,0 @@ -# -# Copyright (C) 2024 Wind River Systems, Inc -# -# SPDX-License-Identifier: GPL-2.0 -# - -inherit enable-vendor-revision - -VENDOR_REVISION_DIR ?= "${TMPDIR}/vendor-revisions/${MACHINE}" -VENDOR_REVISION_ALL ?= "${VENDOR_REVISION_DIR}/wrlinux-vendor-revision.conf" - -# For fixed RCPL users which can be set in their own conf file such as -# conf/layer.conf, for example, ccm01 to ccm99: -#VENDOR_REVISION_SUFFIX = ".ccm01" -VENDOR_REVISION_SUFFIX ??= "" - -addhandler gen_vr_fatal -gen_vr_fatal[eventmask] = "bb.event.BuildStarted" -python gen_vr_fatal() { - bb.fatal('Only bitbake -p is supported when gen-vendor-revision.bbclass is enabled!') -} - -addhandler gen_vr_prepare -gen_vr_prepare[eventmask] = "bb.event.CacheLoadStarted" -python gen_vr_prepare() { - vendor_revision_dir = d.getVar('VENDOR_REVISION_DIR') - # Need a fresh VENDOR_REVISION_DIR and CACHE dir - for k in ('VENDOR_REVISION_DIR', 'CACHE'): - value = d.getVar(k) - bb.note("Removing %s" % value) - bb.utils.remove(value, True) - bb.utils.mkdirhier(value) -} - -# Generate VENDOR_REVISION for each recipe -addhandler gen_vr_recipe_handler -gen_vr_recipe_handler[eventmask] = "bb.event.RecipeParsed" -python gen_vr_recipe_handler() { - """ - Generate VENDOR_REVISION for each recipe, the format is: - VENDOR_REVISION[recipe_file] ?= 'vr cveid1:patch1 notcve:patch2' - """ - - import hashlib - - # Only generate vr for supported recipes - bpn = d.getVar('BPN') - wrl_supported = d.getVar('WRLINUX_SUPPORTED_RECIPE') or d.getVar('WRLINUX_SUPPORTED_RECIPE:pn-%s' % bpn) - if wrl_supported and wrl_supported.strip() == '0': - return - - if vr_need_skip(d): - return - - def get_cve_patch(patch): - ret = [] - patch_bn = os.path.basename(patch) - # Open in 'text' mode doesn't work for very a few patches such as: - # hddtemp_0.3-beta15-52.diff: 'utf-8' codec can't decode byte 0xe8 in - # position 3851: invalid continuation byte - with open(patch, 'rb') as f: - # Get md5 - md5 = hashlib.md5() - md5.update(f.read()) - hash = md5.hexdigest() - patch_bn += ':%s' % md5.hexdigest() - # Reset file postion - f.seek(0, 0) - for line in f: - if not 'CVE:' in str(line): - continue - line = line.decode('utf-8') - if line.startswith('CVE:') and 'CVE-' in line: - line_split = line.split('CVE:') - for cveid in line_split[1].split(): - cveid = cveid.strip() - if cveid.startswith('CVE-'): - ret.append('%s:%s' % (cveid, patch_bn)) - if not ret: - ret.append('notcve:%s' % patch_bn) - return ret - - def update_vr(patches): - """ - Check whether recipe's VENDOR_REVISION need update or not - * If old_vr == new_vf - - No check is needed since they are in the same - RCPL, just update it. - - * If old_vr != new_vr: - - If the patches are the same: - Nothing changed, use the old_vr to avoid unneeded updates by dnf. - - - If the patches are different: - Update to the new_vr - """ - - patches.sort() - new_patches = ' '.join(patches) - - file_short = get_file_short(d) - vr = get_current_vendor_revision(d) - old_val = d.getVarFlag('VENDOR_REVISION', file_short) - - # No checking is needed in the following cases: - # - No old_val: It's a new vr, just update it - if old_val: - old_vr = old_val.split()[0] - if old_vr: - # In different RCPL, check whether need update - if old_vr != vr: - old_patches = ' '.join(old_val.split()[1:]) - # The patches are the same, no update is needed - if old_patches == new_patches: - vr = old_vr - - # Replace .vr -> ${VENDOR_REVISION_PREFIX} - vr_prefix = d.getVar("VENDOR_REVISION_PREFIX") or "" - vr = vr.removeprefix(vr_prefix) - vr = '${VENDOR_REVISION_PREFIX}%s' % vr - out_lines = [] - val = "" - if new_patches: - val = '%s %s' % (vr, new_patches) - out_lines.append("VENDOR_REVISION[%s] ??= '%s'" % (file_short, val)) - - if is_work_shared(d): - s_short = get_var_short(d.getVar('S')) - if val: - out_lines.append("VENDOR_REVISION[%s] ?= '%s'" % (s_short, val)) - else: - out_lines.append("VENDOR_REVISION[%s] ??= '${@d.getVarFlag(\"VENDOR_REVISION\", \"%s\")}'" \ - % (file_short, s_short)) - if out_lines: - out_file = os.path.join(d.getVar('VENDOR_REVISION_DIR'), file_short) - with open(out_file, 'w') as f: - f.write('%s\n' % '\n'.join(out_lines)) - - patches = [] - localdata = bb.data.createCopy(d) - localdata.setVar('OVERRIDES', localdata.getVar('OVERRIDES') + localdata.getVar('GEN_VENDOR_REVISION_OVERRIDES')) - for local in get_src_patches(localdata): - patches += get_cve_patch(local) - update_vr(patches) -} - -# Generate vendor-revision.conf -addhandler gen_vr_all_handler -gen_vr_all_handler[eventmask] = "bb.event.ParseCompleted" -python gen_vr_all_handler () { - """ - Collect each recipe's vendor revision in VENDOR_REVISION_DIR and save - to VENDOR_REVISION_ALL - """ - import glob - vendor_revision_dir = d.getVar('VENDOR_REVISION_DIR') - patches = [] - output = d.getVar('VENDOR_REVISION_ALL') - output_dir = os.path.dirname(output) - for recipe in glob.glob(os.path.join(vendor_revision_dir, '*')): - with open(recipe) as f: - for line in f: - if not line in (patches): - patches.append(line) - patches.sort() - with open(output, 'w') as f: - f.write('require %s\n\n' % "wrlinux-vendor-revision-manual.inc") - f.write(''.join(patches)) - bb.note('The recipes with patches are saved to %s' % output) -} - -# Workaround Exception during build_dependencies for fetcher_hashes_dummyfunc -# https://git.openembedded.org/openembedded-core/commit/?id=a8e7b0f932b9ea69b3a218fca18041676c65aba0 -fetcher_hashes_dummyfunc[vardepvalue] = "" diff --git a/classes/sls-purl.bbclass b/classes/sls-purl.bbclass deleted file mode 100644 index 991786e..0000000 --- a/classes/sls-purl.bbclass +++ /dev/null @@ -1,41 +0,0 @@ -# -# Copyright (C) 2025 Wind River Systems, Inc. -# -# SPDX-License-Identifier: MIT -# - -python do_create_spdx:prepend() { - import oe.packagedata - - purl_qualifiers = "distro=%s-%s&arch=%s" % ("yocto" if d.getVar("DISTRO") == "poky" else d.getVar("DISTRO"), \ - d.getVar("DISTRO_VERSION"), \ - d.getVar("MACHINE"), \ - ) - purl_qualifiers_extend = d.getVar("SPDX_PURL_QUALIFIERS_EXTEND") - if purl_qualifiers_extend: - purl_qualifiers += "&%s" % purl_qualifiers_extend - - purl_type = d.getVar("IMAGE_PKGTYPE") - if purl_type == "ipk": - purl_type = "yocto" - purl_qualifiers = "file_extension=ipk&" + purl_qualifiers - - purl_subpath = d.getVar("SPDX_PURL_SUBPATH") - purl_subpath = "#" + purl_subpath if purl_subpath else "" - - bb.build.exec_func("read_subpackage_metadata", d) - - for package in d.getVar("PACKAGES", True).split(): - if not oe.packagedata.packaged(package, d): - continue - pkg_name = d.getVar("PKG:%s" % package) or package - purl = "pkg:%s/%s/%s@%s?%s%s" % (purl_type, \ - d.getVar("DISTRO"), \ - pkg_name, \ - d.getVar("EXTENDPKGV"), \ - purl_qualifiers, \ - purl_subpath \ - ) - - d.setVar("SPDX_PACKAGE_URL:%s" % package, purl) -} diff --git a/classes/wrlinux-installer-banner.bbclass b/classes/wrlinux-installer-banner.bbclass deleted file mode 100644 index 06b137a..0000000 --- a/classes/wrlinux-installer-banner.bbclass +++ /dev/null @@ -1,27 +0,0 @@ -target_build_msg = "The meta-anaconda layer has been included, and the \ -current build is a regular target build. After it is finished, create \ -a new installer build with DISTRO = 'wrlinux-installer', \ -INSTALLER_TARGET_BUILD = '|' \ -and INSTALLER_TARGET_IMAGE = '' in local.conf" - -target_build_warnmsg = "WARNING: The meta-anaconda layer has been included, \ -and the current build is a regular target build. It requires to enable \ -feature/installer-support template. Add option \ ---templates=feature/installer-support to setup.sh, or set WRTEMPLATE += \ -'feature/installer-support' in local.conf" - -installer_build_msg = "The meta-anaconda layer has been included, and the \ -current build is a installer build, if set INSTALLER_TARGET_BUILD = \ -'', and INSTALLER_TARGET_IMAGE = '' \ -the installer is to do RPMs install; if set INSTALLER_TARGET_BUILD = \ -'', the installer is to do image copy install." - -def get_installer_banner(d): - if d.getVar('DISTRO',True) == 'wrlinux-installer': - return d.getVar('installer_build_msg') - elif "feature/installer-support" in d.getVar("WRTEMPLATE").split(): - return d.getVar('target_build_msg') - else: - return d.getVar('target_build_warnmsg') - -CONFIG_BANNER[installer] = "${@get_installer_banner(d)}" diff --git a/conf/distro/plcos.conf b/conf/distro/plcos.conf index 88d3773..1516743 100644 --- a/conf/distro/plcos.conf +++ b/conf/distro/plcos.conf @@ -218,6 +218,7 @@ WKS_FILE:x86-64 = "plcos-bootdisk-x86.wks.in" WKS_FILE:intel-x86-common = "plcos-bootdisk-intel.wks.in" WKS_FILE:aarch64 ?= "plcos-bootdisk-arm-uboot.wks.in" +WKS_FILE:sunxi = "sunxi-sdcard-image.wks.in" DISTRO_FEATURES:append = " pam opengl usbhost largefile " diff --git a/recipes-core/images/plcos-image-base.bb b/recipes-core/images/plcos-image-base.bb index c4cb42b..c9af1b8 100644 --- a/recipes-core/images/plcos-image-base.bb +++ b/recipes-core/images/plcos-image-base.bb @@ -54,9 +54,11 @@ IMAGE_FSTYPES += "wic wic.bmap" inherit extrausers -IMAGE_EFI_BOOT_FILES:append := " ${KERNEL_IMAGETYPE}-*" + +#additional kernel images may not be required at all, but I don't want to break the x86 build while trying to fix the allwinner build +IMAGE_EFI_BOOT_FILES:append:x86-64 := " ${KERNEL_IMAGETYPE}-*" #IMAGE_EFI_BOOT_FILES:append := "${KERNEL_IMAGETYPE}-*" -IMAGE_BOOT_FILES:append := " ${KERNEL_IMAGETYPE}-*" +IMAGE_BOOT_FILES:append:x86-64 := " ${KERNEL_IMAGETYPE}-*" IMAGE_BOOT_FILES:append:arm-uefi := " startup.nsh" #TODO reference GRUB_IMAGE destination name via variables, otherwise this could break possible future 32 bit builds #BOOT_EFI = diff --git a/recipes-utils/lat-plot/lat-plot_0.0.bb b/recipes-utils/lat-plot/lat-plot_0.0.bb deleted file mode 100644 index 9b2476a..0000000 --- a/recipes-utils/lat-plot/lat-plot_0.0.bb +++ /dev/null @@ -1,47 +0,0 @@ -LICENSE = "CLOSED" -#MY_FILES = -#LIC_FILES_CHKSUM = "file://cf/install-sh;beginline=6;endline=16;md5=6c39b6a36ad775d09cc9ee0e33fe9e6c" - -SRC_URI = "file://lat-plot \ - " - -# python3targetconfig: configuration for the target machine is accessible (such as correct installation directories) -# autotools-brokensep: autotools build process (without support for building outside of ${S}) -# pkgconfig: standard way to get header and library information by using pkg-config -#inherit autotools-brokensep pkgconfig python3native - -# Modify these as desired -PV = "0.1" -#SRCREV = "bcbf35634ccf49ff39261b291f01ca0c4a5fddd5" - -#S = "${WORKDIR}/git" -# LinuxCNC build separation is broken, so we need to build in src -#B = "${S}/src" -S = '${UNPACKDIR}' -TARGET_CC_ARCH += " ${LDFLAGS}" -####################################################### -# autotools fixes -####################################################### -#AUTOTOOLS_SCRIPT_PATH = "${B}" - -# We need to replace autotools_preconfigure with our own, because it deletes ${B} otherwise -# since S != B in our case (but B is still *inside* S) -#DEPENDS += " tk8 tcl8 tcl8-native tk8-native freetype" -RDEPENDS:${PN} += " rt-tests gnuplot stress" -#RDEPENDS:${PN} += "cairo pango gd" -#PREFERRED_VERSION:tk8 = "8.6.%" -#RDEPENDS:${PN}-dev += " tk8 " - -#inherit autotools - -FILES:${PN} += " /usr/bin/lat-plot \ -" -FILES:${PN}-dev = " " -FILES:${PN}-dbg = " " - - - -do_install () { - install -d ${D}/usr/bin -install -m 777 ${UNPACKDIR}/lat-plot ${D}/usr/bin/lat-plot -} diff --git a/recipes-utils/rt-setup/rt-setup_0.0.bb b/recipes-utils/rt-setup/rt-setup_0.0.bb deleted file mode 100644 index 592f9cc..0000000 --- a/recipes-utils/rt-setup/rt-setup_0.0.bb +++ /dev/null @@ -1,58 +0,0 @@ -LICENSE = "MIT" -#MY_FILES = -LIC_FILES_CHKSUM = "file://COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -inherit systemd -SYSTEMD_AUTO_ENABLE:${PN} = "enable" -SYSTEMD_SERVICE:${PN} = "rt.service" - - -SRC_URI:append = "file://rt-setup \ - file://rt.service \ - file://COPYING.MIT \ - " - -# python3targetconfig: configuration for the target machine is accessible (such as correct installation directories) -# autotools-brokensep: autotools build process (without support for building outside of ${S}) -# pkgconfig: standard way to get header and library information by using pkg-config -#inherit autotools-brokensep pkgconfig python3native - -# Modify these as desired -PV = "0.0" -#SRCREV = "bcbf35634ccf49ff39261b291f01ca0c4a5fddd5" - -#S = "${WORKDIR}/git" -# LinuxCNC build separation is broken, so we need to build in src -#B = "${S}/src" -S = '${UNPACKDIR}' -TARGET_CC_ARCH += " ${LDFLAGS}" -####################################################### -# autotools fixes -####################################################### -#AUTOTOOLS_SCRIPT_PATH = "${B}" - -# We need to replace autotools_preconfigure with our own, because it deletes ${B} otherwise -# since S != B in our case (but B is still *inside* S) -#DEPENDS += " tk8 tcl8 tcl8-native tk8-native freetype" -#RDEPENDS:${PN} += " rt-tests " -#PREFERRED_VERSION:tk8 = "8.6.%" -RDEPENDS:${PN} += " bash " - -#inherit autotools - -FILES:${PN} += " /usr/bin/rt-setup \ - ${systemd_unitdir}/system/rt.service \ -" -FILES:${PN}-dev = " " -FILES:${PN}-dbg = " " - - - -do_install () { - install -d ${D}/usr/bin - #install -d ${D}${sysconfdir}/init.d - install -d ${D}${systemd_unitdir}/system - install -m 0755 ${UNPACKDIR}/rt.service ${D}${systemd_unitdir}/system/rt.service - install -m 0755 ${UNPACKDIR}/rt-setup ${D}/usr/bin/rt-setup - #update-rc.d -r ${D} rt-setup start 03 S . -} diff --git a/recipes-utils/rt-setup/rt-setup_0.1.bb b/recipes-utils/rt-setup/rt-setup_0.1.bb new file mode 100644 index 0000000..1b58b56 --- /dev/null +++ b/recipes-utils/rt-setup/rt-setup_0.1.bb @@ -0,0 +1,36 @@ +LICENSE = "MIT" +#MY_FILES = +LIC_FILES_CHKSUM = "file://COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" + +inherit systemd +SYSTEMD_AUTO_ENABLE:${PN} = "enable" +SYSTEMD_SERVICE:${PN} = "rt.service" + + +SRC_URI:append = "file://rt-setup \ + file://rt.service \ + file://COPYING.MIT \ + " + +PV = "0.1" +S = '${UNPACKDIR}' +TARGET_CC_ARCH += " ${LDFLAGS}" +RDEPENDS:${PN} += " bash " + + +FILES:${PN} += " /usr/bin/rt-setup \ + ${systemd_unitdir}/system/rt.service \ +" +FILES:${PN}-dev = " " +FILES:${PN}-dbg = " " + + + +do_install () { + install -d ${D}/usr/bin + #install -d ${D}${sysconfdir}/init.d + install -d ${D}${systemd_unitdir}/system + install -m 0755 ${UNPACKDIR}/rt.service ${D}${systemd_unitdir}/system/rt.service + install -m 0755 ${UNPACKDIR}/rt-setup ${D}/usr/bin/rt-setup + #update-rc.d -r ${D} rt-setup start 03 S . +} diff --git a/recipes-utils/util-scripts/files/LICENSE b/recipes-utils/util-scripts/files/LICENSE new file mode 100644 index 0000000..ee6256c --- /dev/null +++ b/recipes-utils/util-scripts/files/LICENSE @@ -0,0 +1,373 @@ +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. diff --git a/recipes-utils/lat-plot/files/lat-plot b/recipes-utils/util-scripts/files/lat-plot similarity index 100% rename from recipes-utils/lat-plot/files/lat-plot rename to recipes-utils/util-scripts/files/lat-plot diff --git a/recipes-utils/util-scripts/files/rt-run b/recipes-utils/util-scripts/files/rt-run new file mode 100644 index 0000000..84659ec --- /dev/null +++ b/recipes-utils/util-scripts/files/rt-run @@ -0,0 +1,6 @@ +#!/bin/bash +#This script is currently a simple tool which passes the given command (and any arguments) to taskset +#This may expand later to perform more intelligent mapping, and, possibly, to schedule cyclic execution of compiled tasks +#To isolate to one or more target cores, use taskset directly, e.g. taskset -c 1,3,5-8 +icpus="$(cat /sys/devices/system/cpu/isolated)" +taskset -c "${icpus}" $@ diff --git a/recipes-utils/util-scripts/plcos-util-scripts_0.1.bb b/recipes-utils/util-scripts/plcos-util-scripts_0.1.bb new file mode 100644 index 0000000..fff7a29 --- /dev/null +++ b/recipes-utils/util-scripts/plcos-util-scripts_0.1.bb @@ -0,0 +1,30 @@ +#This is a handful of bash helper scripts designed for PLC-OS +#lat-plot: realtime performance testing +#rt-run: run tasks on isolated cores +LICENSE = "MPL-2.0" +LIC_FILES_CHKSUM = "file://LICENSE;md5=45dcfba70224e877d087016b142b3672" + +SRC_URI = " \ + file://lat-plot \ + file://rt-run \ + " + + +PV = "0.1" + +S = '${UNPACKDIR}' +TARGET_CC_ARCH += " ${LDFLAGS}" +RDEPENDS:${PN} += " util-linux bash rt-tests gnuplot stress" +FILES:${PN} += " \ + /usr/bin/lat-plot \ + /usr/bin/rt-run \ +" +FILES:${PN}-dev = " " +FILES:${PN}-dbg = " " + + +do_install () { + install -d ${D}/usr/bin +install -m 755 ${UNPACKDIR}/lat-plot ${D}/usr/bin/lat-plot +install -m 755 ${UNPACKDIR}/rt-run ${D}/usr/bin/rt-run +}