Further reducing writes on boot.. Do not copy /etc unless it changed

svn path=/nixos/trunk/; revision=17948
This commit is contained in:
Michael Raskin 2009-10-24 00:03:13 +00:00
parent 893f13bb14
commit ca6f5e6cd4

View file

@ -63,9 +63,15 @@ in
etc = pkgs.lib.fullDepEntry ''
# Set up the statically computed bits of /etc.
echo "setting up /etc..."
/etc/kill-etc || true
${makeEtc}/bin/fill-etc
echo "/etc is set up"
if [ "$(readlink /etc/kill-etc)" != "${makeEtc}/bin/kill-etc" ]; then
/etc/kill-etc || true
${makeEtc}/bin/fill-etc
echo -e "#! /bin/sh\n${makeEtc}/bin/kill-etc\n${makeEtc}/bin/fill-etc" > /etc/refill-etc
chmod 0755 /etc/refill-etc
echo "/etc is set up"
else
echo "/etc unchanged"
fi
'' [
"systemConfig"
"defaultPath" # path to cp, chmod, chown