Re: GRUB 2.12~rc1 released

2023-08-20 Thread Vitaly Kuzmichev
Hello Daniel, Hello Glenn, I'm now finally completing my patch for search command to add support to search partition devices by PARTUUID, which I submitted in Apr 2021 [1]. I also integrated support to search by partition label submitted by Daniel Wagenknecht in Sep 2022 [2]. I (hopefully) address

Re: GRUB 2.12~rc1 released

2023-08-22 Thread Vitaly Kuzmichev
Hi Glenn, On Mon, 2023-08-21 at 14:52 -0500, Glenn Washburn wrote: > On Sun, 20 Aug 2023 12:28:57 + > Vitaly Kuzmichev wrote: > > > Hello Daniel, Hello Glenn, > > Hi Vitaly, > > > > > I'm now finally completing my patch for search command t

[PATCH v5 16/16] fs/ntfs: Simplify to use grub_utf16_to_utf8_alloc()

2023-08-22 Thread Vitaly Kuzmichev
Transform get_utf8() function to use grub_utf16_to_utf8_alloc() helper function to convert strings from UTF-16 to UTF-8. Signed-off-by: Vitaly Kuzmichev --- grub-core/fs/ntfs.c | 18 +- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/grub-core/fs/ntfs.c b/grub-core

[PATCH v5 05/16] commands/search: Add support to search by partition PARTUUID

2023-08-22 Thread Vitaly Kuzmichev
Improve 'search' grub-shell command with functionality to search for a partition by PARTUUID string. This is useful for embedded systems where FSUUID is not guaranteed to be constant, e.g. it is not preserved between system updates, and modifying grub.cfg is undesired. Signed-off-

[PATCH v5 04/16] include/grub/misc.h: Fix edge case in grub_uuidcasecmp()

2023-08-22 Thread Vitaly Kuzmichev
character '-'. Signed-off-by: Vitaly Kuzmichev --- include/grub/misc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/grub/misc.h b/include/grub/misc.h index 1b35a167f..12fade5de 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -264,7 +264,8 @@ grub_uui

[PATCH v5 10/16] commands/search: Add support to search by partition PARTLABEL

2023-08-22 Thread Vitaly Kuzmichev
Improve 'search' grub-shell command with functionality to search for a partition by PARTLABEL string, which is known as GPT partition name on GPT formatted disks. Signed-off-by: Vitaly Kuzmichev --- grub-core/Makefile.core.def | 5 + grub-core/commands/search.c

[PATCH v5 12/16] docs/grub.texi: Update documentation for 'probe' and 'search' commands

2023-08-22 Thread Vitaly Kuzmichev
Update documentation with new options '--part-uuid' and '--part-label' added to 'probe' and 'search' grub-shell commands. Signed-off-by: Vitaly Kuzmichev --- docs/grub.texi | 47 +++ 1 file changed, 35 insertion

[PATCH v5 02/16] partmap/msdos: Add grub_mbr_partition_get_uuid()

2023-08-22 Thread Vitaly Kuzmichev
This patch adds a function to provide partition PARTUUID on MBR formatted disks by extracting 32-bit disk signature code from MBR at offset 0x01B8 and adding partition number to it, similarly to 'blkid' output. Signed-off-by: Vitaly Kuzmichev --- grub-core/partmap/msdos.c

[PATCH v5 14/16] fs/fat: Simplify to use grub_utf16_to_utf8_alloc()

2023-08-22 Thread Vitaly Kuzmichev
Transform grub_fat_label() function to use grub_utf16_to_utf8_alloc() helper function to convert volume label from UTF-16 to UTF-8. Signed-off-by: Vitaly Kuzmichev --- grub-core/fs/fat.c | 20 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/grub-core/fs/fat.c

[PATCH v5 03/16] commands/probe: Simplify 'probe --part-uuid' command

2023-08-22 Thread Vitaly Kuzmichev
Simplify 'probe --part-uuid' command to use just added helper functions grub_gpt_partition_get_uuid() and grub_mbr_partition_get_uuid(). Signed-off-by: Vitaly Kuzmichev --- grub-core/commands/probe.c | 59 ++ 1 file changed, 15 insertions(+), 44

[PATCH v5 01/16] partmap/gpt: Add grub_gpt_partition_get_uuid()

2023-08-22 Thread Vitaly Kuzmichev
This patch adds a function to provide partition PARTUUID on GPT formatted disks by extracting 16 bytes GUID from corresponding GPT entry and formatting it similarly to 'blkid' output. Signed-off-by: Vitaly Kuzmichev --- grub-core/partmap/gpt.c

[PATCH v5 11/16] commands/probe: Add command option to display partition PARTLABEL

2023-08-22 Thread Vitaly Kuzmichev
Improve 'probe' grub-shell command with functionality to read and display a partition PARTLABEL string, which is known as GPT partition name on GPT formatted disks. Signed-off-by: Vitaly Kuzmichev --- grub-core/commands/probe.c | 22 ++ 1 file changed, 22 insertion

[PATCH v5 07/16] include/grub/charset.h: Add grub_utf16_{strlen, strnlen}()

2023-08-22 Thread Vitaly Kuzmichev
Add two functions to calculate UTF-16 string length. The address to UTF-16 string could be unaligned, so use grub_get_unaligned16() to iterate over characters. Signed-off-by: Vitaly Kuzmichev --- include/grub/charset.h | 26 ++ 1 file changed, 26 insertions(+) diff

[PATCH v5 15/16] fs/iso9660: Simplify to use grub_utf16_to_utf8_alloc()

2023-08-22 Thread Vitaly Kuzmichev
Transform grub_iso9660_convert_string() function to use grub_utf16_to_utf8_alloc() helper function to convert file names and volume name from UTF-16 to UTF-8. Signed-off-by: Vitaly Kuzmichev --- grub-core/fs/iso9660.c | 15 +-- 1 file changed, 1 insertion(+), 14 deletions(-) diff

[PATCH v5 06/16] include/grub/charset.h: Enhance grub_utf16_to_utf8()

2023-08-22 Thread Vitaly Kuzmichev
grub_utf16_to_utf8(). This parameter makes no functional changes. Also change characters reading in grub_utf16_to_utf8() to use grub_get_unaligned16(), as some buffer pointers could be unaligned. Signed-off-by: Vitaly Kuzmichev --- grub-core/commands/efi/lsefisystab.c | 2 +- grub-core/commands/usbtest.c

[PATCH v5 13/16] fs/f2fs: Simplify to use grub_utf16_to_utf8_alloc()

2023-08-22 Thread Vitaly Kuzmichev
Transform grub_f2fs_utf16_to_utf8() function to use grub_utf16_to_utf8_alloc() helper function to convert volume label from UTF-16 to UTF-8. Signed-off-by: Vitaly Kuzmichev --- grub-core/fs/f2fs.c | 24 +--- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/grub

[PATCH v5 00/16] Support searching by PARTUUID and PARTLABEL

2023-08-22 Thread Vitaly Kuzmichev
Signed-off-by: Vitaly Kuzmichev --- V2: This patch is based on Michael Grzeschik version from 27 May 2019 [1] with the following changes: 1. Addressed review feedback from Daniel Kiper [2] and Nick Vinson [3]. 2. Added support for GPT PARTUUID. 3. Moved MBR disk signature reading from partmap/

[PATCH v5 09/16] partmap/gpt: Add grub_gpt_partition_get_label()

2023-08-22 Thread Vitaly Kuzmichev
This patch adds a function to provide partition PARTLABEL on GPT formatted disks by extracting first 72 bytes of UTF-16LE encoded partition name from corresponding GPT entry and converting it to UTF-8 string. Signed-off-by: Vitaly Kuzmichev --- grub-core/partmap/gpt.c | 36

[PATCH v5 08/16] include/grub/charset.h: Add grub_utf16_to_utf8_alloc()

2023-08-22 Thread Vitaly Kuzmichev
-off-by: Vitaly Kuzmichev --- include/grub/charset.h | 28 1 file changed, 28 insertions(+) diff --git a/include/grub/charset.h b/include/grub/charset.h index 099f23fbe..4324fefb8 100644 --- a/include/grub/charset.h +++ b/include/grub/charset.h @@ -20,6 +20,9

Re: [PATCH v5 01/16] partmap/gpt: Add grub_gpt_partition_get_uuid()

2023-08-23 Thread Vitaly Kuzmichev
Hi Vladimir, On Wed, 2023-08-23 at 00:02 +0200, Vladimir 'phcoder' Serbinenko wrote: > > > > > +       { > > +         disk = grub_disk_open (dev->disk->name); > > +         if (disk && grub_disk_read (disk, pt->offset, pt->index, > > +                                     sizeof (gptdata), &gptd

Re: [PATCH v5 06/16] include/grub/charset.h: Enhance grub_utf16_to_utf8()

2023-08-23 Thread Vitaly Kuzmichev
Hi Vladimir, On Tue, 2023-08-22 at 23:55 +0200, Vladimir 'phcoder' Serbinenko wrote: > > > > > > > diff --git a/include/grub/charset.h b/include/grub/charset.h > > index 31a3b52dd..635d6df9e 100644 > > --- a/include/grub/charset.h > > +++ b/include/grub/charset.h > > @@ -49,6 +49,13 @@ > >  #de

Re: [PATCH v5 16/16] fs/ntfs: Simplify to use grub_utf16_to_utf8_alloc()

2023-08-23 Thread Vitaly Kuzmichev
function in ntfs module. All 3 places would expand with grub_utf16_to_utf8_alloc and grub_utf16_to_utf8 code, causing increase of .mod file size. With Best Regards, Vitaly. > > Le mar. 22 août 2023, 23:40, Vitaly Kuzmichev > a écrit : > > Transform get_utf8() function

Re: [PATCH v5 15/16] fs/iso9660: Simplify to use grub_utf16_to_utf8_alloc()

2023-08-23 Thread Vitaly Kuzmichev
e module size by double the size of grub_utf16_to_utf8_alloc and grub_utf16_to_utf8 functions. > > Le mar. 22 août 2023, 23:41, Vitaly Kuzmichev > a écrit : > > Transform grub_iso9660_convert_string() function to use > > grub_utf16_to_utf8_alloc() helper function to convert

Re: [PATCH v5 13/16] fs/f2fs: Simplify to use grub_utf16_to_utf8_alloc()

2023-08-23 Thread Vitaly Kuzmichev
utf8, so no code duplication of inline functions. Best Regards, Vitaly. > > Le mar. 22 août 2023, 23:41, Vitaly Kuzmichev > a écrit : > > Transform grub_f2fs_utf16_to_utf8() function to use > > grub_utf16_to_utf8_alloc() helper function to convert volume label > > from UTF-

Re: [PATCH v5 00/16] Support searching by PARTUUID and PARTLABEL

2023-08-31 Thread Vitaly Kuzmichev
Hi Daniel, On Wed, 2023-08-30 at 16:26 +0200, Daniel Kiper wrote: > Adding Daan who sent similar patch a day earlier... > > On Tue, Aug 22, 2023 at 11:39:08PM +0200, Vitaly Kuzmichev wrote: > > Improve 'search' grub-shell command with functionality to search > >

Re: [PATCH v5 04/16] include/grub/misc.h: Fix edge case in grub_uuidcasecmp()

2023-08-31 Thread Vitaly Kuzmichev
Hi Daniel, On Thu, 2023-08-31 at 19:09 +0200, Daniel Kiper wrote: > On Tue, Aug 22, 2023 at 11:39:12PM +0200, Vitaly Kuzmichev wrote: > > Fix comparison of two identical UUID strings ending with dash '-'. > > > > In this case grub_uuidcasecmp() passes through the

[PATCH v2] commands/search: Add support to search by PARTUUID

2021-03-04 Thread Vitaly Kuzmichev via Grub-devel
[1] https://lists.gnu.org/archive/html/grub-devel/2019-05/msg00124.html [2] https://lists.gnu.org/archive/html/grub-devel/2019-05/msg00131.html [3] https://lists.gnu.org/archive/html/grub-devel/2019-05/msg00134.html Signed-off-by: Vitaly Kuzmichev --- grub-core/Makefile.core.def | 5 ++

[PATCH v3] commands/search: Add support to search by PARTUUID

2021-04-15 Thread Vitaly Kuzmichev via Grub-devel
[1] https://lists.gnu.org/archive/html/grub-devel/2019-05/msg00124.html [2] https://lists.gnu.org/archive/html/grub-devel/2019-05/msg00131.html [3] https://lists.gnu.org/archive/html/grub-devel/2019-05/msg00134.html V3: Minor coding style and spelling fixes. Signed-off-by: Vitaly Kuzmichev ---

[PATCH v4] commands/search: Add support to search by PARTUUID

2022-02-09 Thread Vitaly Kuzmichev via Grub-devel
is needed. [1] https://lists.gnu.org/archive/html/grub-devel/2019-05/msg00124.html [2] https://lists.gnu.org/archive/html/grub-devel/2019-05/msg00131.html [3] https://lists.gnu.org/archive/html/grub-devel/2019-05/msg00134.html V3, V4: Coding style and spelling fixes. Signed-off-by: Vitaly Kuzmichev

Re: [PATCH v4] commands/search: Add support to search by PARTUUID

2022-02-09 Thread Vitaly Kuzmichev via Grub-devel
Hello Glenn, On 2/9/22 6:48 PM, Glenn Washburn wrote: On Wed, 9 Feb 2022 13:08:51 +0300 Vitaly Kuzmichev via Grub-devel wrote: Improve 'search' grub-shell command with functionality to search for a partition by PARTUUID string. This is useful for embedded systems where FSU