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 to add > > support > > to search partition devices

Re: GRUB 2.12~rc1 released

2023-08-22 Thread Daniel Kiper
Hi Vitaly, On Tue, Aug 22, 2023 at 11:14:54AM +, Vitaly Kuzmichev wrote: > 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

[PATCH v2 0/2] Fix documentation issues reported by Olaf

2023-08-22 Thread Glenn Washburn
Updates from v1: * Use @ref instead of @pxref as suggested by Oskari Olaf, would you see if this updated patch series fixes your issues? Glenn Glenn Washburn (2): docs: Use @ref instead of @xref docs: Add menu to prevent older makeinfo versions from failing docs/grub-dev.texi | 5 + d

[PATCH v2 2/2] docs: Add menu to prevent older makeinfo versions from failing

2023-08-22 Thread Glenn Washburn
It has been reported that makeinfo version 4.13a complains and returns error when menus for chapter structuring commands are not present. It is also known that newer makeinfos, such as version 6.7, will create default menus when needed. Since the menu will be created regardless, explicitly create i

[PATCH v2 1/2] docs: Use @ref instead of @xref

2023-08-22 Thread Glenn Washburn
The @xref command is meant to be used at the beginning of a sentence because its expansion creates a "See " prefix on all output formats, and on older makeinfo versions is strict about enforcing a '.' or ',' after the command. The @ref command has no such restriction and is just the link, which all

[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-by: Vitaly Kuzmic

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

2023-08-22 Thread Vitaly Kuzmichev
Fix comparison of two identical UUID strings ending with dash '-'. In this case grub_uuidcasecmp() passes through the null terminators and actual result depends on whatever garbage follows them. So break immediately when it reaches the end in any of the strings after a dash character '-'. Signed

[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 | 16

[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 insertions(+), 12 deletions(-) diff --git a/docs/

[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 | 32 +

[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 deletions(-)

[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 | 36 incl

[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 insertions(+) diff

[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 --git

[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
This patch improves grub_utf16_to_utf8() helper function with additional parameter which allows to explicitly specify UTF-16 string characters byte order (CPU native, Big Endian or Little Endian). Previously grub_utf16_to_utf8() function supported only CPU byte order, which requires to create temp

[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
Improve 'search' grub-shell command with functionality to search for a partition by PARTUUID and PARTLABEL strings. 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-by

[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
This patch adds a wrapper function to perform conversion of UTF-16 string to UTF-8 string using inline function grub_utf16_to_utf8(), but pre-allocating necessary space for the target buffer. This behavior is similar to existing inversed function grub_utf8_to_utf16_alloc() in kern/misc.c. Signed-o

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

2023-08-22 Thread Vladimir 'phcoder' Serbinenko
Part_msdos size is critical as it's in critical supported configuration part_msdos+biosdisk+any FS. Please put it in a non-critical module Le mar. 22 août 2023, 23:41, Vitaly Kuzmichev a écrit : > This patch adds a function to provide partition PARTUUID on MBR > formatted disks by extracting 32-

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

2023-08-22 Thread Vladimir 'phcoder' Serbinenko
LGTM Le mar. 22 août 2023, 23:41, Vitaly Kuzmichev a écrit : > 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 fil

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

2023-08-22 Thread Vladimir 'phcoder' Serbinenko
Would it be easier to change all call sites to use utf16_to_utf8_alloc? Le mar. 22 août 2023, 23:40, Vitaly Kuzmichev a écrit : > 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 > ---

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

2023-08-22 Thread Vladimir 'phcoder' Serbinenko
Maybe change all call sites and eliminate this function altogether? 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 file names and > volume name from UTF-16 to UTF-8. > > Sig

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

2023-08-22 Thread Vladimir 'phcoder' Serbinenko
LGTM Le mar. 22 août 2023, 23:41, Vitaly Kuzmichev a écrit : > 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

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

2023-08-22 Thread Vladimir 'phcoder' Serbinenko
> > > 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 @@ > #define GRUB_UTF16_LOWER_SURROGATE(code) \ >(0xDC00 | (((code) - GRUB_UCS2_LIMIT) & 0x3ff)) > > +typedef e

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

2023-08-22 Thread Vladimir 'phcoder' Serbinenko
Same as other similar patches: maybe change call sites and remove function altogether? 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-16 to UTF-8. > > Si

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

2023-08-22 Thread Vladimir 'phcoder' Serbinenko
Le mar. 22 août 2023, 23:41, Vitaly Kuzmichev a écrit : > This patch adds a wrapper function to perform conversion of UTF-16 > string to UTF-8 string using inline function grub_utf16_to_utf8(), but > pre-allocating necessary space for the target buffer. This behavior is > similar to existing inve

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

2023-08-22 Thread Vladimir 'phcoder' Serbinenko
> > + { > + disk = grub_disk_open (dev->disk->name); > + if (disk && grub_disk_read (disk, pt->offset, pt->index, > + sizeof (gptdata), &gptdata) == 0) > Did you test this? It looks like you're missing a line disk->partition = disk->partitio

Re: [PATCH v2 0/2] Fix documentation issues reported by Olaf

2023-08-22 Thread Oskari Pirhonen
On Tue, Aug 22, 2023 at 13:26:27 -0500, Glenn Washburn wrote: > Updates from v1: > * Use @ref instead of @pxref as suggested by Oskari > > Olaf, would you see if this updated patch series fixes your issues? > > Glenn > > Glenn Washburn (2): > docs: Use @ref instead of @xref > docs: Add menu