libreboot-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Libreboot-dev] Suggestions and proposal for easier Libreboot developmen


From: Paul Kocialkowski
Subject: [Libreboot-dev] Suggestions and proposal for easier Libreboot development
Date: Wed, 20 Apr 2016 18:19:05 +0200

After spending some hours updating C201 support in Libreboot, here are some
suggestions I'd like to submit to make Libreboot development easier and more
comfortable.

First, there were talks about moving the build system to something other than
scripts. Is it still planned? What is the new alternative going to be? I would
strongly urge you to keep a script-based approach. It's a perfect fit for such a
project and a Makefile-based approach should like a train-wreck for this task,
if doable at all.

Regarding the current script-based build system, I noticed how multiple versions
of coreboot are handled, to have a different revision per payload-device
association. I think it's a very nice thing to have, but the way it's done
current seems quite painful to me. Instead of duplicating the tree, I'd suggest
using git and branches, for each devices (even ones that don't need it).

Also, the various scripts would be much easier to handle with some included
library, instead of duplicating lots of aspects in each script, making it hard
to maintain each and creating disparity between projects.

For instance, a library that handles generic project-related aspects for all the
other scripts would be very welcome. This would also make Libreboot more
consistent. Such functions could handle:
* Cloning a particular project from given URLs (with a primary URL and mirrors).
* Creating a branch for each payload-device pair and reverting it to the
appropriate revision. Similarly, having a branch for "modules", used for
building host tools (crossgcc, cbfstool in coreboot, flashrom, bucts, etc).
* Patching each branch with the appropriate patches, both with patches common to
the payload and specific to the device.
* Releasing each project's source code for each payload-device pair, making a
copy for each and removing the git history.

This way, all downloaded projects would only have one copy and a branch for each
needed source tree. For coreboot, it would imply keeping the git history.
Removing it is very inconvenient when developing and there is about no need to
do it prior to releasing.

In order to make everything even more simply, I think it would be best to switch
to a project-based structure, where each project simply defines a few functions
with given names, such as "download", "build", with relevant parameters. The
global scripts would simply include the appropriate scripts and call the
functions with the right arguments. This would severely reduce the dissipation
of files for a particular project. Each file would actually be quite simple
thanks to the use of a library for common operations.

Projects could either be tools (flashrom, bucts), the bootup software (coreboot)
or a payload (GRUB, depthcharge). Since one might surely depend on the other,
each project's script would have a "depends" function calling other scripts and
building the required components.

Regarding the naming of projects, I find some to be quite confusing. Libreboot
sometimes refers to the whole build system or to the deblobbed coreboot, which
is sometimes also called "libreboot-libre". This kind of inconsistency makes it
hard to figure out exactly which component does what.

Overall, here is a suggested directory structure example matching these changes:
ressources/projects/coreboot/libreboot (script with the functions)
ressources/projects/coreboot/config/depthcharge/veyron_speedy/config (coreboot
configuration)
ressources/projects/coreboot/config/depthcharge/veyron_speedy/revision (coreboot
revision)
ressources/projects/coreboot/patches/depthcharge/0001-foo.patch
ressources/projects/coreboot/patches/depthcharge/veyron_speedy/0001-bar.patch
ressources/projects/vboot/libreboot
ressources/projects/vboot/config/depthcharge/veyron_speedy/revision
ressources/libs/git (git-related library)
ressources/libs/common (common operations library)

Also, it would be best to build each project out-of-tree, or to ensure that the
tree is cleaned between different builds (something that could be done in a
clean() step, either called before each build() for in-tree build or skipped for
out-of tree build).

This is really just a mockup at this point, but if you don't hate the idea or
see a reason not to do this, I'll probably be spending some time working in that
direction, because I find the Libreboot build system quite painful to deal with
as it is now and it won't scale well for more projects anyway.

Cheers,
-- 
Paul Kocialkowski, low-level free software developer on embedded devices

Website: https://www.paulk.fr/
Coding blog: https://code.paulk.fr/
Git repositories: https://git.paulk.fr/ https://git.code.paulk.fr/

Attachment: signature.asc
Description: This is a digitally signed message part


reply via email to

[Prev in Thread] Current Thread [Next in Thread]