* Use `exportReferencesGraph' to register the references of the
initial Nix installation correctly. svn path=/nixu/trunk/; revision=7021
This commit is contained in:
parent
91a66e72dc
commit
82ce465751
@ -6,12 +6,17 @@ genericSubstituter {
|
|||||||
dir = "bin";
|
dir = "bin";
|
||||||
isExecutable = true;
|
isExecutable = true;
|
||||||
inherit shell nix;
|
inherit shell nix;
|
||||||
|
|
||||||
nixClosure = stdenv.mkDerivation {
|
nixClosure = stdenv.mkDerivation {
|
||||||
name = "closure";
|
name = "closure";
|
||||||
builder = builtins.toFile "builder.sh"
|
exportReferencesGraph = ["refs" nix];
|
||||||
"source $stdenv/setup; nix-store -qR $nix > $out";
|
builder = builtins.toFile "builder.sh" "
|
||||||
buildInputs = [nix];
|
source $stdenv/setup
|
||||||
inherit nix;
|
if ! test -e refs; then
|
||||||
|
echo 'Your Nix installation is too old!'
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
cp refs $out
|
||||||
|
";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -73,9 +73,21 @@ mkdir -m 0755 -p \
|
|||||||
$mountPoint/nix/var/log/nix/drvs
|
$mountPoint/nix/var/log/nix/drvs
|
||||||
|
|
||||||
|
|
||||||
|
# Get the store paths to copy from the references graph.
|
||||||
|
storePaths=""
|
||||||
|
while read storePath; do
|
||||||
|
storePaths="$storePaths $storePath"
|
||||||
|
read deriver
|
||||||
|
read count
|
||||||
|
for ((i = 0; i < $count; i++)); do
|
||||||
|
read ref
|
||||||
|
done
|
||||||
|
done < @nixClosure@
|
||||||
|
|
||||||
|
|
||||||
# Copy Nix to the Nix store on the target device.
|
# Copy Nix to the Nix store on the target device.
|
||||||
echo "copying Nix to $targetDevice...."
|
echo "copying Nix to $targetDevice...."
|
||||||
for i in $(cat @nixClosure@); do
|
for i in $storePaths; do
|
||||||
echo " $i"
|
echo " $i"
|
||||||
rsync -a $i $mountPoint/nix/store/
|
rsync -a $i $mountPoint/nix/store/
|
||||||
done
|
done
|
||||||
@ -86,12 +98,7 @@ done
|
|||||||
# something. (I.e., Nix will see that, e.g., the glibc path is not
|
# something. (I.e., Nix will see that, e.g., the glibc path is not
|
||||||
# valid, delete it to get it out of the way, but as a result nothing
|
# valid, delete it to get it out of the way, but as a result nothing
|
||||||
# will work anymore.)
|
# will work anymore.)
|
||||||
for i in $(cat @nixClosure@); do
|
chroot $mountPoint @nix@/bin/nix-store --register-validity < @nixClosure@
|
||||||
echo $i
|
|
||||||
echo # deriver
|
|
||||||
echo 0 # nr of references
|
|
||||||
done \
|
|
||||||
| chroot $mountPoint @nix@/bin/nix-store --register-validity
|
|
||||||
|
|
||||||
|
|
||||||
# Create the required /bin/sh symlink; otherwise lots of things
|
# Create the required /bin/sh symlink; otherwise lots of things
|
||||||
|
Loading…
x
Reference in New Issue
Block a user