patches and low-level development discussion
 help / color / mirror / code / Atom feed
From: Demi Marie Obenour <demiobenour@gmail.com>
To: Alyssa Ross <hi@alyssa.is>
Cc: Spectrum OS Development <devel@spectrum-os.org>,
	Yureka Lilian <yureka@cyberchaos.dev>
Subject: Re: [PATCH v6 2/2] host/rootfs: Switch to systemd-udevd
Date: Sat, 8 Nov 2025 23:18:22 -0500	[thread overview]
Message-ID: <af8bdaaa-32ae-4e1d-b82a-5a84b604a825@gmail.com> (raw)
In-Reply-To: <875xbkt9wr.fsf@alyssa.is>


[-- Attachment #1.1.1: Type: text/plain, Size: 3687 bytes --]

On 11/8/25 17:52, Alyssa Ross wrote:
> Demi Marie Obenour <demiobenour@gmail.com> writes:
> 
>> On 11/8/25 17:37, Alyssa Ross wrote:
>>> Demi Marie Obenour <demiobenour@gmail.com> writes:
>>>
>>>> On 11/8/25 17:14, Alyssa Ross wrote:
>>>>> Alyssa Ross <hi@alyssa.is> writes:
>>>>>
>>>>>> Demi Marie Obenour <demiobenour@gmail.com> writes:
>>>>>>
>>>>>>> On 11/8/25 14:49, Alyssa Ross wrote:
>>>>>>>> Demi Marie Obenour <demiobenour@gmail.com> writes:
>>>>>>>>
>>>>>>>>> @@ -113,14 +76,15 @@ let
>>>>>>>>>  
>>>>>>>>>    kernel = linux_latest;
>>>>>>>>>  
>>>>>>>>> -  appvm = callSpectrumPackage ../../img/app { inherit (foot) terminfo; };
>>>>>>>>> -  netvm = callSpectrumPackage ../../vm/sys/net { inherit (foot) terminfo; };
>>>>>>>>> +  appvm = callSpectrumPackage ../../img/app { inherit (no_pgo_foot) terminfo; };
>>>>>>>>> +  netvm = callSpectrumPackage ../../vm/sys/net { inherit (no_pgo_foot) terminfo; };
>>>>>>>>>  
>>>>>>>>>    # Packages that should be fully linked into /usr,
>>>>>>>>>    # (not just their bin/* files).
>>>>>>>>>    usrPackages = [
>>>>>>>>> -    appvm kernel.modules firmware netvm
>>>>>>>>> -  ] ++ (with pkgsGui; [ mesa dejavu_fonts westonLite ]);
>>>>>>>>> +    appvm kernel.modules firmware kmod kmod.lib
>>>>>>>>> +    netvm mesa dejavu_fonts westonLite
>>>>>>>>> +  ];
>>>>>>>>>  
>>>>>>>>>    appvms = {
>>>>>>>>>      appvm-firefox = callSpectrumPackage ../../vm/app/firefox.nix {};
>>>>>>>>
>>>>>>>> So based on what we'd discussed previously, I was ready to just apply
>>>>>>>> this and pare down the Nix changes myself since I don't have to worry
>>>>>>>> about rebuilds, etc., but in doing so I came across this.  Do you know
>>>>>>>> why kmod.lib is required?  Is something impurely dlopening it?  Seems
>>>>>>>> very strange, but I did verify that it's required for Weston to start.
>>>>>>>
>>>>>>> systemd uses dlopen heavily.  This allows dependencies to be optional
>>>>>>> at runtime.  I remember strace showing that systemd-udevd dlopen's
>>>>>>> kmod.lib.  In short, your diagnosis is correct.
>>>>>>
>>>>>> Okay, that's a packaging bug in Nixpkgs then.  (See e.g. [1].)  I'll see
>>>>>> what can be done.
>>>>>>
>>>>>> [1]: https://github.com/NixOS/nixpkgs/commit/2328731ad041735a2260698574ce6599591f33ad
>>>>>
>>>>> I have looked into it a bit and am now even more confused.  From what I
>>>>> can see, loading libkmod should be done by libsystemd-shared.so, which
>>>>> has kmod.lib in its RUNPATH.
>>>>
>>>> According to https://wiki.debian.org/RpathIssue, only the RUNPATH of
>>>> the executable is honored.  The RUNPATH of libraries is not honored.
>>>> For this to work, libsystemd-shared.so needs to have kmod.lib in its
>>>> RPATH, and udevadm *may* need to not have a RUNPATH.
>>>
>>> Right, so we might need to add --force-rpath to the patchelf invocation.
>>>
>>> I wonder why this doesn't affect every NixOS system, though.  They
>>> certainly don't have /usr/lib/libkmod.so.2.
>>
>> Difference between musl and glibc is the first thing that comes to mind.
> 
> Was my first thought too, but people (including Yureka, who can maybe
> confirm) have run musl NixOS systems, and I've never heard of this
> problem with them.

I did the following tests:

1. Move kmod and kmod.libs from usrPackages to packages.  Module
   loading breaks.

2. Switch from pkgsGui.systemd (musl) to pkgs.systemd (glibc).
   Module loading works again.

My conclusion is that this problem is specific to musl.

Would it be okay to merge this with the workaround, and revert it
later when it is no longer needed?
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2025-11-09  4:18 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-07 19:00 [PATCH v6 0/2] Switch from mdevd to systemd-udevd in root filesystem Demi Marie Obenour
2025-11-07 19:00 ` [PATCH v6 1/2] tools: Add adapter tool for services using sd_notify Demi Marie Obenour
2025-11-09 13:58   ` Alyssa Ross
2025-11-07 19:00 ` [PATCH v6 2/2] host/rootfs: Switch to systemd-udevd Demi Marie Obenour
2025-11-08 19:49   ` Alyssa Ross
2025-11-08 21:28     ` Demi Marie Obenour
2025-11-08 21:37       ` Alyssa Ross
2025-11-08 22:14         ` Alyssa Ross
2025-11-08 22:18           ` Demi Marie Obenour
2025-11-08 22:37             ` Alyssa Ross
2025-11-08 22:37               ` Demi Marie Obenour
2025-11-08 22:52                 ` Alyssa Ross
2025-11-08 23:32                   ` Demi Marie Obenour
2025-11-09  4:18                   ` Demi Marie Obenour [this message]
2025-11-09 13:07                     ` Alyssa Ross
2025-11-09  2:18         ` Demi Marie Obenour
2025-11-09 13:58   ` Alyssa Ross
  -- strict thread matches above, loose matches on Subject: below --
2025-11-03  8:29 [PATCH v6 0/2] Switch from mdevd to systemd-udevd in root filesystem Demi Marie Obenour
2025-11-03  8:29 ` [PATCH v6 2/2] host/rootfs: Switch to systemd-udevd Demi Marie Obenour
2025-11-06  9:55   ` Alyssa Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=af8bdaaa-32ae-4e1d-b82a-5a84b604a825@gmail.com \
    --to=demiobenour@gmail.com \
    --cc=devel@spectrum-os.org \
    --cc=hi@alyssa.is \
    --cc=yureka@cyberchaos.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).