Age | Commit message (Collapse) | Author |
|
|
|
and make 'fdisk -v' display their names (NoAutoMount, Hidden,
Shadow, ReadOnly).
Shift 1ULL instead of 1 to make it clear these are uint64_t
flags. Makes clang happier.
|
|
and BOOTABLE, set BOOTABLE attribute bit instead of using the
incorrect GPTDOSACTIVE value, have 'fdisk -v' print out GPT
partition attributes if any of the 64 bits are set, don't spoof
any partition with REQUIRED bit set.
Prompted by kettenis@ stumbling across a machine with 40+ (!!)
REQUIRED GPT partitions.
Tested & ok kettenis@
|
|
usable LBA area of the device the GPT is currently inhabiting.
Makes GPT display as informative as MBR display.
In passing, eliminate possible underflow in partition size
calculation.
ok deraadt@
|
|
end of the device the MBR is currently inhabiting.
Prompted by some interesting MBR's from France, verbiage
suggestion from deraadt@, ok miod@
|
|
Fallout from regress failure spotted by anton@.
|
|
If neither are found, restrict user actions to printing basic
information on the disk, reading the man page, initializing an
MBR or GPT, or terminating fdisk without changing anything.
Feedback on earlier attempt by miod@ and brynet@.
|
|
Put 'setpid' description in correct place in COMMAND MODE
command list. i.e. in same order as ask_cmd() will parse
it.
Simplify ask_cmd() by displaying prompt in edit loop
rather than passing editlevel to ask_cmd().
No intentional functional change.
|
|
Tweak 'abort' description to emphasize discarding
of changes.
|
|
aligned with the code. Tweak usage() to stay in step.
Usual cogent feedback, tweaks and ok jmc@
|
|
input of excessive length.
Make 'args' parameter to Xfuncs const char * and do the multiple
argument parsing in Xswap() and Xflag() on a local copy.
|
|
No functional change.
|
|
variables inside the #ifdef DEBUG block using them.
|
|
information in /usr/mdec/mbr. Stop telling fdisk(8) that macppc
and loongson HAS_MBR, and don't bother including the file in the
base set.
macppc build/install tests and ok gkoehler@
loongson is gone deraadt@
|
|
|
|
equivalent 'update' editing command already is.
Avoids the destruction of the GPT when the preventative MBR
is overwritten with the default MBR.
ok deraadt@
|
|
protective EFI GPT partition to be in MBR partitions 0-3, not
just the default partition 0.
|
|
obvious "> 1". Use easier to spot 'ask_yn() == 0' instead of
'!ask_yn()'.
No functional change.
|
|
#define GTATTR_PROTECT and GTATTR_PROTECT_EFISYS as bits in it.
Use GTATTR_PROTECT to replace the magic value of '1' indicating
the partition is protected. Use GTATTR_PROTECT_EFISYS to replace
hack of checking for "APFS" string in the names of partitions
that want the EFI System (a.k.a. 0xEF) partition to be preserved.
More flexible and easier to extend protections to new partition
types or add new attributes to partition types.
No intentional functional change.
|
|
one easy to find spot. Wrap the long lines of gpt_types[] to
make room for future expansion.
No functional change.
|
|
simplify PRT_protected_guid() by comparing GUID's with
uuid_compare() rather than converting them to strings and using
strncmp().
Further clarify logic by doing the EFI Sys dance only if
the GUID being tested is not marked as protected.
No intentional functional change.
|
|
and PRT_type_to_uuid() to PRT_type_to_guid() so the names clearly match
the field names being searched for.
No intentional functional change.
|
|
"FAT12" for partition types that are mapped to GPT_UUID_MSDOS.
No intentional functional change.
|
|
blanks in the arrays of type names, simplifying the code and
making better use of printf().
Along the way discover that "APFS Recovery" fits, so nuke the
annoying "AFPS Recovry" contraction.
No intentional functional change.
Some "APFS Recovery" nits pointed out by jsg@
|
|
on input/initialization and back to little-endian when writing to
disk.
Easier to read the code when letoh*() and uuid_[enc|dec]_*
invocations are minimized.
No intentional functional change.
ok jmatthew@
|
|
and expose new DISK_[read|write]bytes() functions.
Eliminates many bytes <-> sector i/o dances and makes the code
much easier to understand.
Be a bit more careful to consistently write only bytes that
checksums are calculated over.
No intentional functional change.
|
|
the GPT and calculating them when writing the GPT to disk.
No need to update them in add_partition().
Pointed out by jmatthew@
|
|
interest is checked, not before.
Less confusing error messages.
|
|
big-endian architectures too.
|
|
that the partition entry table associated with the primary GPT
header at sector 1 doesn't overwrite the header or intrude into
the sectors available for partitions.
Similarly ensure that the partition entry table associated with
the alternate header does not overwrite that header or intrude
into the sectors available for partitions.
|
|
|
|
|
|
logic into GPT_get_name(), string_to_name() and name_to_string()
functions. Remove unnecessarily abstract functions ask_string(),
utf16le_to_string() and string_to_utf16le().
No intentional functional change.
|
|
Fix some whitespace and memset() parameters in passing.
No intentional functional change.
|
|
No functional change.
|
|
an index to the gp[] array by calling said parameter 'pn' and making it
const unsigned int.
No functional change.
|
|
No functional change.
|
|
gh.gh_part_num does not need a letoh32().
No functional change.
|
|
and then back to little-endian when writing to disk.
Reduces the number of invocations of the letoh*() and htole*()
functions by 90 or so. Also makes that code much easier to read.
No intentional functional change.
|
|
to get_header() with the rest of the header validity
checks.
No functional change.
|
|
Always calculate the GPT partition entries checksum over
gh_part_num * gh_part_size bytes, not the maximal size of the
internal partition entries array.
No functional change.
|
|
Always calculate the GPT header checksum over gh_size bytes
(a.k.a. 92), not sizeof(struct gpt_header). Compilers in their
wisdom may pad the struct to a nice round size, e.g. 96 bytes.
No functional change.
|
|
number of sectors a given number of GPT partition entries
require.
No intentional functional change.
|
|
jmc@ dislikes a comma before "then" in a conditional, so leave those
untouched.
ok jmc@
|
|
No intentional functional change.
|
|
scanning the GPT partition table. gh.gh_part_num reflects the actual
size of the table read from/written to the disk and scanning
possible entries between this value and the maximum allowed size
of a partition table is pointless.
No intentional functional change.
|
|
function find_gpt_type().
Use find_gpt_type() to simplify the functions obtaining
information from gpt_types[]. Add not yet used
PRT_uuid_to_protection() to allow simplification of GPT partition
protection code..
No intentional functional change.
|
|
|
|
|
|
|