All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: grub-devel@gnu.org
Cc: Daniel Kiper <daniel.kiper@oracle.com>,
	Hans de Goede <hdegoede@redhat.com>
Subject: [PATCH 1/4] Add new "version" command
Date: Wed, 28 Mar 2018 16:50:25 +0200	[thread overview]
Message-ID: <20180328145028.21555-2-hdegoede@redhat.com> (raw)
In-Reply-To: <20180328145028.21555-1-hdegoede@redhat.com>

Add a new "version" command which prints the grub PACKAGE_STRING +
build time and date. This is useful to check if the expected version is
running, for e.g. trouble-shooting purposes.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 grub-core/kern/corecmd.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/grub-core/kern/corecmd.c b/grub-core/kern/corecmd.c
index d9412a316..43273b901 100644
--- a/grub-core/kern/corecmd.c
+++ b/grub-core/kern/corecmd.c
@@ -170,6 +170,15 @@ grub_core_cmd_ls (struct grub_command *cmd __attribute__ ((unused)),
   return grub_errno;
 }
 
+/* version */
+static grub_err_t
+grub_core_cmd_version (struct grub_command *cmd __attribute__ ((unused)),
+		       int argc, char *argv[])
+{
+  grub_printf ("%s, build %s %s\n", PACKAGE_STRING, __DATE__, __TIME__);
+  return 0;
+}
+
 void
 grub_register_core_commands (void)
 {
@@ -186,4 +195,6 @@ grub_register_core_commands (void)
 			 N_("[ARG]"), N_("List devices or files."));
   grub_register_command ("insmod", grub_core_cmd_insmod,
 			 N_("MODULE"), N_("Insert a module."));
+  grub_register_command ("version", grub_core_cmd_version, 0,
+			 N_("Print grub version and build time."));
 }
-- 
2.17.0.rc1



  reply	other threads:[~2018-03-28 14:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-28 14:50 [PATCH 0/4] Make hidden menu really hidden Hans de Goede
2018-03-28 14:50 ` Hans de Goede [this message]
2018-03-29  7:53   ` [PATCH 1/4] Add new "version" command Olaf Hering
2018-03-29  8:37     ` Thomas Schmitt
2018-03-29 14:57     ` Hans de Goede
2018-03-29 15:02       ` Olaf Hering
2018-04-05 11:41   ` Daniel Kiper
2018-03-28 14:50 ` [PATCH 2/4] Accept Both ESC and F8 as user interrupt keys Hans de Goede
2018-03-28 14:56   ` Lennart Sorensen
2018-03-28 15:06     ` Hans de Goede
2018-03-28 15:11       ` Lennart Sorensen
2018-03-28 15:58         ` Hans de Goede
2018-04-05 11:47           ` Daniel Kiper
2018-03-28 14:50 ` [PATCH 3/4] Optionally print less messages at boot Hans de Goede
2018-04-05 12:12   ` Daniel Kiper
2018-04-05 17:53     ` Hans de Goede
2018-04-06 11:41       ` Daniel Kiper
2018-03-28 14:50 ` [PATCH 4/4] EFI: Do not set text-mode until we actually need it Hans de Goede
2018-04-05 12:34   ` Daniel Kiper
2018-04-05 18:05     ` Hans de Goede
2018-04-06 11:44       ` Daniel Kiper
2018-03-28 15:04 ` [PATCH 0/4] Make hidden menu really hidden Daniel Kiper

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=20180328145028.21555-2-hdegoede@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=daniel.kiper@oracle.com \
    --cc=grub-devel@gnu.org \
    /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 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.