fcdistro=$1; shift
case $fcdistro in
f[0-9]*|centos[0-9]*|sl[0-9]*) echo yum ;;
- lenny|etch) echo debootstrap ;;
+ squeeze|wheezy|oneiric|precise|quantal|raring|saucy) echo debootstrap ;;
*) echo Unknown distro $fcdistro ;;
esac
}
exit 1
fi
- install_fedora
- if [ $? -ne 0 ]; then
- echo "failed to install fedora"
- exit 1
- fi
-
- configure_fedora
- if [ $? -ne 0 ]; then
- echo "failed to configure fedora for a container"
- exit 1
- fi
-
- if [ "$(echo $fcdistro | cut -d"f" -f2)" -le "14" ]; then
- configure_fedora_init
- else
- configure_fedora_systemd
- fi
+ pkg_method=$(package_method $fcdistro)
+ case $pkg_method in
+ yum)
+ install_fedora || { echo "failed to install fedora"; exit 1 ; }
+ configure_fedora || { echo "failed to configure fedora for a container"; exit 1 ; }
+ if [ "$(echo $fcdistro | cut -d"f" -f2)" -le "14" ]; then
+ configure_fedora_init
+ else
+ configure_fedora_systemd
+ fi
+ ;;
+ debootstrap)
+ echo "$COMMAND: no support for debootstrap-based systems - yet"
+ exit 1
+ ;;
+ *)
+ echo "$COMMAND:: unknown package_method - exiting"
+ exit 1
+ ;;
+ esac
# Enable cgroup
mkdir $rootfs_path/cgroup
pkg_method=$(package_method $fcdistro)
- # check for .pkgs file based on pldistro
- if [ -n "$BUILD_MODE" ] ; then
- pkgsname=devel.pkgs
- else
- pkgsname=vtest.pkgs
- fi
- pkgsfile=$(pl_locateDistroFile $DIRNAME $pldistro $pkgsname)
+ pkgsfile=$(pl_locateDistroFile $DIRNAME $pldistro $PREINSTALLED)
### install individual packages, then groups
# get target arch - use uname -i here (we want either x86_64 or i386)
function post_install () {
lxc=$1; shift
+ personality=$1; shift
if [ -n "$BUILD_MODE" ] ; then
- post_install_build $lxc
+ post_install_build $lxc $personality
+ start_lxc $lxc
else
- post_install_myplc $lxc
+ post_install_myplc $lxc $personality
+ start_lxc $lxc
wait_for_ssh $lxc
fi
# setup localtime from the host
fi
#
EOF
-
+
}
function post_install_myplc () {
RESISTANT=""
IFNAME=""
LXC_OPTIONS=""
- while getopts "f:d:p:i:" opt ; do
+
+ # the set of preinstalled packages - depends on vbuild or vtest
+ if [ -n "$VBUILD_MODE" ] ; then
+ PREINSTALLED=devel.pkgs
+ else
+ PREINSTALLED=vtest.pkgs
+ fi
+ while getopts "f:d:p:P:i:" opt ; do
case $opt in
f) fcdistro=$OPTARG;;
d) pldistro=$OPTARG;;
p) personality=$OPTARG;;
+ P) PREINSTALLED=$OPTARG;;
i) IFNAME=$OPTARG;;
*) usage ;;
esac
post_install $lxc $personality
- start_lxc $lxc
-
echo $COMMAND Done
}