X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=vbuild-init-vserver.sh;h=cec08df3799cb063cb4d9690b860519df0256b45;hb=ab9c56bfe383075f93102b47dd0c3f32346f723a;hp=8b21957f8c2316ab388323507da19ade90d96283;hpb=17199c318cb55eb6d594621cbc7127d531dc09eb;p=build.git diff --git a/vbuild-init-vserver.sh b/vbuild-init-vserver.sh index 8b21957f..cec08df3 100755 --- a/vbuild-init-vserver.sh +++ b/vbuild-init-vserver.sh @@ -7,7 +7,7 @@ DIRNAME=$(dirname $0) # pkgs parsing utilities PATH=$(dirname $0):$PATH . build.common -DEFAULT_FCDISTRO=f7 +DEFAULT_FCDISTRO=f8 DEFAULT_PLDISTRO=planetlab DEFAULT_PERSONALITY=linux32 @@ -55,7 +55,7 @@ function configure_yum_in_vserver () { else # exclude kernel from fedora repos for i in /vservers/$vserver/etc/yum.repos.d/* ; do - echo "exclude=kernel* ulogd iptables" >> $i + [ -f $i ] && echo "exclude=kernel* ulogd iptables" >> $i done # the build repo is not signed at this stage cat > /vservers/$vserver/etc/yum.repos.d/myplc.repo <> /etc/vservers/$vserver/bcapabilities cap=$(grep ^CAP_IPC_LOCK /etc/vservers/$vserver/bcapabilities | wc -l) [ $cap -eq 0 ] && echo 'CAP_IPC_LOCK' >> /etc/vservers/$vserver/bcapabilities + else + ### capabilities required for a myplc vserver + # for /etc/plc.d/gpg - need to init /dev/random + cap=$(grep ^CAP_MKNOD /etc/vservers/$vserver/bcapabilities | wc -l) + [ $cap -eq 0 ] && echo 'CAP_MKNOD' >> /etc/vservers/$vserver/bcapabilities fi $personality vyum $vserver -- -y install yum @@ -121,7 +127,7 @@ function setup_vserver () { # start the vserver so we can do the following operations $personality vserver $VERBOSE $vserver start - $personality vserver $VERBOSE $vserver exec rm -f /var/lib/rpm/__db* + $personality vserver $VERBOSE $vserver exec sh -c "rm -f /var/lib/rpm/__db*" $personality vserver $VERBOSE $vserver exec rpm --rebuilddb # minimal config in the vserver for yum to work @@ -146,7 +152,7 @@ function devel_tools () { if [ -n "$VBUILD_MODE" ] ; then pkgsname=devel.pkgs else - pkgsname=native-shell.pkgs + pkgsname=vtest.pkgs fi pkgsfile=$(pl_locateDistroFile $DIRNAME $pldistro $pkgsname) @@ -247,23 +253,23 @@ EOF } COMMAND_VBUILD="vbuild-init-vserver.sh" -COMMAND_MYPLC="myplc-init-vserver.sh" +COMMAND_MYPLC="vtest-init-vserver.sh" function usage () { set +x - echo "Usage: $COMMAND_VBUILD [-v] vserver-name [ -- vserver-options ]" - echo "Usage: $COMMAND_MYPLC [-v] vserver-name repo-url [ -- vserver-options ]" + echo "Usage: $COMMAND_VBUILD [options] vserver-name [ -- vserver-options ]" + echo "Usage: $COMMAND_MYPLC [options] vserver-name repo-url [ -- vserver-options ]" echo "Requirements: you need to have a vserver-compliant kernel," - echo " as well as the util-vserver RPM installed" + echo " as well as the util-vserver RPM installed" echo "Description:" - echo " This command creates a fresh vserver instance, for building, or running, myplc" + echo " This command creates a fresh vserver instance, for building, or running, myplc" echo "Supported options" echo " -f fcdistro - for creating the root filesystem - defaults to $DEFAULT_FCDISTRO" echo " -d pldistro - defaults to $DEFAULT_PLDISTRO" echo " -p personality - defaults to $DEFAULT_PERSONALITY" - echo " -v : passes -v to calls to vserver" + echo " -v : verbose - passes -v to calls to vserver" echo "vserver-options" - echo " all args after the optional -- are passed to vserver build " - echo " typical usage is e.g. --interface eth0:200.150.100.10/24" + echo " all args after the optional -- are passed to vserver build " + echo " typical usage is e.g. --interface eth0:200.150.100.10/24" exit 1 }