What it costs to build AOSP 16 on a 2010 IBM x3650 M3

I needed to build /e/OS to work on the prototype of a new feature. I had the idea of restarting an old machine, and I honestly wondered whether it would still cope with a modern AOSP tree.

It did, after two repairs: I added 32 GB of RAM (48 GB in total) and replaced a failing disk in the RAID array. Here is the full /e/OS build for the Fairphone 6 (AOSP 16, LineageOS 23.0 base) on a rack server whose CPUs predate AVX: the time, memory, disk, bandwidth and power it takes, and what breaks along the way.

Result: 8 h 54 min of build time, 124 GB of build output, about 344 GB of disk in total, and roughly €0.55–0.70 of electricity.

The machine

The x3650 M3 (machine type 7945) shipped in 2010, one generation after the 2009 M2. It is a 2U, dual-socket Westmere-EP box with triple-channel DDR3 per socket.

CPU2 × Xeon E5620, 32 nm Westmere-EP, 4 cores / 8 threads each, 2.40 GHz (2.66 turbo), 12 MB L3 each, 80 W TDP each
Threads16
ISASSE4.2, AES-NI. No AVX (that arrived with Sandy Bridge in 2011)
Memory48 GB DDR3 ECC RDIMM over six channels; DDR3-1066 is this CPU’s ceiling
StorageServeRAID M5014 (LSI SAS2108). Sources and output on a 5.9 TB RAID 5 volume, OS on a separate volume
Host OSUbuntu 20.04, kernel 5.4, glibc 2.31, Python 3.8

AOSP’s host toolchain still runs on a pre-AVX x86-64 CPU: the prebuilt Clang, the JDK 21 used by the build, and Rust 1.83 all ran without complaint. The old userland is the real constraint (see below).

The bill

Source sync34 min for about 970 repositories (repo sync -c -j8 --no-tags)
Git objects81 GB
Checked-out tree93 GB
Device images3.75 GB vendor factory image + 2.4 GB official /e/OS OTA, used to extract proprietary blobs and firmware
Build graph174,567 actions
Soong / Kati analysisabout 10 min before the first compile step, with about 26 GB of RAM in use at the peak
During compile16 threads at 92–100%, load average around 18, 8–10 GB of RAM in use (Java-heavy phases)
Main compile7 h 52 min to reach 96% (168,409 actions), when a packaging step failed
Finishing runs10 min + 19 min + 33 min (three incremental restarts after fixes)
Total build time8 h 54 min
Build output (out/)124 GB
ccache20 GB
Disk, everythingabout 344 GB: git objects, tree, out/, ccache and the two device images
Deliverables2.44 GB OTA package, 2.71 GB fastboot image package
Previous run, AOSP 15Full build of the same device: 10 h 23 min, with only 20 GB of RAM. Incremental rebuilds: 27 min to 1 h 22 min
Measured on this machine
Powerabout 250–300 W at the wall under full load, so 2.2–2.7 kWh for the 8 h 54 min
Electricityroughly €0.55–0.70 per full build at €0.25/kWh
Uninterrupted buildabout 8 h 30 min, if none of the failures below had happened
Estimated (not metered)

The electricity is cheap. The real cost is time: a current 32-thread desktop does the same build in a fraction of it, and every failed run on this box costs minutes to hours before the error shows up.

 1 [|||||||||||  94.1%]   2 [|||||||||||  93.5%]   3 [|||||||||||  94.1%]   4 [|||||||||||  94.7%]
 5 [|||||||||||  94.8%]   6 [|||||||||||  92.9%]   7 [|||||||||||| 96.8%]   8 [|||||||||||  94.8%]
 9 [|||||||||||  93.5%]  10 [|||||||||||  95.4%]  11 [|||||||||||  93.5%]  12 [|||||||||||  92.1%]
13 [|||||||||||| 96.1%]  14 [|||||||||||  94.0%]  15 [||||||||||||100.0%]  16 [|||||||||||  92.7%]
Mem 8.56G/47.1G   Tasks 95, 471 thr; 16 running   Load 18.29 15.44 10.99
  CPU% COMMAND
  161. prebuilts/jdk/jdk21/linux-x86/bin/java -XX:OnError="cat hs_err_pid%p.log" …
  125. java -XX:CICompilerCount=6 -XX:+UseDynamicNumberOfGCThreads …
  99.9 prebuilts/rust/linux-x86/1.83.0/bin/rustc -C linker=out/host/linux-x86/bin/…
  37.9 prebuilts/jdk/jdk21/linux-x86/bin/javac -J-Xmx4096M …
  … about 40 more JVMs

htop about 25 minutes into the compile phase. Dozens of JVMs (javac, plus the Java tools that generate API stubs and docs) and rustc keep all 16 threads busy.

What broke, in order

  • Rate limiting during sync. One AOSP repository (external/crosvm) failed with HTTP 429 from googlesource at -j8. Re-syncing that single project with -j1 fixed it.
  • A private dependency. The device tree inherits a launcher package whose repository is no longer public. An empty config.mk in its place removes it from the product cleanly.
  • glibc 2.34 required by a prebuilt. prebuilts/extract-tools/.../stripzip is linked against glibc 2.34; Ubuntu 20.04 has 2.31. It only normalises zip timestamps during blob extraction, so a no-op stub keeps the files byte-identical to the vendor’s. The other extract tools and the compiler toolchain still run on 2.31.
  • EROFS partitions. The official /e/OS OTA ships EROFS images, which Ubuntu 20.04 cannot read. Building fsck.erofs from the tree’s own external/erofs-utils, statically linked against the in-tree external/lz4, took a minute and allowed fsck.erofs --extract.
  • Pinned firmware from an older release. Sixteen Wi-Fi firmware files (vendor/firmware/qca6750/*) are pinned by SHA-1 to an older vendor release (FP6.QREL.15.176.0) that is no longer downloadable. The official /e/OS image contains exactly those hashes, so they were taken from there and verified one by one.
  • Bootloader firmware. 20 of the 24 radio images (xbl, abl, tz, hyp, …) in the vendor factory image differed from the ones the official /e/OS release ships. To avoid flashing anything older than what the phone already runs (anti-rollback), all 24 were taken from the official release. The generated Android.mk checks each radio file’s SHA-1, so those checksums had to be regenerated to match.
  • Missing HAL repository. The product requires android.hardware.nfc-service.sec, provided by hardware/samsung_slsi/nfc, which is not in the manifest. LineageOS lists it in the device’s dependencies; adding it to a local manifest (branch lineage-23.0) let Kati finish.
  • repo inside the build sandbox, at 96%. The rule that writes product/etc/build-manifest.xml runs repo manifest, which keeps a JSON cache of the user’s git config in ~/.repo_.gitconfig.json. When ~/.gitconfig does not exist, repo considers the cache stale on every call and rewrites it, and the build sandbox mounts $HOME read-only. Creating an empty ~/.gitconfig and running repo manifest once outside the build fixed it.
  • A presigned app in the image. Prebuilt APKs that keep their own signature and target API 30 or higher must be declared preprocessed: true, so the build checks them (zip-aligned, uncompressed dex for a privileged app) instead of rewriting them and breaking the v2 signature.

Most failures surfaced during Kati, 2 to 7 minutes into a run. The sandbox one appeared after 7 h 52 min. Thanks to the incremental build, fixing it cost 10 minutes rather than a second night.

Takeaways

  • A 16-thread Westmere box with 48 GB of RAM can still build AOSP 16. CPU age is not the blocker; memory and the host’s userland are.
  • Give Soong’s analysis phase about 30 GB of headroom, or enable swap before the first run.
  • Ubuntu 20.04 works as a host if you are ready to work around a few tools that expect glibc 2.34.
  • Take radio firmware from the release the phone is running, not from the newest vendor image.
  • Make sure ~/.gitconfig exists before a long run, even empty.
  • Use ccache from the start. The first build pays for every later one.

Build target: lineage_FP6-userdebug, /e/OS 4.3.1-a16, BUILD_ID BP2A.250805.005, AOSP 16. Built with breakfast FP6 userdebug && m bacon -j12, ccache enabled.

And you?

What does it cost you to build an AOSP-based OS: which machine, how many hours, how much disk? Which tricks and practices do you recommend to make it faster or less painful? Share your numbers and setups in the comments.


Gaël Duval
CEO at Murena, President at e Foundation

Written with the help of an AI assistant. The machine, the build and the ideas are mine.

Mandrake, Mandriva, Mageia, OpenMandriva… FOSS is FOSS!

Yesterday we learned that Mandriva, the company, was shutting down. I read a lot of sad comments on Twitter about it and realized that few of those guys seemed to be aware that actually Mandriva, the company, wasn’t doing a Linux distribution anymore for several years. The Mandriva Linux distribution, which earlier forked as PCLinuxOS, Mageia and others, is now OpenMandriva.

And as someone tweeted it, “FOSS is FOSS”. True!
That’s the power of FOSS that projects keep alive, and that’s the reason why I think that creating Mandrake Linux 17 years ago was not totally losing my time.

Now, we don’t have to be sad: we have pushed Linux to massive adoption and these have been awesome years! Now the Linux kernel is running millions smartphones worldwide, but the story is only starting! Let’s focus on today’s IT concerns: privacy and the Google hegemony. And a lot more fun stuff actually! Want to be part of it?

Gaël Duval – interested in Open Source, mobile operating systems and data privacy? Follow me on Twitter!

An OS in the Public Interest – a Mandriva Linux Foundation?

TerreLast week, I received, in CC:, an email from a Mandriva Linux developer. This email was entitled “A foundation for Mandriva Linux *NOW* or Mandriva Linux to *DIE*?”

That suggested to me that maybe Mandriva was not going very well. This, of course, hurted me. At the same time it leads to the interesting question of a Foundation for a project like Mandriva Linux.

This is interesting because I remember we first discussed the question of a Foundation for Mandrake Linux back in 2000 or 2001. And we decided that it was a good idea. But we were too busy to really take care of it at the time. And in 2012 there is still no such organisation.

Mandriva Linux, earlier Mandrake Linux, is an interesting case of a Linux distribution who had a HUGE success worlwide, as the first popular Desktop Linux distribution. Remember in the early 2000 days, you could find a Mandrake Linux package in every bookstore in the USA, and it was widely available in Europe too. Then, it became very popular in other countries, and I still have a collection of several Mandrake Linux localized for Japan, Russia and other countries.

It has been distributed in thousand magazines and is still… one of the most downloaded Linux distributions. Still many young people tell me they have started Linux with Mandrake Linux because it was easier to use. I hadn’t expected it’s been so huge actually.

At the same time, the business for MandrakeSoft/Mandriva has always been a headache. The reasons are multiple, one of them is certainly the lack of an adequate business model, and this could be discussed for hours.

As a result, I understand that the existence of Mandriva Linux is now subject to speculation; not because of the product or the project, but because every month developers have to be paid and if the business is not good enough, soon comes a day when there is no more money to pay developers.

But I know about natural selection, and the fact that Mandriva is still here means a lot. This project has deep and strong roots. It has an intrinsinc vital force that lead it to the age of 14 yo, despite all the financial issues.

So, more and more I think that Mandriva could be a good candidate for an “Operating System in the Public Interest”.

Why an OS in the Public Interest?

We see less and less freedom in Operating Systems. People are locked by proprietary OSes. They can’t do what they want, they have lost a lot of Freedom. Before there was Windows, that was seen as evil. New comers are still worse.

MacOS or iOS are terrible in that matter (which is hard for me as I love the technologies of iOS and most Apple products). When you are in the Apple world, you are absolutely locked in the Apple world. Even what is displayed on your iPhone or iPad, you can’t redirect legally elsewhere than to a Mac or to an Apple TV.

Now take Google: they really want to have you in their ecosystem, they do anything to lock you and look friendly with you. But Facebook, Twitter and Google know everything about you. They want to control everything. As a result your life is, want it or not, partly controlled by those private and for-profit companies.

And Google with Android, what are they doing? they are just transforming a kernel in the public interest into software for shareholders interest, and grow your jail-ecosystem.

Projects in the Public Interest?

There is Wikipedia which is an awesome success. There is OpenStreeMap. There are others project as well that are in the Public Interest, which means in the Human Interest, and not in the shareholders interest, and independent.

On the OS side, there is Debian already, and Debian is huge. But Debian is still for servers & geeks. Ubuntu? Good on the desktop, but is holded by Canonical. It’s not in the Public Interest.

There is the Linux Foundation too. It’s very nice and I’m happy that it exists, but it’s for low-level kernel development.

So, if I was 24 again… 🙂 I would try to build a Foundation that would focus on delivering great Operating Systems in the Public Interest, both for PCs and tablets and smartphones.

Such a Foundation would need great engineers and visionary people to release great and easy to use software products for people with all guarantees of independency, security and privacy for their users.

It would, of course, need some financial resources. But when you do a huge Foundation, you find the money. Many people are ready to donate when they know that they are contributing to something good. The public sector, governements can donate. And you can build an ecosystem where some private, commercial companies sell services around the product. So in the end they can support, even financially, the OS in the Public Interest.

Most big infrastructures (roads, electricity, telecommunications) have been started as public projects, for the people, because people need interoperability and freedom. I think Operating Systems are infrasture components too, so we need an OS in the Public Interest, at least as an alternative for people who want to be free.

Gaël Duval, Mandrake Linux Founder.

Interested in open source, mobile operating systems, data privacy? Follow me on Twitter

Diclaimer: I’ve not been involved in Mandriva since March 2006.