Bug 1131 - Build Gentoo SFFS
Summary: Build Gentoo SFFS
Status: RESOLVED FIXED
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:
Blocks:
 
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}


Attachments

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.

https://libre-soc.org/irclog/%23libre-soc.2023-08-23.log.html#t2023-08-23T16:22:17

also i moved the page to a subdirectory covering SFFS

https://git.libre-soc.org/?p=libreriscv.git;a=commit;h=fe042658fb325b888c12f7ed338f370d97119fe8
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:

   https://ftp.libre-soc.org/sffs/stage3-ppc64le-openrc-20230720T024654Z.tar.xz

the SHA256 checksum is shown here:

   https://libre-soc.org/irclog/%23libre-soc.2023-08-23.log.html#t2023-08-23T16:39:56
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

https://libre-soc.org/irclog/%23libre-soc.2023-08-23.log.html#t2023-08-23T17:25:35
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.

https://git.libre-soc.org/?p=libreriscv.git;a=commitdiff;h=25e5ac028738cc1fb9660649f4ae005a56d4ee9f