* grub-core/commands/hashsum.c (aliases): Add sha1sum alias.

(GRUB_MOD_INIT): Register sha1sum command.
(GRUB_MOD_FINI): Unregister sha1sum command.
This commit is contained in:
Colin Watson 2010-09-21 10:56:16 +01:00
parent a4c1d277c1
commit c4fe27a827
2 changed files with 14 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2010-09-21 Colin Watson <cjwatson@ubuntu.com>
* grub-core/commands/hashsum.c (aliases): Add sha1sum alias.
(GRUB_MOD_INIT): Register sha1sum command.
(GRUB_MOD_FINI): Unregister sha1sum command.
2010-09-21 Yves Blusseau <blusseau@zetam.org> 2010-09-21 Yves Blusseau <blusseau@zetam.org>
Keep boot and grub directory names in sync with utils scripts Keep boot and grub directory names in sync with utils scripts

View file

@ -40,6 +40,7 @@ struct { const char *name; const char *hashname; } aliases[] =
{ {
{"sha256sum", "sha256"}, {"sha256sum", "sha256"},
{"sha512sum", "sha512"}, {"sha512sum", "sha512"},
{"sha1sum", "sha1"},
{"md5sum", "md5"}, {"md5sum", "md5"},
{"crc", "crc32"}, {"crc", "crc32"},
}; };
@ -249,7 +250,7 @@ grub_cmd_hashsum (struct grub_extcmd_context *ctxt,
return GRUB_ERR_NONE; return GRUB_ERR_NONE;
} }
static grub_extcmd_t cmd, cmd_md5, cmd_sha256, cmd_sha512 , cmd_crc; static grub_extcmd_t cmd, cmd_md5, cmd_sha1, cmd_sha256, cmd_sha512, cmd_crc;
GRUB_MOD_INIT(hashsum) GRUB_MOD_INIT(hashsum)
{ {
@ -263,6 +264,11 @@ GRUB_MOD_INIT(hashsum)
"[FILE1 [FILE2 ...]]"), "[FILE1 [FILE2 ...]]"),
N_("Compute or check hash checksum."), N_("Compute or check hash checksum."),
options); options);
cmd_sha1 = grub_register_extcmd ("sha1sum", grub_cmd_hashsum, 0,
N_("[-c FILE [-p PREFIX]] "
"[FILE1 [FILE2 ...]]"),
"Compute or check hash checksum.",
options);
cmd_sha256 = grub_register_extcmd ("sha256sum", grub_cmd_hashsum, 0, cmd_sha256 = grub_register_extcmd ("sha256sum", grub_cmd_hashsum, 0,
N_("[-c FILE [-p PREFIX]] " N_("[-c FILE [-p PREFIX]] "
"[FILE1 [FILE2 ...]]"), "[FILE1 [FILE2 ...]]"),
@ -285,6 +291,7 @@ GRUB_MOD_FINI(hashsum)
{ {
grub_unregister_extcmd (cmd); grub_unregister_extcmd (cmd);
grub_unregister_extcmd (cmd_md5); grub_unregister_extcmd (cmd_md5);
grub_unregister_extcmd (cmd_sha1);
grub_unregister_extcmd (cmd_sha256); grub_unregister_extcmd (cmd_sha256);
grub_unregister_extcmd (cmd_sha512); grub_unregister_extcmd (cmd_sha512);
grub_unregister_extcmd (cmd_crc); grub_unregister_extcmd (cmd_crc);