From: sadoon Date: Fri, 18 Aug 2023 12:42:10 +0000 (+0100) Subject: Revamped the rebuild process and made it reproducible without a custom tarball X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f756077b94539e807d91f362038a25701a0ba510;p=libreriscv.git Revamped the rebuild process and made it reproducible without a custom tarball --- diff --git a/HDL_workflow/gentoo-sffs.mdwn b/HDL_workflow/gentoo-sffs.mdwn index bc5a593c1..351685753 100644 --- a/HDL_workflow/gentoo-sffs.mdwn +++ b/HDL_workflow/gentoo-sffs.mdwn @@ -19,7 +19,7 @@ Libre-SOC builds upon the OpenPOWER ISA v3.0 but does not include many parts of You can approach this in two ways: either build the full base Gentoo stage3 packages yourself using the [handbook](https://wiki.gentoo.org/wiki/Handbook:PPC64), optionally automated with our [scripts](https://git.libre-soc.org/?p=dev-env-setup.git;a=tree), or use the [prebuilt rootfs] in a compressed tar archive. -Do note that given the rolling release nature of Gentoo, it is almost impossible to get the same system with the specific package versions we have without using our tarball. If you still want to do a full rebuild but guarantee that the software versions stay the same, this guide will also explain how it can be done using our tarball. +Do note that given the rolling release nature of Gentoo, it is almost impossible to get the same system with the specific package versions we have without using the same stage3 version we used. ## System requirements @@ -28,60 +28,44 @@ Do note that given the rolling release nature of Gentoo, it is almost impossible Cross compiling will make this process much more complicated and is generally not recommended. -## Development Setup Scripts - -If you haven't already, clone Libre-SOC's development environment setup scripts. -These are bash scripts, and greatly simplify the time it takes to create a: - -- Stable environment -- With all software and libraries at specific versions -(which are known to work). - -These attributes are absolutely critical, and no support will be -provided, unless you use these scripts to setup a development environment. This -helps us fix any bugs in the scripts, and make sure everyone runs on the same -page. - - $ git clone https://git.libre-soc.org/git/dev-env-setup.git - -Do *look through* the -[code](https://git.libre-soc.org/?p=dev-env-setup.git;a=tree) before running -any of those scripts. -This is your own legal responsibility (to not run -arbitrary code off of the internet) and we take no responsibility or accept -any liability whatsoever for your use or misuse of them. - It is expected for you to use Debian for the host OS (anything else -is unsupported: many contributors have repeatedly gotten into trouble by not -following this advice), while all the chroots - which are developed -very specifically for "reproducible builds" - run Debian 10 (Buster). +is unsupported: many contributors have repeatedly gotten into trouble by not following this advice) -## Setting up Gentoo from tarball (recommended method) +## Setting up Gentoo from stage3 and rebuilding (recommended method) You will need to run these commands: - $ curl -O [link to tarball] + $ curl -O [link to stage3] # sudo bash # mkdir gentoo-sffs && cd gentoo-sffs # tar xpvf gentoo-sffs.tar.xz --xattrs-include='*.*' --numeric-owner # cd .. - # chroot gentoo-sffs -# (Optional) Rebuilding Gentoo from source without upgrading +Follow these steps from the Gentoo handbook: + +* [Copy DNS info](https://wiki.gentoo.org/wiki/Handbook:PPC64/Installation/Base#Copy_DNS_info) + +* [Mount necessary filesystems](https://wiki.gentoo.org/wiki/Handbook:PPC64/Installation/Base#Mounting_the_necessary_filesystems) + +* [Enter the chroot environment](https://wiki.gentoo.org/wiki/Handbook:PPC64/Installation/Base#Entering_the_new_environment) + +After which you need to add our build flags replacing the default ones in `/etc/portage/make.conf` + +`COMMON_FLAGS="-O2 -pipe -mcpu=power9 -mno-altivec -mno-vsx -mno-crypto -mno-htm -mlong-double-64"` + +`CPU_FLAGS_PPC=""` -We conveniently keep the sources of all the packages on the system in the tarball as well, in case they become unavailable online at any point in time. +Finally, rebuild everything on the system: - # chroot gentoo-sffs - # source /etc/profile # emerge -e --ask --keep-going @world # (Optional) Building an updated Gentoo SFFS This is highly not recommended unless you specifically want to explore how newer versions of software will behave when built with the SFFS flags. -One way of doing this is to just set up Gentoo SFFS from the provided tarball and then upgrade everything, that is much simpler and easier to roll-back if need be. +One way of doing this is to just set up Gentoo SFFS from the provided stage3, add out `make.conf` options and then upgrade everything, that is much simpler and easier to roll-back if need be. -After having a working chroot using our tarball as outlined earlier, run these commands in the chroot: +After having a working chroot using the stage3 as outlined earlier, run these commands in the chroot: # emerge-webrsync # emerge --ask --verbose --update --deep --newuse @world