RE: [PATCH] loader/i386/linux: Add device tree support

2021-10-07 Thread Mislav Stublić
Hi, There is a lot of duplication as I have used existing implementation as a reference (arm, aarch64 and fdt). But refactoring existing implementation atop of implementing x86 didn’t seem realistic as those modules are quite different... at least when I first looked at this. My biggest questio

Re: [PATCH v2 4/8] tests: Fail immediately when grub-shell fails and do not occlude the error code

2021-10-07 Thread Daniel Kiper
On Wed, Oct 06, 2021 at 03:05:57PM -0500, Glenn Washburn wrote: > On Wed, 6 Oct 2021 15:57:24 +0200 > Daniel Kiper wrote: > > > On Wed, Aug 25, 2021 at 02:03:58AM -0500, Glenn Washburn wrote: > > > If grub-shell fails, that means that whatever was being tested was not > > > actually tested. So fai

Re: [PATCH 00/10] More test fixes/improvements

2021-10-07 Thread Daniel Kiper
On Fri, Sep 17, 2021 at 11:03:54PM +, Glenn Washburn wrote: > Here is another patch series of changes needed to get the make check tests > passing on fairly recent Ubuntu/Debian systems, though most of the fixes > are for issues on fairly old systems as well (eg. reiser fixes). The FAT > volume

Re: [PATCH] loader/i386/linux: Add device tree support

2021-10-07 Thread Daniel Kiper
Hi Mislav, First of all, please do not top post and wrap your long lines... On Thu, Oct 07, 2021 at 09:23:14AM +, Mislav Stublić wrote: > Hi, > > There is a lot of duplication as I have used existing implementation > as a reference (arm, aarch64 and fdt). But refactoring existing > implementa

Re: About the code style requirement

2021-10-07 Thread Daniel Kiper
On Fri, Oct 01, 2021 at 03:14:02PM +0800, Qu Wenruo via Grub-devel wrote: > On 2021/10/1 14:08, Vladimir 'phcoder' Serbinenko wrote: [...] > > GRUB already has a btrfs implementation. Writing new one from scratch > > instead of existing one is unwelcome. From scratch means new bugs. > > Do you ha

Re: [PATCH v2 4/8] tests: Fail immediately when grub-shell fails and do not occlude the error code

2021-10-07 Thread Glenn Washburn
On Thu, 7 Oct 2021 14:37:16 +0200 Daniel Kiper wrote: > On Wed, Oct 06, 2021 at 03:05:57PM -0500, Glenn Washburn wrote: > > On Wed, 6 Oct 2021 15:57:24 +0200 > > Daniel Kiper wrote: > > > > > On Wed, Aug 25, 2021 at 02:03:58AM -0500, Glenn Washburn wrote: > > > > If grub-shell fails, that means

[PATCH v3 1/4] tests: Add set -e to missing tests

2021-10-07 Thread Glenn Washburn
This helps to ensure that error codes do not get ignored. Signed-off-by: Glenn Washburn --- tests/grub_cmd_test.in| 1 + tests/grub_script_blockarg.in | 1 + tests/test_sha512sum.in | 1 + 3 files changed, 3 insertions(+) diff --git a/tests/grub_cmd_test.in b/tests/grub_cmd_test.i

[PATCH v3 3/4] tests: Do not occlude grub-shell return code

2021-10-07 Thread Glenn Washburn
The script grub-shell does the bulk of the testing. If it returns an error code, that means that the test failed and the test should immediately exit with that error code. When grub-shell is used as a non-terminating command in a pipeline, eg. when data needs to be extracted from its output, its er

[PATCH v3 2/4] tests: Do not occlude subshell error codes

2021-10-07 Thread Glenn Washburn
When a subshell's output is used as input to a "simple command", its return code is not checked. These subshells contain an execution of the grub-shell script which does the work of the actual test. If grub-shell returns an error code, the test should fail. So refactor to not have the subshell whic

[PATCH v3 4/4] tests: Exit with skipped exit code when test not performed

2021-10-07 Thread Glenn Washburn
These tests were not performed and therefore did not pass, nor fail. This fixes misleading test exit code where, for instance, the pseries_test will pass on i386-pc, which is not a pseries architecture. Signed-off-by: Glenn Washburn --- tests/ahci_test.in | 8 tests/cdboot_tes

[PATCH v3 0/4] Various fixes/improvements for tests

2021-10-07 Thread Glenn Washburn
In this update from the previous patch series, I've only included the patches which required changes, which were the previous patches 4 and 7. Patch 4 was broken up at the Daniel's request, also a little differently than requested. It is now the first 3 patches. I've also changed the patch slightl

[PATCH v2] grub-shell: Boot PowerPC using PMU instead of CUDA for power management

2021-10-07 Thread Glenn Washburn
A recent refactoring of CUDA command code has exposed a bug in OpenBIOS[1] which was causing system powerdown and system reset to fail, thus causing the Qemu instance to hang. This in turn caused the grub-shell command to timeout causing it to return an error code when the test actually completed s

[PATCH 0/2] More test fixes

2021-10-07 Thread Glenn Washburn
The first patch changes the test exit status from skipped to hard error, for tests which fail due to missing dependencies in the environment. The second is a trivial patch to parameterize all uses of parted in the partmap_test. Glenn Glenn Washburn (2): tests: Test aborts due to missing requir

[PATCH 2/2] tests: In partmap_test, use ${parted} variable when checking for binary

2021-10-07 Thread Glenn Washburn
Signed-off-by: Glenn Washburn --- tests/partmap_test.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/partmap_test.in b/tests/partmap_test.in index 0dee5d4c3..43912a608 100644 --- a/tests/partmap_test.in +++ b/tests/partmap_test.in @@ -96,8 +96,8 @@ case "${grub_mo

[PATCH 1/2] tests: Test aborts due to missing requirements should be marked as error instead of skipped

2021-10-07 Thread Glenn Washburn
Many tests abort due to not being root or missing tools, for instance mkfs commands for file system tests. The tests are exited with code 77, which means they were skipped. A skipped test is a test that should not be run, eg. a test specific to ARM64 should not be run on an x86 build. These aborts

[PATCH v2] osdep/linux: Fix md array device enumeration

2021-10-07 Thread Kees Cook
GET_ARRAY_INFO's info.nr_disks does not map to GET_DISK_INFO's disk.number, which is an internal kernel index. If an array has had drives added, removed, etc, there may be gaps in GET_DISK_INFO's results. But since the consumer of devicelist cannot tolerate gaps (it expects to walk a NULL-terminate

Re: [PATCH] osdep/linux: Fix md array device enumeration

2021-10-07 Thread Kees Cook
Hi Daniel, On Tue, Oct 05, 2021 at 06:38:13PM +0200, Daniel Kiper wrote: > On Sat, Sep 25, 2021 at 07:03:35PM -0700, k...@ubuntu.com wrote: > > From: Kees Cook > > > > GET_ARRAY_INFO's info.nr_disks does not map to GET_DISK_INFO's > > disk.number, which is an internal kernel index. If an array ha

Re: [PATCH] osdep/linux: Fix md array device enumeration

2021-10-07 Thread Kees Cook
Hi Petr, On Wed, Oct 06, 2021 at 09:28:32AM +0200, Petr Vorel wrote: > Hi Kees, Daniel, > > > On Sat, Sep 25, 2021 at 07:03:35PM -0700, k...@ubuntu.com wrote: > > > From: Kees Cook > > > > GET_ARRAY_INFO's info.nr_disks does not map to GET_DISK_INFO's > > > disk.number, which is an internal ker

Re: About the code style requirement

2021-10-07 Thread Qu Wenruo via Grub-devel
On 2021/10/7 21:51, Daniel Kiper wrote: On Fri, Oct 01, 2021 at 03:14:02PM +0800, Qu Wenruo via Grub-devel wrote: On 2021/10/1 14:08, Vladimir 'phcoder' Serbinenko wrote: [...] GRUB already has a btrfs implementation. Writing new one from scratch instead of existing one is unwelcome. From