Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: AndreiCherniaev <cherniaev.andrei@kairo.space>
Cc: buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 2/2] board/pc/post-build.sh: allow to use grub config file
Date: Sun, 1 Oct 2023 19:08:02 +0200	[thread overview]
Message-ID: <20231001170802.GN2579@scaer> (raw)
In-Reply-To: <20230109074202.12012-2-cherniaev.andrei@kairo.space>

Andrei, All,

Sorry to come back so alte on that patch...

On 2023-01-09 16:42 +0900, AndreiCherniaev spake thusly:
> Allow to use grub config file with set timeout not default. Before this set timeout always was 5s and can't be changed, any set timeout from BR2_TARGET_GRUB2_BUILTIN_CONFIG_PC was ignored

Please properly format your commit log, wrapped at ~72 chars wide lines.

The files in board/ are meant to be used with the defconfigs in
Buildroot, and together are meant as examples and startkng point for
frther custmisations.

We can't add support for everything up to the kitchen sink in those
scripts; we want to keep them simple so that it is easy to see what they
are doing on how they can be extended.

It is your responsibility to adapt those files to match your use-case,
potentially duplicating them on hyour side to create a new board
definition.

As such, I've maked this patch as rejected.

Regards,
Yann E. MORIN.

> Signed-off-by: AndreiCherniaev <cherniaev.andrei@kairo.space>
> ---
>  board/pc/post-build.sh | 17 ++++++++++++++++-
>  1 file changed, 16 insertions(+), 1 deletion(-)
> 
> diff --git a/board/pc/post-build.sh b/board/pc/post-build.sh
> index c76dee2676..8538faa7eb 100755
> --- a/board/pc/post-build.sh
> +++ b/board/pc/post-build.sh
> @@ -9,7 +9,22 @@ if [ -d "$BINARIES_DIR/efi-part/" ]; then
>      cp -f "$BOARD_DIR/grub-efi.cfg" "$BINARIES_DIR/efi-part/EFI/BOOT/grub.cfg"
>  else
>      cp -f "$BOARD_DIR/grub-bios.cfg" "$TARGET_DIR/boot/grub/grub.cfg"
> -
>      # Copy grub 1st stage to binaries, required for genimage
>      cp -f "$TARGET_DIR/lib/grub/i386-pc/boot.img" "$BINARIES_DIR"
>  fi
> +
> +# When post-build script is runing $BR2_TARGET_GRUB2_BUILTIN_CONFIG_PC is unset, so parce Buildroot .config file again
> +GRUB2_BUILTIN_CONFIG_PC="`grep --only-matching --perl-regex "(?<=BR2_TARGET_GRUB2_BUILTIN_CONFIG_PC\=).*" $BR2_CONFIG`"
> +# Using the native shell prefix/suffix removal feature (see also qstrip)
> +GRUB2_BUILTIN_CONFIG_PC="${GRUB2_BUILTIN_CONFIG_PC%\"}"
> +GRUB2_BUILTIN_CONFIG_PC="${GRUB2_BUILTIN_CONFIG_PC#\"}"
> +if [ -z "$GRUB2_BUILTIN_CONFIG_PC" ]; then #if user doesn't use his .config for grub
> +    # Set time to wait 5 s for keyboard input before booting by default
> +    sed -i -e '1 s/^/set default="0"\nset timeout="5"\n\n/;' "$TARGET_DIR/boot/grub/grub.cfg"
> +#else if user use his .config for grub
> +# to configure bootloader put something like
> +#  set default="0"
> +#  set timeout="5"
> +# to your file located $BR2_TARGET_GRUB2_BUILTIN_CONFIG_PC 
> +# More info https://www.gnu.org/software/grub/manual/grub
> +fi
> -- 
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2023-10-01 17:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  7:42 [Buildroot] [PATCH 2/2] board/pc/post-build.sh: allow to use grub config file AndreiCherniaev
2023-10-01 17:08 ` Yann E. MORIN [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231001170802.GN2579@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@buildroot.org \
    --cc=cherniaev.andrei@kairo.space \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox