mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Michael Olbrich <m.olbrich@pengutronix.de>, barebox@lists.infradead.org
Subject: Re: [PATCH 4/7] efi: add helper to get the GPT partition UUID for a device
Date: Thu, 16 Jul 2015 11:34:25 +0200	[thread overview]
Message-ID: <55A77AA1.4010707@pengutronix.de> (raw)
In-Reply-To: <1437036236-19096-5-git-send-email-m.olbrich@pengutronix.de>


[-- Attachment #1.1: Type: text/plain, Size: 1697 bytes --]

On 07/16/2015 10:43 AM, Michael Olbrich wrote:
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> ---
>  common/efi-devicepath.c | 31 +++++++++++++++++++++++++++++++
>  include/efi.h           |  1 +
>  2 files changed, 32 insertions(+)
> 
> diff --git a/common/efi-devicepath.c b/common/efi-devicepath.c
> index a53c6d2e8b9b..fdb86afc8eca 100644
> --- a/common/efi-devicepath.c
> +++ b/common/efi-devicepath.c
> @@ -1383,3 +1383,34 @@ u8 device_path_to_type(struct efi_device_path *dev_path)
>  
>  	return device_path_type(dev_path);
>  }
> +
> +char *device_path_to_partuuid(struct efi_device_path *dev_path)
> +{
> +	struct efi_device_path *dev_path_node;
> +	struct harddrive_device_path *hd;
> +	char *str = NULL;;
> +
> +	dev_path = unpack_device_path(dev_path);
> +
> +	for (dev_path_node = dev_path; !is_device_path_end(dev_path_node);
> +	     dev_path_node = next_device_path_node(dev_path_node)) {
> +
> +		if (device_path_type(dev_path_node) != MEDIA_DEVICE_PATH)
> +			continue;
> +
> +		if (dev_path_node->sub_type != MEDIA_HARDDRIVE_DP)
> +			continue;
> +
> +		hd = (struct harddrive_device_path *)dev_path_node;
> +
> +		if (hd->signature_type != SIGNATURE_TYPE_GUID)
> +			continue;
> +
> +		str = malloc(sizeof("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")+1);
> +		sprintf(str, "%pU)", (efi_guid_t *)&(hd->signature[0]));
> +		break;
asprintf()?

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 455 bytes --]

[-- Attachment #2: Type: text/plain, Size: 149 bytes --]

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2015-07-16  9:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-16  8:43 [PATCH 0/7] EFI updates Michael Olbrich
2015-07-16  8:43 ` [PATCH 1/7] efi: improve malloc pool allocation Michael Olbrich
2015-07-16  8:43 ` [PATCH 2/7] efi: refactor & improve application loading code Michael Olbrich
2015-07-16  8:43 ` [PATCH 3/7] efi: add support for initrd loading Michael Olbrich
2015-07-16  8:43 ` [PATCH 4/7] efi: add helper to get the GPT partition UUID for a device Michael Olbrich
2015-07-16  9:34   ` Marc Kleine-Budde [this message]
2015-07-16  9:43     ` Michael Olbrich
2015-07-16  8:43 ` [PATCH 5/7] efi: export device_path_from_handle() Michael Olbrich
2015-07-16  8:43 ` [PATCH 6/7] efi: add helper functions to write EFI variables Michael Olbrich
2015-07-16  8:43 ` [PATCH 7/7] efi: write volatile EFI variables used by systemd Michael Olbrich
2015-07-16 20:08   ` Sascha Hauer
2015-07-17  7:05     ` Michael Olbrich
2015-07-17  7:19       ` Sascha Hauer

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=55A77AA1.4010707@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=m.olbrich@pengutronix.de \
    /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