[Ovirt-devel] [PATCH node-image] Add script to help automate adding/updating rpms in node

Perry Myers pmyers at redhat.com
Sun Mar 29 23:21:27 UTC 2009


Signed-off-by: Perry Myers <pmyers at redhat.com>
---
 Makefile.am              |    1 +
 livecd-rpms              |   33 +++++++++++++++++++++++++++++++++
 ovirt-node-image.spec.in |    2 ++
 3 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100755 livecd-rpms

diff --git a/Makefile.am b/Makefile.am
index eef520c..9b13e00 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -43,6 +43,7 @@ EXTRA_DIST =				\
   create-ovirt-iso-nodes		\
   edit-livecd				\
   livecd-setauth			\
+  livecd-rpms				\
   README
 
 DISTCLEANFILES = $(PACKAGE)-$(VERSION).tar.gz \
diff --git a/livecd-rpms b/livecd-rpms
new file mode 100755
index 0000000..239f7a2
--- /dev/null
+++ b/livecd-rpms
@@ -0,0 +1,33 @@
+#!/bin/bash
+#
+# Script to install/update a livecd with a set of RPMS provided
+# in a directory called 'rpms'
+# Copyright 2009 Red Hat, Inc.
+# Written by Perry Myers <pmyers at redhat.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU Library General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if [[ $# < 1 ]]; then
+    echo "Usage: $0 rpmdir"
+    exit 1
+fi
+
+RPMDIR=$1
+
+rm -Rf tmp/rpms
+mkdir -p tmp/rpms
+find $RPMDIR -type f -name "*.rpm" -exec cp -av {} tmp/rpms \; 
+
+chroot . rpm -Uvh /tmp/rpms/*.rpm
+rm -Rf tmp/rpms
diff --git a/ovirt-node-image.spec.in b/ovirt-node-image.spec.in
index c93019d..c3000d9 100644
--- a/ovirt-node-image.spec.in
+++ b/ovirt-node-image.spec.in
@@ -58,6 +58,7 @@ mkdir %{buildroot}
 %{__install} -p -m0755 create-ovirt-iso-nodes %{buildroot}%{_sbindir}
 %{__install} -p -m0755 edit-livecd %{buildroot}%{_sbindir}
 %{__install} -p -m0755 livecd-setauth %{buildroot}%{_sbindir}
+%{__install} -p -m0755 livecd-rpms %{buildroot}%{_sbindir}
 %{__tar} -xf %{image_manifests} -C %{buildroot}%{app_root}
 
 %clean
@@ -80,6 +81,7 @@ mkdir %{buildroot}
 %{_sbindir}/create-ovirt-iso-nodes
 %{_sbindir}/edit-livecd
 %{_sbindir}/livecd-setauth
+%{_sbindir}/livecd-rpms
 
 %changelog
 * Thu Jul 03 2008 Perry Myers <pmyers at redhat.com> 0.92-0
-- 
1.6.0.6




More information about the ovirt-devel mailing list