Rebase - #43
Conversation
Reason for the change: Reduce redundant ls-remote calls for same src URL and tag combinations. Cache SHA values in <DL_DIR>/sha_cache based on src URL and tag. Signed-off-by: mselva006c <mani_selvaraj@comcast.com>
Reason for the change: Improve performance by parallelizing parsing tasks Signed-off-by: mselva006c <mani_selvaraj@comcast.com>
Reason for the change: Update the cache dir name, added error condition checks Signed-off-by: mselva006c <mani_selvaraj@comcast.com>
… file system Allow file:// as well as https://
Feature/rdkoss 358
RDK-58119 Update license_create_manifest_pdf.bbclass to support local file system
…via Settings (#34) * RDKTV-36648: USB Drive Fails to Launch in Offline Mode After Restart via Settings * Update post-rootfs-hooks.bbclass --------- Co-authored-by: maniselva006c <mani.sselvaraj@gmail.com>
Reason for the change: Update change log for release 1.4.0 Signed-off-by: mselva006c <mani_selvaraj@comcast.com>
Release 1.4.0
Add support to fetch licensetext tarballs from local file system
RDK-58119: License manifest pdf creation in local RDK-E build
Reason for the change: Systemd-analyze should be included in the debug build variant, as it provides critical insights for troubleshooting service failures and dependencies.
|
mselva006c seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
…32) Co-authored-by: maniselva006c <mani.sselvaraj@gmail.com>
Reason for change: Add default timeout as 1s for le-remote call and update the sha cache to json format Signed-off-by: mselva006c <mani_selvaraj@comcast.com> Co-authored-by: mselva006c <mani_selvaraj@comcast.com>
Reason for change: Update change log for release 1.5.0 Signed-off-by: mselva006c <mani_selvaraj@comcast.com>
Release 1.5.0
Reason for change: Remove the timeout option(1s) from ls-remote call as it fails on some system
Reason for change: Updated change log for Rel 1.5.1 Signed-off-by: mselva006c <mani_selvaraj@comcast.com>
| for filename in os.listdir(workdir): | ||
| if filename.endswith(".json"): # Check for .json extension | ||
| filepath = os.path.join(workdir, filename) | ||
| json_files.append(filepath) | ||
|
|
||
| if filename == "remote_debugger_oem.json": | ||
| remote_debugger_oem_exists = True |
| python () { | ||
| import fcntl | ||
| import json | ||
| import sqlite3 | ||
| import concurrent.futures | ||
| from typing import Optional | ||
| class ShaCache: | ||
| def __init__(self, cache_dir: str): | ||
| self.cache_dir = os.path.join(cache_dir, "git_revision_cache") | ||
| os.makedirs(self.cache_dir, exist_ok=True) | ||
|
|
| # From below path variable "artifactory_paths" we removed some sensitive strings about IPK server path which need to be reworked or reconstructed after open-sourcing. | ||
| artifactory_paths=$(echo $artifactory_paths | tr ' ' '\n' | grep -o 'http[s]*://[^ ]*') | ||
| artifactory_paths=$(echo $artifactory_paths | tr ' ' '\n' | grep -o -e 'http[s]*://[^ ]*' -e 'file*:[/][^ ]*') | ||
| echo "Final artifactory paths: $artifactory_paths" | ||
| for artifactory_path in $artifactory_paths; do | ||
| set +e | ||
| echo "Downloading licenses from $artifactory_path" | ||
| wget -r -np -nd --cut-dirs=3 --reject="index.html*" $artifactory_path/$machine/licenses/ | ||
| echo "Downloading licenses from $artifactory_path" | ||
| if [[ "$artifactory_path" == *"http"* ]] | ||
| then | ||
| wget -r -np -nd --cut-dirs=3 --reject="index.html*" $artifactory_path/$machine/licenses/ | ||
| elif [[ "$artifactory_path" == "file://"* ]] | ||
| then | ||
| # Remove the file prefix. cp does not need it. | ||
| copy_path=${artifactory_path#"file://"} | ||
| cp $copy_path/licenses/* . | ||
| fi |
|
|
||
| # Ignore problematic components | ||
| COVERITY_BLACKLIST_PATH += "avro-c | graphite2 | zilker | wdmp-c | ctrlm-testapp | wpeframework | mkimage" | ||
| COVERITY_BLACKLIST_PATH += "avro-c | graphite2 | zilker | wdmp-c | ctrlm-testapp | wpeframework | mkimage| openssl" |
| if not isinstance(path_value, str) or not path_value.strip(): | ||
| bb.fatal("Invalid install path: path cannot be empty") | ||
|
|
||
| raw = path_value.strip() | ||
|
|
||
| # Treat FACTORY_APPS_PATH as a target (POSIX) path; reject Windows separators. | ||
| if "\\" in raw: | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': backslashes are not allowed") | ||
|
|
||
| if not raw.startswith("/"): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': must be an absolute path (start with '/')") | ||
|
|
||
| # Reject any '..' path elements to avoid escapes when combined with IMAGE_ROOTFS. | ||
| parts = [p for p in raw.split("/") if p] | ||
| if any(p == ".." for p in parts): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': '..' is not allowed") | ||
|
|
||
| normalized = posixpath.normpath(raw) | ||
| # normpath can remove trailing slashes; ensure it remains absolute | ||
| if not normalized.startswith("/"): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': normalization produced a non-absolute path") |
| execute_aa_compile_std_profiles() { | ||
| install -d ${R}/etc/apparmor.d/ | ||
| install -d ${R}/etc/apparmor/binprofiles/ | ||
| install -d ${R}/etc/apparmor/txttmp/ | ||
|
|
||
| SRCDIR="${R}/etc/apparmor.d" | ||
| OUTDIR="${R}/etc/apparmor/txttmp" | ||
|
|
* Update image-classes.inc * Create legacy_entos_support_patch.bbclass * Update legacy_entos_support_patch.bbclass
Tag 1.9.2
| def process_url(type, host, path, user, pswd, parm, url_index): | ||
| if not user and "user" in parm: | ||
| user = parm[user] | ||
| name = parm.get("name",'default') |
| if os.path.exists(workdir): | ||
| for filename in os.listdir(workdir): | ||
| if filename.endswith(".json"): # Check for .json extension | ||
| filepath = os.path.join(workdir, filename) | ||
| json_files.append(filepath) | ||
|
|
||
| if filename == "remote_debugger_oem.json": | ||
| remote_debugger_oem_exists = True |
| execute_aa_compile_std_profiles() { | ||
| install -d ${R}/etc/apparmor.d/ | ||
| install -d ${R}/etc/apparmor/binprofiles/ | ||
| install -d ${R}/etc/apparmor/txttmp/ | ||
|
|
||
| SRCDIR="${R}/etc/apparmor.d" | ||
| OUTDIR="${R}/etc/apparmor/txttmp" | ||
|
|
|
|
||
| # Ignore problematic components | ||
| COVERITY_BLACKLIST_PATH += "avro-c | graphite2 | zilker | wdmp-c | ctrlm-testapp | wpeframework | mkimage" | ||
| COVERITY_BLACKLIST_PATH += "avro-c | graphite2 | zilker | wdmp-c | ctrlm-testapp | wpeframework | mkimage| openssl" |
| echo $artifactory_paths | ||
| # From below path variable "artifactory_paths" we removed some sensitive strings about IPK server path which need to be reworked or reconstructed after open-sourcing. | ||
| artifactory_paths=$(echo $artifactory_paths | tr ' ' '\n' | grep -o 'http[s]*://[^ ]*') | ||
| artifactory_paths=$(echo $artifactory_paths | tr ' ' '\n' | grep -o -e 'http[s]*://[^ ]*' -e 'file*:[/][^ ]*') |
| conf.write("create\n") | ||
| conf.write("postrotate\n") | ||
| conf.write(" syslog-ng-ctl reopen --control=/tmp/syslog-ng/syslog-ng.ctl\n") | ||
| conf.write("endscript\n") | ||
| conf.write("}\n") |
| memconf.write("postrotate\n") | ||
| memconf.write(" syslog-ng-ctl reopen --control=/tmp/syslog-ng/syslog-ng.ctl\n") | ||
| memconf.write("endscript\n") |
| # Update device.properties in the rootfs | ||
| IMAGE_CLASSES += "update-device-properties" | ||
|
|
||
| #Consume Vendor Script for the Legcay ENTOS device |
| IMAGE_CLASSES +="logrotate_inconfig" | ||
|
|
||
| IMAGE_CLASSES +="remotedebugger_json_merger" |
| # Treat FACTORY_APPS_PATH as a target (POSIX) path; reject Windows separators. | ||
| if "\\" in raw: | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': backslashes are not allowed") | ||
|
|
||
| if not raw.startswith("/"): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': must be an absolute path (start with '/')") | ||
|
|
||
| # Reject any '..' path elements to avoid escapes when combined with IMAGE_ROOTFS. | ||
| parts = [p for p in raw.split("/") if p] | ||
| if any(p == ".." for p in parts): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': '..' is not allowed") | ||
|
|
||
| normalized = posixpath.normpath(raw) | ||
| # normpath can remove trailing slashes; ensure it remains absolute | ||
| if not normalized.startswith("/"): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': normalization produced a non-absolute path") |
* Update logrotate_config.bbclass * Update syslog-ng-config-gen.bbclass * Update syslog-ng-config-gen.bbclass * Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| if os.path.exists(workdir): | ||
| for filename in os.listdir(workdir): | ||
| if filename.endswith(".json"): # Check for .json extension | ||
| filepath = os.path.join(workdir, filename) | ||
| json_files.append(filepath) | ||
|
|
||
| if filename == "remote_debugger_oem.json": | ||
| remote_debugger_oem_exists = True | ||
| else: | ||
| bb.warn("Directory does not exist!") |
| #Install performance and debug tools as required in RDK_TOOLS_PACKAGES | ||
| IMAGE_INSTALL:append = " ${@d.getVar("RDK_TOOLS_PACKAGES", True) or ""} " | ||
|
|
||
| IMAGE_INSTALL:append = "${@bb.utils.contains('BUILD_VARIANT', 'debug', " systemd-analyze", "", d)}" |
| import fcntl | ||
| import json | ||
| import sqlite3 | ||
| import concurrent.futures | ||
| from typing import Optional |
| def process_url(type, host, path, user, pswd, parm, url_index): | ||
| if not user and "user" in parm: | ||
| user = parm[user] | ||
| name = parm.get("name",'default') |
| for line in ipk_feed_uris.split(): | ||
| feed = re.match(r"^[ \t]*([^#]+)##(\S+)[ \t]*$", line) | ||
| if feed is not None: | ||
| arch_name = feed.group(1) | ||
| arch_uri = feed.group(2) | ||
| if not arch_uri.startswith("file:"): | ||
| feed_dict[arch_name] = arch_uri | ||
| return feed_dict |
| # Update device.properties in the rootfs | ||
| IMAGE_CLASSES += "update-device-properties" | ||
|
|
||
| #Consume Vendor Script for the Legcay ENTOS device |
|
|
||
| IMAGE_CLASSES +="logrotate_inconfig" | ||
|
|
||
| IMAGE_CLASSES +="remotedebugger_json_merger" |
|
|
||
| fdo_mode = (d.getVar('FDO_PROFILE_MODE') or "").strip().lower() | ||
| if fdo_mode not in ("", "generate", "use"): | ||
| bb.fatal("[FDO-PROFILING]: FDO_PROFILE_MODE not set") |
| # Treat FACTORY_APPS_PATH as a target (POSIX) path; reject Windows separators. | ||
| if "\\" in raw: | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': backslashes are not allowed") | ||
|
|
||
| if not raw.startswith("/"): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': must be an absolute path (start with '/')") | ||
|
|
||
| # Reject any '..' path elements to avoid escapes when combined with IMAGE_ROOTFS. | ||
| parts = [p for p in raw.split("/") if p] | ||
| if any(p == ".." for p in parts): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': '..' is not allowed") | ||
|
|
||
| normalized = posixpath.normpath(raw) | ||
| # normpath can remove trailing slashes; ensure it remains absolute | ||
| if not normalized.startswith("/"): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': normalization produced a non-absolute path") | ||
|
|
| @@ -0,0 +1,34 @@ | |||
| # | |||
| # Vendor provided scripts,properies file will be used as priority | |||
| def process_url(type, host, path, user, pswd, parm, url_index): | ||
| if not user and "user" in parm: | ||
| user = parm[user] | ||
| name = parm.get("name",'default') |
| with concurrent.futures.ThreadPoolExecutor(max_workers=utils.cpu_count()) as executor: | ||
| futures = [] | ||
| url_index = 0; | ||
| for url in urls: | ||
| type, host, path, user, pswd, parm = bb.fetch2.decodeurl(url) |
| if os.path.exists(workdir): | ||
| for filename in os.listdir(workdir): | ||
| if filename.endswith(".json"): # Check for .json extension | ||
| filepath = os.path.join(workdir, filename) | ||
| json_files.append(filepath) | ||
|
|
||
| if filename == "remote_debugger_oem.json": | ||
| remote_debugger_oem_exists = True |
| if "container" in d.getVar('MACHINEOVERRIDES', True): | ||
| d.appendVar("DEPENDS", " lxc-native") |
| IMAGE_INSTALL:append = " ${@d.getVar("RDK_TOOLS_PACKAGES", True) or ""} " | ||
|
|
||
| IMAGE_INSTALL:append = "${@bb.utils.contains('BUILD_VARIANT', 'debug', " systemd-analyze", "", d)}" |
| # Remove the file prefix. cp does not need it. | ||
| copy_path=${artifactory_path#"file://"} | ||
| cp $copy_path/licenses/* . | ||
| fi |
|
|
||
| # Ignore problematic components | ||
| COVERITY_BLACKLIST_PATH += "avro-c | graphite2 | zilker | wdmp-c | ctrlm-testapp | wpeframework | mkimage" | ||
| COVERITY_BLACKLIST_PATH += "avro-c | graphite2 | zilker | wdmp-c | ctrlm-testapp | wpeframework | mkimage| openssl" |
| # Update device.properties in the rootfs | ||
| IMAGE_CLASSES += "update-device-properties" | ||
|
|
||
| #Consume Vendor Script for the Legcay ENTOS device |
| # Treat FACTORY_APPS_PATH as a target (POSIX) path; reject Windows separators. | ||
| if "\\" in raw: | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': backslashes are not allowed") | ||
|
|
||
| if not raw.startswith("/"): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': must be an absolute path (start with '/')") | ||
|
|
||
| # Reject any '..' path elements to avoid escapes when combined with IMAGE_ROOTFS. | ||
| parts = [p for p in raw.split("/") if p] | ||
| if any(p == ".." for p in parts): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': '..' is not allowed") | ||
|
|
||
| normalized = posixpath.normpath(raw) | ||
| # normpath can remove trailing slashes; ensure it remains absolute | ||
| if not normalized.startswith("/"): | ||
| bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': normalization produced a non-absolute path") | ||
|
|
* Update legacy_entos_support_patch.bbclass * Update legacy_entos_support_patch.bbclass
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (13)
classes/perfomance-debug-tools-packages.bbclass:4
- The BitBake python expansions in IMAGE_INSTALL:append use nested double-quotes, which will break parsing (the string terminates early). Use single quotes inside the Python expression (or escape quotes) and keep spacing consistent.
#Install performance and debug tools as required in RDK_TOOLS_PACKAGES
IMAGE_INSTALL:append = " ${@d.getVar("RDK_TOOLS_PACKAGES", True) or ""} "
IMAGE_INSTALL:append = "${@bb.utils.contains('BUILD_VARIANT', 'debug', " systemd-analyze", "", d)}"
classes/remotedebugger_json_merger.bbclass:17
- This block has inconsistent indentation under
if os.path.exists(workdir):, which will cause a Python IndentationError at parse time.
if os.path.exists(workdir):
for filename in os.listdir(workdir):
if filename.endswith(".json"): # Check for .json extension
classes/remotedebugger_json_merger.bbclass:53
- If a JSON file disappears between
os.listdir()and open, the code warns but still attempts to open it, which will raise and fail the postprocess step. This also doesn't handle JSON parse errors.
if not os.path.exists(json_file):
bb.warn("JSON files does not exist!")
with open(json_file, 'r') as f:
data = json.load(f)
classes/tag_to_sha_converter.bbclass:17
ShaCacheusesos.path/os.makedirs, butosis never imported in this anonymous Python function, which will raise a NameError during parsing.
import fcntl
import json
import sqlite3
import concurrent.futures
from typing import Optional
classes/tag_to_sha_converter.bbclass:148
- This attempts to index
parmwith the currentuservalue (parm[user]) instead of reading the'user'key from the decoded URL params. It will raise KeyError/TypeError and prevents authenticated fetches.
def process_url(type, host, path, user, pswd, parm, url_index):
if not user and "user" in parm:
user = parm[user]
name = parm.get("name",'default')
classes/tag_to_sha_converter.bbclass:179
process_urls()runsprocess_url()in multiple threads, butprocess_url()callsd.setVar(...)on the shared BitBake datastore. BitBake's datastore is not thread-safe, so this can cause non-deterministic metadata corruption. Prefer a serial loop here (git ls-remote is I/O bound anyway) unless you can guarantee thread safety via locking.
def process_urls(urls):
import bb.utils as utils
with concurrent.futures.ThreadPoolExecutor(max_workers=utils.cpu_count()) as executor:
futures = []
url_index = 0;
classes/apparmor_binprofiles.bbclass:31
execute_aa_compile_std_profiles()uses${R}but this variable is not defined anywhere in this bbclass, so allinstall -d ${R}/...and subsequent references will expand to empty and operate on the host filesystem root. DefineRlocally fromIMAGE_ROOTFSbefore using it.
execute_aa_compile_std_profiles() {
install -d ${R}/etc/apparmor.d/
install -d ${R}/etc/apparmor/binprofiles/
install -d ${R}/etc/apparmor/txttmp/
classes/coverity.bbclass:102
- The blacklist list item concatenates
mkimage| opensslwithout the usual|separator spacing, which can break any downstream splitting/regex that expects|-delimited tokens.
COVERITY_BLACKLIST_PATH += "avro-c | graphite2 | zilker | wdmp-c | ctrlm-testapp | wpeframework | mkimage| openssl"
conf/include/image-classes.inc:7
- Spelling/grammar: "Legcay" should be "Legacy" (and add a space after
#for consistency).
#Consume Vendor Script for the Legcay ENTOS device
classes/license_create_manifest_pdf.bbclass:114
- The grep regex intended to match local
file://feed URIs is incorrect:file*:[/][^ ]*matchesfil...patterns, notfile://.... This can cause local feeds to be skipped.
artifactory_paths=$(echo $artifactory_paths | tr ' ' '\n' | grep -o -e 'http[s]*://[^ ]*' -e 'file*:[/][^ ]*')
classes/license_create_manifest_pdf.bbclass:122
- This shell function uses bash-specific
[[ ... ]]tests, but BitBake shell tasks run under/bin/shby default. That can cause a syntax error on systems where/bin/shisdash/POSIX sh. Use a POSIXcase(and quote URLs/paths) instead.
echo "Downloading licenses from $artifactory_path"
if [[ "$artifactory_path" == *"http"* ]]
then
wget -r -np -nd --cut-dirs=3 --reject="index.html*" $artifactory_path/$machine/licenses/
elif [[ "$artifactory_path" == "file://"* ]]
classes/install-factoryapps.bbclass:80
- The validation helper is used for both the global
FACTORY_APPS_PATHand per-entryinstallpath, but the fatal messages always sayFACTORY_APPS_PATH, which is confusing when the error came from an entry'sinstallpath. Use a neutral "install path" wording in these errors.
# Treat FACTORY_APPS_PATH as a target (POSIX) path; reject Windows separators.
if "\\" in raw:
bb.fatal(f"Invalid FACTORY_APPS_PATH '{raw}': backslashes are not allowed")
if not raw.startswith("/"):
classes/fdo-profiling.bbclass:32
- When
FDO_PROFILE_MODEis set to an unexpected value, the fatal message says "not set". This makes debugging harder; include the invalid value and the accepted options.
fdo_mode = (d.getVar('FDO_PROFILE_MODE') or "").strip().lower()
if fdo_mode not in ("", "generate", "use"):
bb.fatal("[FDO-PROFILING]: FDO_PROFILE_MODE not set")
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 26 out of 26 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (11)
classes/tag_to_sha_converter.bbclass:17
ShaCacheusesos.path/os.makedirs, butosis not imported in this python block, which will raise a NameError at parse time.
import fcntl
import json
import sqlite3
import concurrent.futures
from typing import Optional
classes/tag_to_sha_converter.bbclass:148
user = parm[user]is indexing the dict with the current value ofuser(often None) instead of reading the "user" fetch parameter, which can raise KeyError/TypeError and prevents authenticated URLs from working.
def process_url(type, host, path, user, pswd, parm, url_index):
if not user and "user" in parm:
user = parm[user]
name = parm.get("name",'default')
classes/tag_to_sha_converter.bbclass:187
- This code mutates the BitBake datastore (
d.setVar) from multiple ThreadPoolExecutor worker threads. The datastore is not thread-safe; concurrent mutation can lead to nondeterministic behavior or intermittent parse failures. Prefer collecting results in threads and applyingd.setVarin the main thread, or run the loop serially.
def process_urls(urls):
import bb.utils as utils
with concurrent.futures.ThreadPoolExecutor(max_workers=utils.cpu_count()) as executor:
futures = []
url_index = 0;
for url in urls:
type, host, path, user, pswd, parm = bb.fetch2.decodeurl(url)
if "git" in type:
url_index += 1
futures.append(executor.submit(process_url, type, host, path, user, pswd, parm, url_index))
for future in concurrent.futures.as_completed(futures):
future.result()
classes/remotedebugger_json_merger.bbclass:24
- The
for filename in os.listdir(workdir):loop is misindented under theif os.path.exists(workdir):block, which will raise an IndentationError and break the rootfs postprocess step.
if os.path.exists(workdir):
for filename in os.listdir(workdir):
if filename.endswith(".json"): # Check for .json extension
filepath = os.path.join(workdir, filename)
json_files.append(filepath)
if filename == "remote_debugger_oem.json":
remote_debugger_oem_exists = True
else:
bb.warn("Directory does not exist!")
classes/perfomance-debug-tools-packages.bbclass:4
- This file contains nested double-quotes inside BitBake string expressions, which will break parsing (both the existing
getVar("RDK_TOOLS_PACKAGES"...)and the newly addedcontains(..., " systemd-analyze", ...)). Use single quotes inside${@ ... }and keep the outer BitBake string quoted.
IMAGE_INSTALL:append = " ${@d.getVar("RDK_TOOLS_PACKAGES", True) or ""} "
IMAGE_INSTALL:append = "${@bb.utils.contains('BUILD_VARIANT', 'debug', " systemd-analyze", "", d)}"
classes/apparmor_binprofiles.bbclass:12
execute_aa_compile_std_profiles()uses${R}, but this class never definesR. If${R}expands to empty, theinstall -d/find/mvoperations can target the build host filesystem instead of${IMAGE_ROOTFS}.
DEPENDS:append = " apparmor-native "
ROOTFS_POSTPROCESS_COMMAND:append = " override_apparmor_generic_defaults; execute_aa_compile_std_profiles;"
classes/coverity.bbclass:102
- The blacklist entry is missing a separator before
openssl(mkimage| openssl), which changes the token and may prevent matching/blacklistingmkimageas intended.
COVERITY_BLACKLIST_PATH += "avro-c | graphite2 | zilker | wdmp-c | ctrlm-testapp | wpeframework | mkimage| openssl"
classes/license_create_manifest_pdf.bbclass:127
- This shell function uses
[[ ... ]], which is not POSIX and can fail under/bin/sh(BitBake shell functions are not guaranteed to run under bash). Use a POSIXcase/[test and quote variables/URLs.
echo "Downloading licenses from $artifactory_path"
if [[ "$artifactory_path" == *"http"* ]]
then
wget -r -np -nd --cut-dirs=3 --reject="index.html*" $artifactory_path/$machine/licenses/
elif [[ "$artifactory_path" == "file://"* ]]
then
# Remove the file prefix. cp does not need it.
copy_path=${artifactory_path#"file://"}
cp $copy_path/licenses/* .
fi
conf/include/image-classes.inc:7
- Spelling/formatting in comment: "Legcay" -> "legacy", and add a space after
#for consistency/readability.
#Consume Vendor Script for the Legcay ENTOS device
classes/lxc.bbclass:7
d.getVar('MACHINEOVERRIDES', True)can be None; using theinoperator on None raises a TypeError at parse time. Coerce to an empty string before searching.
python __anonymous() {
if "container" in d.getVar('MACHINEOVERRIDES', True):
d.appendVar("DEPENDS", " lxc-native")
}
classes/fdo-profiling.bbclass:32
- The fatal message triggers when
FDO_PROFILE_MODEis set to an unsupported value, but the message says it is "not set". This makes misconfiguration harder to diagnose; report the invalid value and the allowed values.
if fdo_mode not in ("", "generate", "use"):
bb.fatal("[FDO-PROFILING]: FDO_PROFILE_MODE not set")
Co-authored-by: jthoma442 <jomo_thomas@comcast.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 27 out of 27 changed files in this pull request and generated no new comments.
Suppressed comments (7)
classes/tag_to_sha_converter.bbclass:21
ShaCacheusesos.path.join/os.makedirsbutosis never imported in this anonymous Python block, which will raiseNameErrorat parse time.
import fcntl
import json
import sqlite3
import concurrent.futures
from typing import Optional
class ShaCache:
def __init__(self, cache_dir: str):
self.cache_dir = os.path.join(cache_dir, "git_revision_cache")
os.makedirs(self.cache_dir, exist_ok=True)
classes/tag_to_sha_converter.bbclass:187
process_urls()uses aThreadPoolExecutorbut each worker callsd.setVar(...)on the shared BitBake datastore. The datastore is not thread-safe, so this can cause non-deterministic parse-time failures/corruption under parallel execution.
def process_urls(urls):
import bb.utils as utils
with concurrent.futures.ThreadPoolExecutor(max_workers=utils.cpu_count()) as executor:
futures = []
url_index = 0;
for url in urls:
type, host, path, user, pswd, parm = bb.fetch2.decodeurl(url)
if "git" in type:
url_index += 1
futures.append(executor.submit(process_url, type, host, path, user, pswd, parm, url_index))
for future in concurrent.futures.as_completed(futures):
future.result()
conf/include/image-classes.inc:7
- Spelling/wording issue in comment: "Legcay" should be "Legacy", and add a space after
#for consistency with surrounding comments.
#Consume Vendor Script for the Legcay ENTOS device
classes/tag_to_sha_converter.bbclass:148
- The code intended to read the
userfetcher parameter is incorrect:user = parm[user]will raise (sinceuseris not a key) and never sets the username fromparm.
def process_url(type, host, path, user, pswd, parm, url_index):
if not user and "user" in parm:
user = parm[user]
name = parm.get("name",'default')
classes/remotedebugger_json_merger.bbclass:25
- The
for filename in os.listdir(workdir):loop is mis-indented under theif os.path.exists(workdir):block, which will cause anIndentationErrorand break parsing/execution. Also, if the directory doesn't exist the function should return before usingworkdirfor output paths.
if os.path.exists(workdir):
for filename in os.listdir(workdir):
if filename.endswith(".json"): # Check for .json extension
filepath = os.path.join(workdir, filename)
json_files.append(filepath)
if filename == "remote_debugger_oem.json":
remote_debugger_oem_exists = True
else:
bb.warn("Directory does not exist!")
classes/perfomance-debug-tools-packages.bbclass:4
- This file has invalid BitBake quoting: nested double-quotes inside the Python expansions will terminate the string early and cause a parse error.
IMAGE_INSTALL:append = " ${@d.getVar("RDK_TOOLS_PACKAGES", True) or ""} "
IMAGE_INSTALL:append = "${@bb.utils.contains('BUILD_VARIANT', 'debug', " systemd-analyze", "", d)}"
classes/apparmor_binprofiles.bbclass:12
- This class uses
${R}in shell functions but never definesR. IfRexpands to empty, theinstall/mv/rmoperations will target the build host's/etc/...instead of the image rootfs.
ROOTFS_POSTPROCESS_COMMAND:append = " override_apparmor_generic_defaults; execute_aa_compile_std_profiles;"
No description provided.