cosmetic: remove redundancy

svn path=/nixos/trunk/; revision=19040
This commit is contained in:
Marc Weber 2009-12-18 15:08:50 +00:00
parent 01491abbfa
commit 93cb9f819d

View File

@ -46,8 +46,7 @@ copyToKernelsDir() {
} }
# Add an entry for a configuration to the Grub menu, and if # Copy its kernel and initrd to /boot/kernels.
# appropriate, copy its kernel and initrd to /boot/kernels.
addEntry() { addEntry() {
local path="$1" local path="$1"
local generation="$2" local generation="$2"
@ -77,22 +76,11 @@ addEntry() {
cp "$(readlink -f "$path/init")" /boot/nixos-init cp "$(readlink -f "$path/init")" /boot/nixos-init
mkdir -p /boot/default mkdir -p /boot/default
if [ -e /boot/default/system ]; then # ln -sfT: overrides target even if it exists.
rm /boot/default/system ln -sfT $(readlink -f $path) /boot/default/system
fi ln -sfT $(readlink -f $path/init) /boot/default/init
ln -sf $(readlink -f $path) /boot/default/system ln -sfT $initrd /boot/default/initrd
if [ -e /boot/default/init ]; then ln -sfT $kernel /boot/default/kernel
rm /boot/default/init
fi
ln -sf $(readlink -f $path/init) /boot/default/init
if [ -e /boot/default/initrd ]; then
rm /boot/default/initrd
fi
ln -sf $initrd /boot/default/initrd
if [ -e /boot/default/kernel ]; then
rm /boot/default/kernel
fi
ln -sf $kernel /boot/default/kernel
fi fi
} }