Commit Graph

1428 Commits (036bf2c69a64c7a3bfdcfde3139ae2285e790a5b)

Author SHA1 Message Date
Leah Rowe f6ebab5702 option.sh scan_config: clean up if/else block
the code wasn't very clear. make it clearer.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-19 02:35:55 +00:00
Leah Rowe 3b7009aafa option.sh: print error on stderr, not stdout
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-19 02:32:56 +00:00
Leah Rowe c75ca20c0a option.sh: don't rely on zero status on printf
this part of the code *must* return. the for loop
afterwards must not be permitted to execute.

it's unlikely that this would ever occur, unless
perhaps the user is using a very buggy sh.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-19 02:32:30 +00:00
Leah Rowe 578f105d62 git.sh git_am_patches: reduce indentation
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-19 02:26:26 +00:00
Leah Rowe cbd19d81fd git.sh fetch_config: simplify tree name check
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-19 02:23:46 +00:00
Leah Rowe b9f69f26c5 grub.cfg syslinux: support scanning /boot/EFI/
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 10:00:23 +00:00
Leah Rowe 766bb46c5f grub.cfg: fix path
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 09:59:08 +00:00
Leah Rowe 430918ee78 grub.cfg: handle btrfs subvols for extlinux.conf
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 08:31:38 +00:00
Leah Rowe d74c6c7114 grub.cfg: scan extlinux/extlinux.conf
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 08:16:21 +00:00
Leah Rowe f1d6c14367 grub.cfg: support grub and extlinux on ata/ahci
there are special menuentries just for loading
configs, without handling luks, lvm and whatnot.
it's intended for users of cd/dvd drives. well,
now we support both extlinux and grub, with this patch.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 08:14:06 +00:00
Leah Rowe 6db94c1a11 grub.cfg: merge isolinux/grub usb menuentries
many modern distros use grub in their installer images,
so scan for grub.cfg first.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 08:05:37 +00:00
Leah Rowe c4544e04bb grub.cfg: handle extlinux in the default menuentry
isolinux/syslinux/extlinux config files should all work,
using the syslinux parser function in grub

the current behaviour is to only search for grub.cfg,
so extlinux users can't use the default libreboot setup.
with this change, their systems should hopefully work.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 07:58:31 +00:00
Leah Rowe eaa1341b9e grub.cfg syslinux: support ESP and extlinux.conf
the so-called EFI System Partition (ESP) is used
on many UEFI-based setups. some users may be
migrating to libreboot, so let's support it.

on BIOS setups, it would be e.g.
/boot/syslinux/syslinux.conf

on UEFI setups, it would be e.g.

/boot/EFI/syslinux/syslinux.conf

additionally, support scanning for extlinux.conf

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 07:46:14 +00:00
Leah Rowe b817001e29 grub.cfg: don't boot linux without a grub.cfg
the fallback code in the main menuentry is
potentially unsafe, depending on user config.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 06:45:56 +00:00
Leah Rowe 2d6e5ca4c4 grub.cfg: scan lvm volumes last
lvm/* is slow to resolve in grub, on some machines,
because grub enumeration is very slow in general.

however, many people will install distros with any
number of lvm configurations, so we should try to
support them.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 05:11:06 +00:00
Leah Rowe 49eed9ac46 Revert "grub.cfg: try luks2/crypto-lvm before non-crypto"
This reverts commit 20389655e4.

If the user actually has encryption, but has /boot unencrypted,
this will considerably slow down the boot, so the patch has
been reverted.

The patch was originally meant to favour encrypted /boot
setups, but the old behaviour also still works there.
2023-12-18 04:17:05 +00:00
Leah Rowe aed4dff876 Merge pull request 'Dell-flash-unlock README updates from upstream' (#168) from nic3-14159/lbmk:dell-flash-unlock-updates into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/168
2023-12-18 04:03:05 +00:00
Leah Rowe 20389655e4 grub.cfg: try luks2/crypto-lvm before non-crypto
when the user sets up an encrypted machine, grub.cfg
defaults to non-encrypted setups if found, first

this patch reverses the order, deferring to
non-encrypted installations only when encrypted ones
are unavailable

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-18 02:55:25 +00:00
Nicholas Chin d207e9bc45
README.md: Add possibly not working systems
These systems have a report that the unlock utility does not work.
Until there are multiple reports of failed unlocks and a technical
determination of why it doesn't work, they will not be listed as
explicitly unsupported.
2023-12-17 19:38:23 -07:00
Nicholas Chin ab59f9128c
README.md: Add E6500, E6420, and E6530 as supported 2023-12-17 19:38:23 -07:00
Nicholas Chin ca28255db8
README.md: Add instructions for relaxing memory permissions
As this utility requires access to /dev/mem, the default protections of
Linux and OpenBSD must be relaxed to allow this. Make a note of this in
the instructions.
2023-12-17 19:38:23 -07:00
Nicholas Chin f481908135
README.md: Add references to Open Security Training
The old Open Security Training site had a course called Advanced x86:
BIOS and SMM Internals, which had a set of slides outlining the method
to supress SMIs by changing the GBL_SMI_EN bit. Add a reference to it as
this is where I originally learned of this method.
2023-12-17 19:38:16 -07:00
Leah Rowe 3a36c8277e Merge pull request 'master' (#165) from risapav/lbmk:master into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/165
2023-12-18 01:54:59 +00:00
Leah Rowe 0a8ef113a9 Merge pull request 'Update config/grub/config/grub.cfg' (#167) from semigel/lbmk:semigel-btrfs-subvol-patch-1 into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/167
2023-12-18 01:48:40 +00:00
semigel ababbc09f0 Update config/grub/config/grub.cfg
grub.cfg: add BTRFS subvol support
2023-12-18 00:56:48 +00:00
risapav 15226f9eb3 added x220edp_8mb 2023-12-17 16:59:41 +01:00
risapav 1c337ac740 added x220edp_8mb 2023-12-17 16:28:13 +01:00
risapav e6629606ec added x220edp_8mb 2023-12-17 16:14:23 +01:00
Leah Rowe 39a3de574a remove DEBUG handling in lbmk (not needed)
all it did was set -v in the shell, which doesn't yield
very useful results. this is a relic of very old design
in the libreboot build system, that is no longer needed.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-16 07:58:13 +00:00
Leah Rowe 1eb4df6748 fix several shellcheck warnings
lbmk didn't quote certain arguments in commands, or
used ! -z instead of -n, things like that. simple fixes.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-16 07:56:26 +00:00
Leah Rowe 54ca5f24d2 Merge pull request 'config/dependencies/debian: add unifont-bin & xfonts-unifont' (#163) from Riku_V/lbmk:debgrub into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/163
2023-12-11 21:37:18 +00:00
Riku Viitanen 2e6073f2a7 config/dependencies/debian: add unifont-bin & xfonts-unifont
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-12-11 23:28:36 +02:00
Leah Rowe 2e779a5495 handle errors on exits from subshells
most of these are probably redundant, and will never
be called, but lbmk needs to be as safe as possible
under fault conditions. fail early, fail hard.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-11 05:21:27 +00:00
Leah Rowe 9558e2fce7 improved safety/error handling on multitree git-am
update/trees wasn't correctly returning non-zero status,
even though it was printing an error message, when git-am
failed. this is due to the way subshells work, and it was
overlooked in previous auditing.

additionally: don't directly copy trees to the destination,
instead patch/reset first, then copy only under normal
condition, just as with single-tree projects.

when running build/roms, the script would continue after
a bad git-am, without exit. this patch fixes it in the
most paranoid way possible. i'm now fairly confident that
lbmk will fail gracefully and efficiently, under error
conditions. this should prevent bad image builds.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-12-11 05:01:39 +00:00
Leah Rowe 7af200a16a Merge pull request 'fix void dependencies: openssl-devel' (#161) from Riku_V/lbmk:fixvoid into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/161
2023-12-03 00:52:26 +00:00
Riku Viitanen 6d8d2e7538 fix void dependencies: openssl-devel
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-12-02 21:38:41 +02:00
Leah Rowe cb3fad0759 Merge pull request 'fix void dependencies: freetype-devel' (#160) from Riku_V/lbmk:fixvoid into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/160
2023-12-02 18:43:38 +00:00
Riku Viitanen 01a824318b fix void dependencies: freetype-devel
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-12-02 20:34:13 +02:00
Leah Rowe 5a6dec9733 Merge pull request 'fix void dependencies typo' (#159) from Riku_V/lbmk:fivoid into master
Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/159
2023-12-02 17:18:47 +00:00
Riku Viitanen 50bfe1cae0 fix void dependencies typo
Signed-off-by: Riku Viitanen <riku.viitanen@protonmail.com>
2023-12-02 19:13:33 +02:00
Leah Rowe 4e00ac003b revert flashrom back to version 1.2
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-22 12:18:00 +00:00
Leah Rowe 83c8248f55 dependencies/debian: fix libfreetype-dev
install libfreetype-dev, instead of libfreetype6-dev

this still works in debian stable (currently 12.2) but
fixes debian sid, as of 15 November 2023. my test machine
with debian sid could not install libfreetype6-dev, but
could install libfreetype-dev

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-15 17:49:07 +00:00
Leah Rowe 39aad57873 grub: re-add fat/nt file system modules
apparently some people use fat file systems for /boot
on linux systems

this is apparently a thing

it's ridiculous, but also a thing

a user reported they could not boot their t400 because
of those, because they have such a distro installed
on their machine

apparently it was a gentoo user

i don't really care. re-add 1980s dos file system support.

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-13 22:59:33 +00:00
Leah Rowe 47ef411efb Bump GRUB revision to 8 November 2023 revision
Now the revision is:
64e3cee72ab8f5876abfebb263b5e6cf7c4a9a4e

The old revision was:
e58b870ff926415e23fc386af41ff81b2f588763

With this new revision update, the following patches have
been imported from the upstream GRUB project:

* 64e3cee72 gpt: Add compile time asserts for guid and gpt_partentry sizes
* 7de6fe963 types: Split aligned and packed guids
* 5fc985bfd gpt_partition: Mark grub_gpt_partentry as having natural alignment
* 7ad30299d efi: Deduplicate configuration table search function
* c6cf807fc lsefi: Add missing static qualifier
* a964e359b types: Fix typo
* 3f79e3b15 util/grub-mount: Check file path sanity
* 85e40b36e configure: Make the DJVU_FONT_SOURCE configurable with --with-dejavufont=FILE
* 2d6631d2a configure: Make the Unifont FONT_SOURCE configurable with --with-unifont=FILE
* 07318ee7e fs/xfs: Fix XFS directory extent parsing
* ad7fb8e2e fs/xfs: Incorrect short form directory data boundary check
* 4e10213de Revert "zfsinfo: Correct a check for error allocating memory"
* 4266fd2bb disk/i386/pc/biosdisk: Read up to 63 sectors in LBA mode
* cab04dcda kern/i386/pc/init: Flush cache only on VIA C3 and earlier
* 3c7e84257 fs/btrfs: Zero file data not backed by extents
* 4bcf6f747 kern/ieee1275/init: Restrict high memory in presence of fadump on ppc64
* cf58eca2a tests/util/grub-shell: Enable RNG device to better test stack smashing
* c3bdf263f kern/efi/init: Disable stack smashing protection on grub_efi_init()
* 95963d97f disk/cryptodisk: Add support for LUKS2 in (proc)/luks_script
* 016f14257 disk/cryptodisk: Optimize luks_script_get()
* f7a663c00 term/serial: Ensure proper NULL termination after grub_strncpy()
* a19e47ca4 commands/efi/lsefisystab: Print the UEFI specification revision in human readable form

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-09 21:03:22 +00:00
Leah Rowe ce1176f521 fix typo in help text
say whot?

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-09 16:40:36 +00:00
Leah Rowe 70882902b5 build: set --author when running git init
set it to a generic name:
lbmk <lbmk@libreboot.org>

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-09 16:34:11 +00:00
Leah Rowe 5af3ae0586 lbmk: don't use status for unconditional returns
in cases where lbmk must always return from a function,
there are some cases where it relies on non-zero exit
status, which in practise is always the case, but may
change in the future if the relevant part is modified

e.g. do_something && return 0

the proper form is:
do_something
return 0

also do this for unconditional exits

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-08 06:34:12 +00:00
Leah Rowe 64f9337470 lbmk: support showing the revision in help text
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-08 06:21:25 +00:00
Leah Rowe f4b2a588e2 build: don't generate version/versiondate as root
don't run it directly at the bottom of err.sh,
because otherwise the version and versiondate
files will be generated when running "./build
dependencies distroname" which would then create
these files, but as root because the user runs
that specific command as root.

the rest of lbmk, for any other command, prevents
use of the root account, so running check_project
during "./build dependencies distroname" will cause
the build system to fail (because as non-root user,
the user will run lbmk and it will try to update
those files, and fail because it can't, due to lack
of permissions)

this patch fixes the issue, by only generating those
files if the user is *not* root

Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-08 06:11:24 +00:00
Leah Rowe c4d9008753 add grub mods: diskfilter,hashsum,loadenv,setjmp
Signed-off-by: Leah Rowe <leah@libreboot.org>
2023-11-06 18:08:46 +00:00