[lxc-devel] [PATCH 1/4] Fix arch cross-build when running distro cross-build.

Stéphane Graber stgraber at ubuntu.com
Sun Mar 23 00:53:27 UTC 2014


On Sat, Mar 22, 2014 at 01:56:41PM -0400, Michael H. Warfield wrote:
> Fix arch cross-build when running distro cross-build.
> 
> Corner case existed when building a cross-arch container (i686 on x86_64)
> on a cross-distro host (Fedora container on Ubuntu host).  Fixed the
> arch "fixup" code to do the right thing when running from the bootstrap.
> 
> Signed-off-by: Michael H. Warfield <mhw at WittsEnd.com>

Acked-by: Stéphane Graber <stgraber at ubuntu.com>

> ---
>  templates/lxc-fedora.in | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in
> index 20204d4..fa89121 100644
> --- a/templates/lxc-fedora.in
> +++ b/templates/lxc-fedora.in
> @@ -665,7 +665,7 @@ This will take a couple of minutes.  Patience..."
>      chroot . rpm --root /run/install --nodeps -ivh fedora-release-*
>  
>      # yum will take $basearch from host, so force the arch we want
> -    sed -i "s|\$basearch|$basearch|" ./etc/yum.repos.d/*
> +    sed -i "s|\$basearch|$basearch|" ./run/install/etc/yum.repos.d/*
>  
>      chroot . yum -y --nogpgcheck --installroot /run/install install python rpm yum
>  
> @@ -774,10 +774,12 @@ download_fedora()
>      echo "Downloading fedora minimal ..."
>  
>      # These will get changed if it's decided that we need a
> -    # boostrap environment (can not build natively)
> +    # boostrap environment (can not build natively).  These
> +    # are the defaults for the non-boostrap (native) mode.
>  
>      BOOTSTRAP_INSTALL_ROOT=${INSTALL_ROOT}
>      BOOTSTRAP_CHROOT=
> +    BOOTSTRAP_DIR=
>  
>      PKG_LIST="yum initscripts passwd rsyslog vim-minimal openssh-server openssh-clients dhclient chkconfig rootfiles policycoreutils fedora-release"
>      MIRRORLIST_URL="http://mirrors.fedoraproject.org/mirrorlist?repo=fedora-$release&arch=$basearch"
> @@ -858,7 +860,7 @@ download_fedora()
>      ${BOOTSTRAP_CHROOT}rpm --root ${BOOTSTRAP_INSTALL_ROOT} --nodeps -ivh ${BOOTSTRAP_INSTALL_ROOT}/${RELEASE_RPM}
>  
>      # yum will take $basearch from host, so force the arch we want
> -    sed -i "s|\$basearch|$basearch|" ${BOOTSTRAP_INSTALL_ROOT}/etc/yum.repos.d/*
> +    sed -i "s|\$basearch|$basearch|" ${BOOTSTRAP_DIR}/${BOOTSTRAP_INSTALL_ROOT}/etc/yum.repos.d/*
>  
>      ${BOOTSTRAP_CHROOT}yum --installroot ${BOOTSTRAP_INSTALL_ROOT} -y --nogpgcheck install ${PKG_LIST}
>  
> -- 
> 1.8.3.1
> 
> 
> -- 
> Michael H. Warfield (AI4NB) | (770) 978-7061 |  mhw at WittsEnd.com
>    /\/\|=mhw=|\/\/          | (678) 463-0932 |  http://www.wittsend.com/mhw/
>    NIC whois: MHW9          | An optimist believes we live in the best of all
>  PGP Key: 0x674627FF        | possible worlds.  A pessimist is sure of it!
> 



> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


-- 
Stéphane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20140322/0e704df3/attachment.pgp>


More information about the lxc-devel mailing list