mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-11-26 19:25:02 +00:00
In order to dual boot Windows and ChromeOS, Windows must
not find a GPT partition table on the disk. So change
ChromeOS to cope with an alternative signature "CHROMEOS"
instead of the standard "EFI PART"
BUG=chrome-os-partner:6108
TEST=rebuild chromeos, install it,
run cgpt legacy /dev/sda
dd if=/dev/sda of=/tmp/x bs=1k
hexdump -C /tmp/X
see the string CHROMEOS
BRANCH=link
Signed-off-by: Stefan Reinauer <reinauer@chromium.org>
Change-Id: Ia88eff33b9880bd73a78c1b8e026c1f8298c4557
Reviewed-on: https://gerrit.chromium.org/gerrit/31264
Reviewed-by: Randall Spangler <rspangler@chromium.org>
Commit-Ready: Stefan Reinauer <reinauer@chromium.org>
Tested-by: Stefan Reinauer <reinauer@chromium.org>
129 lines
2.8 KiB
C
129 lines
2.8 KiB
C
// Copyright (c) 2012 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 "cgpt.h"
|
|
|
|
// This file defines the internal methods that use the user-mode cgpt programatically.
|
|
// This is the interface for the callers such as the cgpt tool or the C++ post installer
|
|
// executable.
|
|
|
|
typedef struct CgptCreateParams {
|
|
char *drive_name;
|
|
int zap;
|
|
} 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;
|
|
uint16_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;
|
|
|
|
// This is filled in by the relevant methods in cgpt_show.c
|
|
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; // 0 for no match, 1-N for match
|
|
} CgptFindParams;
|
|
|
|
typedef struct CgptLegacyParams {
|
|
char *drive_name;
|
|
int efipart;
|
|
} CgptLegacyParams;
|
|
|
|
// create related methods.
|
|
int cgpt_create(CgptCreateParams *params);
|
|
|
|
// add/attribute/details related methods
|
|
int cgpt_add(CgptAddParams *params);
|
|
int cgpt_set_attributes(CgptAddParams *params);
|
|
int cgpt_get_partition_details(CgptAddParams *params);
|
|
|
|
// boot related methods.
|
|
int cgpt_boot(CgptBootParams *params);
|
|
int cgpt_get_boot_partition_number(CgptBootParams *params);
|
|
|
|
// show/get related methods.
|
|
int cgpt_show(CgptShowParams *params);
|
|
int cgpt_get_num_non_empty_partitions(CgptShowParams *params);
|
|
|
|
// repair related methods.
|
|
int cgpt_repair(CgptRepairParams *params);
|
|
|
|
// priority related methods.
|
|
int cgpt_prioritize(CgptPrioritizeParams *params);
|
|
|
|
// find related methods.
|
|
void cgpt_find(CgptFindParams *params);
|
|
|
|
// legacy related methods.
|
|
int cgpt_legacy(CgptLegacyParams *params);
|
|
|
|
#endif // VBOOT_REFERENCE_CGPT_CGPT_PARAMS_H_
|