naming .lst files after pldistro - including the <pldistro>-filesystems directory
authorThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 21 Nov 2007 09:31:37 +0000 (09:31 +0000)
committerThierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Wed, 21 Nov 2007 09:31:37 +0000 (09:31 +0000)
bootstrapfs.spec
build.sh
planetlab-base.lst [moved from base.lst with 100% similarity]
planetlab-filesystems/production.lst [moved from bootstrap-filesystems/production.lst with 100% similarity]

index 51c084b..0283ee0 100644 (file)
@@ -31,7 +31,7 @@ BootManager to instantiate a node with a new filesystem.
 
 %build
 pushd BootstrapFS
-./build.sh
+./build.sh %{pldistro}
 popd BootstrapFS
 
 %install
@@ -44,7 +44,7 @@ install -D -m 644 PlanetLab-Bootstrap.tar.bz2 \
 
 for bootstrapfs in $(ls bootstrap-filesystems/*.lst) ; do 
        NAME=$(basename $bootstrapfs .lst)
-       install -D -m 644 bootstrap-filesystems/PlanetLab-Bootstrap-${NAME}.tar.bz2 \
+       install -D -m 644 %{pldistro}-filesystems/PlanetLab-Bootstrap-${NAME}.tar.bz2 \
                $RPM_BUILD_ROOT/var/www/html/boot/PlanetLab-Bootstrap-${NAME}.tar.bz2
 done
 
index 4ccb8f3..8537636 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -31,6 +31,10 @@ pl_process_fedora_options $@
 shiftcount=$?
 shift $shiftcount
 
+# pldistro expected as $1 - defaults to planetlab
+pldistro=planetlab
+[ -n "$@" ] && pldistro=$1
+
 # Do not tolerate errors
 set -e
 
@@ -42,11 +46,11 @@ export PL_BOOTCD=1
 # "Parse" out the packages and groups into the options passed to mkfedora
 # -k = exclude kernel* packages
 options="-k"
-lst="base.lst"
-packages=$(pl_getPackages $lst)
-groups=$(pl_getGroups $lst)
-for package in ${packages} ; do  options="$options -p $package"; done
-for group in ${groups} ; do options="$options -g $group"; done
+lst="${pldistro}-base.lst"
+popts=$(pl_getPackagesOptions2 ${pl_DISTRO_NAME} $lst)
+gopts=$(pl_getGroupsOptions2 ${pl_DISTRO_NAME} $lst)
+
+options="${popts} ${gopts}"
 
 echo "+++++++++++++OPTIONS = ${options}"
 
@@ -55,7 +59,7 @@ vref=${PWD}/base
 install -d -m 755 ${vref}
 pl_mkfedora ${vref} ${options}
 
-for lst in bootstrap-filesystems/*.lst ; do
+for lst in ${pldistro}-filesystems/*.lst ; do
     NAME=$(basename $lst .lst)
 
     echo "--------START BUILDING PlanetLab-Bootstrap-${NAME}: $(date)"
@@ -65,7 +69,7 @@ for lst in bootstrap-filesystems/*.lst ; do
     groups=$(pl_getGroups $lst)
     echo "${NAME} has the following packages and groups: ${packages} ${groups}"
 
-    vdir=${PWD}/bootstrap-filesystems/${NAME}
+    vdir=${PWD}/${pldistro}-filesystems/${NAME}
     rm -rf ${vdir}/*
     install -d -m 755 ${vdir}
 
@@ -111,7 +115,7 @@ for lst in bootstrap-filesystems/*.lst ; do
     mv ${vdir}-tmp ${vdir}
 
     echo "--------STARTING tar'ing PlanetLab-Bootstrap-${NAME}.tar.bz2: $(date)"
-    tar -cpjf bootstrap-filesystems/PlanetLab-Bootstrap-${NAME}.tar.bz2 -C ${vdir} .
+    tar -cpjf ${pldistro}-filesystems/PlanetLab-Bootstrap-${NAME}.tar.bz2 -C ${vdir} .
     echo "--------FINISHED tar'ing PlanetLab-Bootstrap-${NAME}.tar.bz2: $(date)"
     echo "--------DONE BUILDING PlanetLab-Bootstrap-${NAME}: $(date)"
 done
similarity index 100%
rename from base.lst
rename to planetlab-base.lst