[lxc-devel] [PATCH] Fedora template...

Michael H. Warfield mhw at WittsEnd.com
Sun Apr 7 22:04:47 UTC 2013


On Thu, 2013-04-04 at 08:50 -0500, Serge Hallyn wrote:
> Quoting Michael H. Warfield (mhw at WittsEnd.com):
> > Proposed patch to the Fedora template...
> > 
> > Purpose - Handle Fedora containers and Fedora Remix hosts on the
> > Raspberry Pi ARM platform.
> > 
> > Changes:
> > 
> > * Map armv6l and armv7l architectures to "arm" for yum and repos to
> > function properly.
> > 
> > * Detect Fedora Remix distros with no "/etc/fedora-release" file and
> > find proper release versions when "remix" part of the file context.
> > 
> > * Change default Fedora container on non-Fedora hosts to Fedora 17
> > (previous versions are unsupported on RPi or unstable on all platforms.
> > 
> > * Added code for autodev for Fedora systemd versions.
> > 
> > Proposed patch...  Soliciting for comments...

> It looks fine to me, worth it to enable them imo.

Ok...  I was hoping for some more comments, maybe from some others
knowlegible in other architectures, as well as anyone else who has had
their fingers in that template script (I didn't write it and this is the
first I've had my nose in it).

In the "Fedora Secondary" repos I see things like PPC, S390, and Sparc.
I've got some Sparc boxes but haven't fired them up in ages (and have no
plans to do so now).

IAC...  I was taking a closer look at the Fedora ARM repos.  There are
two.  There's "arm" and there's "armhfp" (ARM Hardware Floating Point).

Researching the differences, it looks like "arm" should be used for v4
and earlier which have no hardware floating point.  Then "armhfp" should
be used for v7 and later, which have hardware floating point along with
other enhancements.  That leaves v5 and v6 in question.  The RPi is an
ARM v6 while I have v7 ARM's on my tablet (Nexus 7) and
smartphone/phablet (Note 2)...  Hmmm...  LXC on a smartphone.  This
sounds like it could be interesting...  Hmmm...

I had originally, in this patch, mapped armv6 and armv7 to "arm" (no
hardware floating point).  I'm reading that Raspian is compiled for v6
with hardware floating point processor, armhfp.  The same article
claimed that Debian for v7 would not be compatible with the RPi
(implying issues other than the hardware float between v6 and v7).
That, more or less, "implies" that I may have made a mistake for the v6
mapping (and definitely make a mistake for the v7 mapping).  I have no
clue what to do with the v5 but I do notice that the Fedora Remix F17
for RPi reports the repo as armv5tel...  So they're mapping v6 down to
v5 but that still doesn't tell me if I should use armhfp from the repos.
Sigh...

It would seem that the "arm" repo should be safer that then "armhfp"
repo since that should be a safe fallback for all the arm processors.  I
could just "play it safe" and map everything less that v7 to arm and v7
or above (current it v8) to armhfp.

I'm going to retest some builds using armhfp for the RPi and see how
that goes.  At the very least, I'll rework that arch mapping for other
arm archs and fix the v7.  That should keep me busy for a day or so.
Anyone else with comments on architectures or familiarity with the
Fedora template (or other templates you're working on) please chime in.
I'll resubmit this patch in a few more days one way or the other.

Regards,
Mike

> > diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in
> > index 684bb9c..e564160 100644
> > --- a/templates/lxc-fedora.in
> > +++ b/templates/lxc-fedora.in
> > @@ -32,12 +32,22 @@ default_path=@LXCPATH@
> >  root_password=root
> >  
> >  # is this fedora?
> > -[ -f /etc/fedora-release ] && is_fedora=true
> > -
> > -if [ "$arch" = "i686" ]; then
> > -    arch=i386
> > +# Allow for weird remixes like the Raspberry Pi
> > +if [ -e /etc/redhat-release ]
> > +then
> > +    fedora_host_ver=$( sed -e '/^Fedora /!d' -e 's/Fedora.*\srelease\s*\([0-9][0-9]*\)\s.*/\1/' < /etc/redhat-release )
> > +    if [ "$fedora_host_ver" != "" ]
> > +    then
> > +        is_fedora=true
> > +    fi
> >  fi
> >  
> > +# Map a few architectures to their generic Fedora repository archs.
> > +case "$arch" in
> > +i686) arch=i386 ;;
> > +armv6l|arm7l) arch=arm ;;
> > +esac
> > +
> >  configure_fedora()
> >  {
> >  
> > @@ -253,6 +263,8 @@ lxc.tty = 4
> >  lxc.pts = 1024
> >  lxc.mount = $config_path/fstab
> >  
> > +lxc.autodev = $auto_dev
> > +
> >  # When using LXC with apparmor, uncomment the next line to run unconfined:
> >  #lxc.aa_profile = unconfined
> >  
> > @@ -374,14 +386,22 @@ if [ -z "$path" ]; then
> >  fi
> >  
> >  if [ -z "$release" ]; then
> > -    if [ "$is_fedora" ]; then
> > -        release=$(cat /etc/fedora-release |awk '/^Fedora/ {print $3}')
> > +    if [ "$is_fedora" -a "$fedora_host_ver" ]; then
> > +        release=$fedora_host_ver
> >      else
> > -        echo "This is not a fedora host and release missing, defaulting to 14. use -R|--release to specify release"
> > -        release=14
> > +        echo "This is not a fedora host and release missing, defaulting to 16. use -R|--release to specify release"
> > +        release=16
> >      fi
> >  fi
> >  
> > +# Fedora 15 and above run systemd.  We need autodev enabled to keep
> > +# systemd from causing problems.
> > +if [ $release -gt 14 ]; then
> > +    auto_dev="1"
> > +else
> > +    auto_dev="0"
> > +fi
> > +
> >  if [ "$(id -u)" != "0" ]; then
> >      echo "This script should be run as 'root'"
> >      exit 1
> > 
> 
> 
> 
> > ------------------------------------------------------------------------------
> > Minimize network downtime and maximize team effectiveness.
> > Reduce network management and security costs.Learn how to hire 
> > the most talented Cisco Certified professionals. Visit the 
> > Employer Resources Portal
> > http://www.cisco.com/web/learning/employer_resources/index.html
> 
> > _______________________________________________
> > Lxc-devel mailing list
> > Lxc-devel at lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/lxc-devel
> 
> 
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire 
> the most talented Cisco Certified professionals. Visit the 
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> Lxc-devel mailing list
> Lxc-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lxc-devel
> 

-- 
Michael H. Warfield (AI4NB) | (770) 985-6132 |  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!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 482 bytes
Desc: This is a digitally signed message part
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20130407/f611458c/attachment.pgp>


More information about the lxc-devel mailing list