History log of /fuchsia/zircon/system/ulib/gpt/gpt.c
Revision Date Author Comments
# 1eb09e2b 31-Jul-2018 Sean Klein <smklein@google.com>

[chromeos][gpt] Convert Chrome OS tests to C++

- Automatically track lifetimes
- No more mutable globals
- Actually closing disk file descriptor (via unique fd)

Test: /boot/test/sys/chromeos-disk-setup-test

Change-Id: I279aa6f49e3a2e1dfc7b0126b8cba0aaa25fb7e7


# 9c98fccb 22-Jun-2018 James Tucker <raggi@google.com>

[paver] migrate to new partition layout on cros

Alter the partition layout on CROS to include ZIRCON-A, ZIRCON-B and
ZIRCON-R. At this stage only ZIRCON-A will be used, but the others will
begin to be used in following changes.

Test: CQ: chromeos-disk-setup, plus manual plan below.

* Tested against a freshly "recovered" device
* Tested aginst a device paved with the prior generation paving code
* Tested against itself, repeated paving

In the manual tests above, checked `cgpt show` to verify starting state,
and inspected `lsblk` for the correct resultant state.

Change-Id: I1faa76cb2689198db84612a947d224c3ee938e30


# 05d1d15b 16-Jun-2018 Adam Barth <abarth@chromium.org>

[cprng] Update clients to zx_cprng_draw

Test: cprng, chromeos-disk-setup
Change-Id: I8fffa468ceec58a371c8eaa0c6bbdaa204e77df8


# 8f341f20 09-Jun-2018 Adam Barth <abarth@chromium.org>

[cprng] Remove short reads from zx_cprng_draw

We never actually generate short reads from zx_cprng_draw. This CL
removes the |actual| out parameter. Now zx_cprng_draw either fails or
succeeds in drawing the amount requested, simplifying clients and
removing possible mistakes.

This CL is phase 1 of the transition, which introduces the new version as
zx_cprng_draw_new. Once all the clients are migrated, we'll change
zx_cprng_draw itself, migrate all the clients back, and then remove
zx_cprng_draw_new.

Change-Id: I2219d0517f103fb999014de1e846fa8b8a5ca20c


# 7722392c 14-May-2018 Sean Klein <smklein@google.com>

[gpt] Avoid hardcoding GPT driver/library to 512 bytes

ZX-2156 #done

Change-Id: Ie36729ac910f2d06084b95aff14b785a5d57e305


# 8ca3790f 26-Apr-2018 Sean Klein <smklein@google.com>

[gpt] Add functionality to zero out partitions

ZX-2067 #comment In Progress

Change-Id: Ib1c27206225e6752f4e9992c8a6319aaca287da6


# 3874ca35 29-Nov-2017 Justin Mattson <jmatt@google.com>

[gpt][installer][chromeos-disk-setup] Move code

Move a couple of library functions from the installer library to
the GPT library. This seems like a more appropriate home and
prepares for remove of installer.

ZX-1423 #in-progress

Change-Id: Icadd85f3f4eaedb48eea9f65e77b866fac895e0d


# 0859bece 11-Dec-2017 Brian Swetland <swetland@google.com>

[gpt] unify gpt structure headers

The bootloader wants to see these, so migrate to system/zircon/hw
and try to reduce the number of slightly different versions of these
structures and defines we h ave.

ulib/gpt will need more invasive changes to use the common version
of the gpt header that does not make assumptions about the block size,
so I renamed its gpt_header to gpt_hdr_blk to more accurately reflect
what it is, to avoid conflicts until more extensive tidying up can
be done.

Change-Id: I4471ecd6332cc8d071e0bced4df900ccf2579e99


# 78cfb6d2 06-Dec-2017 James Tucker <raggi@google.com>

[gpt][minfs] add installer partition type

This partition type GUID is auto-mounted at /install and will be used by
installer USB keys and such use cases, maybe recovery.

Change-Id: I959c462182285d39b9d8943a8d785857aa7880a1


# 68c00810 02-Nov-2017 Justin Mattson <jmatt@google.com>

[ulib][chromeos-disk-setup] Add ChromeOS disk util

This also adds items in utest and uapp.

Add a library to examine and reconfigure CrOS devices for
paving. We also add a small test binary that does a dry run
of the reconfig an actual program might do if it wanted to
reconfigure the disk layout.

Change-Id: I6b06e3eadc6444d2d1c6599ddf2e3c89d0a2f7a0


# 9b154b7e 21-Nov-2017 Sean Klein <seanmarionklein@gmail.com>

[gpt] Consolidate c-string / UTF-16 conversion

Change-Id: Ic3c801ce8d5f22ae2d9c7e22254387a2bf427105


# 2ae26c8d 15-Nov-2017 Justin Mattson <jmatt@google.com>

[ulib][gpt] Updates for CrOS dual boot support

Add constants to identify typical CrOS partitions

Create a way to initialize a GPT for in-memory use without
needing to write it to disk, particularly a disk that matches
the size the GPT reports for the disk. This great improves
options for testing code which manipulates a GPT.

Change-Id: I2bcdf6fa045e6097ce6488e56891696a4aa0fbd7


# 5cf64faa 13-Nov-2017 Justin Mattson <jmatt@google.com>

[ulib][gpt] Allow single-block partitions

Partitions may have their first and last block be the same if the
partition is a single block in size.

Change-Id: I66226657d47202150205fab715b5ecd2a4294f4b


# f3e2126c 12-Sep-2017 Roland McGrath <mcgrathr@google.com>

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# b2a0e6f7 31-Aug-2017 Brian Swetland <swetland@google.com>

[gpt] improve quality of life

- show new partition table before confirmation prompt
- highlight modified fields in new partition table
- add gpt_get_diffs() to library to enable the above
- wait at confirmation prompt until y/n/ESC pressed
- add "adjust" command to move or resize partitions
- add "--live-dangerously" initial option to override
confirmation prompt for those who are very sure

Change-Id: I90e470c44053ee64f283a7ed88dc7e627b08f783


# ed665024 31-Aug-2017 Todd Eisenberger <teisenbe@google.com>

[gpt] Namespace is_.*_guid predicates

Just a library hygiene fix.

Change-Id: I5e27ca90f083ba651d67bce2193e12657c0236a0


# abe18f39 12-Jul-2017 Tricia Landers <planders@google.com>

[fs] [devmgr] Reformat unmounted partitions

Added a uapp (fixfs) which checks all block devices and
potential mount points (/data, /system, /blobstore), and
upon finding a mount point with a corresponding device
that isn't mounted, gives the option to reformat/mount it.

Currently fixfs will only reformat the first partition
matching a particular mount point. If there are multiple,
additional partitions will be ignored.

Change-Id: Ic27631011d6ad49246ef4ff42b874674cefd9b5f


# d6396fa4 16-Jun-2017 George Kulakowski <kulakowski@google.com>

[ulib][status] Use the MX_OK and MX_ERR_* mx_status_t names

Change-Id: I3ba531de766b559b8922fb4910715c630efc9b82


# 804e2385 31-May-2017 Mike Voydanoff <voydanoff@google.com>

[uapp][gpt] Make "gpt init" clear existing GPT partition maps

"gpt init" was able to create new gpt partition maps where none
existed before, but was not actually reinitializing existing
partition maps.

Change-Id: Ie2dbabc65d32a8e9076e730f13560648a3b2c2a3


# 87a8d0b9 11-May-2017 Sean Klein <smklein@google.com>

[gpt] Fix memory leaks in gpt_device_init

Change-Id: Iec66a045a571587516b2792a042641007f2e44e5


# 7b9e4646 12-Apr-2017 Justin Mattson <jmatt@google.com>

[ulib][gpt] Actually generate a GUID for the disk

Make good on promises.

Change-Id: I88c377d3fc7325bc2077499bcb0c4a4a5de353a8


# 0cc6c15d 10-Apr-2017 Justin Mattson <jmatt@google.com>

[ulib][gpt] Add API to get disk GUID from header

The GPT lib loads this data, but doesn't expose it directly,
until now.

Change-Id: I3e1d8f900efafcf77e2c7bb0cf86290c19c4a912


# 67068bdb 28-Mar-2017 Sean Klein <smklein@google.com>

[gpt] Make GPT tool more usable; update MinFS instructions

- Remove the "Default block device". On real hardware, magically
updating a potentially random device is a recipe for disaster.
- Add operation to ulib/gpt to query usable range of GPT, so user
does not need to calculate size of metadata themselves.
- Add operation to uapp/gpt to initialize empty gpt, so the range of
the GPT may subsequently be queried.
- Improve uapp/gpt usage description to document tool.
- Update uapp/gpt tool to print all block ranges in decimal,
not hex.
- Update uapp/gpt to add partitions by range (start, end), matching
the range presented by the "dump" command.
- Update MinFS instructions to use less "magic" (no assumptions about
underlying block size), and use the new GPT instructions.

Change-Id: Idbb9f6104d0f9b9d8d6efd685686a29a4e4f7e82


# d0e3829a 13-Nov-2016 Sean Klein <smklein@google.com>

[udev][gpt] Returning GUID as uint8_t array, not string

This change relocates the "uint8 to string" utility to the GPT library,
and adds a dependency on the GPT library where previously applications
(devmgr and lsblk) sent ioctls directly to the GPT driver.

This change intentionally copies the "uint8 to string" utility from the
gpt driver to the gpt library -- the copy is not shared, to avoid making
a dependency from a device driver on a larger ulib library.

Change-Id: I6368a8409d5322c1424c2ae1c550744f1b073fff


# 19005180 27-Sep-2016 Doug Evans <dje@google.com>

[userspace] Use PRI?64 macros instead of %ll?

Bug: MG-164

This is the official way to print *int64_t types.

Change-Id: Ib4c7c814a62678650b1691bc1925635235ade217


# 4768386a 18-Aug-2016 Brian Swetland <swetland@google.com>

[lib][cksum] new style build config of shared user/kernel libraries

1. The kernel build globs all includes into one global -I space, but
the user build depends on public includes being relative to the
module source, so the "canonical" source needs to live in the
.../ulib/$module/... space so .../ulib/$module/include/...
contains the public headers:

This is third_party/ulib/cksum for libcksum

2. The kernel version of the module simply needs to reference the
canonical source and contains only a rules.mk, as in:

third_party/lib/cksum

3. If there are public headers, the kernel side rules.mk must
add them to the kernel include space, like the above does:

KERNEL_INCLUDES += $(SRC_DIR)/include

Change-Id: Ia1a5af22844f22e2c027dcaea7e7b7cf35d00ab2


# 66a201f1 16-Aug-2016 Brian Swetland <swetland@frotz.net>

[system] align license and license banners with Fuchsia

This adjusts the Magenta userspace code to match the prevailing
license in Fuchsia (three-clause BSD), using the same banner
and license text.

Change-Id: I6b6d79435c5dbaa32027888874849e4f47aaa7be


# 601836c8 05-Aug-2016 Yvonne Yip <yky@google.com>

[ulib] add gpt manipulation library and utility

Change-Id: I2f9bb765fd26f97e2e88dc239bc2ab43d6e3af00