Skip to content

fix(dracut-install): resolve libraries even if not executable - #2195

Closed
bdrung wants to merge 1 commit into
dracut-ng:mainfrom
bdrung:resolve-libraries
Closed

fix(dracut-install): resolve libraries even if not executable#2195
bdrung wants to merge 1 commit into
dracut-ng:mainfrom
bdrung:resolve-libraries

Conversation

@bdrung

@bdrung bdrung commented Feb 6, 2026

Copy link
Copy Markdown
Member

Library files on Debian/Ubuntu are not marked as executable. This causes dracut-install to not resolve dependencies:

$ ls -l /usr/lib/x86_64-linux-gnu/libarchive.so.13.7.7
-rw-r--r-- 1 root root 874648 Jun 25  2025 /usr/lib/x86_64-linux-gnu/libarchive.so.13.7.7
$ rm -rf foo && mkdir foo
$ ./dracut-install -D foo -l /usr/lib/x86_64-linux-gnu/libarchive.so.13
$ find foo
foo
foo/usr
foo/usr/lib
foo/usr/lib/x86_64-linux-gnu
foo/usr/lib/x86_64-linux-gnu/libarchive.so.13.7.7
foo/usr/lib/x86_64-linux-gnu/libarchive.so.13

There is no requirement for library files to be executable. So resolve dependencies for files that look like libraries (file name containing .so).

This is part one of two for fixing #2193.

Checklist

  • I have tested it locally
  • I have reviewed and updated any documentation if relevant
  • I am providing new code and test(s) for it

Library files on Debian/Ubuntu are not marked as executable. This causes
`dracut-install` to not resolve dependencies:

```
$ ls -l /usr/lib/x86_64-linux-gnu/libarchive.so.13.7.7
-rw-r--r-- 1 root root 874648 Jun 25  2025 /usr/lib/x86_64-linux-gnu/libarchive.so.13.7.7
$ rm -rf foo && mkdir foo
$ ./dracut-install -D foo -l /usr/lib/x86_64-linux-gnu/libarchive.so.13
$ find foo
foo
foo/usr
foo/usr/lib
foo/usr/lib/x86_64-linux-gnu
foo/usr/lib/x86_64-linux-gnu/libarchive.so.13.7.7
foo/usr/lib/x86_64-linux-gnu/libarchive.so.13
```

There is no requirement for library files to be executable. So resolve
dependencies for files that look like libraries (file name containing
`.so`).

Fixes: dracut-ng#2193
@bdrung
bdrung requested a review from a team as a code owner February 6, 2026 11:41
@github-actions github-actions Bot added dracut-install Issues related to dracut install c labels Feb 6, 2026
@Conan-Kudo

Copy link
Copy Markdown
Collaborator

Shouldn't this also check if the file has an ELF binary file magic?

@bdrung

bdrung commented Feb 6, 2026

Copy link
Copy Markdown
Member Author

resolve_deps() will open the file and check for the ELF magic.

We could instead just remove the executable condition (but then we would also resolve scripts that are not executable).

@LaszloGombos

Copy link
Copy Markdown
Collaborator

@chewi - this issue might not impact you, but I am wondering if you could help us with ideas/review. Thanks !

@bdrung

bdrung commented Feb 6, 2026

Copy link
Copy Markdown
Member Author

Shouldn't this also check if the file has an ELF binary file magic?

Here is an alternative: #2196

@chewi

chewi commented Feb 6, 2026

Copy link
Copy Markdown
Member

I'm a little surprised we're only noticing this now. This change is good though. The alternative is better.

@bdrung

bdrung commented Feb 6, 2026

Copy link
Copy Markdown
Member Author

I'm a little surprised we're only noticing this now.

This has only be the case since the initial dracut-install commit 026b81e in 2012. 😆

@Conan-Kudo Conan-Kudo closed this Feb 6, 2026
@bdrung

bdrung commented Feb 6, 2026

Copy link
Copy Markdown
Member Author

#2196 got merged. So this approach is obsolete.

@bdrung
bdrung deleted the resolve-libraries branch February 6, 2026 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c dracut-install Issues related to dracut install

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants