This patch makes sure file time stamp and file permissions are preserved.
The patch is attached and is also at http://github.com/lflaks/cobbler/
--
Leon
diff --git a/snippets/keep_cfengine_keys b/snippets/keep_cfengine_keys
index 0037339..1c7b428 100644
--- a/snippets/keep_cfengine_keys
+++ b/snippets/keep_cfengine_keys
@@ -88,7 +88,7 @@ if [ "$keys_found" = "yes" ]; then
while : ; do
sleep 10
if [ -d /mnt/sysimage$SEARCHDIR ] ; then
- cp -f /tmp/$TEMPDIR/${PATTERN}* /mnt/sysimage$SEARCHDIR
+ cp -af /tmp/$TEMPDIR/${PATTERN}* /mnt/sysimage$SEARCHDIR
logger "keys copied to newly installed system"
break
fi
diff --git a/snippets/keep_files b/snippets/keep_files
index 501992c..5913d8b 100644
--- a/snippets/keep_files
+++ b/snippets/keep_files
@@ -115,7 +115,7 @@ function restore_keys
while : ; do
sleep 10
if [ -d /mnt/sysimage$SEARCHDIR ] ; then
- cp -f /tmp/$TEMPDIR/${PATTERN}* /mnt/sysimage$SEARCHDIR
+ cp -af /tmp/$TEMPDIR/${PATTERN}* /mnt/sysimage$SEARCHDIR
logger "$TEMPDIR keys copied to newly installed system"
break
fi
diff --git a/snippets/keep_rhn_keys b/snippets/keep_rhn_keys
index a9eb0b5..59bfc5d 100644
--- a/snippets/keep_rhn_keys
+++ b/snippets/keep_rhn_keys
@@ -79,7 +79,7 @@ if [ "$rhn_keys_found" = "yes" ]; then
while : ; do
sleep 10
if [ -d /mnt/sysimage/etc/sysconfig/rhn ] ; then
- cp -f /tmp/rhn/* /mnt/sysimage/etc/sysconfig/rhn/
+ cp -af /tmp/rhn/* /mnt/sysimage/etc/sysconfig/rhn/
logger "RHN KEY copied to newly installed system"
break
fi
diff --git a/snippets/keep_ssh_host_keys b/snippets/keep_ssh_host_keys
index 5c69cff..812cf08 100644
--- a/snippets/keep_ssh_host_keys
+++ b/snippets/keep_ssh_host_keys
@@ -88,7 +88,7 @@ if [ "$keys_found" = "yes" ]; then
while : ; do
sleep 10
if [ -d /mnt/sysimage$SEARCHDIR ] ; then
- cp -f /tmp/$TEMPDIR/${PATTERN}* /mnt/sysimage$SEARCHDIR
+ cp -af /tmp/$TEMPDIR/${PATTERN}* /mnt/sysimage$SEARCHDIR
logger "keys copied to newly installed system"
break
fi