History log of /openbsd/sbin/fdisk/cmd.c (Results 101 – 125 of 180)
Revision Date Author Comments
# 5f3fed51 26-Mar-2015 krw <krw@openbsd.org>

Expand internal representation of partition starting LBA and size
to 64 bits, adjusting printf()'s, etc. as required. Preparing for
GPT partitions. Add 't' size unit. No other intentional functional

Expand internal representation of partition starting LBA and size
to 64 bits, adjusting printf()'s, etc. as required. Preparing for
GPT partitions. Add 't' size unit. No other intentional functional
change.

show more ...


# cd6317e3 19-Mar-2015 krw <krw@openbsd.org>

When zapping the GPT at the end of the disk, don't use disk.size
to get the location. disk.size is a 32 bit value for MBR use. Use
DL_GETDSIZE(&dl) to get the real location even on 'big' disks.


# 9317a2dd 18-Mar-2015 krw <krw@openbsd.org>

Stop passing around little used 'struct mbr tt' parameter. Just
make the initial mbr that tt pointed at a global that can be directly
accessed in the couple of places it is needed.

Fewer parameters

Stop passing around little used 'struct mbr tt' parameter. Just
make the initial mbr that tt pointed at a global that can be directly
accessed in the couple of places it is needed.

Fewer parameters, less confusion, no functional change.

show more ...


# 00ce9576 17-Mar-2015 krw <krw@openbsd.org>

Stop passing around little used and superfluous 'offset' parameter.
Just use the offset recorded/parsed in the struct mbr being used.

Can still traverse/edit extended MBRs so offset really wasn't ne

Stop passing around little used and superfluous 'offset' parameter.
Just use the offset recorded/parsed in the struct mbr being used.

Can still traverse/edit extended MBRs so offset really wasn't needed.

Fewer parameters, less confusion, no functional change.

show more ...


# ac519580 16-Mar-2015 krw <krw@openbsd.org>

Stop passing around a pointer to the stack variable 'disk' in main().
There is only one disk being worked on, so just make it a global.

Fewer parameters, less confusion, no functional change.


# 7126966c 14-Mar-2015 krw <krw@openbsd.org>

Whitespace & KNF tweaks. Change functions whose return values are
not checked to void. Use continue inside a do loop instead of a
goto to the top. Move a #define/#undef more local to use. Eliminate
s

Whitespace & KNF tweaks. Change functions whose return values are
not checked to void. Use continue inside a do loop instead of a
goto to the top. Move a #define/#undef more local to use. Eliminate
some lint.

General cleanup of things noticed preparing the big churn.

No intentional functional change.

show more ...


# 10a68084 14-Mar-2015 krw <krw@openbsd.org>

Switch all the license blocks to the standard OpenBSD/ISC license.

With the permission of Toby.

ok deraadt@


# 3f4f9081 10-Feb-2015 krw <krw@openbsd.org>

If 'write' is issued after a 'reinit' command, and the MBR to be
written does not contain an EFI partition, zap any GPT signature
found on the 2nd (LBA 1) and last sectors on the disk. The install
sc

If 'write' is issued after a 'reinit' command, and the MBR to be
written does not contain an EFI partition, zap any GPT signature
found on the 2nd (LBA 1) and last sectors on the disk. The install
script uses this sequence.

This is a temporary workaround until more GPT support is imported
post-5.7.

Should fix at least some machines who insist on using the GPT even
after we have overritten the 'protective' MBR.

ok deraadt@ tedu@ beck@ millert@

show more ...


# ab12137e 09-Feb-2015 krw <krw@openbsd.org>

Rename 'm_flag' to 'e_flag' since it's '-e' that sets it. Rename
'User_modify' to 'USER_edit' for the same reason.


# adf455db 31-Mar-2014 krw <krw@openbsd.org>

Use return value constants to make effects clearer than the use
of an intermediate variable. No intended functional change.


# 49241bda 31-Mar-2014 krw <krw@openbsd.org>

Whitespace rectification.


# e8252b55 20-Mar-2014 krw <krw@openbsd.org>

Add back various #includes of err.h, unistd.h, ctype.h, ioctl.h to
eliminate multiple 'implicit' declarations introduced by the previous
over-zealous #include cleanup.

Thanks to to tedu@ for pointin

Add back various #includes of err.h, unistd.h, ctype.h, ioctl.h to
eliminate multiple 'implicit' declarations introduced by the previous
over-zealous #include cleanup.

Thanks to to tedu@ for pointing out how -Wall reveals all.

show more ...


# a5472107 17-Mar-2014 krw <krw@openbsd.org>

Nuke pointless blank lines, defines, comments and casts. Eliminate
#include in *.h files in favour of listing them as required in the *.c
files. Fix error message to correctly state that 64 is the mi

Nuke pointless blank lines, defines, comments and casts. Eliminate
#include in *.h files in favour of listing them as required in the *.c
files. Fix error message to correctly state that 64 is the minimum
value for -l. Use errx() where errno is not relevant. Use 'continue'
rather than a label to go back to start of a loop.

No intentional functional change.

show more ...


# 5cbc8961 17-Mar-2014 krw <krw@openbsd.org>

Un-revert, being careful to not break snap building. Add paranoia check
for any missing geometry.


# 1a797a71 14-Mar-2014 krw <krw@openbsd.org>

Revert last -- broke building snaps.


# 8437a62b 13-Mar-2014 krw <krw@openbsd.org>

Remove some lint -- ARGSUSED.

Inspired by guenther@.


# 6333ae4c 13-Mar-2014 krw <krw@openbsd.org>

Merge 'struct DISK_metrics' and 'struct disk' into one, since we don't
need to record two sets of metric/geometry data. Use 'geometry'
instead of 'metrics' in names and comments. Eliminate
DISK_getme

Merge 'struct DISK_metrics' and 'struct disk' into one, since we don't
need to record two sets of metric/geometry data. Use 'geometry'
instead of 'metrics' in names and comments. Eliminate
DISK_getmetrics().

While here, make 64 the minimal valid value for '-l' instead of 1. This
avoids the possibility of having 0 cylinders.

No intentional functional change.

Feedback & tweak from chris@

show more ...


# 87dc5144 10-Mar-2014 krw <krw@openbsd.org>

No need to pass the name of the command to the function that is
implementing that command, a pointer to the command arguments is the
only thing needed. No need to have a pointer to the command table

No need to pass the name of the command to the function that is
implementing that command, a pointer to the command arguments is the
only thing needed. No need to have a pointer to the command table in
every command, since there is only one table. No need for shiney new
stack space for every command name and arguments parsed, since we
don't recurse we can just use static memory.

No intentional functional change.

show more ...


# abc6f793 09-Mar-2014 krw <krw@openbsd.org>

Instead of passing around 'char buf[DEV_BSIZE]' buffers, pass around
'struct dos_mbr' variables, since that is what the buffers were used
for. Removes need to know about DEV_BSIZE and thus include pa

Instead of passing around 'char buf[DEV_BSIZE]' buffers, pass around
'struct dos_mbr' variables, since that is what the buffers were used
for. Removes need to know about DEV_BSIZE and thus include param.h
from all files but one so move the param.h #include to that file
(mbr.c).

Nuke a bunch of local MBR #defines in favour of the disklabel.h ones.

Remove a bunch of unneeded #includes, replace the odd malloc/bzero
with calloc, replace equally odd bcopy's with memcpy, remove a stray
duplicate MBR parsing in MBR_pcopy().

No intentional functional change.

show more ...


# 53f0474f 07-Mar-2014 krw <krw@openbsd.org>

Relieve the code of an overburden of unnecessary typedef
abstraction. Call a 'struct' a 'struct' and not a pony.

No functional change.

idea ok deraadt@


# a7568474 21-Mar-2013 deraadt <deraadt@openbsd.org>

more substantial include cleanup


# f7b7a2ad 21-Mar-2013 deraadt <deraadt@openbsd.org>

I don't feel great about adding an include for <sys/param.h>, but I feel
great for removing an include of <machine/param.h>
This needs further cleanup if someone has time.


# e14e8952 11-Jul-2012 krw <krw@openbsd.org>

Simplify guts and calling of getuint(). Eliminate a useless 'help'
capablity by using help text as regular prompt for 'size' and
'offset'. Try to detect and handle more overflow/underflow conditions

Simplify guts and calling of getuint(). Eliminate a useless 'help'
capablity by using help text as regular prompt for 'size' and
'offset'. Try to detect and handle more overflow/underflow conditions
in getuint() and ensure returned value is always within requested
bounds. Handle zero-length partitions by treating them as UNUSED.

tested & ok halex@

show more ...


# eb849750 09-Jul-2012 krw <krw@openbsd.org>

We always want to do unit conversions. So flags parameter of getuint()
is now superflous. With rounding gone the offset parameter is
similarly superfluous. Simply getuint() accordingly.


# 2274bb39 09-Jul-2012 krw <krw@openbsd.org>

I want some of what kjell was smoking 10 years ago when he added
units handling by copying getuint() from disklabel. MBR partition id
and disklabel partition type are different beasts. So deciding to

I want some of what kjell was smoking 10 years ago when he added
units handling by copying getuint() from disklabel. MBR partition id
and disklabel partition type are different beasts. So deciding to
round off a MBR partition with id FS_BSDFFS meant rounding off
NTFS partitions. And FS_SWAP partitions meant DOS FAT 12. So just
nuke rounding off for now to simplify getuint().

ok beck@

show more ...


12345678