Commit Graph

250 Commits

Author SHA1 Message Date
jnemeth a1afb41542 Do the 'dkctl makewedges' dance to drop any wedges assoicated the
destroyed GPT.
2019-10-16 19:03:53 +00:00
christos 683824cce0 gpt_uuid_parse does not set errno ... 2019-10-11 23:04:52 +00:00
martin 8e17bc1a27 Remove outdated note about sysinst restrictions 2019-07-26 07:22:05 +00:00
sevan edae29ee93 Add rcsid 2019-06-30 11:38:16 +00:00
jnemeth 7d442200ff Add an "uuid" command to generate a new UUID for a portion. The
primary intention is for use for after cloning disks to prevent
collisions.
2019-06-25 04:53:40 +00:00
jnemeth acc2b630b1 adjust gpt_uuid_generate() to accept gpt==NULL 2019-06-25 04:25:11 +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
martin cad3861523 When biosboot is used on an existing wedge and we are switching to
the gpt of the parent device, do not pass the size of the wedge to
gpt_open, it certainly is smaller than the whole device.
Fixes bin/54312.
2019-06-20 10:56:38 +00:00
martin 08878476cc Do not try to close a NULL gpt. Fixes the core dump part of PR bin/54312 2019-06-20 10:41:58 +00:00
martin 5bb85d19b9 PR bin/54088: make "destroy" remove the protective MBR too.
We could make this optional if someone comes up with a good reason
to leave it intact.
2019-04-04 14:03:40 +00:00
martin 920f8d883d Ignore -f with the "destroy" command completely (it was effectively
ignored already, so no functional change). Leave it as valid option
for compatibility.
2019-04-04 13:58:20 +00:00
martin f63c9f4407 Allow specifying the partition via -b startsec for the biosboot cmd. 2019-04-04 13:55:40 +00:00
martin d48fad1d9d Allow -b to specify a partition for "gpt unset" as well. 2019-03-26 14:55:02 +00:00
martin d0774e18ba When displaying a single partition (gpt show -i ...) display offset
and size in sectors (instead of the totally confusing bytes),
followed by the humanized byte offset/size.

This makes the numbers match the "gpt show" or "gpt show -a"
output.
2019-03-26 11:23:55 +00:00
martin 1756583860 Allow -b startsec to specify the partition to change for the set subcommand
as well.
Add another option, -N, as a quick way to remove all attributes.
2019-03-25 20:15:49 +00:00
martin 2ee402b3d0 Make the "show" subcommand accept -b startsec to identify a partition
(very usefull for scripts and other robotic callers).
2019-03-24 13:45:35 +00:00
martin f2b09ed0f6 Add support for specifying the partition to resize via -b startsec
(similar to label and other subcommands). Do not fully add gpt_find
functionality here, as resizing multiple partitions in one go does not
make sense.
2019-03-24 13:31:00 +00:00
mlelstv 5ca1f5a8c5 print little-endian header fields correctly. 2019-03-14 10:26:10 +00:00
jnemeth 487d107169 Make it clear when displaying data from the MBR. 2019-03-03 03:20:42 +00:00
jnemeth f23b40fcf3 add some more FAT file system types 2019-03-03 02:28:14 +00:00
martin 8010630c8f Make "gpt migrate" work for disks with FAT32 and NTFS partitions 2019-02-10 10:35:51 +00:00
martin be31cead4d Fix three MBR extended partition related bugs:
1) when walking an extended MBR chain, do not assign duplicate indices
 2) the pointer to the next MBR may be any of the MBR_PTYPE_EXT* variants
 3) the ext MBR chain links are relative to the primary extended partition,
    unlike the contained partitions which are relative to the extended MBR
    block address.
2019-01-27 13:16:05 +00:00
martin 2e2c571302 Add a query function (for external code) to enumerate the know guids.
Add recently added VMware GUIDs to the internal enum type.
Fix some short names (bogus + duplicate).
2018-12-20 14:58:10 +00:00
mrg f5f53dd6ab add support to detect the 3 vmware GPT partition types:
- VMKcore (dump partition)
- VMFS
- VMware reserved

this enables vmkcore partitions for netbsd swap or dump, as well
as naming all of them.
2018-11-06 04:04:33 +00:00
mlelstv a66cbab44c When changing entries skip those that do not match the -L option.
Should fix PR 53668.
2018-10-14 20:10:49 +00:00
sevan 0a08194f8e Add the -T flag to usage() 2018-08-27 15:50:39 +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
kre 1c825c2c91 Spello. (it is "existence").
ispell also says that we should s/parseable/parsable/ but I'm
not sure about that one, so I left it.

I also left a correct spelling that no-one has bothered to mangle!
2018-05-01 21:16:02 +00:00
wiz 64f2452046 Bump date for new EXIT STATUS section. 2018-05-01 21:04:01 +00:00
wiz 32e2530e6d Sort sections. 2018-05-01 21:03:37 +00:00
martin 72be6dafa1 Make the "gpt header" command return EXIT_FAILURE when no GPT is present.
This helps sysinst to tell a GPT labeled disk from others.
Very lazy version of a change proposed by kre.
2018-05-01 08:17:13 +00:00
mrg 28731ff616 if a new map entry doesn't fit, be more verbose about the sizes. 2018-04-11 07:14:23 +00:00
mrg d144e17dce add information about how to boot from gpt. mostly taken from the wiki. 2018-04-11 07:13:18 +00:00
mlelstv a23ee50408 Check device parameter to avoid segfaults. Agument synopsis for -l option. 2018-03-19 09:06:20 +00:00
sevan 9b1213ca1f Spelling 2018-02-13 00:34:11 +00:00
sborrill 3610eeec38 Explain what suffixes are accepted when specifying a size. 2018-01-15 12:20:47 +00:00
mlelstv ff454992cd clarify that alignment is the number of bytes to align to. 2017-10-03 06:55:04 +00:00
christos 47a4080915 use __arraycount 2017-09-07 10:23:33 +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 dec6dba63c PR/52522: Piotr Meyer: Don't NUL terminate the gpt label name.
XXX: pullup-8
2017-09-05 18:30:46 +00:00
wiz cd2cf51300 Use Fx/Nx. 2017-08-05 20:21:08 +00:00
kre 7cd73c9220 Fix a typo, and make a couple of minor wording improvements.
I resisted the (very weak) impulse to Americanise some spellings ...
2017-08-04 02:43:56 +00:00
msaitoh 1848778b0b Add note about bootme flag:
The bootme flag is used to indicate which partiotion should be booted
	by UEFI boot code.
2017-08-03 14:39:31 +00:00
mrg 480adae332 only do wedges if not the tools version. fixes build on netbsd-4,
and any other place that might have the same ioctl name while having
something not quite right (in this case, cpuid_t in headers not
working properly..)

XXX: pullup-8
2017-07-03 06:44:58 +00:00
martin 945b6d1754 Add missing endianes swap to make the "recover" command work on big endian
machines.
2017-03-22 19:59:16 +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
aymeric eadf25e08c Make gpt(8) work when compiled on a glibc-based OS.
This restores the ability to build amd64 install-image's under Linux.
2017-02-12 16:54:06 +00:00
abhinav d468dc41e1 Fix spelling of partition. 2017-01-27 10:21:16 +00:00