From c7c16f384a14d853d989523bde362510a85c9891 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 11 Jan 2007 00:06:46 +0000 Subject: [PATCH] * Fixed some installer bugs. svn path=/nixos/trunk/; revision=7629 --- configuration/rescue-cd.nix | 4 ++-- installer/nixos-installer.sh | 23 ++++++++++++++++++++--- system/system.nix | 1 + 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/configuration/rescue-cd.nix b/configuration/rescue-cd.nix index 333d6154b116..b9b0ffaa0286 100644 --- a/configuration/rescue-cd.nix +++ b/configuration/rescue-cd.nix @@ -1,7 +1,7 @@ rec { - nixpkgsRel = "nixpkgs-0.11pre7593"; + nixpkgsRel = "nixpkgs-0.11pre7628"; configuration = { @@ -94,7 +94,7 @@ rec { # Get a recent copy of Nixpkgs. nixpkgsTarball = pkgs.fetchurl { url = configuration.installer.nixpkgsURL + "/" + nixpkgsRel + ".tar.bz2"; - md5 = "fd443fb8b1c4d352d9a8b7d19dfb7c49"; + md5 = "e7fe1793e69ff5072eb5987e7b7ccd47"; }; diff --git a/installer/nixos-installer.sh b/installer/nixos-installer.sh index c70e1d0cabe1..5e2601288131 100644 --- a/installer/nixos-installer.sh +++ b/installer/nixos-installer.sh @@ -19,11 +19,27 @@ mountPoint="$1" nixosDir="$2" configuration="$3" -if test ! -e "$mountPoint" -o ! -e "$nixosDir" -o ! -e "$configuration"; then +if test -z "$mountPoint" -o -z "$nixosDir" -o -z "$configuration"; then echo "Syntax: installer.sh " exit 1 fi +if ! test -e "$mountPoint"; then + echo "mount point $mountPoint doesn't exist" + exit 1 +fi + +if ! test -e "$nixosDir"; then + echo "NixOS source directory $nixosDir doesn't exist" + exit 1 +fi + +if ! test -e "$configuration"; then + echo "configuration file $configuration doesn't exist" + exit 1 +fi + + nixosDir=$(readlink -f "$nixosDir") configuration=$(readlink -f "$configuration") @@ -124,8 +140,9 @@ mkdir -p $(dirname $targetConfig) if test -e $targetConfig -o -L $targetConfig; then cp -f $targetConfig $targetConfig.backup-$(date "+%Y%m%d%H%M%S") fi -if -cp -f $configuration $targetConfig +if test "$configuration" != "$targetConfig"; then + cp -f $configuration $targetConfig +fi # Grub needs a mtab. diff --git a/system/system.nix b/system/system.nix index f03e32e19653..fdca1eee0faf 100644 --- a/system/system.nix +++ b/system/system.nix @@ -155,6 +155,7 @@ rec { pkgs.less pkgs.lvm2 pkgs.man + pkgs.mdadm pkgs.module_init_tools pkgs.nano pkgs.netcat