Commit Graph

10 Commits (390064247190f34d11f562e6a6554d9b388ce248)

Author SHA1 Message Date
Leah Rowe 3900642471 move root check to lib.sh (bugfix)
this avoids writing the version/versiondate files as root.

this complements the previous fix, that avoided writing those
same files when running the dependencies command.

initial setup of the build system requires root, to run the
dependencies script, but otherwise the build system prevents
running as root for everything else, so we must avoid writing
the version/versiondate files as root.

that same avoidance is necessary when checking whether running
other commands as root; ironically, this check then prevented
running the build system at all!

the bug should be fully fixed now. i found this quite by accident
the other day, when testing something else.

good thing this got fixed because the release!

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-05 11:15:44 +01:00
Leah Rowe 740b1803fa bugfix: move dependencies handling to lib.sh
do it strategically, in just the right place so that the
version and versiondate files aren't written.

otherwise, version/versiondate are written as root and
the build system becomes unusable after that, unless you
reset the file ownerships from root. hardly user-friendly.

mitigate this bug.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-05 11:15:39 +01:00
Leah Rowe 7b9431e336 lib.sh bugfix: check environmental variables right
A user had TMUX_TMPDIR set, which broke the TMPDIR check

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-04 13:58:11 +01:00
Leah Rowe 2478252f67 lib.sh: more friendly output from e()
already of saying "found", say "already exists"

this means the output of these commands more user
friendly and intuitive:

./update trees -b grub default
./update trees -b coreboot i945

this is just an example. when an ELF file already
exists, the build is skipped even if src isn't downloaded.

this design is intentional, because it means that you can
use previous builds if you want to save time on another.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-03 11:09:56 +01:00
Leah Rowe d21fd016ac badcmd: don't print "no context given"
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-03 11:09:51 +01:00
Leah Rowe 663de3bab4 badcmd: link directly to the maintenance manual
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-03 11:09:45 +01:00
Leah Rowe 1d866d17d8 better help text on invalid commands
adding help again is a bad idea. code should never
document itself; that's what documentation is for.

so, make the code do a better job telling the user
where to find documentation.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-03 11:09:39 +01:00
Leah Rowe 1204bc3c96 build: print the project website address on help
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-03 11:09:32 +01:00
Leah Rowe eb4ac3c334 make GRUB multi-tree and re-add xhci patches
The xHCI patches were removed because they caused issues
on Sandybridge-based Dell Latitude laptops. See:
https://codeberg.org/libreboot/lbmk/issues/216

The issue was not reported elsewhere, but we still don't
need xHCI support in Canoeboot's GRUB because none of the
available coreboot targets have xHCI support. However, we
may want it in the future and it helps to keep Canoeboot
in sync with Libreboot (this patch is adapted from lbmk).

Each given coreboot target can say which GRUB tree to use
by setting this in target.cfg:

grubtree="xhci"

In the above example, the "xhci" tree would be used. Some
generic GRUB config has been moved to config/data/grub/
and config/grub/ now looks like config/coreboot/ - also,
the grub.cfg file (named "payload" in each tree) is copied
to the GRUB source tree as ".config", then added to GRUB's
memdisk in the same way, as grub.cfg.

Several other design changes had to be made because of this:

* grub.cfg in memdisk no longer automatically jumps to one
  in CBFS, but now shows a menuentry for it if available

* Certain commands in script/trees are disabled for GRUB,
  such as *config make commands.

* gnulib is now defined in config/submodule/grub/, instead
  of config/git/grub - and this mitigates an existing bug
  where downloading gnulib first would make grub no longer
  possible to download in lbmk.

There is another reason for merging this design change from
lbmk, and that reasoning also applies to lbmk. Specifically:

This change will enable per-board GRUB optimisation in the
future. For example, we hardcode what partitions and LVMs
GRUB scans because * is slow on ICH7-based machines, due
to GRUB's design. On other machines, * is reasonably fast,
for automatically enumerating the list of devices for boot.

Use of * (and other wildcards) could enable our GRUB payload
to automatically boot more distros, with minimal fuss. This
can be done at a later date, in subsequent revisions.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-06-02 22:41:46 +01:00
Leah Rowe d147c5d915 rename include/option.sh to include/lib.sh
Signed-off-by: Leah Rowe <leah@libreboot.org>
2024-05-26 12:11:40 +01:00