OpenBSD CVS

CVS log for src/sbin/fdisk/gpt.h


[BACK] Up to [local] / src / sbin / fdisk

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.20 / (download) - annotate - [select for diffs], Wed Apr 20 17:14:35 2022 UTC (2 years, 1 month ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, HEAD
Changes since 1.19: +2 -1 lines
Diff to previous 1.19 (colored)

Sigh. Another forgotten header file.

Revision 1.19 / (download) - annotate - [select for diffs], Tue Apr 19 20:02:56 2022 UTC (2 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

Forgot a file for previous commit.

No functional change.

Revision 1.18 / (download) - annotate - [select for diffs], Wed Jul 21 12:22:54 2021 UTC (2 years, 10 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0
Changes since 1.17: +2 -1 lines
Diff to previous 1.17 (colored)

Use a dedicated struct mbr to hold the GPT protective MBR,
either the one read from disk or the default one created
when initializing GPT.

Simplifies logic, eliminates MBR_init_GPT() and demotes
MBR_protective_mbr() to a helper function called from
GPT_read().

Nuke an unused variable in passing.

No intentional functional change.

Revision 1.17 / (download) - annotate - [select for diffs], Sun Jul 18 15:28:37 2021 UTC (2 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

Make GPT_read() obtain and validate the on-disk MBR itself, via
MBR_read(), and report success/failure.

Simplifies logic and makes clearer that the protective MBR is a
required part of a GPT.

With the standardization on 0/-1 return values for helper
functions, rename 'valid' to 'error' in GPT_read() to make logic
less mind bending.

No functional change.

Revision 1.16 / (download) - annotate - [select for diffs], Thu Jul 15 21:58:02 2021 UTC (2 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

No need for separate b_sectors, b_offset and b_type variables. We have struct
prt to hold this info in one place.

Construct a struct prt to hold the boot partition information and stash it in
the struct disk for both MBR and GPT to access as needed.

Move the blocks to sectors conversions into DISK_open() with all of its
geometry friends.

No intentional functional change.

Revision 1.15 / (download) - annotate - [select for diffs], Mon Jul 12 22:18:54 2021 UTC (2 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.14: +8 -8 lines
Diff to previous 1.14 (colored)

Toss 'const' in anywhere the compiler doesn't complain about, thus identifying
places that *should* be const but currently aren't and preventing the rot from
spreading further while those issues are dealt with.

No functional change.

Revision 1.14 / (download) - annotate - [select for diffs], Sun Jul 11 13:23:18 2021 UTC (2 years, 10 months ago) by krw
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

Add tabs to make struct definitions and function prototypes easier
to read.

No functional change.

Revision 1.13 / (download) - annotate - [select for diffs], Mon Jun 28 19:50:30 2021 UTC (2 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.12: +5 -2 lines
Diff to previous 1.12 (colored)

Add another epicycle to -A processing that ensures ONLY the
partition table is changed. Not the GPT header. Not the MBR. And
only write back as much partition table information as the header
claims to have room for.

At a minimum should make -A safer when operating on the Apple M1
GPT.

A major overhaul of this code is urgently needed before someone
sneezes too hard in its vicinity.

Feedback kettenis@ & ok deraadt@

Revision 1.12 / (download) - annotate - [select for diffs], Wed Jun 16 15:40:47 2021 UTC (2 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.11: +2 -1 lines
Diff to previous 1.11 (colored)

Ensure that the '-i' command line option and the 'reinit [mbr]'
editing commnd completely remove any existing on-disk GPT header
when writing the MBR.

'-ig'/'reinit gpt' must be used to create GPT format.

Previous interactions between '-i', '-b' and overly clever
'reinit' produced surprising, inconsistent and incorrect
behaviour.

ok deraadt@ kettenis@

Revision 1.11 / (download) - annotate - [select for diffs], Sat Jun 12 17:19:13 2021 UTC (2 years, 11 months ago) by krw
Branch: MAIN
Changes since 1.10: +1 -3 lines
Diff to previous 1.10 (colored)

GPT_get_header() and GPT_get_partition_table() are only used
in gpt.c. Move declarations and rename to get_header() and
get_partition_table().

No functional change.

Revision 1.10 / (download) - annotate - [select for diffs], Wed May 19 21:49:07 2021 UTC (3 years ago) by krw
Branch: MAIN
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

No need to pass the location of the partition table to
GPT_get_partition_table() since the global 'gh' knows where it is.

Fixes a couple of missing letoh64() calls by eliminating the need for
them.

Revision 1.9 / (download) - annotate - [select for diffs], Mon May 10 17:16:01 2021 UTC (3 years ago) by krw
Branch: MAIN
Changes since 1.8: +9 -2 lines
Diff to previous 1.8 (colored)

Replace some magic numbers with #define's. Rename GPT_get_gpt() to
GPT_read() to match MBR_read().

No intentional functional change.

Revision 1.8 / (download) - annotate - [select for diffs], Thu May 6 22:26:14 2021 UTC (3 years ago) by krw
Branch: MAIN
Changes since 1.7: +2 -2 lines
Diff to previous 1.7 (colored)

GPT_get_hdr() is actually spelled GPT_get_header().

Revision 1.7 / (download) - annotate - [select for diffs], Sat Jan 30 18:16:36 2021 UTC (3 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.6: +11 -9 lines
Diff to previous 1.6 (colored)

Make editing GPT easier/safer by defaulting offet to beginning of largest
free space and preventing the creation of overlapping partitions.

Prompted & tested by landry@

Revision 1.6 / (download) - annotate - [select for diffs], Sat Jan 9 18:10:57 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.5: +4 -4 lines
Diff to previous 1.5 (colored)

Revamp the display of GPT information, hiding less important
information under the '-v' flag. This brings the GPT display more
into line with the MBR display and simplifies and hardens the parsing
of the partition info in the install scripts.

Original problem with install scripts parsing hand edited GPT
information reported by Valere Monseur via bugs@.

Man page fixes and tweaks from jmc@.
Install script changes tested & ok rpe@.

Revision 1.5 / (download) - annotate - [select for diffs], Fri Dec 11 21:57:31 2015 UTC (8 years, 5 months ago) by krw
Branch: MAIN
Changes since 1.4: +2 -2 lines
Diff to previous 1.4 (colored)

Add '-v' flag that forces the display of both GPT's and the MBR.
Useful for seeing exactly what is currently on the disk. Suggested
by a request from kettenis@.

Man page & usage ok jmc@

Revision 1.4 / (download) - annotate - [select for diffs], Sun Nov 15 01:22:39 2015 UTC (8 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

Move zapping of invalid GPT data into GPT_get_gpt() rather than
returning a value to tell callers to zap it. Use consistant idiom
to check for the presence of a GPT (check gh.gh_sig). When zapping
GPT, always zap both the header and partition table just for
paranoia's sake.

Revision 1.3 / (download) - annotate - [select for diffs], Fri Nov 13 02:27:17 2015 UTC (8 years, 6 months ago) by krw
Branch: MAIN
Changes since 1.2: +4 -4 lines
Diff to previous 1.2 (colored)

Move from opening/closing disk for every i/o to opening the disk once
and saving the fd in the global 'disk' structure. Stop passing around
fd's and just use the global.

Makes pledge() feasible.

Prompted by and ok deraadt@

Revision 1.2 / (download) - annotate - [select for diffs], Mon Oct 26 15:08:26 2015 UTC (8 years, 7 months ago) by krw
Branch: MAIN
Changes since 1.1: +8 -1 lines
Diff to previous 1.1 (colored)

Add GPT editing. Based on GSOC 2014 work by Markus Muller.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Oct 5 01:39:08 2015 UTC (8 years, 7 months ago) by krw
Branch: MAIN

Enhance '-g' to create a default GPT label in addition to the protective
MBR. If '-b' is specified an EFI System partition of the requested size is
created. All remaining space is put into an OpenBSD partition.

Minimal enhancement necessary for upcoming UEFI install support.
Committed first to flush out any unexpected impacts on 'normal' MBR
operation and install media.

ok deraadt@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.