4 ms·
/bin/sh execution is supported at the kernel level iirc? Like, the minimum requirement for a linux distribution is /bin/sh, the rest of the system doesn't have
by fao_ 6y ago
/bin/sh execution is supported at the kernel level iirc? Like, the minimum requirement for a linux distribution is /bin/sh, the rest of the system doesn't have to be there necessarily.
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- 10000truths 6y agoNo, the Linux kernel only requires an init executable to run. It otherwise makes no assumptions about the programs available in userland. Pretty much any sane/usable Linux distribution will package a shell, though.
- saagarjha 6y agoThe behavior your are likely thinking of (execvp on a file without a shebang) is implemented in libc.
- fao_ 6y agoNo. As someone else mentioned, the kernel hardcodes /bin/sh as a last resort: https://github.com/torvalds/linux/blob/dcc0b49040c70ad827a7f3d58a21b01fdb14e749/init/main.c#L1476 https://github.com/torvalds/linux/blob/dcc0b49040c70ad827a7f...