Age | Commit message (Collapse) | Author |
|
aligned with the code. Tweak usage() to stay in step.
Usual cogent feedback, tweaks and ok jmc@
|
|
equivalent 'update' editing command already is.
Avoids the destruction of the GPT when the preventative MBR
is overwritten with the default MBR.
ok deraadt@
|
|
interest is checked, not before.
Less confusing error messages.
|
|
auto-allocating the space on a disk whose GPT contains
any of the magic Apple partitions.
One step towards saving the firmware files on Apple
M1 machines when installing OpenBSD.
Tested & ok kettenis@
|
|
|
|
any boot partition specified via '-b' or /usr/mdec/mbr; at the
power of 2 block after the first track; or immediately following
the MBR if there is only one track.
Mark any non-EFISYS boot partition created by -b as DOSACTIVE.
Suggested by kettenis@, better than a separate new option.
Brings -b behaviour into line with many uses of -e to create boot
partitions, allowing for the eventual elimination of said -e uses
in the creation of the various boot media and in the install
scripts.
|
|
"rpath wpath" from the pledge() invocation. Makes default_dmbr information
available to DISK_open().
No intentional functional change.
|
|
Those architectures needing either MBR boot code (amd64, i386,
landisk) or special boot partitions (macppc, loongson) have long
used /usr/mdec/mbr to provide that information.
Other architectures should not blindly write i386/amd64 boot code
into the MBR.
Fail quickly if the desired default MBR file is missing.
Prompted by deraadt@, tweak from kettenis@.
|
|
Allow any value from 1 to UINT32_MAX.
MBR boot partition sizes/offsets are completely machine dependent.
Pointed out by loongson.
|
|
|
|
That's what 'bootable' means in the MBR world. GPT
partitions created by '-b' are unaffected.
Pointed out by kettenis@, obviating need for new option.
|
|
place.
Allows single-digit partition id's in '-b' as a side benefit.
|
|
sure the same verbiage is emitted as previously. i.e. "Writing
MBR at offset 0". Fixes regress complaints.
|
|
cases. Make it so.
In passing nuke a single use 'error' variable and move an *errstr
declaration nearer to its friends.
No intentional 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.
|
|
a separate function.
No functional change.
|
|
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.
|
|
following an invocation of MBR_read() with a call to MBR_parse().
No functional change.
|
|
partition array. So no need to memset(0) the gpt header before each
MBR_init() invocation.
No functional change.
|
|
No functional change.
|
|
|
|
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.
|
|
partition geometry info, into DISK_open(). Resulting in clearer logic.
No intentional functional change.
|
|
No functional change.
|
|
Change 'offset' to mbr_lba_self and 'reloffset'
to mbr_lba_firstembr to make their use more evident.
Adjust a few parameter names to match.
Change 'part[]' to mbr_prt[] to reflect that it is an
array of struct prt.
No functional change.
|
|
and crc32().
No functional change.
|
|
to read.
No functional change.
|
|
No functional change.
|
|
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@
|
|
BLOCKALIGNMENT. This will make it more obvious where this
512-byte block count could/should be converted to a disk sector
count.
No functional change.
|
|
Tweak man page.
|
|
counts.
Tweak man page accordingly.
Requested by deraadt@ and kettenis@.
|
|
special boot partitions needed by some hardware. Make it
difficult to add, delete or modify those partitions with 'fdisk
-e'.
Trim back and correct syntax in usage(). Whack at man page
verbiage.
Suggestions and ok deraadt@
|
|
Extend the syntax to allow the boot partition offset and boot
partition type to be specified if needed.
ok deraadt@ kettenis@
|
|
couple of places but never checked. Retire it.
No functional change.
|
|
0xEE (DOSPTYP_EFI) partition, or -1 no usable such partition is found.
Adopt a consistent idiom to capture the index for future use.
Clean up the gpt_chk_mbr() logic to make it clearer what constraints
are being applied when looking for the DOSTYP_EFI partition.
No intentional functional change.
|
|
GPT_read() to match MBR_read().
No intentional functional change.
|
|
|
|
choosing MBR partitioning.
|
|
While here, delete some extra #includes and apply style(9) sort rules.
ok deraadt@ krw@ mpi@
|
|
often confusing than useful these days. Stop emitting them.
Prompted by bugs@ report of the 8TB disk travails of Jiri.
ok deraadt@ tom@
|
|
This diff by deraadt was overlooked far too many times, mostly by me.
It's the original fix of the pledge disklabel breakage found by espie.
diff by deraadt; ok semarie, tb.
|
|
OK krw@
|
|
together three boolean values. In today's englightened world we
know about '||'.
Pointed out by naddy@
|
|
Suggestion, original diff and ok naddy@
|
|
Useful for seeing exactly what is currently on the disk. Suggested
by a request from kettenis@.
Man page & usage ok jmc@
|