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

fix(dracut): ldd output borked with --sysroot (bsc#1228659) #362

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

aafeijoo-suse
Copy link
Collaborator

@aafeijoo-suse aafeijoo-suse commented Aug 9, 2024

dracut-install calls ldd to resolve dependencies, but when the --sysroot option is used, ldd is not performing the search within the sysroot directory. To fix this issue, the LD_LIBRARY_PATH variable needs to be properly set to the directories containing shared libraries within the specified sysroot directory.

E.g., running dracut with --sysroot produces an initrd without the required systemd shared libraries when the version between the host system and the sysroot directory differs:

localhost:~ # ldd /.snapshots/9/snapshot/usr/lib/systemd/systemd | grep libsystemd
    libsystemd-core-256.so => not found
    libsystemd-shared-256.so => not found
localhost:~ # export LD_LIBRARY_PATH=/.snapshots/9/snapshot/usr/lib64/systemd
localhost:~ # ldd /.snapshots/9/snapshot/usr/lib/systemd/systemd | grep libsystemd
    libsystemd-core-256.so => /.snapshots/9/snapshot/usr/lib64/systemd/libsystemd-core-256.so (0x00007f817b600000)
    libsystemd-shared-256.so => /.snapshots/9/snapshot/usr/lib64/systemd/libsystemd-shared-256.so (0x00007f817b000000)

More details on the upstream PR: dracut-ng/dracut-ng#567

We need to fix bsc#1228659 as soon as possible and upstream is not responding at the desired pace (correction for easily offended readers: i.e., at the pace we need specifically with this critical issue that causes a system to be unable to boot after an update).

dracut-install calls ldd to resolve dependencies, but when the `--sysroot`
option is used, ldd is not performing the search within the sysroot directory.
To fix this issue, the `LD_LIBRARY_PATH` variable needs to be properly set to
the directories containing shared libraries within the specified sysroot
directory.

E.g., running dracut with `--sysroot` produces an initrd without the required
systemd shared libraries when the version between the host system and the
sysroot directory differs:

```
localhost:~ # ldd /.snapshots/9/snapshot/usr/lib/systemd/systemd | grep libsystemd
    libsystemd-core-256.so => not found
    libsystemd-shared-256.so => not found
localhost:~ # export LD_LIBRARY_PATH=/.snapshots/9/snapshot/usr/lib64/systemd
localhost:~ # ldd /.snapshots/9/snapshot/usr/lib/systemd/systemd | grep libsystemd
    libsystemd-core-256.so => /.snapshots/9/snapshot/usr/lib64/systemd/libsystemd-core-256.so (0x00007f817b600000)
    libsystemd-shared-256.so => /.snapshots/9/snapshot/usr/lib64/systemd/libsystemd-shared-256.so (0x00007f817b000000)
```
@aafeijoo-suse aafeijoo-suse requested a review from tblume as a code owner August 9, 2024 06:40
Copy link
Collaborator

@tblume tblume left a comment

Choose a reason for hiding this comment

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

LGTM

@aafeijoo-suse aafeijoo-suse merged commit 9a22b6b into openSUSE:SUSE/059 Aug 9, 2024
2 checks passed
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