-
Notifications
You must be signed in to change notification settings - Fork 29
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
bin/ubuntu-core-initramfs: warn about missing dynamic dependencies #271
base: main
Are you sure you want to change the base?
bin/ubuntu-core-initramfs: warn about missing dynamic dependencies #271
Conversation
The current missing libraries on oracular are:
|
Also this is useless on 24.04 as these notes do not exist yet. |
Now systemd loads most of libraries through dlopen. It also defines a .notes.dlopen section to ELF binaries to list those libraries. We use `dlopen-notes` to list those dependencies and warn about missing ones. And eventually fail for required ones.
26f243a
to
4e1c525
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this! I have some comments, mainly about documentation.
sonames = dep["soname"] | ||
priority = dep["priority"] | ||
found_sonames = [] | ||
for soname in sonames: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a list of alternative implementation of the feature?
@@ -616,6 +611,58 @@ def create_initrd_pkg_list(dest_dir, sysroot): | |||
pkgs).decode("utf-8") | |||
pkg_list.write(out) | |||
|
|||
def verify_missing_dlopen(destdir, libdir): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would need a comment saying what it does and why. Maybe also add an example json and maybe a link to where the format is defined. Naming the libraries that have this section would be good too (I see libsystemd-shared-256.so, but not sure if others have it).
print(f"WARNING: These sonames are missing:", file=sys.stderr) | ||
for m, priority in missing.items(): | ||
print(f" * {m} ({priority})", file=sys.stderr) | ||
if priority == "required": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should require any "recommended" library. I see there libkmod.so.2 and libzstd.so.1 and both are probably useful according to "feature".
if os.path.exists(os.path.join(destdir, dest)): | ||
found_sonames.append(soname) | ||
if not found_sonames: | ||
for soname in sonames: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs a comment to help the reader (afaiu this is for having the highest priority if the library is for more than one feature).
Found the reference now: https://systemd.io/ELF_DLOPEN_METADATA/ |
Now systemd loads most of libraries through dlopen. It also defines a .notes.dlopen section to ELF binaries to list those libraries. We use
dlopen-notes
to list those dependencies and warn about missing ones. And eventually fail for required ones.