prepare a placeholder for debian-oriented code
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 20 Jan 2014 07:32:18 +0000 (08:32 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 20 Jan 2014 07:32:18 +0000 (08:32 +0100)
lbuild-initvm.sh

index 30f8463..864d996 100755 (executable)
@@ -581,23 +581,26 @@ function setup_lxc() {
         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