add optional 3rd argument to support additional packages, ex;
S.Çağlar Onur [Tue, 18 Jan 2011 20:23:46 +0000 (15:23 -0500)]
./kvariant 2.6.32 http://build.planet-lab.org/planetlab/centos5/pl-centos5-x86_64-4.3-k32-latest/RPMS/x86_64/kernel-2.6.32-9.planetlab.x86_64.rpm http://build.planet-lab.org/planetlab/centos5/pl-centos5-x86_64-4.3-k32-latest/RPMS/x86_64/kernel-firmware-2.6.32-9.planetlab.x86_64.rpm

kvariant.sh

index dc80128..2613fa9 100755 (executable)
@@ -49,6 +49,9 @@ set -e
 variant=$1; shift
 [[ -z "$@" ]] && usage
 kernelrpm_url=$1; shift
+if [[ -n "$@" ]] ; then
+    extrarpm_url=$1; shift
+fi
 [[ -n "$@" ]] && usage
 
 basedir=$(cd -P $(dirname $0); pwd)
@@ -73,6 +76,12 @@ kernelrpm=$variant_path/$(basename $kernelrpm_url)
 getrpm $kernelrpm_url $kernelrpm
 checkrpm $kernelrpm
 
+if [ -n "$extrarpm_url" ] ; then
+    extrarpm=$variant_path/$(basename $extrarpm_url)
+    getrpm $extrarpm_url $extrarpm
+    checkrpm $extrarpm
+fi
+
 isofsdir=$variant_path/isofs
 
 tmpdir=
@@ -90,6 +99,10 @@ rm -rf boot/*
 rm -rf lib/modules
 echo "Replacing with new kernel"
 rpm2cpio  $kernelrpm | cpio -diu
+if [ -n $"extrarpm_url" ] ; then
+    echo "Unpacking $extrarpm"
+    rpm2cpio  $extrarpm | cpio -diu
+fi
 echo "Running depmod"
 version=$(cd ./boot && ls vmlinuz* | sed 's,vmlinuz-,,')
 depmod -b . $version
@@ -115,7 +128,7 @@ mv ${tmpdir}/bootcd.img ${isofsdir}/bootcd.img
 echo -n " bootcd.img"
 echo ""
 
-rm -rf $tmpdir $kernelrpm
+rm -rf $tmpdir $kernelrpm $extrarpm
 
 echo "new variant $variant ready"
 trap - ERR