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

symlink rather then duplicate multicall binaries #667

Closed
wants to merge 4 commits into from

Conversation

jsbronder
Copy link

This was raised here, jsbronder/meta-openrc#29. As I said there, I think these changes are better done upstream if found acceptable instead of carrying patches or manually creating symlinks post-install.

There is a bunch of binaries in OpenRC that are essentially multicall binaries, but redundantly compiled multiple times:

https://github.com/OpenRC/openrc/blob/0.45.2/src/einfo/meson.build
https://github.com/OpenRC/openrc/blob/0.45.2/src/service/meson.build
https://github.com/OpenRC/openrc/blob/0.45.2/src/mark_service/meson.build
https://github.com/OpenRC/openrc/blob/0.45.2/src/value/meson.build

By symlinking them to one 'main' multicall binary per group, we can reduce rootfs size. As the minimum ARM binary size is pretty big thanks to default 64 kiB alignment in newer binutils, this can be pretty sizable. This saved about 8MB on my test build.

Rather then have many copies of the same executable, that differ in only
name, create a single copy and symlink all the others.
As done with einfo, rather then have many copies of the same executable,
that differ in only name, create a single copy and symlink all the
others.
As done with einfo, rather then have many copies of the same executable,
that differ in only name, create a single copy and symlink all the
others.
As done with einfo, rather then have many copies of the same executable,
that differ in only name, create a single copy and symlink all the
others.
Copy link
Contributor

@floppym floppym left a comment

Choose a reason for hiding this comment

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

meson will dereference the symlinks on installation.

However, we can use the install_symlink function instead.

@floppym
Copy link
Contributor

floppym commented May 29, 2024

I created #712 and #713 to implement the missing pieces using hard links or symlinks.

@jsbronder
Copy link
Author

I created #712 and #713 to implement the missing pieces using hard links or symlinks.

Great, thanks for taking this on!

@jsbronder jsbronder closed this Jun 3, 2024
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.

2 participants