History log of /openbsd/sbin/fdisk/cmd.c (Results 51 – 75 of 180)
Revision Date Author Comments
# 386fe449 17-Jul-2021 krw <krw@openbsd.org>

Change edit/gedit/setpid/gsetpid to return 0/-1 to indicate success or failure
as all other helpers do.

Makes it clear that X* functions are in charge of deciding which CMD_* value
they return to ma

Change edit/gedit/setpid/gsetpid to return 0/-1 to indicate success or failure
as all other helpers do.

Makes it clear that X* functions are in charge of deciding which CMD_* value
they return to main edting loop. Reduces unnecessary copying/restoring of
original partition information.

No intentional functional change.

show more ...


# 2ea83235 16-Jul-2021 krw <krw@openbsd.org>

Change PRT_protected_guid() to take native order uuid's instead of little endian
uuid's. This brings it into line with all the other PRT_ functions taking uuid
parameters.

While adapting gsetid(), i

Change PRT_protected_guid() to take native order uuid's instead of little endian
uuid's. This brings it into line with all the other PRT_ functions taking uuid
parameters.

While adapting gsetid(), introduce separate partition type and partition guid
variables to make the logic clearer.

No intentional functional change.

show more ...


# 199eafea 15-Jul-2021 krw <krw@openbsd.org>

No need for separate b_sectors, b_offset and b_type variables. We have struct
prt to hold this info in one place.

Construct a struct prt to hold the boot partition information and stash it in
the st

No need for separate b_sectors, b_offset and b_type variables. We have struct
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.

show more ...


# 0cd9e2af 13-Jul-2021 krw <krw@openbsd.org>

Disk sector addresses are normally stored/provided in uint64_t
variables/parameters, not off_t.

Adjust various parameters and variables accordingly. A few missed const's
and verbiage tweaks in passi

Disk sector addresses are normally stored/provided in uint64_t
variables/parameters, not off_t.

Adjust various parameters and variables accordingly. A few missed const's
and verbiage tweaks in passing.

No functional change.

show more ...


# 859be6c9 12-Jul-2021 krw <krw@openbsd.org>

Toss 'const' in anywhere the compiler doesn't complain about, thus identifying
places that *should* be const but currently aren't and preventing the rot from
spreading further while those issues are

Toss 'const' in anywhere the compiler doesn't complain about, thus identifying
places that *should* be const but currently aren't and preventing the rot from
spreading further while those issues are dealt with.

No functional change.

show more ...


# 4d10198c 12-Jul-2021 krw <krw@openbsd.org>

Final batch of struct field name tweaks. 'cmd_' for cmd, ut_' for
unit_types, 'pt_' for part_type, 'pg_' for protected_guid.

No functional change.


# 33e90638 12-Jul-2021 krw <krw@openbsd.org>

Add 'dk_' prefix to struct disk field names.

No functional change.


# ee38fe33 11-Jul-2021 krw <krw@openbsd.org>

Add 'prt_' prefix to struct prt field names.

Use 'dp' instead of 'prt' for struct dos_partition *
paramters, and 'prt' instead of 'partn' for struct prt *
parameters.

No functional change.


# 061e6e0a 11-Jul-2021 krw <krw@openbsd.org>

Add 'mbr_' prefix to struct mbr field names.

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

Add 'mbr_' prefix to struct mbr field names.

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.

show more ...


# 543185b3 11-Jul-2021 krw <krw@openbsd.org>

Move ask_cmd(), ask_num(), ask_pid(), ask_string(), parse_b()
and crc32().

No functional change.


# 8c10a749 11-Jul-2021 krw <krw@openbsd.org>

Add tabs to make variable declarations easier
to read.

No functional change.


# 2a536aa2 11-Jul-2021 krw <krw@openbsd.org>

'return' is not a function call.

No functional change.


# c2fbfd6d 28-Jun-2021 krw <krw@openbsd.org>

Add another epicycle to -A processing that ensures ONLY the
partition table is changed. Not the GPT header. Not the MBR. And
only write back as much partition table information as the header
claims t

Add another epicycle to -A processing that ensures ONLY the
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@

show more ...


# 95e8765c 21-Jun-2021 krw <krw@openbsd.org>

Add -A option to "safely" initialize a GPT without removing
special boot partitions needed by some hardware. Make it
difficult to add, delete or modify those partitions with 'fdisk
-e'.

Trim back an

Add -A option to "safely" initialize a GPT without removing
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@

show more ...


# c94b0391 16-Jun-2021 krw <krw@openbsd.org>

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 f

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@

show more ...


# 87fdd627 14-Jun-2021 krw <krw@openbsd.org>

Only use of 'reinited' died in cmd.c r1.100. It is now set in a
couple of places but never checked. Retire it.

No functional change.


# 2b27cdd3 13-Jun-2021 krw <krw@openbsd.org>

Have gedit() and gsetpid() both return CMD_CLEAN if no data has
changed, thus keeping the modified indicator correct and avoiding
early bailout when editing a gpt partition w/o changing the type.


# 142a1f8c 13-Jun-2021 krw <krw@openbsd.org>

Tweak gsetpid() to restore partition info in case of an error,
and mark the partition dirty only if something changed.

More aligned with gedit() and safer when invoked directly from
Xsetpid().


# f05f27a7 11-Jun-2021 krw <krw@openbsd.org>

Add local functions edit() and setpid().

Reduce Xedit()/Xsetpid() to parsing the partition number and
invoking [g]edit()/[g]setpid() appropriately.

No intentional functional change.


# 320e14e3 11-Jun-2021 krw <krw@openbsd.org>

Take a bit more obvious care in gedit() to restore original
partition information when one of the modification steps (e.g.
setting the partition type via gsetpid()) fails.


# c2b81596 11-Jun-2021 krw <krw@openbsd.org>

No need to parse partition number more than necessary. Just pass
a parsed number to the helper functions gedit() and gsetpid().

No functional change.


# 8c167299 10-Jun-2021 krw <krw@openbsd.org>

Another hand rolled partition number parsing bites the dust.


# 29fb24ff 10-Jun-2021 krw <krw@openbsd.org>

Missed an occurance of hand rolled partition number parsing.

No intentional funtional change.


# 996aff7b 10-Jun-2021 krw <krw@openbsd.org>

Abstract repeated parsing of partition numbers into parsepn() to
simplify the code.

No intentional funtional change.


# e61c149e 10-Jun-2021 krw <krw@openbsd.org>

Local functions don't need to be in .h files, nor do they need the
all caps prefixes.

No functional change.


12345678