[PATCH 2/2] winebus.sys: Add code path to bypass udevd and use inotify.
Rémi Bernon
rbernon at codeweavers.com
Wed Oct 20 10:20:47 CDT 2021
On 10/20/21 2:51 PM, Simon McVittie wrote:
> On Wed, 20 Oct 2021 at 11:01:32 +0200, Rémi Bernon wrote:
>> There was some container detection too but that
>> seemed a bit specific, and the new option should be enough.
>
> (I am not a Wine or Proton developer and not subscribed to the list, so
> please cc me if appropriate.)
>
> I think some version of the container detection might be valuable
> to have as a follow-up to this: because udev is not designed to work
> across container boundaries, it seems like it would be good to have Wine
> automatically "do the right thing" when running inside an unprivileged
> container like Flatpak or Steam's pressure-vessel.
>
> The version of the container detection that I contributed to Proton about a
> year ago was specific to those two container managers:
>
> - bypass_udevd = check_bus_option(&disable_udevd, 0);
> + if (access ("/run/pressure-vessel", R_OK)
> + || access ("/.flatpak-info", R_OK))
> + {
> + TRACE("Container detected, bypassing udevd by default\n");
> + bypass_udevd = 1;
> + }
> +
> + bypass_udevd = check_bus_option(&disable_udevd, bypass_udevd);
>
> but unprivileged container managers have moved on a bit, and there is now
> a specification (originating in systemd[1]) for how a container manager can
> announce to contained code that it is running in a container: if the file
> /run/host/container-manager exists, then we're in a container (and the file
> should contain a string like "flatpak\n" or "pressure-vessel\n").
> So replacing the access() checks above with
> access("/run/host/container-manager", R_OK) might be better.
>
Thanks, good to know! If it's now part of some standard I'll probably
consider adding it.
--
Rémi Bernon <rbernon at codeweavers.com>
More information about the wine-devel
mailing list