All of lore.kernel.org
 help / color / mirror / Atom feed
* reduce output into grub.cfg
@ 2020-08-31  8:27 Florian La Roche
  2020-09-01  5:13 ` [PATCH] If $hints is not set, we can reduce the output into grub.cfg from 5 lines to just 1 line Florian La Roche
  0 siblings, 1 reply; 4+ messages in thread
From: Florian La Roche @ 2020-08-31  8:27 UTC (permalink / raw)
  To: grub-devel

[-- Attachment #1: Type: text/plain, Size: 208 bytes --]

The attached patch reduces the output into grub.cfg from 5 lines into
1 if $hints is not set within grub-mkconfig_lib.in and this is reused
several times.

best regards and thanks for grub,

Florian La Roche

[-- Attachment #2: 0001-If-hints-is-not-set-we-can-reduce-the-output-into-gr.patch --]
[-- Type: text/x-patch, Size: 1440 bytes --]

From 1c2d980679b7d5e6f720006ace00e9bdd134e524 Mon Sep 17 00:00:00 2001
From: Florian La Roche <Florian.LaRoche@gmail.com>
Date: Mon, 31 Aug 2020 10:14:58 +0200
Subject: [PATCH] If $hints is not set, we can reduce the output into grub.cfg
 from 5 lines to just 1 line.

---
 util/grub-mkconfig_lib.in | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 2d80f14bf..301d1ac22 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -158,11 +158,15 @@ prepare_grub_to_access_device ()
   fi
   if [ "x${GRUB_DISABLE_UUID}" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then
     hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints=
-    echo "if [ x\$feature_platform_search_hint = xy ]; then"
-    echo "  search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
-    echo "else"
-    echo "  search --no-floppy --fs-uuid --set=root ${fs_uuid}"
-    echo "fi"
+    if [ "x$hints" != x ]; then
+      echo "if [ x\$feature_platform_search_hint = xy ]; then"
+      echo "  search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
+      echo "else"
+      echo "  search --no-floppy --fs-uuid --set=root ${fs_uuid}"
+      echo "fi"
+    else
+      echo "search --no-floppy --fs-uuid --set=root ${fs_uuid}"
+    fi
   fi
   IFS="$old_ifs"
 }
-- 
2.28.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] If $hints is not set, we can reduce the output into grub.cfg from 5 lines to just 1 line.
  2020-08-31  8:27 reduce output into grub.cfg Florian La Roche
@ 2020-09-01  5:13 ` Florian La Roche
  2020-09-17 14:04   ` Daniel Kiper
  0 siblings, 1 reply; 4+ messages in thread
From: Florian La Roche @ 2020-09-01  5:13 UTC (permalink / raw)
  To: grub-devel; +Cc: Florian La Roche

---
 util/grub-mkconfig_lib.in | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
index 2d80f14bf..301d1ac22 100644
--- a/util/grub-mkconfig_lib.in
+++ b/util/grub-mkconfig_lib.in
@@ -158,11 +158,15 @@ prepare_grub_to_access_device ()
   fi
   if [ "x${GRUB_DISABLE_UUID}" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then
     hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints=
-    echo "if [ x\$feature_platform_search_hint = xy ]; then"
-    echo "  search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
-    echo "else"
-    echo "  search --no-floppy --fs-uuid --set=root ${fs_uuid}"
-    echo "fi"
+    if [ "x$hints" != x ]; then
+      echo "if [ x\$feature_platform_search_hint = xy ]; then"
+      echo "  search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
+      echo "else"
+      echo "  search --no-floppy --fs-uuid --set=root ${fs_uuid}"
+      echo "fi"
+    else
+      echo "search --no-floppy --fs-uuid --set=root ${fs_uuid}"
+    fi
   fi
   IFS="$old_ifs"
 }
-- 
2.28.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] If $hints is not set, we can reduce the output into grub.cfg from 5 lines to just 1 line.
  2020-09-01  5:13 ` [PATCH] If $hints is not set, we can reduce the output into grub.cfg from 5 lines to just 1 line Florian La Roche
@ 2020-09-17 14:04   ` Daniel Kiper
  2020-09-17 14:16     ` Florian La Roche
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Kiper @ 2020-09-17 14:04 UTC (permalink / raw)
  To: Florian La Roche via Grub-devel; +Cc: Florian La Roche, Florian La Roche

On Tue, Sep 01, 2020 at 07:13:20AM +0200, Florian La Roche via Grub-devel wrote:

Missing SOB as previously... I can add it on your behalf if you are OK
with it. Otherwise Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

> ---
>  util/grub-mkconfig_lib.in | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
> diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in
> index 2d80f14bf..301d1ac22 100644
> --- a/util/grub-mkconfig_lib.in
> +++ b/util/grub-mkconfig_lib.in
> @@ -158,11 +158,15 @@ prepare_grub_to_access_device ()
>    fi
>    if [ "x${GRUB_DISABLE_UUID}" != "xtrue" ] && fs_uuid="`"${grub_probe}" --device $@ --target=fs_uuid 2> /dev/null`" ; then
>      hints="`"${grub_probe}" --device $@ --target=hints_string 2> /dev/null`" || hints=
> -    echo "if [ x\$feature_platform_search_hint = xy ]; then"
> -    echo "  search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
> -    echo "else"
> -    echo "  search --no-floppy --fs-uuid --set=root ${fs_uuid}"
> -    echo "fi"
> +    if [ "x$hints" != x ]; then
> +      echo "if [ x\$feature_platform_search_hint = xy ]; then"
> +      echo "  search --no-floppy --fs-uuid --set=root ${hints} ${fs_uuid}"
> +      echo "else"
> +      echo "  search --no-floppy --fs-uuid --set=root ${fs_uuid}"
> +      echo "fi"
> +    else
> +      echo "search --no-floppy --fs-uuid --set=root ${fs_uuid}"
> +    fi
>    fi
>    IFS="$old_ifs"
>  }

Daniel


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] If $hints is not set, we can reduce the output into grub.cfg from 5 lines to just 1 line.
  2020-09-17 14:04   ` Daniel Kiper
@ 2020-09-17 14:16     ` Florian La Roche
  0 siblings, 0 replies; 4+ messages in thread
From: Florian La Roche @ 2020-09-17 14:16 UTC (permalink / raw)
  To: Daniel Kiper; +Cc: Florian La Roche via Grub-devel

Hello grub-devel people and Daniel Kiper,

Am Do., 17. Sept. 2020 um 16:04 Uhr schrieb Daniel Kiper <dkiper@net-space.pl>:
>
> On Tue, Sep 01, 2020 at 07:13:20AM +0200, Florian La Roche via Grub-devel wrote:
>
> Missing SOB as previously... I can add it on your behalf if you are OK
> with it. Otherwise Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>

Yes, please add. (Next time I'll make sure to send this in complete form.)

best regards,

Florian La Roche


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-17 14:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-31  8:27 reduce output into grub.cfg Florian La Roche
2020-09-01  5:13 ` [PATCH] If $hints is not set, we can reduce the output into grub.cfg from 5 lines to just 1 line Florian La Roche
2020-09-17 14:04   ` Daniel Kiper
2020-09-17 14:16     ` Florian La Roche

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.