Skip to content

fix(dracut-install): resolve dependencies even if not executable - #2196

Merged
Conan-Kudo merged 1 commit into
dracut-ng:mainfrom
bdrung:resolve-libraries-v2
Feb 6, 2026
Merged

fix(dracut-install): resolve dependencies even if not executable#2196
Conan-Kudo merged 1 commit into
dracut-ng:mainfrom
bdrung:resolve-libraries-v2

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 all files. resolve_deps() will check if the file is either an ELF file or a script.

This will also resolve dependencies of scripts that are not marked executable, which might be an undesired side effect. In this case users are advised to either call dracut-install without -l or not include those files at all.

Fixes: #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 all files. `resolve_deps()` will check if the file is
either an ELF file or a script.

This will also resolve dependencies of scripts that are not marked
executable, which might be an undesired side effect. In this case users
are advised to either call `dracut-install` without `-l` or not include
those files at all.

Fixes: dracut-ng#2193
@bdrung
bdrung requested a review from a team as a code owner February 6, 2026 13:59
@github-actions github-actions Bot added dracut-install Issues related to dracut install c labels Feb 6, 2026
@Conan-Kudo
Conan-Kudo enabled auto-merge (rebase) February 6, 2026 14:25
@Conan-Kudo
Conan-Kudo merged commit fff546a into dracut-ng:main Feb 6, 2026
133 checks passed
@bdrung
bdrung deleted the resolve-libraries-v2 branch February 6, 2026 14:26
@bdrung bdrung added this to the 110 milestone Feb 6, 2026
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.

TEST-45-SYSTEMD-IMPORT fails: libxml2.so.16 and libxxhash.so.0 missing in initrd

4 participants