History log of /freebsd-head/sys/geom/part/g_part_bsd.c
Revision Date Author Comments
dd6f2f2c8db6f6b0def5142f024bc873b1151cdf 10-Apr-2018 kevans <kevans@FreeBSD.org> Annotate geom modules with MODULE_VERSION

GEOM ELI may double ask the password during boot. Once at loader time, and
once at init time.

This happens due a module loading bug. By default GEOM ELI caches the
password in the kernel, but without the MODULE_VERSION annotation, the
kernel loads over the kernel module, even if the GEOM ELI was compiled into
the kernel. In this case, the newly loaded module
purges/invalidates/overwrites the GEOM ELI's password cache, which causes
the double asking.

MFC Note: There's a pc98 component to the original submission that is
omitted here due to pc98 removal in head. This part will need to be revived
upon MFC.

Reviewed by: imp
Submitted by: op
Obtained from: opBSD
MFC after: 1 week
Differential Revision: https://reviews.freebsd.org/D14992
a82e3a8b2430553d1a48209e110921023d727e45 27-Nov-2017 pfg <pfg@FreeBSD.org> sys/geom: adoption of SPDX licensing ID tags.

Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.
a69327a6a6622e3fd4d355dbc50377a1b71333ea 21-Nov-2017 imp <imp@FreeBSD.org> Remove trailing whitespace (one I just introduced and a bunch of
others in the same directory).

Sponsored by: Netflix
00d578928eca75be320b36d37543a7e2a4f9fbdb 27-May-2016 grehan <grehan@FreeBSD.org> Create branch for bhyve graphics import.
32dcf3933ae22fbfb85b50bf3abccef14d82f274 20-Apr-2016 pfg <pfg@FreeBSD.org> Indentation issues.

Contract some lines leftover from r298310.

Mea culpa.
a7d40a88c91d105dcfe2f235bc84a522bfea3de2 19-Apr-2016 pfg <pfg@FreeBSD.org> kernel: use our nitems() macro when it is available through param.h.

No functional change, only trivial cases are done in this sweep,

Discussed in: freebsd-current
20163879d8b33bcbcbe0718b7369c9c8d2fd571b 06-Jan-2015 imp <imp@FreeBSD.org> Remove old ioctl use and support, once and for all.
21eead8e9118723d9442b4151b4d97f9c12c6551 20-Nov-2014 imp <imp@FreeBSD.org> Actually, that was a bad idea. Go back to MAXPARTITIONS.

Submitted by: bruce
89b75f4cb6aff60168eef86c2b051db051c48e44 19-Nov-2014 imp <imp@FreeBSD.org> The number of BSD partitions is variable. Return the proper number
(which is in basetable->gpt_entries).

Submitted by: ae@
3c75037f3e1c19fb43fc3d662c253fe3c772ba05 18-Nov-2014 imp <imp@FreeBSD.org> Implement the historic DIOCGDINFO ioctl for gpart on BSD
partitions. Several utilities still use this interface and require
additional information since gpart was activated than before. This
allows fsck of a UFS partition without having to specify it is UFS,
per historic behavior.
b6530ab0a75df248778a68ad2c476a217ce76392 01-Jul-2014 ae <ae@FreeBSD.org> 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
f045bddc4eff5fc14e7956951a527b0ed7e45ba8 11-Jun-2014 ae <ae@FreeBSD.org> Add aliases for DragonFlyBSD's partition types.

MFC after: 2 weeks
8e5289f450c978cf458941bf5d2dd8bd3a7d7a9b 12-May-2014 ae <ae@FreeBSD.org> MFC r256690:
Add an automatic resize support to the GEOM_PART class.

When parent provider has been resized, the scheme specific G_PART_RESIZE
method does an update of scheme's metadata. But all changes are not saved
to disk, until `gpart commit` will be called.

MFC r265336:
Add an advice what to do when partition was automatically resized.
eb1a5f8de9f7ea602c373a710f531abbf81141c4 21-Feb-2014 gjb <gjb@FreeBSD.org> Move ^/user/gjb/hacking/release-embedded up one directory, and remove
^/user/gjb/hacking since this is likely to be merged to head/ soon.

Sponsored by: The FreeBSD Foundation
6b01bbf146ab195243a8e7d43bb11f8835c76af8 27-Dec-2013 gjb <gjb@FreeBSD.org> Copy head@r259933 -> user/gjb/hacking/release-embedded for initial
inclusion of (at least) arm builds with the release.

Sponsored by: The FreeBSD Foundation
05ca533af6819555c1c445085cd62d92ae824773 17-Oct-2013 ae <ae@FreeBSD.org> Add an automatic resize support to the GEOM_PART class.

When parent provider has been resized, the scheme specific G_PART_RESIZE
method does an update of scheme's metadata. But all changes are not saved
to disk, until `gpart commit` will be called.

Discussed with: trasz
MFC after: 1 month
5306b1eeab09fc89054e9d4151e0f7b293e90146 25-May-2012 marcel <marcel@FreeBSD.org> Add a partition type for nandfs to the apm, bsd, gpt and vtoc8 schemes.
The gpart alias for these partition types is "freebsd-nandfs".
459dac9ae12ce812640844e10164607e4115645c 08-Mar-2012 emaste <emaste@FreeBSD.org> Remove unactionable message about label geometry

It's not clear to a user what they should do after seeing the "geometry
does not match label" kernel message, and it does not appear to present
a problem in practice. Thus, just remove the messages.

Approved by: marcel
f892d9414af8b47d6971e28906e6f4e5470219b9 20-Jun-2011 ae <ae@FreeBSD.org> Change the way how we update bootcode for BSD scheme.
Since the only parameter that we check is size of bootcode, then
allow only two sizes: size of boot1 and size of /boot/boot.
This partially protects users from losing ability to boot if incorrect
bootcode is specified.

Requested by: ru
a0e3009476be448d59844c5c97bc2c7eeeab4efa 08-May-2011 ae <ae@FreeBSD.org> Limit number of sectors that can be addressed.

MFC after: 1 week
6bf702a55bf6e540929bc37a97ba26e51394a94c 25-Feb-2011 netchild <netchild@FreeBSD.org> Add some FEATURE macros for various GEOM classes.

No FreeBSD version bump, the userland application to query the features will
be committed last and can serve as an indication of the availablility if
needed.

Sponsored by: Google Summer of Code 2010
Submitted by: kibab
Reviewed by: silence on geom@ during 2 weeks
X-MFC after: to be determined in last commit with code from this project
258630083a992bd8475c64eb6dd3de7518a2ab70 27-Jan-2011 ae <ae@FreeBSD.org> While inspecting the disklabel check that start offset of partition is
within provider's bounds. If not then reject this disklabel.
Mark bbarea as NULL to do not free it again in destroy method.

MFC after: 1 week
904cc72f190967800c699fe0d05d7044b2414147 02-Dec-2010 ivoras <ivoras@FreeBSD.org> Add a note about the magic number 20. Actually, 22.75 entries fit in
a 512 byte sector but when choosing magic numbers, 20 looks nicer.

Discussed with: marcel
09f9c897d33c41618ada06fbbcf1a9b3812dee53 19-Oct-2010 jamie <jamie@FreeBSD.org> A new jail(8) with a configuration file, to replace the work currently done
by /etc/rc.d/jail.
926697037a775a808ee3f60c01d723b006cb41ae 11-Jun-2010 marius <marius@FreeBSD.org> MFC: r208746

Don't leak memory on destruction.

Reviewed by: marcel
Approved by: re (kib)
f05cc30a988fbf6bb187c8f51e001af03f07472e 02-Jun-2010 marius <marius@FreeBSD.org> Don't leak memory on destruction.

Reviewed by: marcel
MFC after: 3 days
be854af5d14098bfb67a3e4bed86d0bb5d62cc92 23-Apr-2010 marcel <marcel@FreeBSD.org> Implement the resize verb and add support for resizing partitions
for all schemes but EBR. Quality work by Andrey!

Submitted by: "Andrey V. Elsukov" <bu7cher@yandex.ru>
f1216d1f0ade038907195fc114b7e630623b402c 19-Mar-2010 delphij <delphij@FreeBSD.org> Create a custom branch where I will be able to do the merge.
7133fbf3b234a6ce945c663259c9513aa6a2abb6 25-Jan-2010 trasz <trasz@FreeBSD.org> Remove unneeded variables.

Found with: clang
1525b2b738e72cc7a7f99298340391c1e0fb144e 27-Mar-2009 marcel <marcel@FreeBSD.org> Sharpen the saw:
o BSD uses 32-bit block numbers. Limit the scheme to 2^32-1
blocks when the media is larger.
42a7dd58e4032ee5f5b726aa625cd53514b2d6cb 21-Feb-2009 marcel <marcel@FreeBSD.org> Add bootcode handling.
de0440230a608745b647cff0dc9189aa3628ada1 08-Feb-2009 imp <imp@FreeBSD.org> Fix g_part_*dumpconf to return void to match kobj definition.
Fix g_part_*name to return a const char * rather than a char *.
e06c47109ccf822fe4f49c9a8e5c428fe0488b7e 26-Dec-2008 obrien <obrien@FreeBSD.org> When the geometry does not match the label, print out the values.
11ca3c2595160eeb7c1b645aba5a5c9446ce1c34 26-Nov-2008 marcel <marcel@FreeBSD.org> Allow dumpon to a partition of type FS_UNUSED as well.
86005b831182ee450f09768af15a255ba08f0ff5 18-Nov-2008 marcel <marcel@FreeBSD.org> Partition type FS_UNUSED does not mean the partition entry
is unused. Unused partition entries have a partition size
of zero. Therefore, partitions can have type FS_UNUSED.

MFC after: 3 days
27c09cdcec9ef5edfa7f22d40d6925ab4e1b7f75 01-Nov-2008 kmacy <kmacy@FreeBSD.org> IF_RELENG7 183757:184526
8fb9b724ff720705e8eeeedd65f997aa95f53cdb 25-Oct-2008 marcel <marcel@FreeBSD.org> Invalid BSD disklabels have been created by sysinstall and
are possibly still being created. The d_secperunit field
contains the number of sectors of the disk and not of the
slice/partition to which the disklabel applies.
Rather than reject the disklabel, we now silently adjust
the field. Existing code, like bslabel(8), does not seem
to check the label that extensively and seems to adjust
fields as a side-effect as well.
In other words, it's not that important apparently, so
gpart should not be too strict about it.

Reported by: nyan@
Reported by: Andriy Gapon <avg@icyb.net.ua>
cf5320822f93810742e3d4a1ac8202db8482e633 19-Oct-2008 lulf <lulf@FreeBSD.org> - Import the HEAD csup code which is the basis for the cvsmode work.
1fe9adfff0df06eb3b50066d40218df2a484acd0 29-Sep-2008 marcel <marcel@FreeBSD.org> Return G_PART_PROBE_PRI_HIGH instead of G_PART_PROBE_PRI_NORM
if the probe succeeds. This guarantees that the BSD scheme
wins over the MBR scheme when MBR gets to probe first. Build-
or link-time conditions can cause schemes to end up in the
linker set in a different order. Normally BSD is before MBR
in the linker set and as such get to probe first. But typically
when the kernel gets rebuild or relinked, this can change.
3177393070971da5219f5f2ef9b2e19b00821465 27-Sep-2008 marcel <marcel@FreeBSD.org> Allow 255 sectors/track for the BSD disklabel. The previous limit
of 63 sectors/track is too PC BIOS specific. On pc98, where the
BSD disklabel is used as well, 255 sectors/track is not uncommon.

Submitted by: nyan@
77394dc9ce6e1491077a3de6f6aa6e80fbf0221a 26-Jul-2008 marcel <marcel@FreeBSD.org> MFC r179747-179748,179750-179752,179755-179756

Add the raw partition type to the XML.
169adaca5e7035f357df3db94920b11459a21554 12-Jun-2008 marcel <marcel@FreeBSD.org> Add the raw partition type to the XML.
a512895f3c87ff4e222e8d5d9ab7f9a3a7d9b149 09-Jun-2008 marcel <marcel@FreeBSD.org> MFC r177223 through r179684:
o Redefine G_PART_SCHEME_DECLARE() from populating a private
linker set to declaring a proper module.
o Add support for PC-9800 partition tables.
o Change the order from SI_ORDER_FIRST to SI_ORDER_ANY (within
SI_SUB_DRIVERS) to avoid loading schemes before all the GEOM
classes have been loaded and initialized.
o Add the bootcode verb for installing boot code.
o Implement the G_PART_DUMPCONF method for all 6 schemes.
38e8adf72053670c84a15fd57d641357ec1d4501 23-Apr-2008 marcel <marcel@FreeBSD.org> Implement the G_PART_DUMPCONF method for all 6 schemes. Also call
the method for the (indent == NULL) case (i.e. the kern.geom.conftxt
sysctl). The purpose is to extend the conftxt output with scheme-
specific fields which can be used by libdisk. In particular, have
the schemes dump the xs and xt fields, which contain the backward
compatible values for class type and partition type. This allows
libdisk to work with the legacy slicers as well as with gpart and
helps/promotes migration.
c184f6ced2d94b18defce564aa19ac904e701381 23-Mar-2008 marcel <marcel@FreeBSD.org> Redefine G_PART_SCHEME_DECLARE() from populating a private linker set
to declaring a proper module. The module event handler is part of the
gpart core and will add the scheme to an internal list on module load
and will remove the scheme from the internal list on module unload.
This makes it possible to dynamically load and unload partitioning
schemes.
47125c335e95cc1257523b9163f6f44d99248795 18-Jan-2008 cvs2svn <cvs2svn@FreeBSD.org> This commit was manufactured by cvs2svn to create branch 'RELENG_7'.
5817fa6edc7badf743a8f2b9877038a445bfad11 24-Dec-2007 marcel <marcel@FreeBSD.org> Various fixes:
o BSD disklabels have relative offsets. Even for the BSD in MBR slice
setup, except when the mbroffset ioctl is supported. Since we don't
support that ioctl, bsdlabel(8) expects relative offsets. So, when
reading an existing disklabel, correct for disklabels that mistakenly
have the mbroffset offsets.
o Don't take the geometry seriously, because it's untrustworthy. We do
expect the numbers to be within range. This means that the secperunit
field will not be computed from secpercyl and ncyls, but simply is
the mediasize in sectors.
o Don't enforce partitions to be aligned to track boundaries. The
default label, constructed by bsdlabel(8), puts partition a at offset
BBSIZE bytes, which commonly means sector 16.
7827a1496ac105c837da84cd8e270af2cf731a17 08-Dec-2007 marcel <marcel@FreeBSD.org> Add support for FS_ZFS.
5f073f27891e074a1328a322fd6bcf3dc7aebd87 06-Dec-2007 marcel <marcel@FreeBSD.org> Add a BSD disklabel backend to g_part:
o Disklabels can have between 8 and 20 partitions (inclusive).
o No device special file is created for the raw partition.
o Switch ia64 to use this backend.
o No support for boot code yet.