Re: [PATCH 0/7] ZFS/other CoW FS save_env support

2020-03-25 Thread Paul Dagnelie
reviews on the changes from people with experience in the codebase, and that one day we will be able to stop maintaining our fork. On Wed, Mar 25, 2020 at 10:06 AM Daniel Kiper wrote: > > Hi Paul, > > On Wed, Mar 11, 2020 at 10:37:08AM -0700, Paul Dagnelie wrote: > > Hey all, I pr

[PATCH 5/7] Add ZFS envblock functions

2020-03-11 Thread Paul Dagnelie
envblk logic doesn't store the file size, so the only way to retrieve it is to determine the length of the file using strlen. If this is considered too poor of an approach to be acceptable, format changes can still be made to the structure of the padding area. Signed-off-by: Paul Dagnelie --- grub

[PATCH 3/7] Factor out envblk buffer creation for reuse

2020-03-11 Thread Paul Dagnelie
This patch factors out the filling of the grubenv buffer into a separate function for reuse. Signed-off-by: Paul Dagnelie --- include/grub/util/install.h | 3 +++ util/editenv.c | 26 +- 2 files changed, 20 insertions(+), 9 deletions(-) diff --git

[PATCH 7/7] Update editenv to support editing zfs envblock, fix whitespace, and autodetect bootenv support in libzfs

2020-03-11 Thread Paul Dagnelie
are present in the version of libzfs present at build time. There is also a small whitespace fix in grub-editenv unrelated to the content of these changes. Signed-off-by: Paul Dagnelie --- configure.ac | 8 ++ include/grub/util/libzfs.h | 7 + util/grub-editenv.c| 278

[PATCH 1/7] Factor out file filter function for reuse

2020-03-11 Thread Paul Dagnelie
This patch refactors out the logic that applies filters to files for reuse in other code. Signed-off-by: Paul Dagnelie --- grub-core/kern/file.c | 46 +-- 1 file changed, 27 insertions(+), 19 deletions(-) diff --git a/grub-core/kern/file.c b/grub-core

[PATCH 4/7] Use envblk file and fs functions to implement reading the grubenv file from special FS regions

2020-03-11 Thread Paul Dagnelie
be used to force the file or envblock logic to be used. Signed-off-by: Paul Dagnelie --- grub-core/commands/loadenv.c | 122 ++- include/grub/lib/envblk.h| 2 + 2 files changed, 109 insertions(+), 15 deletions(-) diff --git a/grub-core/commands/loadenv.c b

[PATCH 2/7] Add support for special envblk functions in GRUB

2020-03-11 Thread Paul Dagnelie
and the per-fs logic, an interface for which is also added as part of this patch. Signed-off-by: Paul Dagnelie --- grub-core/kern/file.c | 30 -- include/grub/file.h | 10 ++ include/grub/fs.h | 12 3 files changed, 50 insertions(+), 2

[PATCH 6/7] Refactor default envblk size out for reuse

2020-03-11 Thread Paul Dagnelie
This patch refactors the DEFAULT_ENVBLK_SIZE definition into a header file for reuse in other code, and renames it to match other definitions in that header. Signed-off-by: Paul Dagnelie --- include/grub/lib/envblk.h | 1 + util/editenv.c| 9 - 2 files changed, 5 insertions

[PATCH 0/7] ZFS/other CoW FS save_env support

2020-03-11 Thread Paul Dagnelie
github.com/zfsonlinux/zfs/pull/10009 , the ZoL patch that enables ZFS to read from and write to the padding areas we reserved for the data. Paul Dagnelie (7): Factor out file filter function for reuse Add support for special envblk functions in GRUB Factor out envblk buffer creation for reuse

[PATCH 4/4] Update grub editenv to support modifying envblk

2020-02-25 Thread Paul Dagnelie
: Paul Dagnelie AuthorDate: Mon Feb 24 14:29:47 2020 -0800 Commit: Paul Dagnelie CommitDate: Tue Feb 25 10:08:08 2020 -0800 Update editenv to support editing zfs envblock --- include/grub/util/libzfs.h | 7 ++ util/grub-editenv.c| 279

[PATCH 2/4] Add envblk reading/writing functionality to GRUB

2020-02-25 Thread Paul Dagnelie
the grubenv file from a file or from the envblk even if it would not automatically choose to do so. commit d9e66e27592ad83f4a90d0e231a9ffc679617cae Author: Paul Dagnelie AuthorDate: Mon Feb 24 13:40:55 2020 -0800 Commit: Paul Dagnelie CommitDate: Tue Feb 25 10:08:07 2020 -0800 Use

[PATCH 3/4] Add ZFS envblock functions

2020-02-25 Thread Paul Dagnelie
reliability. commit 0f108fee27917afd72d834620db8f8b1e7ca1699 Author: Paul Dagnelie AuthorDate: Mon Feb 24 14:29:35 2020 -0800 Commit: Paul Dagnelie CommitDate: Tue Feb 25 10:08:08 2020 -0800 Add ZFS envblock functions --- grub-core/fs/zfs/zfs.c | 129

[PATCH 1/4] Add envblk open functions to grub file interface

2020-02-25 Thread Paul Dagnelie
: Paul Dagnelie AuthorDate: Mon Feb 24 11:19:40 2020 -0800 Commit: Paul Dagnelie CommitDate: Tue Feb 25 10:08:07 2020 -0800 Add support for special envblk functions in GRUB --- grub-core/kern/file.c | 76 +-- include/grub/file.h | 10

Re: [PATCH] ZFS/other CoW FS save_env support

2020-02-24 Thread Paul Dagnelie
down). Is there a preference in this codebase against consistency when other considerations are also relevant? -- Paul Dagnelie ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

[PATCH] ZFS/other CoW FS save_env support

2020-02-18 Thread Paul Dagnelie
; + + fs_envblk_spec_t *p; + + for (p = spec; p->fs_name; p++) +{ + if (strcmp (grub_fs->name, p->fs_name) == 0 && !have_abstraction) +{ + grub_util_info ("Detected envblock support in %s, leveraging", grub_fs->name); + fs_envblk = xmalloc (sizeof (fs_envblk_t)); + fs_envblk->spec = p; + fs_envblk->fs = grub_fs; + fs_envblk->data = p->fs_init (grub_dev); + grub_device_close (grub_dev); + return fs_envblk; +} +} + + grub_device_close (grub_dev); + return NULL; } int @@ -278,8 +524,11 @@ main (int argc, char *argv[]) command = argv[curindex++]; } + if (strcmp (filename, DEFAULT_ENVBLK_PATH) == 0) +fs_envblk = probe_fs_envblk (fs_envblk_table); + if (strcmp (command, "create") == 0) -grub_util_create_envblk_file (filename); +create_envblk (filename); else if (strcmp (command, "list") == 0) list_variables (filename); else if (strcmp (command, "set") == 0) -- Paul Dagnelie ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel

ZFS grubenv write support

2020-01-13 Thread Paul Dagnelie
u for your time and attention! -- Paul Dagnelie ___ Grub-devel mailing list Grub-devel@gnu.org https://lists.gnu.org/mailman/listinfo/grub-devel