>From a454b666f0c9e8970291500448f48d33bb39b46b Mon Sep 17 00:00:00 2001 From: Build Account
Date: Mon, 17 Nov 2014 11:48:19 +0000 Subject: [PATCH 2/2] Get devmapper.c to build Signed-off-by: John Lane --- grub-core/disk/devmapper.c | 12 +++++++----- include/grub/err.h | 3 ++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/grub-core/disk/devmapper.c b/grub-core/disk/devmapper.c index 1ac8e5d..7dc7d22 100644 --- a/grub-core/disk/devmapper.c +++ b/grub-core/disk/devmapper.c @@ -39,6 +39,8 @@ #define MIN(a, b) (a < b ? a : b) +GRUB_MOD_LICENSE ("GPLv3+"); + struct grub_crypto { char *devname, *source_devname; @@ -149,7 +151,7 @@ static const struct grub_arg_option options[] = { }; static grub_err_t -grub_cmd_devmap (grub_extcmd_t cmd, int argc, char **args) +grub_cmd_devmap (grub_extcmd_context_t ctxt, int argc, char **args) { grub_disk_t disk; grub_crypto_t newdev; @@ -159,7 +161,7 @@ grub_cmd_devmap (grub_extcmd_t cmd, int argc, char **args) char *passphrase = ""; /* char cmdphrase[MAX_PASSPHRASE]; */ const gcry_cipher_spec_t *ciph; - struct grub_arg_list *state = cmd->state; + struct grub_arg_list *state = ctxt->state; if (argc < 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, "Device name required"); @@ -218,7 +220,7 @@ grub_cmd_devmap (grub_extcmd_t cmd, int argc, char **args) grub_free (newdev->source_devname); grub_free (newdev->devname); grub_free (newdev); - return grub_error (GRUB_ERR_CIPHER_NOT_FOUND, "Unknown cipher %s", hash); + return grub_error (GRUB_ERR_CIPHER_NOT_FOUND, "Unknown cipher %s", cipher); } newdev->cipher = grub_crypto_cipher_open (ciph); if (!newdev->cipher) @@ -319,7 +321,7 @@ grub_crypto_open (const char *name, grub_disk_t disk) /* Populate requested disk */ disk->total_sectors = grub_disk_get_size (private->srcdisk); disk->id = (int) dev; - disk->has_partitions = dev->has_partitions; + /*disk->has_partitions = dev->has_partitions;*/ disk->data = private; return 0; @@ -400,7 +402,7 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT (devmapper) { - cmd = grub_register_extcmd ("devmap", grub_cmd_devmap, GRUB_COMMAND_FLAG_BOTH, + cmd = grub_register_extcmd ("devmap", grub_cmd_devmap, 0, "devmap [OPTIONS...] [DEVICE] [SRC-DEV]", "Map one device onto another (w/ cryptography support).", options); diff --git a/include/grub/err.h b/include/grub/err.h index 9896fcc..4e050e6 100644 --- a/include/grub/err.h +++ b/include/grub/err.h @@ -71,7 +71,8 @@ typedef enum GRUB_ERR_NET_PACKET_TOO_BIG, GRUB_ERR_NET_NO_DOMAIN, GRUB_ERR_EOF, - GRUB_ERR_BAD_SIGNATURE + GRUB_ERR_BAD_SIGNATURE, + GRUB_ERR_CIPHER_NOT_FOUND } grub_err_t; -- 2.1.2