scripts: target_config_lib: make opkg a device-specific package #3367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a package is installed target-wide, but removed for specific devices (or through image-customization), it is first installed during target rootfs generation, and then uninstalled again for the derived device rootfs.
For packages that are marked as essential, removal of the package will be refused by default, which is usually the correct thing to do to avoid building broken images.
For opkg, we know that it is not required for regular operation of Gluon, and removing it may be desirable for devices with small flash. By never adding opkg to the target list of packages and instead only installing it as a device-specific package, the uninstall issue can be avoided.
Removing opkg saves ~38KiB of the squashfs on mips_24kc. Stripping the opkg database is not supported however, as there is no device-specific flag for that.
I'm undecided if 38KiB are worth a hack like this... but at least the change is very simple.
cc @rotanid
Fixes #3365