]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
The yum in Centos 5.11 does not know about '--releasever', which is used by: lxc...
authorDwight Schauer <das@teegra.net>
Tue, 2 Jun 2015 04:41:09 +0000 (23:41 -0500)
committerStéphane Graber <stgraber@ubuntu.com>
Fri, 14 Aug 2015 17:15:10 +0000 (13:15 -0400)
The release version only needs to be set in the outer bootstrap, not the inner one.
With this change an lxc-create bootstrap of CentOS 5.11 completes enough to be usable.
CentOS 5.11 containers can be created, started, stopped, and networking works.
Signed-off-by: Dwight Schauer <das@teegra.net>
templates/lxc-centos.in

index 272d25743c5ceece0fd01a4cc6f48331993ffc22..282e3a593a4687648ebca26108d89a3f475bbb7c 100644 (file)
@@ -403,10 +403,12 @@ download_centos()
 
     # download a mini centos into a cache
     echo "Downloading centos minimal ..."
+    YUM0="yum --installroot $INSTALL_ROOT -y --nogpgcheck"
+
     if yum -h | grep -q 'releasever=RELEASEVER'; then
-        YUM="yum --installroot $INSTALL_ROOT -y --nogpgcheck --releasever=$release"
+       YUM="$YUM0 --releasever=$release"
     else
-        YUM="yum --installroot $INSTALL_ROOT -y --nogpgcheck"
+       YUM="$YUM0"
     fi
     PKG_LIST="yum initscripts passwd rsyslog vim-minimal openssh-server openssh-clients dhclient chkconfig rootfiles policycoreutils"
 
@@ -473,7 +475,7 @@ EOF
         mknod -m 666 $INSTALL_ROOT/$INSTALL_ROOT/dev/urandom c 1 9
         mkdir -p $INSTALL_ROOT/$INSTALL_ROOT/var/cache/yum
         cp -al $INSTALL_ROOT/var/cache/yum/* $INSTALL_ROOT/$INSTALL_ROOT/var/cache/yum/
-        chroot $INSTALL_ROOT $YUM install $PKG_LIST
+        chroot $INSTALL_ROOT $YUM0 install $PKG_LIST
         if [ $? -ne 0 ]; then
             echo "Failed to download the rootfs, aborting."
             return 1