Re: [PATCH v7 12/17] luks2: Better error handling when setting up the cryptodisk

2020-12-07 Thread Patrick Steinhardt
On Mon, Dec 07, 2020 at 10:04:01PM -0600, Glenn Washburn wrote: > On Sun, 6 Dec 2020 20:35:13 +0100 > Patrick Steinhardt wrote: > > > On Fri, Dec 04, 2020 at 10:43:41AM -0600, Glenn Washburn wrote: > > > First, check to make sure that source disk has a known size. If > > > not, print debug messag

Re: [PATCH v7 05/17] luks2: Add json_slot_key member to struct grub_luks2_keyslot/segment/digest

2020-12-07 Thread Patrick Steinhardt
On Mon, Dec 07, 2020 at 10:06:44PM -0600, Glenn Washburn wrote: > On Mon, 7 Dec 2020 21:02:39 +0100 > Daniel Kiper wrote: > > > On Sun, Dec 06, 2020 at 02:29:06PM +0100, Patrick Steinhardt wrote: > > > On Fri, Dec 04, 2020 at 10:43:34AM -0600, Glenn Washburn wrote: > > > > This allows code using

Re: [PATCHv2] grub-install: Add backup and restore

2020-12-07 Thread Dimitri John Ledkov
On Tue, 8 Dec 2020, 03:17 Michael Chang, wrote: > On Mon, Dec 07, 2020 at 12:37:28PM +, Dimitri John Ledkov wrote: > > Refactor clean_grub_dir to create a backup of all the files, instead > > of just irrevocably removing them as the first action. If available, > > register on_exit handle to r

Re: [PATCH v2] loopback: Do not automaticaly replace existing loopback dev, error instead

2020-12-07 Thread Glenn Washburn
On Fri, 4 Dec 2020 13:34:44 +0100 Daniel Kiper wrote: > On Thu, Dec 03, 2020 at 07:57:11PM -0600, Glenn Washburn wrote: > > If there is a loopback device with the same name as the one to be > > created, instead of closing the old one and replacing it with the > > new one, return an error instead.

Re: Mips-arc tests ever work?

2020-12-07 Thread Glenn Washburn
On Sat, 5 Dec 2020 21:28:05 +0100 John Paul Adrian Glaubitz wrote: > On 12/5/20 8:10 PM, Glenn Washburn wrote: > >> I'm running manual tests for all architectures before each release. > > > > What exactly are manual tests? Is that running manually the tests > > for that target? (ie "make check"

Re: [PATCH v7 12/17] luks2: Better error handling when setting up the cryptodisk

2020-12-07 Thread Glenn Washburn
This patch got mangled accidentally with patch 5. I'll update them both. Glenn On Fri, 4 Dec 2020 10:43:41 -0600 Glenn Washburn wrote: > First, check to make sure that source disk has a known size. If not, > print debug message and return error. There are 4 cases where > GRUB_DISK_SIZE_UNKNOW

Re: [PATCH v7 05/17] luks2: Add json_slot_key member to struct grub_luks2_keyslot/segment/digest

2020-12-07 Thread Glenn Washburn
On Mon, 7 Dec 2020 21:02:39 +0100 Daniel Kiper wrote: > On Sun, Dec 06, 2020 at 02:29:06PM +0100, Patrick Steinhardt wrote: > > On Fri, Dec 04, 2020 at 10:43:34AM -0600, Glenn Washburn wrote: > > > This allows code using these structs to know the named key > > > associated with these json data st

Re: [PATCH v7 09/17] cryptodisk: Add macros GRUB_TYPE_U_MAX/MIN(type) to replace literals

2020-12-07 Thread Glenn Washburn
On Mon, 7 Dec 2020 21:22:09 +0100 Daniel Kiper wrote: > On Fri, Dec 04, 2020 at 10:43:38AM -0600, Glenn Washburn wrote: > > Add GRUB_TYPE_U_MAX/MIN(type) macros to get the max/min values for > > an unsigned number with size of type. > > > > Signed-off-by: Glenn Washburn > > Reviewed-by: Daniel

Re: [PATCH v7 12/17] luks2: Better error handling when setting up the cryptodisk

2020-12-07 Thread Glenn Washburn
On Sun, 6 Dec 2020 20:35:13 +0100 Patrick Steinhardt wrote: > On Fri, Dec 04, 2020 at 10:43:41AM -0600, Glenn Washburn wrote: > > First, check to make sure that source disk has a known size. If > > not, print debug message and return error. There are 4 cases where > > GRUB_DISK_SIZE_UNKNOWN is se

Re: [PATCHv2] grub-install: Add backup and restore

2020-12-07 Thread Michael Chang via Grub-devel
On Mon, Dec 07, 2020 at 12:37:28PM +, Dimitri John Ledkov wrote: > Refactor clean_grub_dir to create a backup of all the files, instead > of just irrevocably removing them as the first action. If available, > register on_exit handle to restore the backup if any errors occur, or > remove the bac

Re: [PATCH 8/9] efi: Only register shim_lock verifier if shim_lock protocol is found and SB enabled

2020-12-07 Thread Michael Chang via Grub-devel
On Thu, Dec 03, 2020 at 04:01:49PM +0100, Javier Martinez Canillas wrote: > The shim_lock module registers a verifier to call shim's verify, but the > handler is registered even when the shim_lock protocol was not installed. > > This doesn't cause a NULL pointer dereference in shim_lock_write() be

[PATCH] templates: allow loading a Device Tree file from user conf

2020-12-07 Thread Matteo Croce
From: Matteo Croce Some machines rely on Device Tree for hardware discovery, so a .dtb file must be passed to the kernel. GRUB can do this via the `devicetree` command, but it's not possible to do this from the user configuration. Add a GRUB_DEVICETREE_FILE variable which holds the path of the

Re: [SPECIFICATION RFC] The firmware and bootloader log specification

2020-12-07 Thread Tom Rini
On Fri, Dec 04, 2020 at 02:23:23PM +0100, Paul Menzel wrote: > Dear Wim, dear Daniel, > > > First, thank you for including all parties in the discussion. > Am 04.12.20 um 13:52 schrieb Wim Vervoorn: > > > I agree with you. Using an existing standard is better than inventing > > a new one in this

Re: [PATCH v7 09/17] cryptodisk: Add macros GRUB_TYPE_U_MAX/MIN(type) to replace literals

2020-12-07 Thread Daniel Kiper
On Fri, Dec 04, 2020 at 10:43:38AM -0600, Glenn Washburn wrote: > Add GRUB_TYPE_U_MAX/MIN(type) macros to get the max/min values for an > unsigned number with size of type. > > Signed-off-by: Glenn Washburn Reviewed-by: Daniel Kiper But one nit below... > --- > grub-core/disk/cryptodisk.c | 8

Re: [PATCH v7 08/17] cryptodisk: Add macro GRUB_TYPE_BITS() to replace some literals

2020-12-07 Thread Daniel Kiper
On Fri, Dec 04, 2020 at 10:43:37AM -0600, Glenn Washburn wrote: > The new macro GRUB_TYPE_BITS(type) returns the number of bits allocated for > type. > > Signed-off-by: Glenn Washburn Reviewed-by: Daniel Kiper Daniel ___ Grub-devel mailing list Grub-

Re: [PATCH v7 07/17] luks2: Add string "index" to user strings using a json index.

2020-12-07 Thread Daniel Kiper
On Fri, Dec 04, 2020 at 10:43:36AM -0600, Glenn Washburn wrote: > This allows error messages to be more easily distinguishable between indexes > and slot keys. The former include the string "index" in the error/debug > string, and the later are surrounded in quotes. > > Signed-off-by: Glenn Washbur

Re: [PATCH v7 06/17] luks2: Use more intuitive slot key instead of index in user messages

2020-12-07 Thread Daniel Kiper
On Fri, Dec 04, 2020 at 10:43:35AM -0600, Glenn Washburn wrote: > Use the slot key name in the json array rather than the 0 based index in the > json array for keyslots, segments, and digests. This is less confusing for > the end user. For example, say you have a LUKS2 device with a key in slot 1 >

Re: [PATCH v7 05/17] luks2: Add json_slot_key member to struct grub_luks2_keyslot/segment/digest

2020-12-07 Thread Daniel Kiper
On Sun, Dec 06, 2020 at 02:29:06PM +0100, Patrick Steinhardt wrote: > On Fri, Dec 04, 2020 at 10:43:34AM -0600, Glenn Washburn wrote: > > This allows code using these structs to know the named key associated with > > these json data structures. In the future we can use these to provide better > > e

Re: [PATCH v7 04/17] luks2: Make sure all fields of output argument in luks2_parse_digest() are written to

2020-12-07 Thread Daniel Kiper
On Fri, Dec 04, 2020 at 10:43:33AM -0600, Glenn Washburn wrote: > We should assume that the output argument "out" is uninitialized and could > have random data. So, make sure to initialize the segments and keyslots bit > fields because potentially not all bits of those fields are written to. > Othe

Re: [PATCH v7 03/17] luks2: Remove unused argument in grub_error

2020-12-07 Thread Daniel Kiper
On Fri, Dec 04, 2020 at 10:43:32AM -0600, Glenn Washburn wrote: > Reviewed-by: Daniel Kiper > Signed-off-by: Glenn Washburn Nit, my RB should be after your SOB. I will fix it. Daniel ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.or

Re: [PATCH v7 02/17] misc: Add parentheses around ALIGN_UP and ALIGN_DOWN arguments

2020-12-07 Thread Daniel Kiper
On Fri, Dec 04, 2020 at 10:43:31AM -0600, Glenn Washburn wrote: > This ensures that expected order of operations is preserved when arguments > are expressions. > > Signed-off-by: Glenn Washburn Good catch! Reviewed-by: Daniel Kiper Daniel ___ Grub-de

Re: [PATCH v7 01/17] disk: Rename grub_disk_get_size to grub_disk_native_sectors

2020-12-07 Thread Daniel Kiper
On Fri, Dec 04, 2020 at 10:43:30AM -0600, Glenn Washburn wrote: > The function grub_disk_get_size is confusingly named because it actually > returns a sector count where the sectors are sized in the grub native sector > size. Rename to something more appropriate. > > Suggested-by: Daniel Kiper >

Re: [PATCHv2] grub-install: Add backup and restore

2020-12-07 Thread Colin Watson
On Mon, Dec 07, 2020 at 12:37:28PM +, Dimitri John Ledkov wrote: > Refactor clean_grub_dir to create a backup of all the files, instead > of just irrevocably removing them as the first action. If available, > register on_exit handle to restore the backup if any errors occur, or > remove the bac

[PATCHv2] grub-install: Add backup and restore

2020-12-07 Thread Dimitri John Ledkov
Refactor clean_grub_dir to create a backup of all the files, instead of just irrevocably removing them as the first action. If available, register on_exit handle to restore the backup if any errors occur, or remove the backup if everything was successful. If on_exit is not available, the backup rem