Age | Commit message (Collapse) | Author |
|
This makes it possible to provision virtual machine images that
need a "BIOS Boot" partition.
Report, original diff and testing by Christian Ludwig. Thanks!
ok miod@
|
|
with "0x".
Pointed out by Philippe Meunier.
|
|
using 'flag <part #>' to make a partition the only bootable partition.
Just turn off the bootable bit in the other partitions.
ok dlg@
|
|
.. INT64_MAX decimal values..
Easier to specify the 64 bits of GPT partition attributes and
0x8000000000000000 (a.k.a. MS_NOAUTOMOUNT, a.k.a. 1 << 63)
becomes accessable.
Prompted by bug report and testing by Philippe Meunier. Thanks!
ok dlg@
|
|
i.e. two digits.
|
|
No intentional functional change.
|
|
|
|
returning struct uuid's use 'uuid' in their names.
Lengthen a pointlessly short line.
No functional change.
|
|
variables related to gpt partitions. Makes it clear that there is
no required tie between mbr partition types and gpt partition
types.
No functional change.
|
|
no type can be found. 0 is a valid type!
No functional change.
|
|
to the original input. Just zap it for now.
No functional change.
|
|
width of output in printf() rather than "%-*s" and sizeof(name) +
1. Clearer, may even save some bytes as many names are shorter
than the max.
Rename PRT_print_mbrtypes() to PRT_print_mbrmenu() and
PRT_print_gpttypes() to PRT_print_gptmenu() to remove implied
completeness of list presented in menu.
No functional change.
|
|
shortness of the names.
No functional change.
|
|
No intentional functional change.
|
|
by function return values is not fiddled with.
No intentional functional change.
|
|
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@
|
|
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@.
|
|
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.
|
|
obvious "> 1". Use easier to spot 'ask_yn() == 0' instead of
'!ask_yn()'.
No 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.
|
|
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@
|
|
interest is checked, not before.
Less confusing error messages.
|
|
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.
|
|
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.
|
|
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.
|
|
uint64_t values.
|
|
CHS information as required when writing MBR to disk, editing a partition in CHS
mode or printing MBR.
No intentional functional change.
|
|
conversion formula
LBA = (C Ã HPC + H) Ã SPT + (S â 1)
instead of the equivalent tortuous arithmetic used in PRT_fix_BN().
No intentional functional change.
|
|
|
|
to align with GPT functions. Simplifies logic and eliminates the
magic invocations to print the header.
No functional change.
|
|
-l, -c/-h/-s or DIOCGPDINFO) should be enough for anyone.
|
|
Remove now pointless NULL check in unit_lookup().
No intentional functional change.
|
|
goto's.
Rename CMD_SAVE to CMD_QUIT to reflect actual command (Xquit) and
help and man page verbiage.
No intentional functional change.
|
|
shrinking static data demands. Split PRT_printall() into
PRT_print_mbrtypes() and PRT_print_gpttypes() to eliminate
pointless 'pseudo' MBR partition types and pointless display of
MBR partition types with no associated GPT GUIDs.
Eases future MBR and GPT partition type editing improvements.
ok kettenis@
|
|
id's that have no associated GUID, rather than disabling the
partition.
If the current partition type is a GUID with no corresponding
partition id, display and use that GUID as the default value.
Less surprising behaviour all round.
|
|
|
|
place.
Allows single-digit partition id's in '-b' as a side benefit.
|
|
parsing more robust (e.g. 'edit 0 ' is now accepted) and strict
(e.g. 'reinit gptx' is now rejected).
Input which may want that whitespace is not trimmed (e.g. GPT
partition names).
Use consistent definition of whitespace corresponding to that
used by isspace().
|
|
string_from_line(). Just errx() inside string_from_line() if
getline() fails.
Use strcspn() idiom to nuke '\n' returned by getline().
No functional change.
|
|
calling it from Xhelp(). Move declaration of struct cmd to nestle
next to its only instantiation (cmd_table) and use nitems() when
scanning cmd_table.
No functional change.
|
|
|
|
code.
'-g' is promoted to be independant of '-i'. This makes it clearer
that there are four mutually exclusive initialization options.
'-i' puts the default MBR on disk, '-g' puts the default GPT on
disk, '-u' updates the MBR boot code on disk and '-A' puts a new
set of GPT partitions on disk without overwriting 'protected'
partitions.
The last initialization option specified is the one executed, so
existing '-i -g' finger memory, etc. continue to work as before.
man page/usage feedback/tweaks from jmc@
|
|
|
|
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.
|
|
need to pass the value to MBR_write().
Let MBR_write() do the translation from struct mbr to the
struct dos_mbr that will be written to the disk. Thus
eliminating unnecessary struct dos_mbr variables and the
parsing thereof.
No intentional functional change.
|
|
partition array. So no need to memset(0) the gpt header before each
MBR_init() invocation.
No functional change.
|
|
No functional change.
|