RDKEMW-9196: image assembler support for removing MW packages - #83
RDKEMW-9196: image assembler support for removing MW packages#83goruklu wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
| 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 "================================================" |
There was a problem hiding this comment.
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).
| 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 |
…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
49fe090 to
ee5e825
Compare
| # 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 |
| ### middleware-feature-mapping.conf | ||
|
|
||
| Location: `meta-rdk-images/conf/middleware-feature-mapping.conf` | ||
|
|
| ### Step 2: Update Configuration | ||
|
|
||
| Edit `meta-rdk-images/conf/middleware-feature-mapping.conf`: | ||
| ```bitbake |
| ### Class: rdk-assembler-post-rootfs-hooks.bbclass | ||
|
|
||
| **Location**: `meta-rdk-images/classes/rdk-assembler-post-rootfs-hooks.bbclass` | ||
|
|
| ## 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 |
Change-Id: Ie4bba22605555d06f1d3a78b10e405d03dc7db16