* Started setting up a proper init environment.
svn path=/nixu/trunk/; revision=785
This commit is contained in:
parent
e019265ec9
commit
1f7a8c8ae9
@ -1,4 +0,0 @@
|
||||
let {
|
||||
pkgs = import pkgs/system/i686-linux.nix;
|
||||
body = pkgs.bash;
|
||||
}
|
@ -52,7 +52,7 @@ done) < /tmp/successors
|
||||
echo setting init symlink...
|
||||
initPath=$(/nix/bin/nix-store -qn $initExpr)
|
||||
rm -f $root/init
|
||||
ln -s $initPath/bin/sh $root/init
|
||||
ln -s $initPath/bin/init $root/init
|
||||
|
||||
echo unmounting...
|
||||
umount $root
|
||||
|
14
init/builder.sh
Executable file
14
init/builder.sh
Executable file
@ -0,0 +1,14 @@
|
||||
#! /bin/sh -e
|
||||
|
||||
. $stdenv/setup
|
||||
|
||||
mkdir $out
|
||||
mkdir $out/bin
|
||||
|
||||
sed \
|
||||
-e "s^@bash\@^$bash^g" \
|
||||
-e "s^@coreutils\@^$coreutils^g" \
|
||||
-e "s^@findutils\@^$findutils^g" \
|
||||
< $src > $out/bin/init
|
||||
|
||||
chmod +x $out/bin/init
|
9
init/default.nix
Normal file
9
init/default.nix
Normal file
@ -0,0 +1,9 @@
|
||||
{stdenv, bash, coreutils, findutils}:
|
||||
|
||||
derivation {
|
||||
name = "init";
|
||||
system = stdenv.system;
|
||||
builder = ./builder.sh;
|
||||
src = ./init.sh;
|
||||
inherit stdenv bash coreutils findutils;
|
||||
}
|
14
init/init.sh
Normal file
14
init/init.sh
Normal file
@ -0,0 +1,14 @@
|
||||
#! @bash@/bin/sh -e
|
||||
|
||||
export PATH=@bash@/bin:@coreutils@/bin:@findutils@/bin
|
||||
|
||||
echo "--- Nix ---"
|
||||
|
||||
#echo "remounting root..."
|
||||
|
||||
echo "starting root shell..."
|
||||
|
||||
@bash@/bin/sh
|
||||
|
||||
echo "shutting down..."
|
||||
exit 0
|
@ -18,7 +18,7 @@ fi
|
||||
|
||||
|
||||
# What to copy?
|
||||
storeexpr=$(nix-instantiate ./bootstrap.nix)
|
||||
storeexpr=$(echo '(import ./pkgs.nix).init' | nix-instantiate -)
|
||||
nix-store -rB $storeexpr
|
||||
nix-store -qn --requisites $storeexpr > $storepaths
|
||||
|
||||
|
4
pkgs.nix
Normal file
4
pkgs.nix
Normal file
@ -0,0 +1,4 @@
|
||||
rec {
|
||||
inherit (import pkgs/system/i686-linux.nix) stdenv bash coreutils findutils;
|
||||
init = (import ./init) {inherit stdenv bash coreutils findutils;};
|
||||
}
|
Loading…
Reference in New Issue
Block a user