Fix: Always use 'WSLInterop` as the binfmt name (#13467)

Co-authored-by: Ben Hillis <benhill@ntdev.microsoft.com>
This commit is contained in:
Ben Hillis 2025-09-09 09:28:11 -07:00 committed by GitHub
parent 36c077bd69
commit d43b725b3d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 11 deletions

View File

@ -19,15 +19,6 @@ Abstract:
//
#define LX_INIT_BINFMT_NAME "WSLInterop"
//
// Name of the WSL 'late' binfmt_misc interpreter.
// This name is used by the wsl-binfmt systemd unit which
// registers the interpreter a second time after systemd-binfmt to make sure
// that wsl's interpreter is always registered last.
//
#define LX_INIT_BINFMT_NAME_LATE "WSLInterop-late"
#define BINFMT_MISC_MOUNT_TARGET "/proc/sys/fs/binfmt_misc"
#define BINFMT_MISC_REGISTER_FILE BINFMT_MISC_MOUNT_TARGET "/register"
#define BINFMT_INTEROP_REGISTRATION_STRING(Name) ":" Name ":M::MZ::" LX_INIT_PATH ":P"

View File

@ -365,8 +365,8 @@ ExecStart=/bin/mount -o bind,ro,X-mount.mkdir -t none /mnt/wslg/.X11-unix /tmp/.
ExecStop=
ExecStart=/bin/sh -c '(echo -1 > {}/{}) ; (echo "{}" > {})' )",
BINFMT_MISC_MOUNT_TARGET,
LX_INIT_BINFMT_NAME_LATE,
BINFMT_INTEROP_REGISTRATION_STRING(LX_INIT_BINFMT_NAME_LATE),
LX_INIT_BINFMT_NAME,
BINFMT_INTEROP_REGISTRATION_STRING(LX_INIT_BINFMT_NAME),
BINFMT_MISC_REGISTER_FILE);
// Install the override for systemd-binfmt.service.