Commit Graph

23 Commits

Author SHA1 Message Date
jnemeth
e003a26f4c Add a third argument to the "cfn" function that is an argument to
gpt_change_ent().  The purpose of the third argument is to specify
whether the entry to be changed is a primary GPT entry or a secondary
GPT entry.  It is assumed that a secondary GPT entry will always
follow a corresponding primary entry.

This is in preparation for an upcoming change that will require it.
2019-06-21 02:14:59 +00:00
jnemeth
aa3b5bb2ee Not all things that write to the disk do something that dk(4) will
be interested in.  Let individual commands decide if ioctl(DIOCMWEDGES)
should be done.  I was conservative and set the flag on any command
that might create/modify/delete partitions in any way.
2018-07-03 03:41:23 +00:00
christos
da0a3b4c0b eliminate static globals so that commands can be re-used. 2015-12-03 01:07:28 +00:00
christos
bbb4a8ab26 refactor more duplicated code. 2015-12-01 19:25:24 +00:00
christos
8ca93e4658 Refactor the command dispatching and help printing logic. 2015-12-01 16:32:19 +00:00
christos
0b43d398b9 Firs step of refactoring, remove all globals, factor out some common code,
handle alternate usage but not advertise it.
2015-12-01 09:05:33 +00:00
christos
ca4e0dcdd1 merge the create errors in one place and fix them. 2015-11-29 00:14:46 +00:00
christos
21c34dbb1d Add internal uuid support, since the linux+macos versions of the library
are different than than *bsd ones, and others might not have it at all.
2014-09-30 17:59:59 +00:00
christos
c917041fda remove compat defines. 2014-09-30 02:12:55 +00:00
christos
a50708a134 minor toolification: need libprop... 2014-09-29 20:28:57 +00:00
jnemeth
ac204e48a2 PR/47990 - Dr. Wolfgang Stukenbrock -- add "-L <label>" as selector option 2014-09-29 05:56:43 +00:00
jnemeth
2b199b9458 when calling dehumanize_number() make sure the resulting number is >= 1 2013-11-28 01:37:14 +00:00
jnemeth
9299334f79 Remove FreeBSD specific code as per message to tech-userlevel. 2013-11-27 01:47:53 +00:00
jnemeth
9ceccfb63b change the "-b blocknr" parameter to accept a "human number" 2013-11-22 04:21:02 +00:00
jnemeth
4f22d16faa In the manpage:
- s/-b number/-b blocknr/
- s/-s count/-s sectors/
- s/-p count/-p partitions/

In the program:
- s/-b lba/-b blocknr/
- s/-s lba/-s sectors/

This makes the documentation in the manpage and the program consistent
and makes it more clear what the parameters are.  Also, "-s lba" was
just plain wrong since LBA stands for Logical Block Address[ing], and
the -s option didn't represent any kind of address, but rather a size.
2013-11-22 03:50:05 +00:00
jakllsch
287267eb57 Clean up gpt(8) a bit more
uuid_create_nil(3) and uuid_is_nil(3) take a uuid_t*, not a pointer to
an array of bytes merely casted to compatible type.

Additonally, there no need for extra casts and address-of operations when
using le_uuid_*() functions.

Furthermore, le_uuid_*() are identical to uuid_*_le functions in
libc/libuuid, so use those instead on NetBSD.
2013-04-13 18:04:33 +00:00
jakllsch
fe89322e15 Use correct spelling of "secondary" in comments. 2013-04-13 16:48:03 +00:00
joerg
a4b65553ae Use __dead 2011-08-27 17:38:16 +00:00
uebayasi
0edd7181ba Make manual and usage consistent. No functional changes. 2009-02-07 17:21:44 +00:00
riz
0fac2edb7f Fix the usage strings for each command, and print them all for the
"global" usage.  It's still a little ugly, but hopefully not as
fantastically confusing as before...
2007-12-18 21:46:45 +00:00
riz
16a0235c60 Use strtoll() when converting a 64-bit quantity. This makes "gpt add"
work with an offset of more than 2147483647 sectors.  While I'm here,
use strtoul() when converting an unsigned quantity.
2007-02-16 17:13:02 +00:00
christos
9b52236568 Make this work under NetBSD. 2006-10-15 22:36:29 +00:00
christos
5819a8c09d Import the gpt tool from FreeBSD 2006-10-15 22:34:15 +00:00