Commit Graph

41 Commits

Author SHA1 Message Date
sevan edae29ee93 Add rcsid 2019-06-30 11:38:16 +00:00
jnemeth 46e7349176 Add gpt_change_hdr() similar to gpt_change_ent() for changing
arbitrary header fields.
2019-06-25 03:42:45 +00:00
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
mlelstv a23ee50408 Check device parameter to avoid segfaults. Agument synopsis for -l option. 2018-03-19 09:06:20 +00:00
christos d68621905c - make sure that the utf16 string is padded with 0's where needed.
- since the utf16 string is not 0 terminated, pass the size of the string.
2017-09-06 18:17:18 +00:00
christos f8bc8f05cf allow 0 timestamp 2017-02-16 22:40:19 +00:00
christos ef9cffab3f Add -T timestamp for reproducible builds. 2017-02-16 03:32:17 +00:00
christos 3017a7a39f PR/51230: Add the ability to set the active flag in the PMBR. 2016-06-09 15:12:54 +00:00
christos f9db75489b - add more informational messages
- handle case where last argument is an option not a device (set -l)
2015-12-29 16:45:04 +00:00
christos 4d523900d0 Add listing commands for type, set and unset.
Add help and formatting for set and unset.
Change show to print all the attribute info in one line.
2015-12-06 00:39:26 +00:00
christos 5b47b594ae Fix resizedisk. 2015-12-04 16:46:24 +00:00
christos 667106442f don't print dkctl message for files
fix typo
2015-12-04 01:46:32 +00:00
christos 5c1ccc6e9b WARNS=6 2015-12-03 02:02:43 +00:00
christos cdf86847f5 refactor the utf code so that it does not leak memory. 2015-12-02 04:07:11 +00:00
christos 0f004afe33 merge command line parsers and check all memory allocations. 2015-12-01 23:29:07 +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 e4ed2565fe - automatically sync the wedge information unless -n is specified.
- document the general options in the traditional way.
- split the main program into a separate file.
2015-11-30 19:59:34 +00:00
christos 7e254cfb82 Remove getdisksize support; we either have the ioctls (current/-7) or we
don't (non-netbsd-current/7+tools).
2015-11-29 15:32:46 +00:00
christos ca4e0dcdd1 merge the create errors in one place and fix them. 2015-11-29 00:14:46 +00:00
jnemeth 902aecab13 Add a "header" subcommand that displays information about the size of
the disk along with information from the GPT header if it exists.
2015-11-03 02:19:24 +00:00
christos ccbdb0d177 Factor out the getdisksize() drvctl method, and provide an alternative that
directly uses the disk ioctl's instead of relying on the drvctl device driver
which is currently not mandatory.
2014-12-29 16:27:06 +00:00
mlelstv 96f40a63cc handle constness better 2014-11-17 07:15:28 +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 4da1cfa89d more toolification changes 2014-09-29 22:22:03 +00:00
jnemeth 88085c2f28 PR/44218 - David Young -- add "type" subcommand to change a partition type 2014-09-28 08:14:51 +00:00
jnemeth 2ed5cc2617 - make gpt_gpt() available for use directly by subcommands
- create new resizedisk disk subcommand for relocating backup GPT
2014-09-23 07:47:54 +00:00
jnemeth 3170c9b01c Add restore subcommand.
XXX It does not actually work yet.  It is being committed now to make
later pullups easier.
2014-08-10 18:27:15 +00:00
jnemeth 4fb24d0cac Add the backup subcommand. It dumps the contents of the partition
tables as a plist, which is readable by the restore subcommand.

XXX restore subcommand forthcoming
2013-12-19 06:46:51 +00:00
jnemeth 1cb2b94165 Add two new subcommands, "set" and "unset". These were inspired by
FreeBSD's gpart(8), but the code is all mine.  The purpose of these
is to set and unset partition attributes.
2013-12-09 08:03:17 +00:00
jnemeth 9299334f79 Remove FreeBSD specific code as per message to tech-userlevel. 2013-11-27 01:47:53 +00:00
jnemeth 0a08058311 Add a resize command. This command was inspired by FreeBSD's gpart(8),
but the code was written by myself.
2013-11-20 08:08:47 +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 a5fb435357 Support booting from GPT-partioned disks on PC-BIOS-compatible systems.
Much of the work in this commit was done by Mike Volokhov during GSoC 2009.
2011-01-06 01:08:48 +00:00
uebayasi cede8f9855 Let 'gpt add' suggest a collect device name so that opendisk(3) called by
dkctl(8) succeeds.
2009-02-07 18:12:22 +00:00
thorpej 7077ca222a Don't use sizeof(struct gpt_hdr). It will pad the structure on x86-64,
which causes some systems to reject the GPT.

kern/38997
2008-11-12 22:50:22 +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