Commit graph

246 commits

Author SHA1 Message Date
Leah Rowe b5aa8b2d35 git.sh: allow finer control of git submodules
in each submodule configuration directory, a module.cfg
file can now be provided. in it, the user can specify
two repository links (main and backup) and a revision, like
so:

subrepo="repo link goes here"
subrepo_bkup="backup repo link goes here"
subrev="git revision id goes here"

additionally:

in the *main* project directory for the submodules,
a module.list file can be provided. example entries:

3rdparty/vboot
3rdparty/libgfxinit

if the module.list file is provided, only those submodules
will be downloaded. this can be combined with the module.cfg
files, if you wish, but it's optional. you can mix and match.

example locations:

multi-tree project:
config/submodule/coreboot/default/module.list
config/submodule/coreboot/default/vboot/module.cfg
single-tree project:
config/submodule/flashprog/module.list
config/submodule/flashprog/foo/module.cfg

*no* configuration files have been provided, in this commit,
which means that the current behaviour is maintained.

follow-up commits will absolutely configure the submodules.
this is being done to reduce the number of modules downloaded,
because we don't use most of the coreboot submodules that are
downloaded, thus wasting bandwidth and the releases are also
much bigger than necessary.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 11:39:50 +01:00
Leah Rowe 9339c6f3fd build: hide git-init output
following on from the previous commit, if you run
something like "./build roms list" when running for
the first time from a codeberg tarball, the output
of the git commands will be included in the output

hide this output

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 11:38:36 +01:00
Leah Rowe 31e089aff3 option.sh: generate version file if .git not found
a user was getting error "version unset" when using the
tarball generated from codeberg. it's recommended to use
the git repository properly, or a release archive.

mitigate this so that the build succeeds anyway.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 11:37:56 +01:00
Leah Rowe 7ec023907b update/trees: remove unused variable
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 11:37:47 +01:00
Leah Rowe 2b0e71412e git.sh: move repo copying to a new function
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 11:37:35 +01:00
Leah Rowe d71c4d326e git.sh: move link_crossgcc to end of file
link_crossgcc is called after git_am_patches, so
put it after ward

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 11:37:18 +01:00
Leah Rowe 0d7c249c9b move deblob function to new file "deblob.sh"
i'm importing some changes from lbmk and they go at the
end of git.sh, in the diffs. moving the deblob function
to its own file will allow me to cherry-pick with fewer
merge conflicts.

Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-25 11:35:50 +01:00
Leah Rowe 1300f09e67 git.sh: move xgcc linking to a new function
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 18:51:25 +01:00
Leah Rowe 24934e6569 git.sh: don't include --checkout in submodules
this is an oversight in the last few commits.

canoeboot must not use --checkout, because doing so
would download blob repositories from coreboot.org

by only including "--init" in the submodule command,
coreboot's build system skips almost all blobs.

(and then canoeboot deletes any remaining stragglers)

Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-22 18:15:03 +01:00
Leah Rowe 5e0129eb0f git.sh: skip submodules if .gitmodules missing
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 18:09:29 +01:00
Leah Rowe 7f82622caf git.sh: merge patch_submodules in prep_submodules
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 18:09:19 +01:00
Leah Rowe 9c0a7f14fc git.sh: split submodule handling to new function
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 18:09:12 +01:00
Leah Rowe b593127795 git.sh: remove errant line break
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 16:48:38 +01:00
Leah Rowe 19f694bf2a git.sh: remove another meaningless check
again, the directory in question is simply used
in a for loop using asterisk (git_am_patches) and
the for loop simply won't iterate if either the
directory doesn't exist or it contains no items.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 16:48:32 +01:00
Leah Rowe 71a9fcced8 git.sh: shorter variable names
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 16:48:26 +01:00
Leah Rowe 6693588857 git.sh: remove meaningless check
in the function that immediately follows, it
starts two for loops that check every item in
that directory, using the asterisk wildcard.

if the directory does not exist, then the for
loop will simply break on first pass.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 16:48:20 +01:00
Leah Rowe 5c459ad4ac git.sh: remove variable not meaningfully used
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 16:48:14 +01:00
Leah Rowe 7be7bb8edb add CHANGELOG to .gitignore
we want ./update release to work in release archives.

under the current logic, CHANGELOG would be cloned into
release/, thus breaking ./update trees -f

fix it by adding the file to .gitignore

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 02:17:18 +01:00
Nicholas Chin 3b2ebda890 Fix E6400 display reference clock patches
The ones I submitted before seem to have been outdated ones
that don't actually build properly.

Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-05-22 02:09:26 +01:00
Leah Rowe 995f052bb0 fix building coreboot images on i686 hosts
firstly, memtest86+ is currently not cross compiled and
relies on 64-bit headers (x86_64 only). a 32-bit distro
is unlikely to be able to build 64-bit binaries.

secondly: vboot throws a build error due to -Werror when
building on 32-bit hosts. we rely on vboot code to build
cbfstool, so turn off -Werror on vboot

that's all. 32-bit hosts are not recommended; it is assumed
that you are building on an x86_64 host. work will go into
the build system at a later date to make it more portable,
by cross compiling everything, but this should fix 32-bit
for now.

there are some x60/t60 users who still want to build roms,
so let's allow them that possibility.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-21 23:42:27 +01:00
Mate Kukri 31d2c818eb Also try unlocking encrypted volume on NVMe 2024-05-21 20:26:07 +01:00
Leah Rowe 58f6741fb4 git.sh: fix invalid command in git_prep()
"./update project trees" is a leftover from the
old build system design, prior to audits.

this particular call is for when xtree is defined,
which means that a given tree must rely on the given
coreboot tree defined by xtree. the "xtree" tree is
downloaded, so that its crossgcc builds can be re-used
to save time when building targets across many trees.

this is because trees often use identical crossgcc builds.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-21 18:25:30 +01:00
Mate Kukri f58b01c300 Add NVMe support to GRUB2 payload
Tested on OptiPlex 3050 (via injecting grub2.elf into WIP coreboot
port).
2024-05-21 18:24:01 +01:00
Nicholas Chin b892036edf Fix E6400 display issue with 1440 x 900 panel
The E6400 uses a 100 MHz reference clock on DPLL_REF_SSCLK, whereas
libgfxinit assumed that the reference was always 96 MHz. The frequency
difference caused by a 100 MHz reference with PLL config values
calculated assuming a 96 MHz reference were not significant enough to
cause noticable issues with the more common 1280 x 800 panels, but are
enough to matter for the 1440 x 900 panels which use a higher pixel
clock. This only affected the pre-OS graphics environment provided by
libgfxinit, as Linux drivers would determine the reference clock
frequency based on data in the VBT.

Fix this by making the reference clock frequency in libgfxinit
configurable for GM45 based on a new coreboot Kconfig, which is set to
100 MHz for the E6400.

Signed-off-by: Nicholas Chin <nic.c3.14@gmail.com>
2024-05-21 18:18:22 +01:00
samuraikid f81c7ed8e9 Add pt qwerty keymap to lbmk
Signed-off-by: samuraikid <samuraikid@noreply.codeberg.org>
2024-05-21 18:16:44 +01:00
Leah Rowe 849466c0ac git.sh: allow patching submodules
for single-tree project (e.g. flashprog):
config/submodule/PROJECT/MODNAME/patches

for multi-tree project (e.g. coreboot):
config/submodule/PROJECT/TREE/MODNAME/patches

MODNAME is e.g.:
3rdparty/vboot directory in coreboot: would become vboot
(the submodule codepath is filtered to up to the final slash)

another example:
submodire src dir 3rdparty/foo/bar
MODNAME would be "bar"

Add whatever patches you like to a given submodule.

An example patch is included in this commit.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-20 00:28:46 +01:00
Leah Rowe 8d4d063ace git.sh: don't delete .git if src/project/project
otherwise, "./update release" will epicly fail

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-20 00:28:00 +01:00
Leah Rowe 0ecb062df0 build/roms: skip target if config/ dir missing
fixes a regression when running ./build roms all

now it should work again

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-20 00:27:51 +01:00
Leah Rowe 4783c5b90e more minor cleanup in the build system
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19 08:18:24 +01:00
Leah Rowe 10ecf41ee0 git.sh: remove fetch_from_upstream()
the function is very small and only called once,
from fetch_project_trees()

merge it into fetch_project_trees()

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19 08:16:48 +01:00
Leah Rowe ddcb793bd2 option.sh: don't return 1 in mkrom_tarball
one of the calling functions relies on the return value
to be always 0, so these error conditions in mkrom_tarball
have been altered to cause an *exit* (non-zero) instead.

in practise, the commands in question were printf commands
run after tho directory they output to had been created,
so write access would probably not be an issue.

nonetheless, technically correct is the best kind of correct.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19 06:53:20 +01:00
Leah Rowe ae8637b620 option.sh: mktar_release to mkrom_tarball
that's all it's used for, to compress the rom images

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19 06:47:39 +01:00
Leah Rowe 309c3b1f33 build/roms: rename moverom to copyrom
it copies, it doesn't move, so name it right

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19 06:47:33 +01:00
Leah Rowe a39c95cfac minor code cleanup in the build system
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19 06:31:46 +01:00
Leah Rowe f102e21ab6 build/roms: simplify serprog list command
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 22:21:23 +01:00
Leah Rowe 7a565c9f43 build/roms: simplified config payload checks
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 22:21:11 +01:00
Leah Rowe a243dc2308 option.sh: err if config directory is missing
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 22:20:48 +01:00
Leah Rowe c28166ff9e option.sh: print the config filename being checked
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 22:19:53 +01:00
Leah Rowe 9fd504e24a git.sh: Remove .git if XBMK_RELEASE=y
The build system already deletes .git in all source
directories for each given release, but does so at
the very end; it still does, but now it is deleted
one by one per project, to save space during very
large builds (release sizes vary wildly, depending
on how many trees exist for coreboot basically).

If you're building entirely in tmpfs (as I do), this
could be a problem if you have lots of .git/ directories.

This change reduces disk usage, or in the above example,
memory usage when running the build system from tmpfs.

This complements another recent change, where ROM images
are compressed per target during release builds, rather
than all at the very end of the process. It is part of a
series of optimisations, to reduce the memory and disk
usage of the build system, and to reduce I/O wastage
in general.

This change will not be the last of such changes!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 04:57:47 +01:00
Leah Rowe e4956478db build: remove initcmd() and simplify main()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-16 11:37:22 +01:00
Leah Rowe f2b3bb142d build: initialise git first (before commands)
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-16 11:36:36 +01:00
Leah Rowe 571932d33e build: remove excmd() and simplify main()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-16 11:24:35 +01:00
Leah Rowe 525f5525d3 build: don't make script_path a global variable
this allows a mild cleanup of the code (reduction by 1 line)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-16 11:13:28 +01:00
livio fbac2d8fe6 Implemented failsafe options at boot and inside menus for enabling/disabling serial, spkmodem and gfxterm
Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-16 05:56:08 +01:00
Leah Rowe 3e5db248dd cbmk: allow easier sync with lbmk
an equivalent change has been made in lbmk.

certain cbmk-specific variable names have been made
generic, with certain functions and other variables
moved around.

i maintain sync between libreboot and canoeboot, where
both projects can have the same behaviours, and most of
the merge conflicts have to do with variable names
containing "LBMK", "lbmk", "cbmk" or "CBMK", or
indeed "canoeboot" and "libreboot"

LBMK/lbmk/CBMK/cbmk variables between canoeboot and
libreboot now contain the string XBMK/xbmk

it should now be *much* easier to merge build system
changes between lbmk and cbmk.

Signed-off-by: Leah Rowe <info@minifree.org>
2024-05-16 03:59:23 +01:00
Leah Rowe e71189420f remove help commands (user should read docs)
i always say, code should never document itself.

that's what documentation is for. the releases
contain documentation under docs/ but the git
repository does not; for that, use the website.

(in practise, cbmk usually needs internet anyway)

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-15 07:55:54 +01:00
Leah Rowe 23854de888 option.sh: delete check_git()
it's only used from main() in the main build script,
and it's very small, as is main()

therefore, move the logic into main()

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-15 07:54:24 +01:00
Leah Rowe 2c5f52ce29 build: define "xp" in the global variables
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-15 07:54:06 +01:00
Leah Rowe 48c5c57cff build: simplify for loop in fetch_trees()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-15 07:53:47 +01:00
Leah Rowe c2baebc79a build: simplified downloads in fetch_trees()
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-15 07:53:34 +01:00