2004-02-14 22:56:51 +00:00
|
|
|
#! /bin/sh -e
|
|
|
|
|
2005-07-05 13:52:49 +00:00
|
|
|
archivesDir=/tmp/arch
|
|
|
|
manifest=${archivesDir}/MANIFEST
|
2005-07-06 14:42:41 +00:00
|
|
|
nixpkgs=/nixpkgs2/trunk/pkgs
|
2005-07-06 16:00:20 +00:00
|
|
|
fill_disk=$archivesDir/scripts/fill-disk.sh
|
2005-07-06 14:42:41 +00:00
|
|
|
|
2005-07-11 17:59:19 +00:00
|
|
|
chmod -R +w ${archivesDir}/*
|
2005-07-06 14:42:41 +00:00
|
|
|
rm -rf ${archivesDir}/*
|
2004-08-06 13:52:39 +00:00
|
|
|
|
|
|
|
NIX_CMD_PATH=/nix/bin
|
|
|
|
|
2005-07-05 13:52:49 +00:00
|
|
|
storeExpr=$(echo '(import ./pkgs.nix).everything' | $NIX_CMD_PATH/nix-instantiate -v -v -)
|
2005-07-05 14:39:12 +00:00
|
|
|
$NIX_CMD_PATH/nix-push --copy $archivesDir $manifest $(nix-store -r $storeExpr) $(nix-store -r $(echo '(import ./pkgs.nix).kernel' | $NIX_CMD_PATH/nix-instantiate -))
|
2004-02-18 10:56:07 +00:00
|
|
|
|
|
|
|
# Location of sysvinit?
|
2005-07-06 16:00:20 +00:00
|
|
|
sysvinitPath=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).sysvinit' | $NIX_CMD_PATH/nix-instantiate -))
|
2004-02-18 10:56:07 +00:00
|
|
|
|
2004-02-18 14:56:32 +00:00
|
|
|
# Location of Nix boot scripts?
|
2005-07-06 16:00:20 +00:00
|
|
|
bootPath=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).boot' | $NIX_CMD_PATH/nix-instantiate -))
|
|
|
|
|
2005-07-08 10:06:41 +00:00
|
|
|
nix=$($NIX_CMD_PATH/nix-store -q $(echo '(import ./pkgs.nix).nix' | $NIX_CMD_PATH/nix-instantiate -))
|
2005-07-05 14:39:12 +00:00
|
|
|
|
2005-07-11 17:59:19 +00:00
|
|
|
#nixDeps=$($NIX_CMD_PATH/nix-store -qR $(echo '(import ./pkgs.nix).nix' | $NIX_CMD_PATH/nix-instantiate -))
|
|
|
|
|
|
|
|
nixDeps=$($NIX_CMD_PATH/nix-store -qR $(nix-store -r $(echo '(import ./pkgs.nix).nix' | $NIX_CMD_PATH/nix-instantiate -)))
|
|
|
|
|
|
|
|
echo $nixDeps
|
|
|
|
|
2005-07-06 14:42:41 +00:00
|
|
|
cp -fa ${nixpkgs} ${archivesDir}
|
2005-07-11 17:59:19 +00:00
|
|
|
cp -fa --parents ${nixDeps} ${archivesDir}
|
2005-07-06 14:42:41 +00:00
|
|
|
mkdir ${archivesDir}/scripts
|
|
|
|
cp -fa * ${archivesDir}/scripts
|
2005-07-06 16:00:20 +00:00
|
|
|
sed -e "s^@sysvinitPath\@^$sysvinitPath^g" \
|
|
|
|
-e "s^@bootPath\@^$bootPath^g" \
|
2005-07-08 10:06:41 +00:00
|
|
|
-e "s^@NIX_CMD_PATH\@^$nix^g" \
|
2005-07-06 16:00:20 +00:00
|
|
|
< $fill_disk > $fill_disk.tmp
|
|
|
|
mv $fill_disk.tmp $fill_disk
|