lxc-fedora fixes
lxc-fedora fixes

Howdy,

I was playing around with LXC containers this past weekend, and
noticed a couple of issues with the lxc-fedora script:

#1: Line 96 should be ${ROOTFS}/etc/sysconfig/network instead of
${ROOTFS}/sysconfig/network

#2 Line 249 contains a reference to $PKG, which isn't used in the
program. I adjusted the variable to point to the correct package, and
use this in the calls to yumdownloader:

    PKG="${DISTRO}-release.noarch.rpm"
                   .....
    yumdownloader --destdir="${CACHE}/partial" "${PKG}"

#3 The $CACHE/partial path is escaped unnecessarily:

   RPM="rpm --root \"${CACHE}/partial\""

#4 The program assumes yumdownloader will work, which isn't always the
case. I added an if statement to check the return code:


   echo "Downloading distribution release file ${PKG}"
   yumdownloader --destdir="${CACHE}/partial" "${PKG}"
   RESULT=$?

   if [ "${RESULT}" != "0" ]; then
       echo "Enable to download the distribution release file"
       exit 1
   fi

#5 The package name passed to yumdownloader is incorrect:

   yumdownloader --destdir="${CACHE}/partial" "${DISTRO}-release.noarch.rpm"

   On Fedora 10 and 11, this evaluates to:

   fedora-release.noarch.rpm

   When we need it to evaluate to:

   fedora-{RELEASE_VER}.release.noarch

   This is fixed in the PKG variable listed above.

A patch that addresses these issues is attached.

Thanks,
- Ryan

Signed-off-by: Matty <0603f459957c5166d4a14b399574caba504a4951@gmail.com>
Signed-off-by: Daniel Lezcano <3211518dd4d87cb3f7ee12cb52e14b7fb2bc0446@fr.ibm.com>

GreatFruitOmsk/lxc,hfuCN/lxc,jirislaby/lxc,Distrotech/lxc,DarknessBeforeDawn/lxc,aeris/lxc,LynxChaus/lxc,federicobriata/lxc,efiop/lxc,ecarrara/lxc,caglar10ur/lxc,efiop/lxc,ksperis/lxc,potatosalad/lxc,smoser/lxc,lazy404/lxc,major/lxc,aeris/lxc,yubo/lxc,lisongmin/lxc,akshaykarle/lxc,Distrotech/lxc,thmo/lxc,efiop/lxc,ss1h2a3tw/lxc,ss1h2a3tw/lxc,ioops/lxc,bmoar/lxc,ysbnim/lxc,abstrakraft/lxc-android-lxc,rldleblanc/lxc,bostjan/lxc,hallyn/lxc,caglar10ur/lxc,sapun/lxc,christiaan/lxc,terceiro/lxc,glensc/lxc,ostap/lxc,akshaykarle/lxc,ojkastl/lxc_Patches,ysbnim/lxc,tych0/lxc,usc-isi/lxc,hfuCN/lxc,abstrakraft/lxc-android-lxc,cjwatson/lxc,coconutpilot/lxc-gentoo-new,Pelagicore/lxc,thmo/lxc,weizhenwei/lxc,bmoar/lxc,ioops/lxc,potatosalad/lxc,abstrakraft/lxc-android-lxc,DarknessBeforeDawn/lxc,abstrakraft/lxc-android-lxc,ostap/lxc,hkjolhede/lxc,raspberrypython/lxc,tych0/lxc,virajs/lxc,hallyn/lxc,jirislaby/lxc,LynxChaus/lxc,virajs/lxc,raspberrypython/lxc,fwilson42/lxc,JohnPeacockMessageSystems/lxc,inokappa/lxc,armcc/lxc,rowhit/lxc,codebauss/lxc,christiaan/lxc,terceiro/lxc,Pelagicore/lxc,major/lxc,glensc/lxc,armcc/lxc,yubo/lxc,GreatFruitOmsk/lxc,bmoar/lxc,yubo/lxc,regit/lxc,jirislaby/lxc,smoser/lxc,caglar10ur/lxc,ecarrara/lxc,ss1h2a3tw/lxc,terceiro/lxc,thmo/lxc,ojkastl/lxc_Patches,sapun/lxc,cjwatson/lxc,rowhit/lxc,christiaan/lxc,ksperis/lxc,regit/lxc,usc-isi/lxc,weizhenwei/lxc,coconutpilot/lxc-gentoo-new,major/lxc,ecarrara/lxc,DarknessBeforeDawn/lxc,rldleblanc/lxc,akshaykarle/lxc,cipriancraciun/lxc,ojkastl/lxc_Patches,cipriancraciun/lxc,Distrotech/lxc,hfuCN/lxc,sapun/lxc,bostjan/lxc,szaszg/lxc,lisongmin/lxc,smoser/lxc,codebauss/lxc,QingweiPeterLan/cs188-lxc,hkjolhede/lxc,regit/lxc,lazy404/lxc,cjwatson/lxc,smoser/lxc,weizhenwei/lxc,glensc/lxc,Ponce/lxc,kylef/lxc,ksperis/lxc,lazy404/lxc,GreatFruitOmsk/lxc,ioops/lxc,QingweiPeterLan/cs188-lxc,aeris/lxc,ysbnim/lxc,szaszg/lxc,virajs/lxc,federicobriata/lxc,bostjan/lxc,Pelagicore/lxc,JohnPeacockMessageSystems/lxc,fwilson42/lxc,usc-isi/lxc,LynxChaus/lxc,codebauss/lxc,QingweiPeterLan/cs188-lxc,federicobriata/lxc,kylef/lxc,inokappa/lxc,hkjolhede/lxc,fwilson42/lxc,hallyn/lxc,szaszg/lxc,Ponce/lxc,rldleblanc/lxc,lisongmin/lxc,ojkastl/lxc_Patches,armcc/lxc,tych0/lxc,JohnPeacockMessageSystems/lxc,raspberrypython/lxc,Ponce/lxc,rowhit/lxc