plcapi
[build.git] / vbuild-init-lxc.sh
index 06acdec..288cbff 100755 (executable)
@@ -195,21 +195,24 @@ TYPE=Ethernet
 MTU=1500
 EOF
 
-# set the hostname
-if [[ "$fcdistro" == "f18" ]] ; then
-    cat <<EOF > ${rootfs_path}/etc/hostname
+    # set the hostname
+    case "$fcdistro" in 
+       f18|f2?)
+           cat <<EOF > ${rootfs_path}/etc/hostname
 $HOSTNAME
 EOF
-else
-    cat <<EOF > ${rootfs_path}/etc/sysconfig/network
+           echo ;;
+       *)
+            cat <<EOF > ${rootfs_path}/etc/sysconfig/network
 NETWORKING=yes
 HOSTNAME=$HOSTNAME
 EOF
-    # set minimal hosts
-    cat <<EOF > $rootfs_path/etc/hosts
+            # set minimal hosts
+           cat <<EOF > $rootfs_path/etc/hosts
 127.0.0.1 localhost $HOSTNAME
 EOF
-fi
+           echo ;;
+    esac
 
     dev_path="${rootfs_path}/dev"
     rm -rf $dev_path
@@ -276,6 +279,10 @@ set -x
     # check the mini fedora was not already downloaded
     INSTALL_ROOT=$cache/partial
     echo $INSTALL_ROOT
+
+    # download a mini fedora into a cache
+    echo "Downloading fedora minimal ..."
+
     mkdir -p $INSTALL_ROOT
     if [ $? -ne 0 ]; then
         echo "Failed to create '$INSTALL_ROOT' directory"
@@ -297,13 +304,6 @@ set -x
       sed -i "s/\$basearch/$arch/g; s/\$releasever/$release/g;" $f
     done 
 
- #   install fedora
- #   PKG_LIST="yum initscripts passwd rsyslog vim-minimal dhclient chkconfig rootfiles policycoreutils openssh-server openssh-clients"
- #   yum --installroot=$INSTALL_ROOT --nogpgcheck install fedora-release
- #   yum --installroot=$INSTALL_ROOT --nogpgcheck install $PKG_LIST
-
-  
-    
     MIRROR_URL=http://mirror.onelab.eu/fedora/releases/$release/Everything/$arch/os
     RELEASE_URL1="$MIRROR_URL/Packages/fedora-release-$release-1.noarch.rpm"
     # with fedora18 the rpms are scattered by first name