-
Notifications
You must be signed in to change notification settings - Fork 824
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
Microsoft should provide a static linked /init - Process #229
Comments
Thanks for the feedback. There's a related discussion in #8 if you are interested, and here's the short summary: For now WSL is scoped to delivering a solid bash shell but there are many other exciting potential applications of the technology, including allowing people to select their distro of choice. |
We've changed the init daemon over to be a statically linked, this will be available in a Windows Insider build soon. |
Nice 💯. Of course, this is a bad case of "careful what you wish for". Now I can't |
I can confirm that it works on the latest insider build, thanks! |
@therealkenc Out of curiosity, what are you LD_PRELOADing? |
@jstarks - It was more of a tounge-in-cheek hypothesis rather than something I got around to trying. This stems from taking the briefest of looks back in August #2372 (message). As long as |
How can I get BusyBox binary with bash applet in-build? Or do I compile it myself? I want to make a symbolic link from bash to busybox. So that the tar.gz file will have only one file. |
@Biswa96 hint is enable IF_FEATURE_BASH_IS_ASH, I guess you have to do the compile. |
@benhillis LxssManager.dll doesn't add the file creation time of |
With a static linked bash and a static linked busybox it is possible to reduce the WSL - system
to the bare minimum with only three executeables: /init, /bin/bash and the busybox - system
(executable and symlinks in /bin /usr/bin /usr/sbin /sbin).
With a static linked init - process we could get rid of /lib64 and /lib/x64_86-linux-gnu.
This in turn would allow to construct or use a distribution (with busybox as bootstrap) without any dependencies.
Appendix: How to make a minimal WSL - system
I assume you have built or downloaded a static linked bash (bash) and a busybox - system
(busybox and busybox.tar) and is available in C:\Install
cd /
cp /mnt/c/Install/bash /
cp /mnt/c/Install/busybox /
exec /bash
/busybox rm -rf /boot
/busybox rm -rf /bin
/busybox rm -rf /usr
/busybox rm -rf /sbin
/busybox rm -rf /etc/*
/busybox ln -s /run/resolvconf/resolv.conf /etc
/busybox tar -xf /mnt/c/Install/busybox.tar
cp /bash /bin/bash
At this point, the busybox - system is working
Now:
Empty /var
Empty /lib but leave /lib/x64_86-linux-gnu
Conclusion: In order to play with the WSL - system it should be as standalone as possible
The text was updated successfully, but these errors were encountered: