History log of /openbsd/sbin/fdisk/cmd.c (Results 1 – 25 of 180)
Revision Date Author Comments
# 01a159e4 01-Mar-2024 krw <krw@openbsd.org>

Allow fdisk(8) to add GPT partitions of protected types.

This makes it possible to provision virtual machine images that
need a "BIOS Boot" partition.

Report, original diff and testing by Christian

Allow fdisk(8) to add GPT partitions of protected types.

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@

show more ...


# 14c04d21 18-Nov-2023 krw <krw@openbsd.org>

Scan past whitespace before checking if flag string starts
with "0x".

Pointed out by Philippe Meunier.


# 54ee4acd 10-Nov-2023 krw <krw@openbsd.org>

GPT partitions have many attributes. Don't stomp on them all when
using 'flag <part #>' to make a partition the only bootable partition.
Just turn off the bootable bit in the other partitions.

ok dl

GPT partitions have many attributes. Don't stomp on them all when
using 'flag <part #>' to make a partition the only bootable partition.
Just turn off the bootable bit in the other partitions.

ok dlg@

show more ...


# 85135147 10-Nov-2023 krw <krw@openbsd.org>

Enhance 'flag' to accept hex values in addition to the current 0
.. INT64_MAX decimal values..

Easier to specify the 64 bits of GPT partition attributes and
0x8000000000000000 (a.k.a. MS_NOAUTOMOUN

Enhance 'flag' to accept hex values in addition to the current 0
.. 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@

show more ...


# 717a7d06 10-Apr-2023 krw <krw@openbsd.org>

Make GPT display of menu hex octet the same as the MBR display.
i.e. two digits.


# f3cf20a5 09-Apr-2023 krw <krw@openbsd.org>

Refactor and simplify GPT menu selection logic.

No intentional functional change.


# d8f6db85 07-Apr-2023 krw <krw@openbsd.org>

Oops. Missed files in last commit.


# 490259bd 31-Mar-2023 krw <krw@openbsd.org>

Be more consistent in function naming. Functions taking or
returning struct uuid's use 'uuid' in their names.

Lengthen a pointlessly short line.

No functional change.


# e3f6ba90 29-Mar-2023 krw <krw@openbsd.org>

Change 'type' to 'menuid' in various struct's, functions and
variables related to gpt partitions. Makes it clear that there is
no required tie between mbr partition types and gpt partition
types.

No

Change 'type' to 'menuid' in various struct's, functions and
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.

show more ...


# 43277e5d 29-Mar-2023 krw <krw@openbsd.org>

Simplify code by having PRT_uuid_to_type() return -1 when
no type can be found. 0 is a valid type!

No functional change.


# a0193349 26-Mar-2023 krw <krw@openbsd.org>

Pass lbuf/lbuflen to PRT_print_[mbr|gpt]_menu() to allow changes
to the original input. Just zap it for now.

No functional change.


# 24a7e0dd 25-Mar-2023 krw <krw@openbsd.org>

Make *_name fields char * instead of char[]. Specify desired
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

Make *_name fields char * instead of char[]. Specify desired
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.

show more ...


# 934b6408 25-Mar-2023 krw <krw@openbsd.org>

Rename *_sname fields/functions to *_name to remove implied
shortness of the names.

No functional change.


# 5f7fe693 04-Mar-2023 krw <krw@openbsd.org>

Use nitems() in the simple iterations over mbr->mbr_prt[].

No intentional functional change.


# 8c6d22ae 04-Mar-2023 krw <krw@openbsd.org>

Toss in some const's to ensure that static data pointed to
by function return values is not fiddled with.

No intentional functional change.


# 95a0034f 11-Sep-2022 krw <krw@openbsd.org>

Add #define's for GPT partition attribute bits REQUIRED, IGNORE
and BOOTABLE, set BOOTABLE attribute bit instead of using the
incorrect GPTDOSACTIVE value, have 'fdisk -v' print out GPT
partition att

Add #define's for GPT partition attribute bits REQUIRED, IGNORE
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@

show more ...


# 9ba61043 25-Jul-2022 krw <krw@openbsd.org>

Only MBR and GPT structures can be edited by fdisk.

If neither are found, restrict user actions to printing basic
information on the disk, reading the man page, initializing an
MBR or GPT, or termin

Only MBR and GPT structures can be edited by fdisk.

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@.

show more ...


# c5fb5a34 10-Jul-2022 krw <krw@openbsd.org>

Add some anti-feline input protection by refusing to process
input of excessive length.

Make 'args' parameter to Xfuncs const char * and do the multiple
argument parsing in Xswap() and Xflag() on a

Add some anti-feline input protection by refusing to process
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.

show more ...


# 63400da5 10-Jul-2022 krw <krw@openbsd.org>

Use nice #define's for input buf size and output help buf size.

No functional change.


# 44ce0cac 09-May-2022 krw <krw@openbsd.org>

Replace a stray 0xA6 with DOSPTYP_OPENBSD. Tweak a ">= 2" to more
obvious "> 1". Use easier to spot 'ask_yn() == 0' instead of
'!ask_yn()'.

No functional change.


# e48f25a4 06-May-2022 krw <krw@openbsd.org>

Rename PRT_uuid_to_[protection|typename] to PRT_uuid_to_[protected|sname],
and PRT_type_to_uuid() to PRT_type_to_guid() so the names clearly match
the field names being searched for.

No intentional

Rename PRT_uuid_to_[protection|typename] to PRT_uuid_to_[protected|sname],
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.

show more ...


# 2de77560 28-Apr-2022 krw <krw@openbsd.org>

Convert the internal GPT partition entries into host-endian form
on input/initialization and back to little-endian when writing to
disk.

Easier to read the code when letoh*() and uuid_[enc|dec]_*
in

Convert the internal GPT partition entries into host-endian form
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@

show more ...


# 45a092d7 24-Apr-2022 krw <krw@openbsd.org>

Use warnx() if errno is not relevant. close() after errno of
interest is checked, not before.

Less confusing error messages.


# a66d82b0 20-Apr-2022 krw <krw@openbsd.org>

Simpify code manipulating GPT partition names by coalescing
logic into GPT_get_name(), string_to_name() and name_to_string()
functions. Remove unnecessarily abstract functions ask_string(),
utf16le_t

Simpify code manipulating GPT partition names by coalescing
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.

show more ...


# e4e9ede8 20-Apr-2022 krw <krw@openbsd.org>

Eliminate some local pointers to gp[pn] and just use gp[pn].

Fix some whitespace and memset() parameters in passing.

No intentional functional change.


12345678