Ensure that the '-i' command line option and the 'reinit [mbr]'
authorkrw <krw@openbsd.org>
Wed, 16 Jun 2021 15:40:47 +0000 (15:40 +0000)
committerkrw <krw@openbsd.org>
Wed, 16 Jun 2021 15:40:47 +0000 (15:40 +0000)
commitc94b0391c2425cf229f3d2fc83575cde3a9c2897
treef3b8e0e808539dccc35a4bef7aae4038fdb131cd
parent627c97d9222ce740183124bc06e26a24c28a3a30
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@
sbin/fdisk/cmd.c
sbin/fdisk/fdisk.8
sbin/fdisk/gpt.c
sbin/fdisk/gpt.h
sbin/fdisk/mbr.c
sbin/fdisk/mbr.h