Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts: target_config_lib: make opkg a device-specific package #3367

Closed
wants to merge 1 commit into from

Conversation

neocturne
Copy link
Member

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

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.
@github-actions github-actions bot added the 3. topic: build This is about the build system label Nov 5, 2024
@rotanid
Copy link
Member

rotanid commented Nov 8, 2024

I'm undecided if 38KiB are worth a hack like this... but at least the change is very simple.

i think because of this i shouldn't be the one to decide whether to merge,
@blocktrron ?

@neocturne
Copy link
Member Author

Discussed at meetup; decided that 38K aren't worth a hack (and opkg is on the way to be replaced by apk in OpenWrt anyways)

@neocturne neocturne closed this Dec 10, 2024
@neocturne neocturne deleted the opkg-remove-hack branch December 10, 2024 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. topic: build This is about the build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

removing opkg package not possible per-device
2 participants