unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Leo Famulari <leo@famulari.name>
To: myglc2 <myglc2@gmail.com>
Cc: guix-devel@gnu.org
Subject: Non-graphical GRUB configuration
Date: Sun, 2 Apr 2017 17:06:20 -0400	[thread overview]
Message-ID: <20170402210620.GA26945@jasmine> (raw)
In-Reply-To: <86vaqmwz3c.fsf@gmail.com>

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

On Sun, Apr 02, 2017 at 12:31:19PM -0400, myglc2 wrote:
> I gather you are focused on KVM deployment, so this may be off-
> topic. But FWIW, the patch that I use to run GRUB menus both locally on
> the console and over IPMI SOL (serial over LAN) on an headless ASRock
> server (MT-c224 w/ ASPEED 2300 BMC controller) is attached below.

I think we can make it work on KVM and bare metal in the same commit :)

> The important point is that 'terminal_output console' displays grub
> menus on _both_ the local console and via serial ... but ... grub does
> not receive the serial inputs ... unless ... 'terminal_input serial
> console' is also specified.

Okay, but your diff only selects the "console" terminal_output. Is that
because the native console is accessed over the serial line? Or should
it be 'terminal_output console serial'?

> diff --git a/gnu/system/grub.scm b/gnu/system/grub.scm
> index 4f9bde6a6..8199f6f0b 100644
> --- a/gnu/system/grub.scm
> +++ b/gnu/system/grub.scm
> @@ -199,7 +199,8 @@ system string---e.g., \"x86_64-linux\"."
>      insmod vga
>    fi
>  
> -  terminal_output gfxterm
> +  serial --unit=0 --speed=115200
> +  terminal_input serial console; terminal_output console
>  "
>          ""))
>  

Based on the GRUB manual [0], how about this plan?

We'd add these fields to (grub-configuration): 

terminal-outputs: One or more symbols: console, serial, gfxterm,
ofconsole, vga_text. Default gfxterm.

terminal-inputs: One or more symbols: console, serial, ofconsole,
at_keyboard,usb_keyboard. Default unset.

serial-unit: An integer from {0,1,2,3}, default 0
serial-port: ??? I don't know which values are accepted
serial-speed: GRUB default is 9600. Should this be an arbitrary
integer, or should we offer a list of values?
serial-word: An integer from {5,6,7,8}, default 8
serial-stop: An integer from {1,2}, default 1
serial-parity: A symbol from {no, odd, even}, default no

They would correspond to the GRUB configuration keys
GRUB_TERMINAL_OUTPUT, GRUB_TERMINAL_INPUT, and GRUB_SERIAL_COMMAND,
respectively. [0]

If 'terminal-inputs' or 'serial-*' are unset, we do what we do now:
nothing. If 'terminal-outputs' is unset, we also do the same thing we
now, which is set it to gfxterm.

If any of them are set, we'd insert the corresponding text into the
generated grub.cfg.

If terminal-outputs does not include the symbol 'gfxterm', we'd disable
the "setup_gfxterm" function.

We can use the `grub-script-check` program to check the syntax of the
generated grub.cfg.

[0]
https://www.gnu.org/software/grub/manual/html_node/Simple-configuration.html
https://www.gnu.org/software/grub/manual/html_node/terminal_005foutput.html
https://www.gnu.org/software/grub/manual/html_node/terminal_005finput.html
https://www.gnu.org/software/grub/manual/html_node/serial.html

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-04-02 21:06 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 12:59 question about pty,agetty for an intermediate virtual server image ng0
2017-03-31 23:43 ` Leo Famulari
2017-04-01  7:27   ` ng0
2017-04-01 18:33     ` Leo Famulari
2017-04-01 20:29     ` Leo Famulari
2017-04-02 16:31       ` question about pty, agetty " myglc2
2017-04-02 21:06         ` Leo Famulari [this message]
2017-04-02 22:13           ` Non-graphical GRUB configuration Leo Famulari
2017-04-03  0:31             ` myglc2
2017-04-03  8:39               ` Ludovic Courtès
2017-04-03  0:16           ` myglc2
2017-04-05 11:59           ` Leo Famulari
2017-04-05 15:14             ` myglc2
2017-04-05 16:07               ` Leo Famulari
2017-04-05 20:43                 ` myglc2
2017-04-06 15:18                   ` Leo Famulari
2017-04-06 17:34                     ` myglc2
2017-04-17 13:44             ` myglc2
2017-04-17 19:51               ` Leo Famulari

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=20170402210620.GA26945@jasmine \
    --to=leo@famulari.name \
    --cc=guix-devel@gnu.org \
    --cc=myglc2@gmail.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).