summaryrefslogtreecommitdiffstats
path: root/sys/geom/part
Commit message (Collapse)AuthorAgeFilesLines
* o When creating the EBR scheme, set the number of entriesmarcel2009-02-211-0/+2
| | | | | | | | | | | | properly. Otherwise the minimum of 1 is used and you can only insert a single partition/slice and only at sector 0 (index 1). o When adding a partition/slice, recalculate the index after the start and size of the partition/slice are adjusted to make them a multiple of the track size. Since the precheck method sets the index based on the start of the partition as provided by the user, we know that we're off by at most 1 and adjusting the index is safe.
* Add bootcode handling.marcel2009-02-211-13/+46
|
* Provide compatibility symlink for logical partitions:marcel2009-02-203-1/+69
| | | | | | | | | | 1. Extend geom_dev by having it create the symlink (i.e. call make_dev_alias) based on the DIOCGPROVIDERALIAS ioctl. In this way the functionaility is generic and thus usable by any geom/provider. 2. Have g_part handle said ioctl through the devalias method, so that it's under control of the scheme itself. By design the alias will not be created for newly added partitions.
* Fix an infinite loop created when the last logical partition ismarcel2009-02-201-3/+3
| | | | removed.
* Add a default implementation for pre-check. It shouldmarcel2009-02-171-2/+12
| | | | | | always succeed if not implemented. Pointy hat: marcel
* Remove gpt_offset and related code. It was introduced for usemarcel2009-02-172-26/+0
| | | | | by the BSD scheme, ended up not to be needed. Remove to avoid abuse and to keep the bloat to a minimum.
* Add support to add, delete and modify logical partitions, as wellmarcel2009-02-161-6/+251
| | | | | as to create and destroy the extended partitioning scheme. In other words: full support.
* Add method precheck to the g_part interface. The precheckmarcel2009-02-153-20/+43
| | | | | | | | | | | | | | | | | | | | | method allows schemes to reject the ctl request, pre-check the parameters and/or modify/set parameters. There are 2 use cases that triggered the addition: 1. When implementing a R/O scheme, deletes will still happen to the in-memory representation. The scheme is not involved in that operation. The pre-check method can be used to fail the delete up-front. Without this the write to disk will typically fail, but at that time the delete already happened. 2. The EBR scheme uses a linked list to record slices. There's no index. The EBR scheme defines the index as a function of the start LBA of the partition. The add verb picks an index for the range and then invokes the add method of the scheme to fill in the blanks. It is too late for the add method to change the index. The pre-check is used to set the index up-front. This also (silently) overrides/nullifies any (pointless) user-specified index value.
* Fix g_part_dumpconf and g_part_name prototpyes.imp2009-02-104-21/+16
| | | | Submitted by: marcel@
* Add the EBR scheme. The EBR scheme supports the Extended Boot Recordsmarcel2009-02-082-0/+345
| | | | | | | | found inside extended partitions and used to create logical partitions. At this time write/modify support is not (yet) present. The EBR and MBR schemes both check the parent scheme. The MBR will back-off when nested under another MBR, whereas the EBR only nests under a MBR.
* Allow gpe_offset to be set by the scheme. When gpe_offset is zero,marcel2009-02-081-2/+7
| | | | | or invalid, initialize it to the start of the partition. Adjust the mediasize when the offset lies somewhere inside the partition.
* o Add the "PART::scheme" attribute that returns the name of themarcel2009-02-081-0/+7
| | | | | | | | | | | | | | | underlying partitioning scheme. o Put the start and end of the partition in the XML configuration. The start and end are the LBAs of the first and last sector (resp.) of the partition. They are currently identical to the offset and size attributes, which describe the partition as an offset and size in bytes, but may not in the future. The start and end will be used for the logical partition boundaries and may include metadata. The offset and size will always represent the useful storage space within the partition. Typically these two notions are the same, but for logical partitions in an extended partition, the EBR is more naturally treated as being part of the partition.
* Fix g_part_*dumpconf to return void to match kobj definition.imp2009-02-082-10/+8
| | | | Fix g_part_*name to return a const char * rather than a char *.
* - Don't enforce an upper-bound to the number of sectors or heads,marius2009-01-061-7/+15
| | | | | | | | | | | | | | | | | | | | | allowing the full 16-bit width of the corresponding fields in the VTOC8 label to be used. The removed limits basically only held true for providers labeled using the synthetic geometry provided by cam_calc_geometry(9) but neither SCSI disks labeled with Solaris nor sufficiently large ATA disks. - Given that providers (originally) labeled with Solaris typically use the native geometry as reported by the target while FreeBSD typically uses a synthetic one put the message complaining about mismatching geometries between what the label indicates and what GEOM thinks the provider has, which we generally can't help, under bootverbose in order to not unnecessarily scare users. - For informational purposes add the non-matching values to the message complaining about them, similar to what r186501 did for g_part_bsd_read() except also indicating the origin of the values. - Make it clear that the messages emitted by this code refer to the VTOC8 support rather than to another existing scheme or to VTOC32.
* Don't enforce an upper-bound to the number of sectors or headsmarcel2009-01-061-4/+2
| | | | | that that the provider has. The limits we imposed were PC BIOS specific and not always applicable.
* Improve probing.marcel2009-01-041-5/+9
| | | | | | | | | o Don't check the dummy fields. o The entry is unused if either dp_mid is 0 or dp_sid is 0. o The start or end cylinder cannot be 0. o The start CHS cannot be equal to the end CHS. Submitted by: nyan
* When the geometry does not match the label, print out the values.obrien2008-12-261-3/+4
|
* Allow boot code to be smaller than what the scheme expects.marcel2008-12-014-5/+20
| | | | | This effectively changes the boot code size to be an upper bound and makes the interface more flexible.
* Allow dumpon to a partition of type FS_UNUSED as well.marcel2008-11-261-2/+3
|
* Partition type FS_UNUSED does not mean the partition entrymarcel2008-11-181-3/+1
| | | | | | | is unused. Unused partition entries have a partition size of zero. Therefore, partitions can have type FS_UNUSED. MFC after: 3 days
* Fix a panic caused by a corrupted table when the header ismarcel2008-11-061-4/+7
| | | | | | | | | still valid. We were checking the state of the header and not the table. PR: 119868 Based on a patch from: Jaakko Heinonen <jh@saunalahti.fi> MFC after: 1 week
* Add support for reading Tivo Series 1 partitioning. This likely needsimp2008-11-021-12/+52
| | | | | | | | | a little refinement, but is good enough to commit as is. # Should look to see if I should move swab(3) into the kernel or just # provide the unoptimized routine here. Reviewed by: marcel@
* Invalid BSD disklabels have been created by sysinstall andmarcel2008-10-251-1/+6
| | | | | | | | | | | | | | | 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>
* Allow dumps to partitions with a tag of 0. The legacymarcel2008-10-221-2/+5
| | | | | sunlabel implementation in FreeBSD does not use VTOC information and as such as no partition types.
* The active and bootable flags are not part of the type.marcel2008-10-201-11/+82
| | | | | | | | | | Export the active and bootable flags as attributes in the configuration XML and allow them to be manipulated with the set/unset commands. Since libdisk treats the flags as part of the partition type, preserve behavior by keeping them included in the configuration text.
* Return G_PART_PROBE_PRI_HIGH instead of G_PART_PROBE_PRI_NORMmarcel2008-09-291-1/+1
| | | | | | | | | 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.
* Insert the null scheme at the head. This does not change anymarcel2008-09-291-1/+1
| | | | | functionality, but creates an invariant: the first element on the list is always the null scheme.
* Export the partition name in the conftxt and confxml output.marcel2008-09-271-6/+12
| | | | | | | The conftxt output is used by libdisk, and the confxml output is used by gpart itself (gpart show -l). Submitted by: nyan@
* Hold the root mount while we're tasting. It is possiblemarcel2008-09-271-0/+4
| | | | | | that a nested partition (typically the BSD disklabel) is not done tasting while the root file system is being mounted. While this is rare, it's still possible.
* Allow 255 sectors/track for the BSD disklabel. The previous limitmarcel2008-09-271-1/+1
| | | | | | | 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@
* Fix build.rpaulo2008-09-051-2/+2
|
* Keep entries sorted.rpaulo2008-09-053-3/+3
|
* Include the vendor in the partition name.rpaulo2008-09-051-1/+1
|
* Detect Apple HFS GPT slices.rpaulo2008-09-053-1/+9
|
* Add sbuf_new_auto as a shortcut for the very common case of creating ades2008-08-091-7/+7
| | | | | | | completely dynamic sbuf. Obtained from: Varnish MFC after: 2 weeks
* Trivial commit to attempt to diagnose a svn problem. Addpeter2008-07-221-0/+1
| | | | comment that Tivo disks are APM, but do not have a DDR record.
* Add the set and unset verbs used to set and clear attributes formarcel2008-06-184-5/+130
| | | | | partition entries. Implement the setunset method for the MBR scheme to control the active flag.
* Finish the support for partition labels and add it to the XML.marcel2008-06-121-10/+86
|
* Add the raw partition type to the XML.marcel2008-06-121-6/+12
|
* Add the raw partition type to the XML.marcel2008-06-121-4/+11
|
* Add the raw partition type to the XML.marcel2008-06-121-4/+10
|
* Add the raw partiton type to the XML.marcel2008-06-121-6/+14
|
* Add the raw partition type to the XML.marcel2008-06-121-4/+10
|
* Add the partition label and the raw partition type to the XML.marcel2008-06-121-5/+19
|
* Implement the G_PART_DUMPCONF method for all 6 schemes. Also callmarcel2008-04-237-0/+113
| | | | | | | | | | 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.
* Add the bootcode verb for installing boot code. Boot codemarcel2008-04-136-23/+147
| | | | | is supported for the MBR, GPT and PC98 schemes, where GPT installs boot code into the PMBR.
* Change the order from SI_ORDER_FIRST to SI_ORDER_ANY (withinmarcel2008-03-291-1/+1
| | | | | | | SI_SUB_DRIVERS) to avoid loading schemes before all the GEOM classes have been loaded and initialized. Otherwise we may end up using mutexes that haven't been initialized (due to g_retaste() posting an event).
* Add support for PC-9800 partition tables.marcel2008-03-281-0/+428
|
* Redefine G_PART_SCHEME_DECLARE() from populating a private linker setmarcel2008-03-237-27/+128
| | | | | | | | 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.
* Add support for VTOC8 labels (aka sun disk labels). When a label doesmarcel2008-03-021-0/+480
| | | | | | | | not have VTOC information about the partitions, it will be created. This is because the VTOC information is used for the partition type and FreeBSD's sunlabel(8) does not create nor use VTOC information. For this purpose, new tags have been added to support FreeBSD's partition types.
OpenPOWER on IntegriCloud