Commit Graph

486 Commits

Author SHA1 Message Date
ngie
5952006acb MFC r292048:
Don't leak rsector/sector in mp_label(..)

Use calloc instead of malloc + memset(.., 0, ..) when allocating sector

Differential Revision: https://reviews.freebsd.org/D4450
Reported by: cppcheck
Reviewed by: mav
Sponsored by: EMC / Isilon Storage Division
2015-12-17 06:31:55 +00:00
trasz
d6b9751caa MFC r287827:
Add a way to specify stripesize and stripeoffset to gnop(8). This makes
it possible to "simulate" 4K media, to eg test alignment handling.

Sponsored by:	The FreeBSD Foundation
2015-10-18 15:02:07 +00:00
ae
76b23ad923 MFC r285735:
lseek() allows an offset to be set beyond the end of file. Using
  it to check that partition has enough space to write bootcode doesn't
  work. Use the known size of provider instead.

  PR:		201504
2015-07-28 08:22:50 +00:00
allanjude
10c80a84da MFC: r285594
New partition flag for gpart, writes the 0xee partition in the pmbr in the second slot, rather than the first.
	Works around Lenovo legacy GPT boot issue

PR:		184910
Approved by:	re (gjb), marcel
Relnotes:	yes
Sponsored by:	ScaleEngine Inc.
Differential Revision:	https://reviews.freebsd.org/D3140
2015-07-21 15:50:14 +00:00
brueffer
3b154288ec MFC: r284290, r284323
Improve grammar.

PR:		200673
Submitted by:	Fabian Keil
Obtained from:	ElectroBSD
Approved by:	re (gjb)
2015-07-13 13:14:51 +00:00
brueffer
22520d35de MFH: r284250
Consistently use trailing whitespace in passphrase prompts.

PR:		193496
Submitted by:	Fabian Keil
2015-06-24 12:21:25 +00:00
pjd
fb6b5e38d8 MFC r265950 (by thomas):
Add mention of metadata version 7 in FreeBSD 10.0.
2015-06-02 20:29:58 +00:00
ae
8e1b135fb3 MFC r282465:
Add apple-boot, apple-hfs and apple-ufs aliases to MBR scheme.
  Sort DOSPTYP_* entries in diskmbr.h by value.
  Document these scheme-specific types in gpart(8).
2015-05-13 14:05:53 +00:00
mav
5f22f76484 MFC r280687: Make GEOM_PART work in presence of previous withered self. 2015-04-09 10:10:05 +00:00
ae
c07681e98f MFC r269854:
Remove duplicate entry.

MFC r279935:
  Add GUID and alias for Apple Core Storage partition.

  PR:		196241
2015-03-19 14:09:27 +00:00
trasz
1aec35d876 MFC r277799:
Fix sysctl name.

Sponsored by:	The FreeBSD Foundation
2015-03-07 19:46:47 +00:00
ae
204f9a5f7c MFC r279324:
When gpart(8) is trying automatically determine the first available
  block of free space after existing partition, take into account
  provider's stripeoffset, since the result will be adjusted to this
  value.

  PR:		197989
2015-03-05 10:08:37 +00:00
ngie
d4c625976a MFC r264400,r265836:
r264400:

  NO_MAN= has been deprecated in favor of MAN= for some time, go ahead
  and finish the job. ncurses is now the only Makefile in the tree that
  uses it since it wasn't a simple mechanical change, and will be
  addressed in a future commit.

r265836:

  Remove last two NO_MAN= in the tree. In both of these cases, MAN= is
  what is needed.
2014-12-31 23:25:37 +00:00
emaste
37dd226a2e MFC EFI support for the installer
r264978 (nwhitehorn):

    Add EFI support to the installer. This requires that the kernel
    provide a sysctl to determine what firmware is in use. This sysctl
    does not exist yet, so the following blocks are in front of the
    wheels:
    - I've provisionally called this "hw.platform" after the equivalent
      thing on PPC
    - The logic to check the sysctl is short-circuited to always choose
      BIOS.  There's a comment in the top of the file about how to turn
      this off.

    If IA64 acquired a boot1.efifat-like thing (probably with very few
    modifications), the same code could be adapted there.

r265016 (nwhitehorn):

    Finish connecting up installer UEFI support. If the kernel was
    booted using EFI, set up the disks for an EFI system. If booted from
    BIOS/CSM, set up for BIOS.

r268256 (nwhitehorn):

    After EFI support was added to the installer, it needed to allow
    boot partitions of types other than "freebsd-boot" (in particular,
    "efi").  This allows the removal of some nasty hacks for supporting
    PowerPC systems, in particular aliasing freebsd-boot to apple-boot
    on APM and an IBM-specific code on MBR.

    This changes the installer to use the correct names, which also
    breaks a degeneracy in the meaning of "freebsd-boot" that allows the
    addition of support for some newer IBM systems that can boot from
    GPT in addition to MBR. Since I have no idea how to detect which
    those systems are, leave the default on IBM PPC systems as MBR for
    now.

Approved by:	re
PR:		193658
Relnotes:	Yes
2014-09-15 17:49:46 +00:00
ae
0f937e3532 MFC r268407 (by gjb):
Fix non-version text after .Fx macro usage.

MFC r269487 (by issyl0):
  Add generic list, status, load and unload docs to gpart(8)

  - In the style of gmirror(8).
  PR:		docs/191534

MFC r269852:
  Add sysctl and loader tunable kern.geom.part.mbr.enforce_chs that is set
  by default. It can be used to disable automatic alignment to CHS geometry,
  that GEOM_PART_MBR does.
2014-08-25 12:49:10 +00:00
wblock
d8d95145c2 MFC r267617:
Fix spelling, typos, missing articles, contractions.  Expanded version
of patch supplied with PR.
2014-07-15 23:20:25 +00:00
ae
b3514fe3a8 MFC r268090:
Document all aliases supported by GEOM_PART class.
2014-07-08 01:01:30 +00:00
ae
b6530ab0a7 MFC r267355:
Add UUIDs for DragonFlyBSD's partition types.

MFC r267356:
  Add DragonFlyBSD's Hammer FS types and type names.

MFC r267357:
  Add aliases for DragonFlyBSD's partition types.

MFC r267358:
  Allow dumping to DragonFlyBSD's swap partition.

MFC r267359:
  Add disklabel64 support to GEOM_PART class.

  This partitioning scheme is used in DragonFlyBSD. It is similar to
  BSD disklabel, but has the following improvements:
  * metadata has own dedicated place and isn't accessible through partitions;
  * all offsets are 64-bit;
  * supports 16 partitions by default (has reserved place for more);
  * has reserved place for backup label (but not yet implemented);
  * has UUIDs for partitions and partition types;

MFC r267360:
  Add disklabel64 support

Relnotes:	yes
2014-07-01 13:29:17 +00:00
marck
207aa6a18b MFC: r266483
Document VMware-related filesystems additions.

	Reviewed by:	jmg
2014-05-28 15:02:42 +00:00
ae
fa4bb91966 MFC r264039:
Document more parition types.
2014-04-09 13:35:39 +00:00
ae
2865f87f4a MFC r259634:
Prevent users from deactivating the last component of a mirror.

MFC r259929:
  Add an ability to stop gmirror and clear its metadata in one command.
  This fixes the problem, when gmirror starts again just after stop.

  The problem occurs when gmirror's component has geom label with equal size.
  E.g. gpt and gptid have the same size as partition, diskid has the same
  size as entire disk. When gmirror's geom has been destroyed, glabel
  creates its providers and this initiate retaste.

  Now "gmirror destroy" command is available. It destroys geom and also
  erases gmirror's metadata.

PR:		184985
2014-01-10 07:48:36 +00:00
ae
5308ec5802 MFC r258357:
Add "resize" verb to gmirror(8) and such functionality to geom_mirror(4).
  Now it is easy to expand the size of the mirror when all its components
  are replaced. Also add g_resize method to geom_mirror class. It will write
  updated metadata to new last sector, when parent provider is resized.
2014-01-10 07:43:40 +00:00
asomers
7779917bec MFC 257006
sbin/geom/class/part/geom_part.c
        Always validate the return of find_geomcfg().  It could be NULL, for
        example when the geom is withering.

Approved by:    ken (mentor)
Sponsored by:   Spectra Logic Corporation
2013-12-13 16:55:39 +00:00
pluknet
3f9b259642 Sweep man pages replacing ad -> ada.
Approved by:	re (blackend)
MFC after:	1 week
X-MFC note:	stable/9 only
2013-10-01 18:41:53 +00:00
crees
08061c3f1e Note NULL encryption method for GELI
PR:		docs/180551
Submitted by:	r4721@tormail.org
Approved by:	gjb (mentor)
2013-08-05 10:38:34 +00:00
wblock
e997c4f73e Add a new gptboot(8) man page. Factor out the redundant information
in gpart(8) and boot(8), adding references to gptboot(8) in both.

Reviewed by:	jhb, ae, pjd, Paul Schenkeveld <bsdcan@psconsult.nl>, david_a_bright@dell.com (portions), gjb
MFC after:	1 week
2013-07-01 22:38:36 +00:00
marcel
0c3f6d383d Change the set and unset ctlreqs by making the index argument optional.
This allows setting attributes on tables. One simply does not provide
an index in that case. Otherwise the entry corresponding the index has
the attribute set or unset.

Use this change to fix a relatively longstanding bug in our GPT scheme
that's the result of rev 198097 (relatively harmless) followed by rev
237057 (damaging). The damaging part being that our GPT scheme always
has the active flag set on the PMBR slice. This is in violation with
EFI. Existing EFI implementions for both x86 and ia64 reject the GPT.
As such, GPT disks created by us aren't usable under EFI because of
that.

After this change, GPT disks never have the active flag set on the PMBR
slice. In order to make the GPT disk bootable under some x86 BIOSes,
the reason of rev 198097, one must now set the active attribute on the
gpt table. The kernel will apply this to the PMBR slice For (S)ATA:
	gpart set -a active ada0

To fix an existing GPT disk that has the active flag set in the PMBR,
and that does not need the flag, use (again for (S)ATA):
	gpart unset -a active ada0

The EBR, MBR & PC98 schemes, which also impement at least 1 attribute,
now check to make sure the entry passed is valid. They do not have
attributes that apply to the table.
2013-06-09 23:34:26 +00:00
joel
a0b7a4476c Minor clarificiation.
PR:		177455
2013-04-22 17:38:26 +00:00
ed
120125784a Add the Clang specific -Wmissing-variable-declarations to WARNS=6.
This compiler flag enforces that that people either mark variables
static or use an external declarations for the variable, similar to how
-Wmissing-prototypes works for functions.

Due to the fact that Yacc/Lex generate code that cannot trivially be
changed to not warn because of this (lots of yy* variables), add a
NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this
specific compiler warning.

Announced on:	toolchain@
2013-04-19 19:45:00 +00:00
jmg
8d0d0606e6 update information about debugging sysctl...
MFC after:	1 week
2013-04-14 16:20:25 +00:00
joel
7a7d50bfd4 Remove kernel options from the SYNOPSIS. They are already documented in the
geom(4) manual page SYNOPSIS.
2013-04-11 18:02:42 +00:00
joel
acae1cdab7 Minor rewording.
Discussed with:	mav
2013-04-04 10:26:09 +00:00
joel
009d7ce55c Remove references to ataraid(4) and atacontrol(8). 2013-04-04 08:45:37 +00:00
maxim
59efa29db9 o Typo: IEE -> IEEE.
PR:		docs/173069
Submitted by:	Bjorn Heidotting
MFC after:	1 week
2013-03-25 12:38:45 +00:00
pjd
ee34459918 Reduce stack usage. 2013-03-18 21:11:31 +00:00
joel
7b26e8ff4f Cross-reference gvinum(8) instead of vinum(8). 2013-03-16 22:02:47 +00:00
sbruno
22372779e5 Add legacy support to geom raid to create a /dev/arX device for support
of upgrading older machines using ataraid(4) to newer releases.

This optional parameter is controlled via kern.geom.raid.legacy_aliases
and will create a /dev/ar0 device that will point at /dev/raid/r0 for
example.

Tested on Dell SC 1425 DDF-1 format software raid controllers installing from
stable/7 and upgrading to stable/9 without having to adjust /etc/fstab

Reviewed by:	mav
Obtained from:	Yahoo!
MFC after:	2 Weeks
2013-03-08 20:07:32 +00:00
benno
5dde1547f6 Fix typo in EFI GPT GUID. 2013-02-27 03:43:16 +00:00
pjd
385da813c5 Fix minor memory leak. 2013-02-10 15:56:47 +00:00
pjd
861349429a Assert that if we are not dealing with keyfile we are dealing with passfile. 2013-02-10 15:56:20 +00:00
pjd
007755626a Use arc4random_buf(3) instead of reimplementing it. 2013-02-10 15:55:42 +00:00
wblock
2390f6ef87 Expand description of how gptboot and gptzfsboot choose a partition for
booting.

Reviewed by:	ae
MFC after:	1 week
2013-01-25 16:33:00 +00:00
mav
d3c13df6d1 For Promise/AMD metadata add support for disks with capacity above 2TiB
and for volumes with sector size above 512 bytes.
2013-01-17 00:50:25 +00:00
mav
97cf52e0e8 Allow to insert new component to geom_raid3 without specifying number.
PR:		kern/160562
MFC after:	2 weeks
2013-01-15 10:06:35 +00:00
kib
aa8d1947b9 Use tabs for indentation.
MFC after:	2 weeks
2013-01-05 21:52:38 +00:00
kib
a460c4d98b Do not round up the size of the UFS filesystem to the fragment size
when comparing its size with the size of the media, to determine if
the last disk block is unused.

Submitted by:	Andreas Longwitz <longwitz@incore.de>
Reviewed by:	pjd
MFC after:	2 weeks
2013-01-05 21:42:14 +00:00
wblock
4f4f5f3fa0 Document the output of the show command. Modified version of patch
provided by Bas Smeelen <b.smeelen@ose.nl>.  Use of 'gpart list'
suggested by by Andrey V. Elsukov <ae@FreeBSD.org>.

PR:		docs/174270
Submitted by:	Ronald F.Guilmette <rfg@tristatelogic.com>
Reviewed by:	ae (block sizes)
MFC after:	1 week
2013-01-03 21:58:28 +00:00
ed
af31e8843c More -Wmissing-variable-declarations fixes.
In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
2012-10-19 14:49:42 +00:00
mav
db9e01aca9 Add global and per-module sysctls/tunables to enable/disable metadata taste.
That should help to handle some cases when disk has some RAID metadata that
should be ignored, especially during boot.

MFC after:	3 days
2012-09-13 13:27:09 +00:00
des
3e53f10006 Change the gptboot example so the boot partition is aligned on a 4 kB
boundary.

MFC after:	3 days
2012-08-29 15:18:56 +00:00