Commit Graph

2077 Commits (67c92889a866d67132bcc37de6444e0bc56f548c)

Author SHA1 Message Date
Leah Rowe db06bbdb6e build: do root check before git check
otherwise, git could be initialised as root.

running as root is not allowed.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 16:34:48 +01:00
Leah Rowe 8d199a31d1 build: simplify git checks
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 16:34:07 +01:00
Leah Rowe 8da2559b35 option.sh: fix bad check for version/versiondate
i was checking whether it's a directory, whereas i should
have been checking whether it's a file. this is a workaround
put in place in case someone downloaded a tarball from codeberg
which is pre-generated per commit. in this situation, the
version and versiondate files do not exist, but the design
of the build system requires that they do exist.

the existing check is correct except for this bug, so fix
the bug. check that they are files, not directories

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 14:37:40 +01:00
Leah Rowe d32968c731 trees: reset makeargs per target/project
it wasn't being reset before. when coreboot is being
built, i add to makeargs every time. if multiple targets
are being built, the make command would end up looking
something like:

make -C src/coreboot/default UPDATED_SUBMODULES=1 \
    UPDATED_SUBMODULES=1

(the parameter would be printed twice)

of course, this doesn't check whether that parameter is
added already in target.cfg for a given target, but that's
ok because i won't add that one in target.cfg

i baked it into the code, only when handling coreboot,
because that was easier than either putting it in makeargs
for every coreboot target.cfg, or again modifying the code to
handle that; the current solution is the cleanest.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 14:32:06 +01:00
Leah Rowe 7bab0cf9ed trees: also use UPDATED_SUBMODULES=1 on crossgcc
i overlooked this in the previous revision

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 00:37:26 +01:00
Leah Rowe 0a50eaf227 trees: add UPDATED_SUBMODULES to coreboot make
we do not want submodules to be downloaded after the fact.

we only handle this on ./update trees -f coreboot

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 00:22:34 +01:00
Leah Rowe ff0840bdf8 trees: write -C on the make command first not last
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-25 00:18:40 +01:00
Leah Rowe b91ee72762 config: add backup coreboot submodule repositories
this is using the same functionality that was added a few
commits ago, to override the use of "git submodule update"

each coreboot submodule has two repositories defined, with
the second one kicking in if the mail one fails upon cloning.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-24 23:42:05 +01:00
Leah Rowe 4a3ebe84a8 coreboot/default: remove chromeec from module.list
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-24 21:44:27 +01:00
Leah Rowe 9c5890e9f2 git.sh: break if a submodule clone succeeds
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-24 21:43:10 +01:00
Leah Rowe fdb08143e4 coreboot: only download the necessary submodules
whitelist what modules are downloaded, by adding
module.list files in the corresponding directories
under config/submodule/, per each coreboot tree.

this is making use of functionality added in the
previous commit.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-24 19:30:43 +01:00
Leah Rowe 1cb255e8be 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-24 18:58:48 +01:00
Leah Rowe 5d87eea77c 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-24 15:00:46 +01:00
Leah Rowe b8ec7d5640 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-24 14:53:45 +01:00
Leah Rowe 87c361f3df update/trees: remove unused variable
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-23 00:01:20 +01:00
Leah Rowe da42727209 git.sh: move repo copying to a new function
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 23:11:12 +01:00
Leah Rowe 093c4a367d 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-22 23:08:13 +01:00
Leah Rowe 73a2d99102 git.sh: move xgcc linking to a new function
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 18:50:42 +01:00
Leah Rowe d774987697 git.sh: skip submodules if .gitmodules missing
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 18:03:48 +01:00
Leah Rowe c3e1aa343a git.sh: merge patch_submodules in prep_submodules
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 18:01:39 +01:00
Leah Rowe a41633306a git.sh: split submodule handling to new function
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 17:59:42 +01:00
Leah Rowe aa4faf0815 git.sh: remove errant line break
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 16:03:28 +01:00
Leah Rowe 0014269604 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 15:57:47 +01:00
Leah Rowe fc3b0ba8bf git.sh: shorter variable names
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 15:56:35 +01:00
Leah Rowe dae10dd482 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 15:53:37 +01:00
Leah Rowe c148fa53df git.sh: remove variable not meaningfully used
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-22 15:53:15 +01:00
Leah Rowe 079afb5bd3 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:15:39 +01:00
Leah Rowe 0d8781ef4e Merge pull request 'Fix E6400 display reference clock patches' (#214) from nic3-14159/lbmk:fix-e6400-igpu-ref-clock into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/214
2024-05-22 01:06:59 +00:00
Nicholas Chin 9f50e36228
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-21 18:58:28 -06:00
Leah Rowe e5a5935d8d 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:40:25 +01:00
Leah Rowe a2ac4d1398 Merge pull request 'Also try unlocking encrypted volume on NVMe' (#213) from mkukri/lbmk:master into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/213
2024-05-21 19:09:37 +00:00
Mate Kukri 77ebd05010 Also try unlocking encrypted volume on NVMe 2024-05-21 19:47:14 +01:00
Leah Rowe 287d05555f Merge pull request 'Add NVMe support to GRUB2 payload' (#212) from mkukri/lbmk:master into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/212
2024-05-21 17:13:28 +00:00
Leah Rowe 47d77c9429 Merge pull request 'Fix E6400 display issue with 1440 x 900 panel' (#211) from nic3-14159/lbmk:fix-e6400-igpu-ref-clock into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/211
2024-05-21 17:13:17 +00:00
Leah Rowe 0beecd1b03 Merge pull request 'Add pt qwerty keymap to lbmk' (#210) from samuraikid/lbmk:master into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/210
2024-05-21 17:13:07 +00:00
Leah Rowe 835e5ad0e8 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:09:41 +01:00
Mate Kukri abe6717c33 Add NVMe support to GRUB2 payload
Tested on OptiPlex 3050 (via injecting grub2.elf into WIP coreboot
port).
2024-05-20 20:48:44 +01:00
Nicholas Chin 8629873a60
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-20 10:46:25 -06:00
Leah Rowe 1e54db2989 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:10:27 +01:00
Leah Rowe 00e00a18d0 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-19 23:04:37 +01:00
Leah Rowe 245b4eb21d 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-19 22:43:52 +01:00
Leah Rowe aadccc591b more minor cleanup in the build system
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19 08:14:57 +01:00
Leah Rowe 5b8928c7c9 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 07:50:24 +01:00
Leah Rowe 71baf65351 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:51:20 +01:00
Leah Rowe 1fe9c4b899 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:45:38 +01:00
Leah Rowe cc7ed6926b 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:43:37 +01:00
Leah Rowe b40118ae59 minor code cleanup in the build system
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-19 06:30:32 +01:00
samuraikid 8d723d1498 Add pt qwerty keymap to lbmk
Signed-off-by: samuraikid <samuraikid@noreply.codeberg.org>
2024-05-18 22:05:27 +00:00
Leah Rowe 998f30ad4d build/roms: simplify serprog list command
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 22:17:12 +01:00
Leah Rowe 21a7efaa95 build/roms: simplified config payload checks
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-18 22:13:20 +01:00