Skip to content

RDKEMW-9196: image assembler support for removing MW packages - #83

Open
goruklu wants to merge 3 commits into
developfrom
feature/RDKEMW-9196
Open

RDKEMW-9196: image assembler support for removing MW packages#83
goruklu wants to merge 3 commits into
developfrom
feature/RDKEMW-9196

Conversation

@goruklu

@goruklu goruklu commented Feb 27, 2026

Copy link
Copy Markdown
Contributor

Change-Id: Ie4bba22605555d06f1d3a78b10e405d03dc7db16

Copilot AI review requested due to automatic review settings February 27, 2026 18:29
@goruklu
goruklu requested review from a team as code owners February 27, 2026 18:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request implements a feature-based filtering system for middleware components in RDK image builds. The system allows conditional inclusion/exclusion of middleware packages and files based on DISTRO_FEATURES, providing product teams with fine-grained control over which components are included in the final image.

Changes:

  • Refactored rootfs post-processing functions from image recipe into a reusable bbclass
  • Added package-level filtering using BAD_RECOMMENDATIONS based on DISTRO_FEATURES
  • Added file-level filtering to remove specific files from installed packages during rootfs creation
  • Created configuration files for feature-to-package and feature-to-file mappings
  • Added comprehensive documentation explaining the filtering system

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
recipes-images/rdk-fullstack-image.bb Refactored to inherit new bbclass, added BAD_RECOMMENDATIONS filtering, removed inline functions
conf/middleware-feature-mapping.conf New configuration file mapping DISTRO_FEATURES to middleware packages (e.g., nuanceeve)
conf/middleware-file-filter.conf New configuration file mapping DISTRO_FEATURES to file patterns (e.g., MotionDetection plugin files)
classes/rdk-assembler-post-rootfs-hooks.bbclass New bbclass implementing package/file filtering logic and rootfs post-processing functions
README-MW-package-and-file-filtering.md Comprehensive documentation covering architecture, usage, configuration, and examples

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread classes/rdk-assembler-post-rootfs-hooks.bbclass Outdated
Comment thread classes/rdk-assembler-post-rootfs-hooks.bbclass
Comment thread classes/rdk-assembler-post-rootfs-hooks.bbclass Outdated
Comment thread classes/rdk-assembler-post-rootfs-hooks.bbclass Outdated
Comment thread classes/rdk-assembler-post-rootfs-hooks.bbclass Outdated
Comment thread classes/rdk-assembler-post-rootfs-hooks.bbclass Outdated
Comment thread classes/rdk-assembler-post-rootfs-hooks.bbclass Outdated
Comment thread classes/rdk-assembler-post-rootfs-hooks.bbclass
Comment thread classes/rdk-assembler-post-rootfs-hooks.bbclass Outdated
Copilot AI review requested due to automatic review settings March 2, 2026 19:05

Copilot AI commented Mar 2, 2026

Copy link
Copy Markdown

@goruklu I've opened a new pull request, #84, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +139 to +150
bbwarn "================================================"
bbwarn "PACKAGE FILTERING FAILED!"
bbwarn "================================================"
bbwarn "The following packages should have been excluded but are still installed:"
for pkg in $installed_excluded; do
bbwarn " - $pkg"
done
bbwarn ""
bbwarn "This usually means the package is added as RDEPENDS instead of RRECOMMENDS."
bbwarn "BAD_RECOMMENDATIONS only works for packages listed as RRECOMMENDS."
bbwarn ""
bbwarn "================================================"

Copilot AI Mar 2, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

validate_package_filtering() only emits warnings when excluded packages are still installed, but it doesn't fail the build. If the goal is to ensure MW packages are actually removed, this makes it easy for CI/release builds to silently produce images with unwanted components. Consider making this a hard failure (e.g., bbfatal / non-zero return) or gating it behind a variable (warn by default, fail when MW_FILTER_STRICT=1).

Suggested change
bbwarn "================================================"
bbwarn "PACKAGE FILTERING FAILED!"
bbwarn "================================================"
bbwarn "The following packages should have been excluded but are still installed:"
for pkg in $installed_excluded; do
bbwarn " - $pkg"
done
bbwarn ""
bbwarn "This usually means the package is added as RDEPENDS instead of RRECOMMENDS."
bbwarn "BAD_RECOMMENDATIONS only works for packages listed as RRECOMMENDS."
bbwarn ""
bbwarn "================================================"
if [ "${MW_FILTER_STRICT}" = "1" ]; then
bbfatal "Package filtering validation failed: excluded packages still installed:${installed_excluded}"
else
bbwarn "================================================"
bbwarn "PACKAGE FILTERING FAILED!"
bbwarn "================================================"
bbwarn "The following packages should have been excluded but are still installed:"
for pkg in $installed_excluded; do
bbwarn " - $pkg"
done
bbwarn ""
bbwarn "This usually means the package is added as RDEPENDS instead of RRECOMMENDS."
bbwarn "BAD_RECOMMENDATIONS only works for packages listed as RRECOMMENDS."
bbwarn ""
bbwarn "================================================"
fi

Copilot uses AI. Check for mistakes.
@goruklu
goruklu requested review from a team as code owners April 21, 2026 04:10
goruklu and others added 3 commits June 2, 2026 11:21
…product build

Change-Id: Ie4bba22605555d06f1d3a78b10e405d03dc7db16
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Remove file filter Python function and remove_feature_filtered_files() shell function from rdk-assembler-post-rootfs-hooks.bbclass
- Remove conf/middleware-file-filter.conf
- Update README to remove all file filtering references

Change-Id: I3a6e90b28fdff59db8e24892d2b5b4de27a4ceb3
Copilot AI review requested due to automatic review settings June 2, 2026 18:21
@goruklu
goruklu force-pushed the feature/RDKEMW-9196 branch from 49fe090 to ee5e825 Compare June 2, 2026 18:21

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

Comment on lines +68 to +73
# Get list of installed packages from opkg status file
local status_file="${IMAGE_ROOTFS}${OPKGLIBDIR}/opkg/status"
if [ ! -f "$status_file" ]; then
# Try alternative location
status_file="${IMAGE_ROOTFS}/usr/lib/opkg/status"
fi
Comment on lines +82 to +85
### middleware-feature-mapping.conf

Location: `meta-rdk-images/conf/middleware-feature-mapping.conf`

Comment on lines +125 to +128
### Step 2: Update Configuration

Edit `meta-rdk-images/conf/middleware-feature-mapping.conf`:
```bitbake
Comment on lines +248 to +251
### Class: rdk-assembler-post-rootfs-hooks.bbclass

**Location**: `meta-rdk-images/classes/rdk-assembler-post-rootfs-hooks.bbclass`

Comment on lines +328 to +333
## Related Files

- `meta-rdk-images/classes/rdk-assembler-post-rootfs-hooks.bbclass` - Main implementation
- `meta-rdk-images/conf/middleware-feature-mapping.conf` - Package filtering config
- `meta-rdk-images/recipes-images/rdk-fullstack-image.bb` - Image recipe
- `meta-middleware-release/recipes-middleware/packagegroup-middleware-layer.bb` - Package group
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants