Skip to content

shell: use binfmt misc instead of ld preload to detect wasm executable#226

Closed
btheado wants to merge 4 commits intotractordev:mainfrom
btheado:fix178-use-binfmt_misc_instead-of-ld_preload
Closed

shell: use binfmt misc instead of ld preload to detect wasm executable#226
btheado wants to merge 4 commits intotractordev:mainfrom
btheado:fix178-use-binfmt_misc_instead-of-ld_preload

Conversation

@btheado
Copy link
Copy Markdown

@btheado btheado commented Nov 15, 2025

  1. Configure the kernel to enable binfmt_misc
  2. Mount binfmt_misc and configure it to use wexec for files starting with \0asm header
  3. Remove preload.so
  4. Static compile of busybox
  5. Remove busybox related .so files

Fixes #178

Comment thread shell/Dockerfile
COPY --from=lib32 /lib/ld-linux.so.2 /rootfs/lib/
COPY --from=lib32 /lib/i386-linux-gnu/libc.so.6 /rootfs/lib/
COPY --from=lib32 /lib/i386-linux-gnu/libm.so.6 /rootfs/lib/
COPY --from=lib32 /lib/i386-linux-gnu/libresolv.so.2 /rootfs/lib/
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I wasn't able to determine if all these .so files are only for busybox. Especially this one. What tests should I run for this change?

@progrium
Copy link
Copy Markdown
Contributor

Hugely glad you took the time to take this on an make a PR, but major changes have made this obsoleted. We use binfmt_misc in Apptron and the eventual alpine bundle, but our built-in shell is going back to a single binary so we dont need to depend on a VM to get a repl.

Thanks again! Hope you keep contributing!

@progrium progrium closed this Apr 24, 2026
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.

shell: use binfmt_misc instead of ld_preload

2 participants