[PATCH] grub-mount: Support libfuse 3

2022-01-12 Thread Fabian Vogt
libfuse 3.0.0 got released in 2016, with some API changes compared to 2.x. This commit introduces support for 3.x while keeping it compatible with 2.6 as a fallback still. To detect fuse3, switch configure over to use pkg-config, which is simpler yet more reliable than looking for library and head

[PATCH] http module is not checking correctly HTTP headers

2022-01-12 Thread Javier Moragon
According to https://www.ietf.org/rfc/rfc2616.txt 4.2, header names shall be case insensitive and we are now forced to read headers like `Content-Length` capitalized. The problem with that is when a HTTP server responds with a `content-length` header in lowercase GRUB gets stuck because HTTP modul

[PATCH 0/2] Add check-native and check-nonnative as make targets

2022-01-12 Thread Glenn Washburn
Tests can be put into two categories, native (tests that run on the build system) and non-native (tests run in QEMU). For any two targets (even of completely different architectures), the native tests will be running the same binary code (because they will be compiled for and run on the build machi

[PATCH 2/2] tests: Add check-native and check-nonnative make targets

2022-01-12 Thread Glenn Washburn
This allows for testing only tests that run directly on the build machine or only tests that run in a virtualized environment. When testing multiple targets on the same build machine the native tests only need to be run once for all targets. Whereas, the nonnative tests must be run for each target

[PATCH 1/2] conf/Makefile.common: Order alphabetically variables

2022-01-12 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- conf/Makefile.common | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/conf/Makefile.common b/conf/Makefile.common index 2a1a886f6..f0bb6e160 100644 --- a/conf/Makefile.common +++ b/conf/Makefile.common @@ -102,24 +102,24 @@ M

[PATCH 0/2] Fix a couple issues in moddep parsing

2022-01-12 Thread Glenn Washburn
The first patch fixes an OOB read bug and the second outputs a less confusing error to the user when the moddep.lst line is too long. Really it would be better to support lines of unlimited length, but I'm not motivated to add that. The condition under which these issues are triggered should never

[PATCH 1/2] util/resolve.c: Do not read past the end of the array in read_dep_list

2022-01-12 Thread Glenn Washburn
If the last non-NULL byte of 'buf' is not a white-space character (such as when a read line is longer than the size of 'buf'), then 'p' will eventually point to the byte after the last byte in 'buf'. After which 'p' will be dereferenced in the while conditional leading to an out of bounds read. Mak

[PATCH 2/2] util/resolve.c: Bail with error if moddep lst file line is too long

2022-01-12 Thread Glenn Washburn
The code reads each line into a buffer of size 1024 and does not check if the line is longer. So a line longer than 1024 will be read as a valid line followed by an invalid line. Then an error confusing to the user is sent with the test "invalid line format". But the line format is prefectly fine,

[PATCH 0/2] Make build more robust

2022-01-12 Thread Glenn Washburn
I've found these two patches to be necessary under certain build conditions that I've not been able to narrow down to a specific cause. I suspect it is related to the values of some build environment variables (like *CFLAGS). Either way, these patches allow a successful build finishes without error

[PATCH 1/2] gentpl.py: Fix issue where sometimes marker files have CPP defines

2022-01-12 Thread Glenn Washburn
When generating video.lst, modules whose marker file contains the string VIDEO_LIST_MARKER are selected. But when the marker file contains the CPP defines, one of the defines is VIDEO_LIST_MARKER and is present in all marker files, so they are all selected. By removing the defines, the correct modu

[PATCH 2/2] Makefile: Only look for @MARKER@ at the start of a line when generating libgrub_a_init.lst

2022-01-12 Thread Glenn Washburn
Under certain conditions libgrub.pp gets generated with a such that it contains a bunch of CPP defines, at least one of which contains "@MARKER@". This line should not be used when generating libgrub_a_init.lst, otherwise we get compiler errors like: libgrub_a_init.c:22:18: error: stray ‘#’ in p

[PATCH 0/5] Various test fixes and improvements

2022-01-12 Thread Glenn Washburn
I believe the patches are fairly self explantatory. Glenn Glenn Washburn (5): tests: Do not remove image file on error in pata_test tests: Skip pata_test on i386-efi tests: Remove $((BASE#NUM)) bashism in grub-fs-tester tests: Ensure that mountpoints are unmounted before exiting tests:

[PATCH 2/5] tests: Skip pata_test on i386-efi

2022-01-12 Thread Glenn Washburn
In comparison to other i386 targets, on i386-efi the Q35 QEMU machine type is used to do the testing to be able to make use of the EFI firmware in QEMU. On the Q35 machine type there is no way to use ATA to communicate with an IDE, only AHCI. Signed-off-by: Glenn Washburn --- tests/pata_test.in

[PATCH 4/5] tests: Ensure that mountpoints are unmounted before exiting

2022-01-12 Thread Glenn Washburn
When all tests complete successfully, filesystems mounted by grub-fs-tester will be unmounted before exiting. However, on certain test failures the tester will exit with a failure code and not unmount previously mounted filesystems. Now keep track of mounts and umounts and run an exit handler on ex

[PATCH 1/5] tests: Do not remove image file on error in pata_test

2022-01-12 Thread Glenn Washburn
The image file can be useful in debugging an issue when the test fails. Signed-off-by: Glenn Washburn --- tests/pata_test.in | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/pata_test.in b/tests/pata_test.in index 4fee0b0fb..27dccec19 100644 --- a/tests/pata_test.in +++ b/tests/pata_test

[PATCH 5/5] tests: Ensure that loopback devices and zfs devices are cleaned up

2022-01-12 Thread Glenn Washburn
ZFS file systems are not unmounted using umount, but instead by exporting them. So export the ZFS file system that has the same label as the one that was created during the test, if such one exists. This is required to delete the loopback device that uses the ZFS image file. Otherwise the added cod

[PATCH 3/5] tests: Remove $((BASE#NUM)) bashism in grub-fs-tester

2022-01-12 Thread Glenn Washburn
This bashism allows converting NUM in base BASE to decimal. Its not needed because the only place its used is to convert from hexidecimal and this can also be done with the more portable $((0xHEXNUM)) syntax. Signed-off-by: Glenn Washburn --- tests/util/grub-fs-tester.in | 10 +- 1 file

Re: [PATCH] http module is not checking correctly HTTP headers

2022-01-12 Thread Glenn Washburn
On Wed, 12 Jan 2022 23:54:58 +0100 Javier Moragon wrote: > According to https://www.ietf.org/rfc/rfc2616.txt 4.2, header names > shall be case insensitive and we are now forced to read headers like > `Content-Length` capitalized. > > The problem with that is when a HTTP server responds with a >