mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-24 02:05:01 +00:00
This CL accesses the partition entry array through its header's
entries_lba value.
Previously, we assume the primary entry array lies on third sector, and
the secondary array lies (1 + 32) sectors from disk end. This assumption
was fine, even Wikipedia assumed the same.
But in order for us to support writing boot code to the third sector (as
required by some Freescale board), the primary entry array must be moved
to another location. Therefore, we must use "entries_lba" to locate the
arrays from now on.
BRANCH=none
BUG=chromium:406432
TEST=unittest
TEST=`cgpt create -p` and then `cgpt show`. Make sure the table
header and entries are properly moved.
Change-Id: Ia9008b0bb204f290b1f6240df562ce7d3a9bbff2
Reviewed-on: https://chromium-review.googlesource.com/213861
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Tested-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Nam Nguyen <namnguyen@chromium.org>
Tested-by: Nam Nguyen <namnguyen@chromium.org>
101 lines
1.9 KiB
C
101 lines
1.9 KiB
C
// Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#ifndef VBOOT_REFERENCE_CGPT_CGPT_PARAMS_H_
|
|
#define VBOOT_REFERENCE_CGPT_CGPT_PARAMS_H_
|
|
#include <stdint.h>
|
|
|
|
#include "gpt.h"
|
|
|
|
enum {
|
|
CGPT_OK = 0,
|
|
CGPT_FAILED,
|
|
};
|
|
|
|
typedef struct CgptCreateParams {
|
|
char *drive_name;
|
|
int zap;
|
|
uint64_t size;
|
|
uint64_t padding;
|
|
} CgptCreateParams;
|
|
|
|
typedef struct CgptAddParams {
|
|
char *drive_name;
|
|
uint32_t partition;
|
|
uint64_t begin;
|
|
uint64_t size;
|
|
Guid type_guid;
|
|
Guid unique_guid;
|
|
char *label;
|
|
int successful;
|
|
int tries;
|
|
int priority;
|
|
uint32_t raw_value;
|
|
int set_begin;
|
|
int set_size;
|
|
int set_type;
|
|
int set_unique;
|
|
int set_successful;
|
|
int set_tries;
|
|
int set_priority;
|
|
int set_raw;
|
|
} CgptAddParams;
|
|
|
|
typedef struct CgptShowParams {
|
|
char *drive_name;
|
|
int numeric;
|
|
int verbose;
|
|
int quick;
|
|
uint32_t partition;
|
|
int single_item;
|
|
int debug;
|
|
int num_partitions;
|
|
} CgptShowParams;
|
|
|
|
typedef struct CgptRepairParams {
|
|
char *drive_name;
|
|
int verbose;
|
|
} CgptRepairParams;
|
|
|
|
typedef struct CgptBootParams {
|
|
char *drive_name;
|
|
uint32_t partition;
|
|
char *bootfile;
|
|
int create_pmbr;
|
|
} CgptBootParams;
|
|
|
|
typedef struct CgptPrioritizeParams {
|
|
char *drive_name;
|
|
uint32_t set_partition;
|
|
int set_friends;
|
|
int max_priority;
|
|
int orig_priority;
|
|
} CgptPrioritizeParams;
|
|
|
|
typedef struct CgptFindParams {
|
|
char *drive_name;
|
|
int verbose;
|
|
int set_unique;
|
|
int set_type;
|
|
int set_label;
|
|
int oneonly;
|
|
int numeric;
|
|
uint8_t *matchbuf;
|
|
uint64_t matchlen;
|
|
uint64_t matchoffset;
|
|
uint8_t *comparebuf;
|
|
Guid unique_guid;
|
|
Guid type_guid;
|
|
char *label;
|
|
int hits;
|
|
int match_partnum; /* 1-based; 0 means no match */
|
|
} CgptFindParams;
|
|
|
|
typedef struct CgptLegacyParams {
|
|
char *drive_name;
|
|
int efipart;
|
|
} CgptLegacyParams;
|
|
|
|
#endif // VBOOT_REFERENCE_CGPT_CGPT_PARAMS_H_
|