OpenBSD CVS

CVS log for src/sbin/pdisk/pdisk.c


[BACK] Up to [local] / src / sbin / pdisk

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.87 / (download) - annotate - [select for diffs], Sat May 28 22:26:13 2016 UTC (8 years ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0, HEAD
Changes since 1.86: +1 -11 lines
Diff to previous 1.86 (colored)

Remove all the pledge "disklabel" before ioctl DIOCGPDINFO is
called in order to avoid a pledge crash with 'pdisk /dev/tty'.
Only the pledge "stdio" right after the ioctl remains.

ok krw

Revision 1.86 / (download) - annotate - [select for diffs], Wed Apr 27 07:29:08 2016 UTC (8 years, 1 month ago) by krw
Branch: MAIN
Changes since 1.85: +6 -4 lines
Diff to previous 1.85 (colored)

Tweak command line processing vs pledge logic to make things nicer. No
functional change.

Prodded (a while ago) and ok (recently) deraadt@

Revision 1.85 / (download) - annotate - [select for diffs], Wed Mar 9 12:55:18 2016 UTC (8 years, 3 months ago) by krw
Branch: MAIN
Changes since 1.84: +3 -4 lines
Diff to previous 1.84 (colored)

Accept only character special devices rather than generating a core
dump on the attempt to get a disklabel from a regular file.

Regular files have not been acceptable as the 'disk' for some time,
and pledging changed the consequences from a somewhat obscure error
message to an abort().

Issue discovered by espie@.

ok natano@

Revision 1.84 / (download) - annotate - [select for diffs], Tue Feb 2 15:23:07 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.83: +18 -2 lines
Diff to previous 1.83 (colored)

Pledge, based on what's done in fdisk.

Revision 1.83 / (download) - annotate - [select for diffs], Sun Jan 31 23:00:11 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.82: +3 -3 lines
Diff to previous 1.82 (colored)

Nuke pointless map field 'physical_block' and just use 'sbBlkSize' which is
set to the same value.

Revision 1.82 / (download) - annotate - [select for diffs], Sat Jan 30 17:21:10 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.81: +2 -3 lines
Diff to previous 1.81 (colored)

Move last three lines (#define's) from dpme.h to partition_map.h and
tweak #include's as necessary.

Revision 1.81 / (download) - annotate - [select for diffs], Sat Jan 30 17:09:11 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.80: +9 -9 lines
Diff to previous 1.80 (colored)

Fold struct dpme into struct entry. Same reasons as for folding
struct block0 into struct partition_map. Easier to read code.

Revision 1.80 / (download) - annotate - [select for diffs], Fri Jan 29 20:18:17 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.79: +12 -3 lines
Diff to previous 1.79 (colored)

Add do_dump_map() to make command processing more consistent. Pass
1/0 (a.k.a. vverbose/not verbose) do do_dump_map() to differentiate
P/p.

Revision 1.79 / (download) - annotate - [select for diffs], Fri Jan 29 14:54:38 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.78: +31 -31 lines
Diff to previous 1.78 (colored)

Rename struct partition_map_header to struct partition_map. No change to
.o files.

Revision 1.78 / (download) - annotate - [select for diffs], Thu Jan 28 19:07:45 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.77: +2 -1 lines
Diff to previous 1.77 (colored)

Hand rolled lists suck. First, replace disk_order with an LIST.

Revision 1.77 / (download) - annotate - [select for diffs], Thu Jan 28 01:07:39 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.76: +3 -2 lines
Diff to previous 1.76 (colored)

Tweak verbiage for 'r' (reorder) command.

Revision 1.76 / (download) - annotate - [select for diffs], Wed Jan 27 20:11:00 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.75: +5 -5 lines
Diff to previous 1.75 (colored)

Tweak some verbiage.

Revision 1.75 / (download) - annotate - [select for diffs], Wed Jan 27 16:38:37 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.74: +3 -3 lines
Diff to previous 1.74 (colored)

On-disk partition name/types/processorid may or may not be NUL
terminated after all. So add an extra byte for a NUL in the in-memory
struct's.

Revision 1.74 / (download) - annotate - [select for diffs], Wed Jan 27 14:47:53 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.73: +2 -2 lines
Diff to previous 1.73 (colored)

We do not support logical_block != physical_block. Remove logical_block
field and left over code that checks for logical != physical.

Removes confusion with dmpe fields lblock_start and lblocks, which
have nothing to do with block sizes! lblock_start is the block
offset within the partition where the data actually starts. and
lblocks is the number of blocks of data within the partition. Both
are in units of *physical blocks*, a.k.a. disk sectors.

Revision 1.73 / (download) - annotate - [select for diffs], Wed Jan 27 14:19:59 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.72: +1 -6 lines
Diff to previous 1.72 (colored)

Check block 0 signature, physical block size and physical block count when
reading partition map.

Check for unmapped physical blocks and overlapping partitions when reading
partition map.

No need for duplicate checks in validate_map(), so remove validate.c from
build and 'v' command from code and docs.

Revision 1.72 / (download) - annotate - [select for diffs], Tue Jan 26 23:41:48 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.71: +54 -48 lines
Diff to previous 1.71 (colored)

Rework and simplify string argument parsing. All string arguments are at
most DPISTRLEN (32) characters so there is no need for fancy dynamic
growing strings. Use a DPISTRLEN long buffer and bail if it fills up.

Rename get_string() to get_dpistr() and get_string_argument() to
get_dpstr_argument() to emphasize they will return strings that fit
in DPISTRLEN.

Rework & simplify a pair of their consumers - do_rename_partition() and
do_change_type() - to be more obviously identitical to each other bar
the displayed verbiage.

Revision 1.71 / (download) - annotate - [select for diffs], Tue Jan 26 21:07:54 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.70: +13 -3 lines
Diff to previous 1.70 (colored)

dpme_name and dpme_type are NUL-terminated in Apple code, so use
strlcpy() to fill them.

They are also supposed to be NUL-padded so zap previous contents
before copying in possibly shorter new values.

Revision 1.70 / (download) - annotate - [select for diffs], Tue Jan 26 16:39:00 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.69: +6 -8 lines
Diff to previous 1.69 (colored)

Whitespace, line wrapping fixes. Nuke many superfluous '{}' around single
statements. 0 -> NULL for pointer checks.

Revision 1.69 / (download) - annotate - [select for diffs], Mon Jan 25 23:43:20 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.68: +4 -13 lines
Diff to previous 1.68 (colored)

Use new read/write_block0 and read/write_dpme which handle any
endian or alignment issues forcefully. Removes need for convert_*
functions so unhook convert.c from build. read/write_block become
static functions inside file_media.c.

Tweak struct block0 to stop trying to handle alignment issues by clever
declaration. Rely on the new functions to accurately translate between
on-disk and in-memory layouts.

Enables pdisk to work on amd64 and likely other architectures if
it's ever desirable. Does bring back DEV_BSIZE to pdisk.c since the
in-memory structure will *not* be 512 bytes on other archs.

Revision 1.68 / (download) - annotate - [select for diffs], Mon Jan 25 03:26:54 2016 UTC (8 years, 4 months ago) by jsg
Branch: MAIN
Changes since 1.67: +1 -2 lines
Diff to previous 1.67 (colored)

remove some uneeded includes
ok krw@

Revision 1.67 / (download) - annotate - [select for diffs], Sun Jan 24 14:56:39 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.66: +1 -25 lines
Diff to previous 1.66 (colored)

Nuke more pointless checks for map NULLness.

Revision 1.66 / (download) - annotate - [select for diffs], Sun Jan 24 01:38:32 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.65: +24 -24 lines
Diff to previous 1.65 (colored)

Whitespace fixes.

Revision 1.65 / (download) - annotate - [select for diffs], Sat Jan 23 23:25:58 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.64: +2 -1 lines
Diff to previous 1.64 (colored)

Nuke unused kPatchType. Nuke kStringNot and use " not' where needed.
Nuke kStringEmpty and use "" where needed. Nuke unused static 'g'.

Eliminate #include's in *.h files.

Some whitespace fixes.

Revision 1.64 / (download) - annotate - [select for diffs], Sat Jan 23 22:55:23 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.63: +10 -11 lines
Diff to previous 1.63 (colored)

No need for 'default_value' parameter for get_number_argument() since we
always pass kDefault. a.k.a. -1. Nuke kDefault since it is now unused.

Nuke unused #define MAXIOSIZE in passing.

Revision 1.63 / (download) - annotate - [select for diffs], Sat Jan 23 19:14:04 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.62: +5 -5 lines
Diff to previous 1.62 (colored)

No need for get_string_argument() parameter 'reprompt' since we
always pass it '1'.

Revision 1.62 / (download) - annotate - [select for diffs], Sat Jan 23 15:05:52 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.61: +4 -3 lines
Diff to previous 1.61 (colored)

Pass the disk sector size to open_partition_map(), eliminating it's
internal need for DEV_BSIZE. Ditto create_partition_map().

malloc((sizeof(struct [block0|dpme])) instead of malloc(DEV_BSIZE).

Remove another #include <param.h>.

Revision 1.61 / (download) - annotate - [select for diffs], Sat Jan 23 14:10:05 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.60: +13 -18 lines
Diff to previous 1.60 (colored)

Add comments to ensure future spelunkers realize that struct block0
and struct dpme must be 512-bytes long at the moment.

Use this fact to avoid using DEV_BSIZE and thus replace #include
<param.h> with #include <types.h> in pdisk.c.

Constrain media size to UINT32_MAX, the actual limit, instead of
LONG_MAX, which could be way more on some theoretical future arch
running pdisk. And do the constraint inside open_partition_map().

Revision 1.60 / (download) - annotate - [select for diffs], Fri Jan 22 18:57:42 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.59: +7 -7 lines
Diff to previous 1.59 (colored)

Change partition map field 'data' to 'dmpe'. Change 'create_data'
to 'create_dmpe'. Sweep up some 'struct dpme *data' to struct dpme
*dpme'.

Revision 1.59 / (download) - annotate - [select for diffs], Fri Jan 22 04:16:25 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.58: +9 -12 lines
Diff to previous 1.58 (colored)

Repair creation of initial partition table on a blank disk, broken
when hoisting file operations and ioctl to main(). Pass media size
to open_partition_map() and create_partition_map() so they can
properly initialize a map.

Revision 1.58 / (download) - annotate - [select for diffs], Fri Jan 22 01:25:56 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.57: +2 -3 lines
Diff to previous 1.57 (colored)

In the "why use two variables when one would do" category, eliminate
the 'written' field and just use the 'changed' field to mediate
when it is appropriate to ask whether changes should be discarded.

Revision 1.57 / (download) - annotate - [select for diffs], Fri Jan 22 00:38:53 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.56: +41 -139 lines
Diff to previous 1.56 (colored)

Nuke 'expert' mode and the enabling, undocumented, '-d' flag by
just making all the commands available all the time. Document the
newly available commands.

Remove the former 'P' command (list partitions in base address
order) and use 'P' from expert mode (show map data structures).

Stop accepting uppercase aliases for commands documented as lower
case.

Bring the 'h' help text and man pages into agreement.

ok jasper@ millert@

Revision 1.56 / (download) - annotate - [select for diffs], Thu Jan 21 15:33:21 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.55: +64 -41 lines
Diff to previous 1.55 (colored)

Hoist all file opening and ioctl calls into main(), passing a pointer to
a valid map to edit(). Should enable pledging a la fdisk at some point.

Since edit() always gets a valid map (and maintains its validity even when
'I'nitializing a new one) many checks for (map == NULL) are junked.

Remove some dances around block sizes by using DEV_BSIZE everywhere
since we don't support non-DEV_BSIZE (a.k.a. 512-byte) sectors.

Remove many superfluous #include statements.

Revision 1.55 / (download) - annotate - [select for diffs], Thu Jan 21 02:52:52 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.54: +4 -28 lines
Diff to previous 1.54 (colored)

Nuke 'writable' field now that it is always in sync with 'rflag'. Since
(!rflag && writable == 0) can't be true remove those warning blocks and
simply leave the not-writable warning when attempting to write the
map. Always show 'w' in the help and rely on the check and warning
in do_write_partition_map() so the user always gets a message.

Revision 1.54 / (download) - annotate - [select for diffs], Tue Jan 19 23:44:47 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.53: +8 -10 lines
Diff to previous 1.53 (colored)

Simplify the main command switch, eliminating a couple of /* fall
through */ and two variables by simply calling the target functions
with the different parameters.

Revision 1.53 / (download) - annotate - [select for diffs], Tue Jan 19 23:33:18 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.52: +4 -10 lines
Diff to previous 1.52 (colored)

It's pointless to check for 'dflag' inside do_expert(), since you can't
get there unless dflag is set. Makes switch() statement easier to grasp.

Revision 1.52 / (download) - annotate - [select for diffs], Tue Jan 19 16:53:04 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.51: +1 -2 lines
Diff to previous 1.51 (colored)

Remove forward declarations for functions that do not exist.

Revision 1.51 / (download) - annotate - [select for diffs], Tue Jan 19 14:50:40 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.50: +15 -16 lines
Diff to previous 1.50 (colored)

Bring code into line with man page and usage() by only allowing one
disk to be specified on the command line. Nuke dump() function and
hoist its few lines into main() as a result.

Revision 1.50 / (download) - annotate - [select for diffs], Tue Jan 19 12:25:28 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.49: +1 -73 lines
Diff to previous 1.49 (colored)

No need for pdisk(8) to provide a version of hexdump. Remove
the "expert" mode 'd'/'D' command and its supporting code.

ok deraadt@ jasper@

Revision 1.49 / (download) - annotate - [select for diffs], Mon Jan 18 21:50:53 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.48: +1 -24 lines
Diff to previous 1.48 (colored)

The contents of the Apple_Patches partition is none of our business.
Stop pretending we care or know what's in there. Remove 'debugging'
mode command to examine the partition contents and the supporting
code.

ok deraadt@ jasper@

Revision 1.48 / (download) - annotate - [select for diffs], Mon Jan 18 17:57:35 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.47: +7 -8 lines
Diff to previous 1.47 (colored)

struct file_media had 1 field left. And one place where struct
file_media was actually stored. So move the last field (fd) into
the place formerly used to store pointer to the instance. As a
result we can just pass fd's around rather than pointers to a struct
containing a fd.

close_file_media() becomes empty but for a close(). So just use
close() and nuke close_file_media().

Revision 1.47 / (download) - annotate - [select for diffs], Mon Jan 18 02:16:06 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.46: +565 -573 lines
Diff to previous 1.46 (colored)

Run indent(1) over it and tweak the results a bit manually to look more
KNF'ish.

Revision 1.46 / (download) - annotate - [select for diffs], Mon Jan 18 00:19:29 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.45: +23 -44 lines
Diff to previous 1.45 (colored)

Fold get_options() into main() and eliminate unneeded nFLAG_DEFAULT
#defines. Zero is a well known and acceptable number.

Revision 1.45 / (download) - annotate - [select for diffs], Mon Jan 18 00:04:36 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.44: +1 -11 lines
Diff to previous 1.44 (colored)

Remove a grab bag of unused #define's, fields, enum's, variables,
functions.

Revision 1.44 / (download) - annotate - [select for diffs], Sun Jan 17 23:18:19 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.43: +20 -23 lines
Diff to previous 1.43 (colored)

Change "//" comments to "/**/". Nuke really stupid ones.

Revision 1.43 / (download) - annotate - [select for diffs], Sun Jan 17 19:39:20 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.42: +17 -17 lines
Diff to previous 1.42 (colored)

Reduce namespace pollution by eliminating parameter names from forward
declarations.

Revision 1.42 / (download) - annotate - [select for diffs], Sun Jan 17 19:15:55 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.41: +9 -9 lines
Diff to previous 1.41 (colored)

Kill leading, imbedded, trailing whitespace.

Revision 1.41 / (download) - annotate - [select for diffs], Sun Jan 17 18:57:52 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.40: +1 -31 lines
Diff to previous 1.40 (colored)

Remove a bunch of ridiculous and uninformative comments like "// Defines".

Revision 1.40 / (download) - annotate - [select for diffs], Sun Jan 17 17:44:05 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.39: +34 -34 lines
Diff to previous 1.39 (colored)

The great de-typedef'ification continues.

partition_map -> struct partition_map
partition_map_header -> struct partition_map_header

Revision 1.39 / (download) - annotate - [select for diffs], Sun Jan 17 16:15:59 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored)

The great de-typedef'ification continues. Block0 -> struct block0.

Revision 1.38 / (download) - annotate - [select for diffs], Sun Jan 17 16:07:06 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.37: +3 -3 lines
Diff to previous 1.37 (colored)

The great de-typedef'ification continues. DPME -> struct dpme.

Revision 1.37 / (download) - annotate - [select for diffs], Sun Jan 17 15:57:12 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.36: +2 -2 lines
Diff to previous 1.36 (colored)

Let the great de-typedef'ification begin. MEDIA -> struct file_media *.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jan 16 22:28:14 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

Move last field (size_in_bytes) in struct media to struct file_media
and replace MEDIA with FILE_MEDIA everywhere. media.h becomes unused.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Jan 16 21:41:41 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.34: +2 -5 lines
Diff to previous 1.34 (colored)

There can be only one. 'grain' that is. i.e. DEV_BSIZE. No need to track
or store. Just use.

No functional change.

Revision 1.34 / (download) - annotate - [select for diffs], Sat Jan 16 20:00:50 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.33: +3 -3 lines
Diff to previous 1.33 (colored)

Start peeling away excess layers of abstraction.

Since 'file' is the only kind of media, no need to call the appropriate
functions via pointers. Just call the _file_ variants directly.
Nuke the fields do_read(), do_write(), do_close(), do_os_reload()
and the functions read_media(), write_media(), close_media() and
os_reload_media().

No functional change.

Revision 1.33 / (download) - annotate - [select for diffs], Fri Jan 15 23:05:00 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.32: +8 -7 lines
Diff to previous 1.32 (colored)

We don't need yet another alias for DEV_BSIZE. Use DEV_BSIZE and
nuke PBLOCK_SIZE and another unused #define.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Jan 14 15:10:25 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.31: +2 -6 lines
Diff to previous 1.31 (colored)

Kill unused variable 'lfile'.

Revision 1.31 / (download) - annotate - [select for diffs], Thu Jan 14 04:22:25 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.30: +1 -2 lines
Diff to previous 1.30 (colored)

Don't include hfs_misc.h, which no longer contains anything of use.

Revision 1.30 / (download) - annotate - [select for diffs], Thu Jan 14 04:02:05 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.29: +1 -9 lines
Diff to previous 1.29 (colored)

Remove code supporting undocumented and inaccessible flags 'a'
(abbreviate partition type names), 'f' (print HFS partition names)
and 'kLogicalOption' (obviously a getopt_long() conversion error).

Revision 1.29 / (download) - annotate - [select for diffs], Wed Jan 13 00:29:25 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.28: +4 -7 lines
Diff to previous 1.28 (colored)

Remove obsolete flags (h, v, i, c) from getopt() call.

No need for 'flags' variable. Just call usage() on unknown options.

Revision 1.28 / (download) - annotate - [select for diffs], Tue Jan 12 20:22:32 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.27: +1 -2 lines
Diff to previous 1.27 (colored)

The only thing in pdisk.h is an unused #define. So don't include it.

Revision 1.27 / (download) - annotate - [select for diffs], Tue Jan 12 20:09:39 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.26: +23 -19 lines
Diff to previous 1.26 (colored)

Use normal err/errx/warn/warnx rather than handrolling new ones. Move
usage() to pdisk.c and nuke do_help() and '-h'.

ok jasper@ deraadt@

Revision 1.26 / (download) - annotate - [select for diffs], Tue Jan 12 15:32:08 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.25: +5 -138 lines
Diff to previous 1.25 (colored)

Retire '-i', a poorly documented interactive mode that tries to
mimic the 20th century MacOS version of pdisk more closely than the
usual interactive editor. One set of commands is enough for anyone.

ok jasper@

Revision 1.25 / (download) - annotate - [select for diffs], Tue Jan 12 01:17:41 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.24: +1 -21 lines
Diff to previous 1.24 (colored)

Since we use the disklabel size info we are always in 'device size
mode' and '-c' and the '-d' command to toggle cflag are pointless
since cflag is never examined.

Revision 1.24 / (download) - annotate - [select for diffs], Mon Jan 11 23:45:02 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.23: +2 -8 lines
Diff to previous 1.23 (colored)

Remove some '-v' leftovers. Pointed out by jasper@.

Revision 1.23 / (download) - annotate - [select for diffs], Mon Jan 11 23:31:27 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.22: +3 -3 lines
Diff to previous 1.22 (colored)

open_pathname_as_media() simply called open_file_as_media() which
takes the same parameters and returns the same value. Nuke
open_pathname_as_media() and call open_file_as_media() directly.

Nothing else from pathname.[ch] is used so remove them from build
in preparation for moving them to the attic.

ok deraadt@

Revision 1.22 / (download) - annotate - [select for diffs], Mon Jan 11 18:43:06 2016 UTC (8 years, 4 months ago) by krw
Branch: MAIN
Changes since 1.21: +3 -21 lines
Diff to previous 1.21 (colored)

Remove '-v' and related version handling. Use strncasecmp() instead
of handrolled local istrncmp(). No need to compile util.c anymore.

ok deraadt@ jasper@

Revision 1.21 / (download) - annotate - [select for diffs], Mon Jan 11 08:01:07 2016 UTC (8 years, 4 months ago) by jasper
Branch: MAIN
Changes since 1.20: +2 -2 lines
Diff to previous 1.20 (colored)

more whitespace was lurking

Revision 1.20 / (download) - annotate - [select for diffs], Mon Jan 11 07:54:07 2016 UTC (8 years, 4 months ago) by jasper
Branch: MAIN
Changes since 1.19: +2 -0 lines
Diff to previous 1.19 (colored)

add rcs ids

Revision 1.19 / (download) - annotate - [select for diffs], Thu Dec 10 17:27:00 2015 UTC (8 years, 6 months ago) by mmcc
Branch: MAIN
Changes since 1.18: +3 -6 lines
Diff to previous 1.18 (colored)

Remove NULL-checks before free(). ok tb@

Revision 1.18 / (download) - annotate - [select for diffs], Sun Dec 6 12:00:16 2015 UTC (8 years, 6 months ago) by tobias
Branch: MAIN
Changes since 1.17: +0 -2 lines
Diff to previous 1.17 (colored)

Use __progname instead of manually handling argv[0].

ok deraadt, mmcc, tedu

Revision 1.17 / (download) - annotate - [select for diffs], Thu Aug 20 22:02:21 2015 UTC (8 years, 9 months ago) by deraadt
Branch: MAIN
Changes since 1.16: +1 -1 lines
Diff to previous 1.16 (colored)

<stdlib.h> is included, so do not need to cast result from
malloc, calloc, realloc*
ok krw millert

Revision 1.16 / (download) - annotate - [select for diffs], Wed Aug 8 12:05:22 2012 UTC (11 years, 10 months ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3
Changes since 1.15: +0 -31 lines
Diff to previous 1.15 (colored)

remove mac68k leftovers
ok miod@ mpi@ deraadt@ martin@

Revision 1.15 / (download) - annotate - [select for diffs], Tue May 25 19:01:32 2010 UTC (14 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.14: +0 -2 lines
Diff to previous 1.14 (colored)

use opendev(), as requested in 6373.  document this using text borrowed from
disklabel(8), and while at it, fix the usage code to not be utterly distasteful
ok drahn

Revision 1.14 / (download) - annotate - [select for diffs], Wed Dec 23 02:24:39 2009 UTC (14 years, 5 months ago) by krw
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.13: +1 -1 lines
Diff to previous 1.13 (colored)

partion -> partition. First one (mkfs.c) noted by Brad Tilley on tech@.

Revision 1.13 / (download) - annotate - [select for diffs], Fri May 12 13:16:23 2006 UTC (18 years, 1 month ago) by martin
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.12: +4 -44 lines
Diff to previous 1.12 (colored)

put back original getopt(3) handling lost during the update

Revision 1.12 / (download) - annotate - [select for diffs], Thu May 11 17:20:40 2006 UTC (18 years, 1 month ago) by martin
Branch: MAIN
Changes since 1.11: +0 -39 lines
Diff to previous 1.11 (colored)

remove a bunch of linux and NeXT defines and, in turn, -D__unix__

Revision 1.11 / (download) - annotate - [select for diffs], Sat Apr 29 00:43:41 2006 UTC (18 years, 1 month ago) by martin
Branch: MAIN
Changes since 1.10: +0 -69 lines
Diff to previous 1.10 (colored)

With last pdisk and full functionality for mac68k now in place, start
cleaning the maze of ifdef's not relevant for us.

This round wipes most linux and/or MacOS-only bits, more to come.

Revision 1.10 / (download) - annotate - [select for diffs], Thu Apr 27 19:52:21 2006 UTC (18 years, 1 month ago) by martin
Branch: MAIN
Changes since 1.9: +182 -119 lines
Diff to previous 1.9 (colored)

update for pdisk 0.8a2, from NetBSD, retaining our local changes;
summing it up:

- Clean up sources - fix naming, delete old email addresses
- Added support for display of Mac volume names
- Fix block 0 display to show logical offset of drivers
- Require confirmation of quit without write
- Fix iteration to not complain about missing devices
- Warn when creating/writing a map with more than 15 entries

and, most important, add do_update_dpme() which allows us to partition
OpenBSD slices without previous MacOS setup.

Tested with shared MacOS install on macppc, procedure there remains the
same.

grammer and spelling help and ok jmc@

ok miod@

Revision 1.9 / (download) - annotate - [select for diffs], Sun Mar 6 17:40:01 2005 UTC (19 years, 3 months ago) by cloder
Branch: MAIN
CVS Tags: OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.8: +4 -1 lines
Diff to previous 1.8 (colored)

Check strdup return value for failure.  OK miod

Revision 1.8 / (download) - annotate - [select for diffs], Thu Apr 24 17:48:30 2003 UTC (21 years, 1 month ago) by pvalchev
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.7: +8 -3 lines
Diff to previous 1.7 (colored)

get rid of incorrectly sized buffer by using asprintf; ok millert

Revision 1.7 / (download) - annotate - [select for diffs], Wed Apr 2 00:13:06 2003 UTC (21 years, 2 months ago) by deraadt
Branch: MAIN
Changes since 1.6: +1 -2 lines
Diff to previous 1.6 (colored)

snprintf; drahn ok

Revision 1.6 / (download) - annotate - [select for diffs], Sun Dec 15 13:28:22 2002 UTC (21 years, 5 months ago) by henning
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3
Changes since 1.5: +7 -7 lines
Diff to previous 1.5 (colored)

more writable spelling; torh

Revision 1.5 / (download) - annotate - [select for diffs], Sun Jun 9 08:13:08 2002 UTC (22 years ago) by todd
Branch: MAIN
CVS Tags: OPENBSD_3_2_BASE, OPENBSD_3_2
Changes since 1.4: +18 -18 lines
Diff to previous 1.4 (colored)

rm trailing whitespace

Revision 1.4 / (download) - annotate - [select for diffs], Fri Oct 12 04:48:02 2001 UTC (22 years, 8 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_3_1_BASE, OPENBSD_3_1, OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.3: +50 -1 lines
Diff to previous 1.3 (colored)

New feature for pdisk, change the type of a parition.
Useful since that is part of the OpenBSD/macppc installation procedure.
Code by Alexander Guy,
examined by drahn@
ok deraadt@

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jun 4 14:59:48 2001 UTC (23 years ago) by mickey
Branch: MAIN
Changes since 1.2: +1 -1 lines
Diff to previous 1.2 (colored)

return from main() don't exit

Revision 1.2 / (download) - annotate - [select for diffs], Sat Mar 24 00:20:59 2001 UTC (23 years, 2 months ago) by drahn
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9
Changes since 1.1: +68 -2 lines
Diff to previous 1.1 (colored)

Make the apple code compile for OpenBSD. These changes are mostly from maja.

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Sat Mar 24 00:14:17 2001 UTC (23 years, 2 months ago) by drahn
Branch: apple19980218
CVS Tags: ver1
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

Import of pdisk from apple, BSD licensed code. Archive dated Feb 18 1998 
This is a HFS partition editing tool.

Revision 1.1 / (download) - annotate - [select for diffs], Sat Mar 24 00:14:17 2001 UTC (23 years, 2 months ago) by drahn
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.