Bug 1131 - Build Gentoo SFFS
Summary: Build Gentoo SFFS
Alias: None
Product: Libre-SOC's first SoC
Classification: Unclassified
Component: Milestones (show other bugs)
Version: unspecified
Hardware: PC Linux
: --- enhancement
Assignee: Sadoon Albader
URL: https://libre-soc.org/SFFS/gentoo_boo...
Depends on:
Reported: 2023-08-02 20:46 BST by Toshaan Bharvani
Modified: 2024-03-10 06:58 GMT (History)
3 users (show)

See Also:
NLnet milestone: NLnet.2022-08-107.ongoing
total budget (EUR) for completion of task and all subtasks: 2500
budget (EUR) for this task, excluding subtasks' budget: 2500
parent task for budget allocation: 999
child tasks for budget allocation:
The table of payments (in EUR) for this task; TOML format:
sadoon={amount=1500, submitted=2024-02-26, paid=2024-03-08} lkcl = {amount=1000, submitted=2024-02-26, paid=2024-03-08}


Note You need to log in before you can comment on or make changes to this bug.
Description Toshaan Bharvani 2023-08-02 20:46:26 BST
Rebuilding Gentoo for ppc64el sffs using Gentoo's built-in tools. A specific version of the stage3 tarball was chosen to guarantee full reproducibility and was uploaded to our server since Gentoo's mirrors take down anything older than a month.

This task consists not only of the work of rebuilding Gentoo, but also documentation (wiki page: https://libre-soc.org/SFFS/gentoo_bootstrap ) that guarantees full reproduciblity and only requires one to have a POWER8 or newer system and to download the tarball to rebuild everything from source using the scripts.
Comment 1 Sadoon Albader 2023-08-04 17:17:12 BST
Building Gentoo for sffs is the same as building for regular power9, with the only exception being adding these flags to /etc/portage/make.conf

COMMON_FLAGS="-O2 -pipe -mcpu=power9 -mno-altivec -mno-vsx -mno-crypto -mno-htm -mlong-double-64"
CPU_FLAGS_PPC="" #To overwrite just in case, mostly unnecessary

Keep in mind you'll have to rebuild world to make sure all packages are rebuilt with these flags:

emerge --keep-going --ask -e @world

EDIT: this has also been verified with the objdump test from https://bugs.libre-soc.org/show_bug.cgi?id=1128#c8
Comment 2 Luke Kenneth Casson Leighton 2023-08-23 16:34:02 BST
just a note that there is a way to not need a ppc64 actual hardware
host, by running the entire build in qemu-ppc64le-user.  this is
slightly slower than what openembedded/yocto do, which is to perform
*only* things like autoconf in qemu-*-user and then use cross-compilers
but it is at least a way not to have to have USD 10,000 hardware in
order to replicate this task.


also i moved the page to a subdirectory covering SFFS

Comment 3 Luke Kenneth Casson Leighton 2023-08-23 16:45:44 BST
a copy of the stage-3 bootstrap (which is rolling, sigh) has had to be
dropped here:


the SHA256 checksum is shown here:

Comment 4 Sadoon Albader 2023-08-23 16:48:15 BST
The Gentoo SFFS bootstrap is complete and the full tutorial is available on https://libre-soc.org/SFFS/gentoo_bootstrap
Comment 5 Luke Kenneth Casson Leighton 2023-08-23 17:28:29 BST
TODO for the future, modify the script so that it checks if a local
copy of the stage3 is already present, and if not attempts to download
from multiple sources

Comment 6 Luke Kenneth Casson Leighton 2023-08-25 13:58:38 BST
same update as on bug #1130, they are likely a cut/paste clone of each
other and needed the same minor corrections.