- merge revision 1.23
authorMark Huang <mlhuang@cs.princeton.edu>
Tue, 9 May 2006 21:43:40 +0000 (21:43 +0000)
committerMark Huang <mlhuang@cs.princeton.edu>
Tue, 9 May 2006 21:43:40 +0000 (21:43 +0000)
date: 2006/05/09 16:45:28;  author: mlhuang;  state: Exp;  lines: +9 -11
- fix how GPG keys are pushed into the reference images

vserver-reference.init

index e283aa5..6287054 100755 (executable)
@@ -9,7 +9,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2004 The Trustees of Princeton University
 #
-# $Id: vserver-reference.init,v 1.19.4.1 2006/05/08 20:34:30 mlhuang Exp $
+# $Id: vserver-reference.init,v 1.19.4.2 2006/05/08 20:53:35 mlhuang Exp $
 #
 
 case "$1" in
@@ -60,24 +60,22 @@ setattr --barrier /vservers
 # Copy configuration files from host to slices
 for file in /etc/hosts /etc/resolv.conf /etc/yum.conf /etc/planetlab/node_id \
             /etc/planetlab/plc_config* /etc/planetlab/php/* \
-            /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora \
-            /etc/pki/rpm-gpg/RPM-GPG-KEY-planetlab ; do
+            /etc/pki/rpm-gpg/* ; do
     if [ -r $file ] ; then
        for vroot in $VROOTS ; do
-           if [ "$(dirname $file)" = "/etc/pki/rpm-gpg" -a \
-                ! -f $vroot/$file ] ; then
-               import=1
-           else
-               import=0
-           fi
            install -D -m 644 $file $vroot/$file
-           if [ $import -eq 1 ] ; then
-               chroot $vroot rpm --import $file
-           fi
        done
     fi
 done
 
+# (Re)install GPG signing keys
+if [ -d /etc/pki/rpm-gpg ] ; then
+    for vroot in $VROOTS ; do
+       chroot $vroot rpm --allmatches -e gpg-pubkey || :
+       chroot $vroot rpm --import /etc/pki/rpm-gpg/* || :
+    done
+fi
+
 # Old versions of the Boot Manager copied portions of the Boot CD to
 # /mnt/cdrom/bootme, to support old scripts which assumed that the
 # Boot CD was mounted even in production mode. Now, it just copies it