summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
20 hoursutil/nvmutil: remove pointless arg in openFilesLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
21 hoursutil/nvmutil: don't use xor swapLeah Rowe
it doesn't save any time on modern systems, and it's just confusing for some people to read. i mean, i understand it instinctively, but normal people do it with a swap variable. Signed-off-by: Leah Rowe <leah@libreboot.org>
21 hoursutil/nvmutil: don't use size_t as pointerLeah Rowe
the only reason i did this was for that xor swap, but we can just use an intermediary value Signed-off-by: Leah Rowe <leah@libreboot.org>
21 hoursutil/nvmutil: don't capitalise set_errLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
21 hoursutil/nvmutil: make xopen a function, not a macroLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
22 hoursutil/nvmutil: merge block_unveil back with mainLeah Rowe
we always want unveil/pledge calls to be in main, when possible, so that they are more transparent and easier to understand when re-factoring, because it's extremely important that these syscalls be done correctly. main is small enough now, from other re-factoring changes, that i'm happy to have this back in main now. Signed-off-by: Leah Rowe <leah@libreboot.org>
26 hoursutil/nvmutil: fix bad bound checkLeah Rowe
the current check is too liberal. make it sticter. the issue is that the previous check did not take into account that it's a check on a uint16_t array, against nf which refers to a number of bytes. Signed-off-by: Leah Rowe <leah@libreboot.org>
26 hoursutil/nvmutil: tidy up the xopen macroLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
27 hoursutil/nvmutil: add boundary checks on word/setWordLeah Rowe
this was the other complication with doing it as a macro. for something this fundamental, we really want to ensure that every access is safe. Signed-off-by: Leah Rowe <leah@libreboot.org>
27 hoursutil/nvmutil: make word/setWord a functionLeah Rowe
having this as a macro makes the code quite brittle. better to have it as a function. Signed-off-by: Leah Rowe <leah@libreboot.org>
27 hoursutil/nvmutil: rename openGbeFile to openFilesLeah Rowe
merge the urandom handling back into this function. it's called immediately after in main anyway, so we may as well. this reduces the size of main. Signed-off-by: Leah Rowe <leah@libreboot.org>
27 hoursutil/nvmutil: remove redundant unveil callLeah Rowe
in the given call, we then do an equivalent call immediately after that is the same, but without unveil, so we'll just defer to that. this changes no behaviour. Signed-off-by: Leah Rowe <leah@libreboot.org>
27 hoursutil/nvmutil: call block_unveil earlierLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
27 hoursutil/nvmutil: bring pledge in set_io_flag to mainLeah Rowe
in general, we should ensure that the pledge calls only happen inside main. this means we can more easily see them, in future re-factoring. Signed-off-by: Leah Rowe <leah@libreboot.org>
27 hoursutil/nvmutil: call set_cmd much earlierLeah Rowe
this will enable hardening of the pledge syscalls. it also means that the program will error out much earlier, when an invalid command is given, rather than opening a bunch of files first, and it will do so under reduced privilege already, notwithstanding the further pledge/unveil hardening that is planned. Signed-off-by: Leah Rowe <leah@libreboot.org>
27 hoursutil/nvmutil: unveil /dev/urandom much earlierLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
28 hoursutil/nvmutil: split xopen handlingLeah Rowe
same as the previous change. i'm going to harden the unveil and pledge calls next. Signed-off-by: Leah Rowe <leah@libreboot.org>
28 hoursutil/nvmutil: split unveil handlingLeah Rowe
urandom in main. this is because i'm going to further harden the use of pledge and unveil in a future patch, and this is a prerequisite. Signed-off-by: Leah Rowe <leah@libreboot.org>
28 hoursutil/nvmutil: split cmd init to new functionLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
31 hoursutil/nvmutil: split flags init to new functionLeah Rowe
main is getting much smaller now Signed-off-by: Leah Rowe <leah@libreboot.org>
31 hoursutil/nvmutil: tidy up main()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
32 hoursutil/nvmutil: split unveil code to new functionLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
32 hoursutil/nvmutil: separate usage functionLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
6 daysRe-add x230_12mb corebootfb configLeah Rowe
also for other variants i removed it because it was reported broken. it's not. the removal was always temporary, pending further testing. next time, i will be more sceptical. everything works fine. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysnvmutil: simplify readGbe and writeGbeLeah Rowe
the for loop only contains one line Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysnvmutil: centralise all errno handlingLeah Rowe
do it in the macro. this way, if a given error is present, it's not overridden. this enables easier debugging. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysnvmutil: rename ERR to SET_ERR, for clarityLeah Rowe
i renamed filename to fname, so that certain lines would still fit within 80 characters without introducing a new line break. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysnvmutil: split pread from readGbeLeah Rowe
split it into readGbe_part, for code clarity. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysnvmutil: split pwrite handling from writeGbeLeah Rowe
handle it in a separate function, for clarity. the main function just checks each part whether it changed, and then passes control to writeGbe_part. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysnvmutil: simplify a few else statementsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysnvmutil: don't hardcode errno to ECANCELEDLeah Rowe
use the ERR macro instead, so that an existing value will not be overridden. this is useful for debugging. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysnvmutil: explain a few parts in nvmallocLeah Rowe
the current code is optimised for speed, but it's a bit esoteric, so make it easier to understand. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysnvmutil: split malloc handling out of readGbeLeah Rowe
this has to do with memory allocation, not actual reading of the gbe file into memory. split it up, for clarity. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysnvmutil: further simplify nr/nw error handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysutil/nvmutil: simplify nr/nw error handlingLeah Rowe
when nf and nr/nw are not the same, we know there is an error condition, so defer to the following err() call, but use ERR() there instead of hardcoding use of ECANCELED. this actually improves the error handling, by being more verbose, while reducing the amount of logic. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysutil/nvmutil: remove pointless diagnosticsLeah Rowe
we only need to know the number of bytes written or read under error conditions. Signed-off-by: Leah Rowe <leah@libreboot.org>
8 daysutil/nvmutil: say part number on read/write reportLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysvendor.sh: handle mfs in find_meLeah Rowe
This makes the argument handling easier to understand, since other arguments are also handled in find_me Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysvendor.sh: handle me_cleaner -p separatelyLeah Rowe
this is a special mode that skips FPTR checks, which is needed on the topton x2e_n150 we currently set this, when MEclean="n", but we may want to skip cleaning while still checking FPTR on some boards (in a future lbmk revision) Signed-off-by: Leah Rowe <leah@libreboot.org>
9 daysvendor.sh: tidied up mecleaner argument handlingLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysMerge pull request 'Provide x270 patch for correct VBT and HDA verb' (#405) ↵Leah Rowe
from kittywitch/lbmk:x270-patch into master Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/405
10 daysProvide x270 patch for correct VBT and HDA verbKat Inskip
10 daysget.sh: properly initialise _uaLeah Rowe
it is currently only initialised inside case conditions. this is fine on most shells, but some of them can be a bit buggy here. initialise it empty and then override. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysg43t_am3: make it 2mb, not 4mbLeah Rowe
idk why i made it 4 Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysremove release=n on x270 portLeah Rowe
this is a hangover from an earlier work, where we had some issues prior to merging. as it is, the port is ready for a future release. Signed-off-by: Leah Rowe <leah@libreboot.org>
10 daysAdd ThinkPad X270 coreboot port from Kat InskipLeah Rowe
Courtesy of Kat Inskip who ported this board. Headphone output doesn't work at the moment, due to incorrect verb. Intel VBT is also wrong. Both are taken from another board. This will be amended later with the correct verb and VBT. Signed-off-by: Leah Rowe <leah@libreboot.org>
12 dayscoreboot/default: new rev ed5a993fLeah Rowe
latest coreboot rev as of literally today this is in preparation for a thinkpad x270 port using a WIP patch that was contributed Signed-off-by: Leah Rowe <leah@libreboot.org>
12 daysMerge pull request 'supermicro x11ssh_f: Use deguard-configured ME image ↵Leah Rowe
instead of SPS and disable ME HECI in devicetree' (#404) from noisytoot/supermicro-x11ssh-f into master Reviewed-on: https://codeberg.org/libreboot/lbmk/pulls/404
12 daysutil/grubpo: new util, for grub PO filesLeah Rowe
this is the program I recently wrote, that generated the submodule entries for the GRUB PO file fix this utility is for reference only. i'll probably do away with the fix at some point, replacing it with my own git-based submodule repository, containing the PO files. this would make things easier, and then that repository would contain the utility instead. i'm just putting this in lbmk for now, so that we have it somewhere. Signed-off-by: Leah Rowe <leah@libreboot.org>
12 daysutil/nvmutil: general code cleanupLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>