summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
Commit message (Collapse)AuthorAgeFilesLines
* (_get_disk_type) factorize code after previous commitsThierry Vignaud2019-04-211-6/+9
|
* Minimise calls to ped_disk_probe() when writing partition tables.Martin Whitaker2019-04-201-0/+2
|
* Remove obsolete comment and fix indentation.Martin Whitaker2019-04-201-26/+24
|
* Minimise calls to ped_disk_probe() when reading partition tables (mga#15752)Martin Whitaker2019-04-201-0/+8
|
* enhance partition_table docThierry Vignaud2018-11-221-0/+32
|
* When writing a GPT partition table, merge all actions into a single commit.Martin Whitaker2017-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids unnecessary udev events, which in some cases were causing udevd to trigger a kernel partition table reread, causing the kernel to get out of sync with drakx. In order to do so, the libparted bindings are enhanced so that we manipulate a 'ped_disk' object: - disk_open() returns such an object - set_disk_type() is removed - disk_commit() writes back the partition table and tell the kernel about it if we fails to write the partition table, we let partition_table::write() fire an exceptionc if we only have succeed in writing the partition table, we let partition_table::write() try harder (umounting partitions before trying againt to tell the kernel again) - need_to_tell_kernel() is overrided The last change is needed because we now tell the kernel about the new partition layout in partition_table::gpt::write() when calling disk_commit() while previously we were deferring that to partition_table::write() which after having called the gpt's write() calls tell_kernel() -> c::tell_kernel_to_reread_partition_table() So we must tell partition_table::write() that telling the kernel to reread the partition_table is not needed if we already succeeded in that.
* Record the partition table type when initialising a partition table.Martin Whitaker2017-03-141-0/+1
| | | | | | | | When performing an automatic install that uses the clear or clearall option, we don't read the current partition table, so the current partition table type was not getting recorded in $hd->{pt_table_type}. This information is needed to determine whether a BIOS boot partition is required.
* Revised fix for clearing GPT partitions during automatic install.Martin Whitaker2017-03-141-2/+10
| | | | | | | | | | | | | | | | This reverts commit 532fd1d60df306e204bae79c5158ca2302739966, which introduced a new bug when clearing GPT partitions in an interactive session (mga#20264), and replaces it with a new solution. When a partition table is initialised, we now add an 'init' action to the $hd->{will_tell_kernel} list. This is used both by gpt::write() (to clear the partition table) and by partition_table::tell_kernel() (to force the kernel to reread the partition table). Previous changes stored in $hd->{will_tell_kernel} are discarded, as they are no longer of interest. This also removes support for the will_tell_kernel 'force_reboot' action, as nothing uses that any more.
* Fix auto-allocation of BIOS boot partitions (mga#20161, mga#19888).Martin Whitaker2017-02-251-0/+1
| | | | | | | | | | | | | | | | | This adds a specific subroutine, fsedit::auto_allocate_boot_bios_parts that detects if a BIOS boot partition is needed and allocates it if so. This allows us to relax the rules in fs::any::is_boot_bios_part_needed to allow the user to manually allocate the BIOS boot partition on a different device if they so wish. In the normal case that installation is confined to a single disk, this will allocate a single BIOS boot partition on that disk. In the rare case that installation is spread over multiple disks, it will allocate a BIOS boot partition on every disk. Given that the BIOS boot partitions are very small and that this is not a normal use case (see mga#16055), this seems an acceptable quirk - and does allow the user to then choose any disk when installing the boot loader.
* Rename partition_table::_default_type to partition_table::default_type.Martin Whitaker2017-02-251-3/+3
| | | | The following patches want to use it outside the partition_table module.
* Fix erratic behaviour when telling kernel to delete partitions (mga#20074).Martin Whitaker2017-02-251-4/+0
| | | | | | | | | | | When telling the kernel about changes to a DOS partition table, if a partition was deleted on a disk that also contained an Empty partition, the kernel also removed the Empty partition from its cached partition table (and renumbered the other partitions). Experimentation showed that leaving the udev exec queue active whilst we were telling the kernel about the changes fixed this problem, although I don't have an explanation for why it does.
* Document new partition table object API used when writing partition tables.Martin Whitaker2017-02-251-0/+27
| | | | v2 (tvignaud): enhance doc
* Don't tell the kernel about partition table changes when it rescans them ↵Martin Whitaker2017-02-251-1/+1
| | | | | | | | | | | | | | | automatically (mga#20074). When no partitions on a DOS-partitioned disk are mounted, the kernel automatically rescans the partition table when it is written to disk. We shouldn't then try to update the kernel's view of the partition table, as the list of deltas we have recorded is relative to the previous state of the partition table, not the newly rescanned state. The behaviour for other partition table types is unchanged. v2 (tvignaud): just make base class assume the kernel doesn't reread, only mbr subclass overrides need_to_tell_kernel() in order to be smarter
* Ensure the kernel doesn't rescan a partially written partition table ↵Martin Whitaker2017-02-251-3/+4
| | | | | | | | | | | | | | | | | | | (mga#20074). When no partitions on a DOS-partitioned disk are mounted, the kernel automatically rescans the partition table when the file handle to the raw device is released. Currently the code opens and closes the raw device when writing the primary partition table and when writing each extended partition table segment. As the extended partition table segments form a linked list, this allows the kernel to get in and rescan the table when the list is not in a coherent state. This patch changes the code to open the raw device before writing the primary partition table and to close it only after writing the last extended partition table segment. The behaviour for other partition table types is unchanged. v2 (tvignaud): simplify by moving copies of noop funcs into the base class
* convert some comments to PODThierry Vignaud2017-01-221-6/+35
|
* add basic PODThierry Vignaud2017-01-221-0/+43
|
* Renumber existing partitions before adding a new one (mga#19935).Martin Whitaker2017-01-171-6/+12
|
* do not switch from gpt to dos scheme on small diskThierry Vignaud2016-07-311-1/+3
| | | | | | | | or more generally, do not switch from current scheme to default one if not told otherwise else we get errors when partitionning after clearing them, such as: "INTERNAL ERROR: unknown device vda7"
* MBR limit really is 2TiB, not 4Thierry Vignaud2016-06-101-2/+2
| | | | | so use GPT for disks > 2TiB, thus fixing using invalid MBR on disks between 2 & 4 TiB
* don't guess a drive letter for ESP partitionsThierry Vignaud2015-04-121-2/+2
|
* don't guess a drive letter for recovery partitionsThierry Vignaud2015-04-091-1/+1
| | | | thus fixing mga15636
* fix telling kernel to reread partition tableThierry Vignaud2015-03-201-1/+1
| | | | use libparted in order to do so (mga#14758)
* Simplify codePascal Terjan2015-02-031-2/+1
|
* Default to GPT on large disks, not LVMPascal Terjan2015-02-031-2/+2
|
* uefi needs gpt partitioningThomas Backlund2015-01-081-2/+2
|
* remove support for ataraidThierry.Vignaud2014-06-181-1/+1
| | | | | | was killed in kernel on 2002-08-16, obsolete since kernel-2.6... See https://git.kernel.org/cgit/linux/kernel/git/tglx/history.git/commit/?id=12105c896098faf822e882f3495fee485c2ebaa5
* kill $Id:$ tagsThierry Vignaud2014-06-071-1/+1
| | | | they're obsolete since switching from CVS/SVN to git...
* drop (broken) support for Alpha, PPC, Sparc & most of IA64Thierry.Vignaud2014-05-261-37/+8
| | | | | | | | | | | | | Including Xsun, silo & yaboot support Rationale: it's unused/unmaintained for years and those arches are beyond any hope of being usefull any day... They just got in the way... Part of IA64 support is still kept (eg: support for GPT, EFI, right xorg driver at install, ...) as it might be usefull to extend to other arches Next to consider: Xbox?
* (tell_kernel) run udevadm in installer too (might fix unnecessary reboot ↵Thierry Vignaud2012-04-271-2/+2
| | | | (mga#4439))
* perl_checker cleanupsThierry Vignaud2012-03-231-2/+2
|
* partition_table: align partitions to 1MB boundaries to avoidAnssi Hannula2011-08-061-0/+13
| | | | performance issues with drives with 4k physical sectors (mga#1215)
* - perl -pi -e 's!hard drive!hard disk drive!'Ahmad Samir2011-04-041-2/+2
|
* - string changes: perl -pi -e 's!Can not!Cannot!'Ahmad Samir2011-04-041-1/+1
|
* - use 'cannot' instead of 'can not'Ahmad Samir2011-04-021-2/+2
| | | | | - use 'LDAP' instead of 'Ldap'
* Synthesized commit during git-svn import combining previous Mandriva history ↵Mageia SVN-Git Migration2011-02-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with Mageia. This commit consitsts of the following subversion commits: ------------------------------------------------------------------------ r431 | dmorgan | 2011-02-06 01:58:02 +0000 (Sun, 06 Feb 2011) | 1 line Add drakx structure on the SVN ------------------------------------------------------------------------ r432 | dmorgan | 2011-02-06 01:59:38 +0000 (Sun, 06 Feb 2011) | 1 line Import cleaned advertising ------------------------------------------------------------------------ r446 | dmorgan | 2011-02-06 22:37:08 +0000 (Sun, 06 Feb 2011) | 1 line Import Clean perl-install ------------------------------------------------------------------------ r448 | dmorgan | 2011-02-06 23:02:36 +0000 (Sun, 06 Feb 2011) | 1 line Add cleaned files ------------------------------------------------------------------------ r449 | dmorgan | 2011-02-06 23:03:52 +0000 (Sun, 06 Feb 2011) | 1 line Import cleaned kernel ------------------------------------------------------------------------ r450 | dmorgan | 2011-02-06 23:23:30 +0000 (Sun, 06 Feb 2011) | 1 line Import cleaned tools ------------------------------------------------------------------------ r451 | dmorgan | 2011-02-07 00:01:56 +0000 (Mon, 07 Feb 2011) | 1 line Import stage1 ------------------------------------------------------------------------ r473 | dmorgan | 2011-02-07 11:20:50 +0000 (Mon, 07 Feb 2011) | 1 line Import images ------------------------------------------------------------------------ r497 | ennael | 2011-02-09 21:02:06 +0000 (Wed, 09 Feb 2011) | 2 lines readd missing file ------------------------------------------------------------------------ r502 | pterjan | 2011-02-09 23:30:32 +0000 (Wed, 09 Feb 2011) | 1 line Import rescue ------------------------------------------------------------------------ r603 | ennael | 2011-02-24 13:32:54 +0000 (Thu, 24 Feb 2011) | 2 lines import cleaned rescue for Mageia ------------------------------------------------------------------------ r2061 | tv | 2011-10-20 20:32:19 +0100 (Thu, 20 Oct 2011) | 1 line import (cleaned) doc ------------------------------------------------------------------------
* diskdrake: don't ask to reboot after resize if not neededPascal Terjan2010-05-101-3/+7
|
* Rewrite gpt support with libpartedPascal Terjan2009-01-271-1/+2
|
* (write) get major/minor again after writing the partition table soThierry Vignaud2008-12-181-0/+3
| | | | | | that we got them for dynamic devices (eg: for SCSI like devices with kernel-2.6.28+)
* (add) kernel-2.6.28+ supports more than 15 partitions on SATA & SCSI devicesThierry Vignaud2008-12-171-1/+1
|
* - diskdrake:Pascal Rigaux2008-09-181-1/+2
| | | | | o handle partitions encrypted with cryptsetup
* - bootloader-config:Pascal Rigaux2008-09-161-1/+1
| | | | | | | o fix reading existing grub conf in present of /dev/mapper/xxxx0p1 partitions (which was causing bootloader-config to drop correct entries, cf #37722)
* - fix partition device name for some dmraid (missing "p", cf #38363)Pascal Rigaux2008-03-061-3/+9
| | | | | | | | simplifying code, since using "p" to separate device name from partition number when device name ends with a digit is standard in the kernel $hd->{prefix} is no more always created. Only used in same special cases
* - diskdrake:Pascal Rigaux2008-02-141-1/+3
| | | | | | o final fix for resizing's failures due to udev's race (when writing the partition, do not del/add the same partition)
* - bootloader-config, diskdrake:Pascal Rigaux2008-01-221-1/+1
| | | | | | o look for LVM PV on non partitioned disk before looking for DOS partition_table (esp. for lilo which puts the DOS magic)
* - diskdrake:Pascal Rigaux2007-12-041-38/+0
| | | | | | o drop "Undo", "Restore partition table", "Save partition table" (preparing to switch to libparted)
* - diskdrake :Pascal Rigaux2007-09-191-1/+1
| | | | | | o do not allow partitions bigger than 2TB-1 on DOS MBR, nor partitions starting above 2TB-1
* - diskdrake:Pascal Rigaux2007-09-191-5/+8
| | | | | o "Clear All" defaults to LVM on full disk if drive is >4TB
* rename partition_table::raw::clear() into partition_table::initialize()Pascal Rigaux2007-09-181-0/+23
|
* handle "LVM on full disk" like other partition tablesPascal Rigaux2007-09-181-1/+2
|
* drop unused variablesPascal Rigaux2007-09-181-1/+0
|