Skip to content

Conversation

@jadahl
Copy link

@jadahl jadahl commented Aug 17, 2022

From the second commit:

mkinitramfs: Copy DT_NEEDED files if any too

This fixes using busybox installations that aren't really static, e.g.
the one in Fedora 36 and 37, since they still need
/lib/ld-musl-x86_64.so.1 to run.

As also mentioned in the commit message, this makes use of pyelftools (pip install pyelftools) to do the actual ELF parsing.

Related: https://bugzilla.redhat.com/show_bug.cgi?id=2079295

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
@jadahl
Copy link
Author

jadahl commented Aug 17, 2022

A different approach to a similar problem exist in #13

Copy link
Contributor

@zevweiss zevweiss left a comment

Choose a reason for hiding this comment

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

Neat...

As compared to #13, this approach has the advantage of avoiding fork/exec and parsing command output, which is nice.

The ldd-based approach has the advantages of being a bit more thorough (it gets transitive DSO dependencies and /etc/ld.so.conf handling "for free", whereas I believe this patch would require additional work for both) and avoids adding a dependency on a third-party python module, which I think would be a first for this project.

Personally I appreciate the easier out-of-the-box usability of not having to mess with adding python modules, but would be basically OK with whichever @amluto prefers.

@JonathonReinhart
Copy link

JonathonReinhart commented Aug 18, 2022 via email

@jadahl
Copy link
Author

jadahl commented Aug 18, 2022

The ldd-based approach has the advantages of being a bit more thorough (it gets transitive DSO dependencies and /etc/ld.so.conf handling "for free", whereas I believe this patch would require additional work for both) and avoids adding a dependency on a third-party python module, which I think would be a first for this project.

Yea, I almost went and started to parse that file, as well as $LD_LIBRARY_PATH, but decided it was for another day :P

FWIW, I also then tested #13 and it appears to worked as well.

I thought about parsing ldd, but couldn't find any information about the output format being actually specified according to some "API". I realize it likely hasn't changed in decades, so perhaps over pedantic.

This fixes using busybox installations that aren't really static, e.g.
the one in Fedora 36 and 37, since they still need
/lib/ld-musl-x86_64.so.1 to run.

This uses elftools to parse.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
gnomesysadmins pushed a commit to GNOME/mutter that referenced this pull request Aug 18, 2022
It's this time of the year again ...

The glibc update means that we finally run into the catchsegv removal
issue in our CI image. At least for now, solve this by including the
glibc-tools project, which aims at keeping those tools alive.

[jadahl]: Bumped virtme to include amluto/virtme#77

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2430>
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