From ca6f5e6cd48cdec330da4495a626b720775e2061 Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sat, 24 Oct 2009 00:03:13 +0000 Subject: [PATCH] Further reducing writes on boot.. Do not copy /etc unless it changed svn path=/nixos/trunk/; revision=17948 --- modules/system/etc/etc.nix | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/system/etc/etc.nix b/modules/system/etc/etc.nix index 35137597d04..7246d62c160 100644 --- a/modules/system/etc/etc.nix +++ b/modules/system/etc/etc.nix @@ -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