[Arm-dev] Work in progress ARM v7 port

Jacco Ligthart jacco at redsleeve.org
Sat Feb 21 10:39:20 UTC 2015


Hi Howard,

As Gordan noted before, I did more ore less the same but then for armv5.
As of today the result of that can be found here:
http://www.mirrorservice.org/sites/ftp.redsleeve.org/pub/el7/

It might be interesting for you to have a look at the things that required patching or other "special" treatment for mock building. I tried to summarize that all here:
http://www.mirrorservice.org/sites/ftp.redsleeve.org/pub/el7/alpha/RS7_issuelog.html
(the patches are all here: http://www.mirrorservice.org/sites/ftp.redsleeve.org/pub/el7/alpha/patches/ )

What I wanted is to have RHEL7/CentOS7 to run on the Raspberry Pi model 1 (there was no model 2 when I started)
After discussion with Gordan I went for armv5 in stead of armv6, so it would work for more arm devices.


> Hello all.  Recently I've been having a bit of fun trying to port CentOS 
> 7 to ARMv7, and I thought I'd share info on what I've been doing with 
> the list.
>
> As a long-time Red Hat family distribution user, I've been interested in 
> a CentOS build for ARM since the release of the originally Raspberry 
> Pi.  However, it's only with the release of RHEL 7 that a source code 
> base that largely works on ARM has been available to CentOS [1].  The 
> announcement and release of the new, faster, quad-core ARMv7-based 
> Raspberry Pi 2 sounded like an ideal reason to have a go at making a 
> CentOS-like RHEL rebuild for ARM, so I ordered a couple of Pi 2s, and 
> started having a think about how I'd go about building EL7.
>
> Having been on the periphery of the CentOS project for quite a while, I 
> knew how CentOS 7 was built: the RHEL 7 sources were rebuilt multiple 
> times; first against the public RHEL 7 beta, then against the results of 
> this build, then against then those results, and so on.  Ideally, a 
> similar process could be used to built EL7 for ARM, but of course there 
> has never been a RHEL 7 release for ARM of any sort.  Fortunately, 
> Fedora 19, which RHEL 7 was forked from, does have a public (and 
> functional) ARM release.  So an EL7 ARM port can be bootstrapped from 
> the Fedora binary RPMs.
My build was bootstrapped from the armv5 build of F18
And exactly as you explained, all rpms have been build (at least) twice. Once against F18 (or a combination of F18 and RSEL7) and after that once against the result of that.

> Of course, before I could start rebuilding CentOS sources, I'd need an 
> OS image to rebuild on.  Fortunately, the Raspberry Pi's bootloader 
> system is pretty simple: the Pi's firmware looks for specifically named 
> files in the VFAT-formatted first partition of the SD card.  The Fedora 
> 19 Minimal image has an ext4 /boot partition which is easily 
> reformatted, and populated with the contents of /boot from the Pi 2 
> Rasbian image, and the kernel modules to go with the Rasbian-shipped 
> kernel copied to the ext4 / filesystem.  A quick (not really) dd of the 
> image to an SD card, and I had a booting Pi 2.  The next step was to 
> test out running mock to build Fedora 19 chroots ready to build packages 
> in.  Testing showed that it took the Pi roughly 8m30s to create a basic 
> F19 mock chroot on the SD card.
>
> At the same time as starting out working with the Pi 2, a friend pointed 
> me at the ODROID C1 [2], a Pi-like small ARM board.  The C1 has a couple 
> of advantages over even the Pi 2: it has a somewhat faster CPU [3], but, 
> more importantly, it has on-SoC gigabit ethernet [4].  The ODROID is 
> designed and manufactured by Hardkernel in South Korea. The ODROID is a 
> bit more expensive (£33 from a UK supplier [5] versus the £25 Pi 2), but 
> still quite affordable. Realising that building RPMs on a Pi on the SD 
> card or over the network would be very slow, I ordered a C1 to try.
I also took refuge to Odroid after discovering that buildtimes on a Pi1 would seriously hamper this undertaking. I bought an Odroid U3, because this was the cheapest quadcore ARM with 2GB of mem. And my guess is that lots of memory will speedup the build quite a lot.

> I was really rather pleased with the C1 when it arrived.  After trying 
> and failing to modify the Fedora 19 ARM Minimal image with an 
> ODROID-specific kernel [6], I ended up grabbing an F21 image made by one 
> of the ODROID forum members [7].  The (one of the) nice thing(s) about 
> building RPMs in mock is that as long as the host OS can run mock, it 
> doesn't really matter what the host OS is, so a Fedora 21 OS for the C1s 
> is fine.
>
> Of course, even the ODROID wouldn't be able to make mock chroots very 
> quickly on their SD card, but the built-in gigabit ethernet makes 
> another option quite sensible: iSCSI.  By mounting a block device [8] 
> from a server over iSCSI, the C1 can create an F19 chroot in about 
> 2m40s.  Having decided the C1 was better for the builder job than the Pi 
> 2, I borrowed another C1 from my friend, and put an order in for two more.
I took the easy way. I bought an external USB drive. The SD is now only used for '/boot'. '/' is on the USB disk.

> In the meantime, I made a start on building packages using the C1. The 
> sensible starting point was building the C7 versions of the packages 
> that go into the basic mock build chroot.  The basic idea here is that 
> the sooner that the set of packages used to build all packages is 
> replaced with the C7 versions, the closer the OS will be to a "true" C7 
> OS [9]. Once this base set was built, the order of the remaining 1000+ 
> SRPMs is a bit less critical, and more at the mercy of my random whims 
> [10].  I should also note that I'm concentrating on building the CentOS 
> 7 GA package set, not any of the updates.  Once I have a C7 GA package 
> set I'm happy with, then I'll look at all the package updates from GA to 
> current.
I also first build everything in the "build-sys" group (against F18). I thought (wrongly) that having this would mean I could build the rest without further help from F18. It does not work that way, there are numerous circular references in the build dependencies. There are even a lot of packages that depend on themselves :(
If I would do it again I would first build *everything* against F18 (or better yet F19) and after that do it all again against itself.

Your choice for GA has pro's and con's:
- some packages won't build because they have a time-constraint. java comes to mind, which will complain about the change of the turkish currency is more than 10 years ago, but I've seen similar things for outdated certificates in the srpm, etc
- other packages FTBFS when build against newer packages than GA. I think I had 5 packages that don't build with the latest java.

> I was originally planning to knock up a script or two to wrap mock and 
> do createrepo runs.  Instead I decided to dust off Plague, the old build 
> system Seth Vidal and co wrote for Fedora Extras.  Plague takes care of 
> managing a queue of SRPMs to distribute to multiple builders, running 
> builds, collecting resulting logs and RPMs, and making yum repos.  
> Plague is a tad old, and needed a few code changes to support ARM 
> architectures.  It's also a bit... tempremental at times, as the central 
> manager process has issues spotting when builders come and go, but 
> overall it's done quite well.
>
> So what's the current status of the rebuild effort?  Of the 2481 SRPMs 
> in CentOS 7.0.1406 (the GA C7 release), 1125 don't need to be rebuilt 
> for ARM, either because they're entirely noarch packages [11], or 
> because they're listed as either "exclusivearch", which means they 
> should only be built on a specific list of architectures [12].  Of the 
> remaining 1356 packages, 943 have been successfully rebuilt, 62 have 
> failed to build, and 351 haven't been attempted yet.  Thus far only two 
> RPMs have needed to be modified: centos-release had to be altered to not 
> conflict with the Fedora 19 systemd (both packages contain 
> /usr/lib/systemd/system-preset/90-default.preset), but is now replaced 
> with the stock C7 version, and elfutils has had its test suite disabled 
> [13].  Very much on the positive side, after a 36 hour build, the third 
> build attempt of libreoffice completed successfully [14].
I found that I often do want to build the exclusivearch packages. They are sometimes needed for dependencies, or are just perfectly good packages for arm.

I also sometimes disable the testsuites, but elfutils is not one of them.

> The other thing that's worth saying is that I've not yet looked at any 
> ARM-specific "special" stuff, like an ARM kernel build, or any 
> bootloader support.  That's potentially hard stuff, and will take some 
> thinking about [15].
I made the kernel build (even the latest version, which was more of a challenge), but till now I've only used the headers for building other packages. I think my kernel srpm patch can be used to build a perfectly working arm kernel *if you have the right .config*
I noticed that both the raspberrypi and the odroid have quite some patches against the standard kernel and I don't think it is worth it to try and merge that to RH's kernel.
I think I should put this a bit stronger: I don't trust RH to make a good basis for an ARM kernel. A good example is that one of the patches they did against the kernel "missed" the arm part of the patch (resulting in FTBFS). The original patch I saw *did* have the ARM part, so RH must have removed that somewhere. Point is that if you're not a kernel hacker it will be damn difficult to assess if the fixes they did to the kernel are present in your ARM build, etc.

In the end I just package the pre-compiled stuff from raspberry/odroid 

Good luck on your endeavor and feel free to ask if you need any help.


Jacco



More information about the Arm-dev mailing list