diff mbox

uefidump: add Relative Offset Range subtype support for Media device path (LP: #1322465)

Message ID 1400834352-30644-1-git-send-email-ivan.hu@canonical.com
State Accepted
Headers show

Commit Message

Ivan Hu May 23, 2014, 8:39 a.m. UTC
Add the subtype support.
Sub-Type 8 – Relative Offset Range.

Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
---
 src/uefi/uefidump/uefidump.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Colin Ian King May 23, 2014, 3:47 p.m. UTC | #1
On 23/05/14 09:39, Ivan Hu wrote:
> Add the subtype support.
> Sub-Type 8 – Relative Offset Range.
> 
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefidump/uefidump.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index 61e8b7c..efb2c53 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -573,6 +573,14 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
>  					p->fw_volume_name.info4[6], p->fw_volume_name.info4[7]);
>  			}
>  			break;
> +		case FWTS_UEFI_RELATIVE_OFFSET_RANGE_SUBTYPE:
> +			if (dev_path_len >= sizeof(fwts_relative_offset_range_path)) {
> +				fwts_relative_offset_range_path *r = (fwts_relative_offset_range_path *)dev_path;
> +				path = uefidump_vprintf(path, "\\RELATIVEOFFSETRANGE("
> +					"0x%" PRIx64 ",0x%" PRIx64 ")",
> +					r->starting_offset, r->ending_offset);
> +			}
> +			break;
>  		default:
>  			path = uefidump_vprintf(path, "\\Unknown-MEDIA-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype);
>  			break;
> 

For some reason I can't get this to compile. I think my repo is not in
sync with what you are building on. Perhaps we need some patches ack'd
and applied to the fwts git report and I'll try again later next week.

Colin
Ivan Hu May 25, 2014, 12:09 a.m. UTC | #2
On 05/23/2014 11:47 PM, Colin Ian King wrote:
> On 23/05/14 09:39, Ivan Hu wrote:
>> Add the subtype support.
>> Sub-Type 8 – Relative Offset Range.
>>
>> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
>> ---
>>   src/uefi/uefidump/uefidump.c |    8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
>> index 61e8b7c..efb2c53 100644
>> --- a/src/uefi/uefidump/uefidump.c
>> +++ b/src/uefi/uefidump/uefidump.c
>> @@ -573,6 +573,14 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
>>   					p->fw_volume_name.info4[6], p->fw_volume_name.info4[7]);
>>   			}
>>   			break;
>> +		case FWTS_UEFI_RELATIVE_OFFSET_RANGE_SUBTYPE:
>> +			if (dev_path_len >= sizeof(fwts_relative_offset_range_path)) {
>> +				fwts_relative_offset_range_path *r = (fwts_relative_offset_range_path *)dev_path;
>> +				path = uefidump_vprintf(path, "\\RELATIVEOFFSETRANGE("
>> +					"0x%" PRIx64 ",0x%" PRIx64 ")",
>> +					r->starting_offset, r->ending_offset);
>> +			}
>> +			break;
>>   		default:
>>   			path = uefidump_vprintf(path, "\\Unknown-MEDIA-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype);
>>   			break;
>>
>
> For some reason I can't get this to compile. I think my repo is not in
> sync with what you are building on. Perhaps we need some patches ack'd
> and applied to the fwts git report and I'll try again later next week.
>
> Colin
>

The fwts_relative_offset_range_path is defined in the fwts_uefi.h and 
included in the patch, [V2] uefi: add a test for sanity checking for the 
UEFI Boot path (LP: #1316019).
you might need to apply it first.

Ivan
Alex Hung July 24, 2014, 6:53 a.m. UTC | #3
On 05/23/2014 04:39 PM, Ivan Hu wrote:
> Add the subtype support.
> Sub-Type 8 – Relative Offset Range.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>   src/uefi/uefidump/uefidump.c |    8 ++++++++
>   1 file changed, 8 insertions(+)
>
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index 61e8b7c..efb2c53 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -573,6 +573,14 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
>   					p->fw_volume_name.info4[6], p->fw_volume_name.info4[7]);
>   			}
>   			break;
> +		case FWTS_UEFI_RELATIVE_OFFSET_RANGE_SUBTYPE:
> +			if (dev_path_len >= sizeof(fwts_relative_offset_range_path)) {
> +				fwts_relative_offset_range_path *r = (fwts_relative_offset_range_path *)dev_path;
> +				path = uefidump_vprintf(path, "\\RELATIVEOFFSETRANGE("
> +					"0x%" PRIx64 ",0x%" PRIx64 ")",
> +					r->starting_offset, r->ending_offset);
> +			}
> +			break;
>   		default:
>   			path = uefidump_vprintf(path, "\\Unknown-MEDIA-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype);
>   			break;
>

Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin July 24, 2014, 6:55 a.m. UTC | #4
On Fri, May 23, 2014 at 4:39 PM, Ivan Hu <ivan.hu@canonical.com> wrote:
> Add the subtype support.
> Sub-Type 8 – Relative Offset Range.
>
> Signed-off-by: Ivan Hu <ivan.hu@canonical.com>
> ---
>  src/uefi/uefidump/uefidump.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
> index 61e8b7c..efb2c53 100644
> --- a/src/uefi/uefidump/uefidump.c
> +++ b/src/uefi/uefidump/uefidump.c
> @@ -573,6 +573,14 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
>                                         p->fw_volume_name.info4[6], p->fw_volume_name.info4[7]);
>                         }
>                         break;
> +               case FWTS_UEFI_RELATIVE_OFFSET_RANGE_SUBTYPE:
> +                       if (dev_path_len >= sizeof(fwts_relative_offset_range_path)) {
> +                               fwts_relative_offset_range_path *r = (fwts_relative_offset_range_path *)dev_path;
> +                               path = uefidump_vprintf(path, "\\RELATIVEOFFSETRANGE("
> +                                       "0x%" PRIx64 ",0x%" PRIx64 ")",
> +                                       r->starting_offset, r->ending_offset);
> +                       }
> +                       break;
>                 default:
>                         path = uefidump_vprintf(path, "\\Unknown-MEDIA-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype);
>                         break;
> --
> 1.7.9.5
>

the patch can compile with current head in the git tree, so,

Acked-by: Keng-Yu Lin <kengyu@canonical.com>
diff mbox

Patch

diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
index 61e8b7c..efb2c53 100644
--- a/src/uefi/uefidump/uefidump.c
+++ b/src/uefi/uefidump/uefidump.c
@@ -573,6 +573,14 @@  static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
 					p->fw_volume_name.info4[6], p->fw_volume_name.info4[7]);
 			}
 			break;
+		case FWTS_UEFI_RELATIVE_OFFSET_RANGE_SUBTYPE:
+			if (dev_path_len >= sizeof(fwts_relative_offset_range_path)) {
+				fwts_relative_offset_range_path *r = (fwts_relative_offset_range_path *)dev_path;
+				path = uefidump_vprintf(path, "\\RELATIVEOFFSETRANGE("
+					"0x%" PRIx64 ",0x%" PRIx64 ")",
+					r->starting_offset, r->ending_offset);
+			}
+			break;
 		default:
 			path = uefidump_vprintf(path, "\\Unknown-MEDIA-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype);
 			break;