[Nix-dev] chroot builds on other Linux platforms

Sander van der Burg - EWI S.vanderBurg at tudelft.nl
Fri Dec 28 19:08:00 CET 2012


Yes, you're right about the statically linked shell, or I have to bind mount /lib into the chroot environment as well, introducing many more impurities. 

Now that I'm thinking about this: It almost sounds like a good idea to implement a feature in Nix providing a static shell in /bin/sh for any Nix chroot build (or a bash shell with its required libraries included). Maybe this also provides a solution for platforms not having bash in /bin/sh, such as Ubuntu/Debian (with dash as the default /bin/sh shell), or FreeBSD.

I could also be more creative -- e.g. running nix-daemon in a chroot providing a "pure" environment. But doing that is a bit too much effort for me. :P
________________________________________
From: nix-dev-bounces at lists.science.uu.nl [nix-dev-bounces at lists.science.uu.nl] on behalf of Eelco Dolstra [eelco.dolstra at logicblox.com]
Sent: Friday, December 28, 2012 6:58 PM
To: nix-dev at lists.science.uu.nl
Subject: Re: [Nix-dev] chroot builds on other Linux platforms

Hi,

On 28/12/12 18:41, Sander van der Burg - EWI wrote:

> A possible solution is to bind mount a different directory from my host system
> (only containing the shell) into the the chroot environment.

It would have to be a statically linked shell, otherwise you'll need /lib as well.

> Is there an option to achieve this, or must Nix be extended to do this?

It's not currently possible, see https://github.com/NixOS/nix/issues/24.

--
Eelco Dolstra | LogicBlox, Inc. | http://nixos.org/~eelco/
_______________________________________________
nix-dev mailing list
nix-dev at lists.science.uu.nl
http://lists.science.uu.nl/mailman/listinfo/nix-dev


More information about the nix-dev mailing list