[Nix-dev] Dealing with non-Bash /bin/sh on non-NixOS

Ludovic Courtès ludo at gnu.org
Sat Nov 3 22:02:02 CET 2012


Hi,

Michael Raskin <7c6f434c at mail.ru> skribis:

[...]

>>I was thinking that, instead of just bind-mounting /bin, we could have
>>at least a nix-daemon option that would allow the host code to specify
>>which file /bin/sh should point to.  Even better would be to have an
>>additional ‘derivation’ parameter.

[...]

> So, I guess there would be a configuration option (marked as dangerous
> and/or impure) to override what is taken from external environment for 
> a normal chroot build (ideally, nothing — maybe it is possible to use
> even fake proc?).

What I had in mind was more an extension of DerivationInputs.  Instead
of having just a derivation-path/output-ids pair, it could optionally be
something like a derivation-path/output-id/file/fs-mapping.

IOW, instead of (or in addition to) /.../bash.drv + “out”, you could
have: /.../bash.drv + “out” + “bin/bash” + “/bin/sh”, which would mean
“map ${bash}/bin/bash to /bin/sh”.

This would make chroot builds compulsory, though.

So an intermediate solution would be to have a specific nix-daemon
option to say what /bin/sh should point to.

Thoughts?

Ludo’.


More information about the nix-dev mailing list