1246 Commits (4acf63fd9adbca56e6431bc1d317db2e110f179a)

Author SHA1 Message Date
Adriaan de Groot 8db004ce45 [partition] Use the FailJob to stop installation
- For unsafe installations (compile-time option), make sure
   things fail before partitions are actually written, unless
   the other option is also turned off.
6 years ago
Adriaan de Groot 62f03d8aad [partition] Allow unsafe partitioning decisions
- This is a compile-time choice, and off by default. This may be useful
   for developers that need to get through installation to a different
   partition on their root drive.
 - Add an option to avoid actually doing unsafe things. This is an extra
   safeguard; you need to turn on one and turn off the other option to
   really be unsafe.
6 years ago
Adriaan de Groot 105f9c4861 [partition] Set firmware type
- This got lost in 3.2.4.
 - Thanks Gabriel for hunting it down; patch applied with some changes.
6 years ago
Adriaan de Groot fdb4311a70 Merge branch 'issue-1098'
- Doesn't fix the issue, but adds useful things I want in master
   already, also for debugging other issues.
6 years ago
Adriaan de Groot 2b149fb944 [partition] Uncomment updateButtons()
- This was commented out to combat the crash in device->type()
 - I believe the crash was caused by double-deletion, which was
   fixed in 2092ec3c9a by not re-
   parenting an immutable copy of something.
 - Restore the button-fix, since we need that to keep the
   *create* button in-sync with the selected partition.

FIXES #1097
6 years ago
Adriaan de Groot 3e067e617e [partition] Add accessor and documentation to BootLoaderInstallPath 6 years ago
Arnaud Ferraris 982840bafd [partition] Allow a configurable EFI System Partition size
As requested, this commit adds a new configuration option to the
partition.conf file, name `efiSystemPartitionSize`.

When this option is absent, the default size of 300MiB will be used.

Fixes #1090

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris a5258f07a1 [partition] move bytesToSectors() and sizeToSectors() to PartUtils
In order to allow the use of these functions across the whole partition
module and keep all partition size-related functions in the same
namespace, this commit moves them to PartUtils.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris c3ccc0de0e [libcalamares] Add a KiB unit
This commit creates a _KiB operator for future use by the partition
module.
It also fixes a typo in one instance of MiBtoBytes(), requiring a couple
extra fixes.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris 90eb6afd52 [partition] move parseSizeString() function to PartUtils
In order to be able to parse partition size strings using the same
functions across the partition module, the parseSizeString() function is
exported to the PartUtils namespace.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Adriaan de Groot b4cefff975 [partition] Avoid heap-wrangling
- The CreatePartitionDialog doesn't need to be on the heap, it's
   modal here. Avoid QPointer weirdness as well.
6 years ago
Adriaan de Groot 943f3fb1f9 [partition] Improve debug-logging
- Use cDebug() instead of qDebug()
 - Be more chatty when selecting a bootloader installation path
6 years ago
Adriaan de Groot 92d9c9491a [partition] Reduce lambda-happiness
- Make some methods that are called mostly as slots, actual slots,
   instead of going through extra lambdas.
 - Use QOverload<>::of for disambiguation instead of homebrew casts.
6 years ago
Adriaan de Groot 7cfaba2d53 [partition] In logging, name device nicely
- Provide a convenience method that names a Partition* with the
   best human-readable name we can find (worst-case, spit out a
   pointer representation which will at least help figure out
   the identity of the Partition*).
6 years ago
Adriaan de Groot 8cf3c217f7 Merge branch 'requirements-checking' 6 years ago
Adriaan de Groot cece01e3c5 [partition] Simplify next() 6 years ago
Adriaan de Groot 08565b5f17 [libcalamaresui] Remove the signal done() from ViewStep
- The signal is emitted, generally from next(), but not actually used.
6 years ago
Adriaan de Groot fbb513eee3 [partition] Remove artificial delay
- The sleep(3) was meant as a debugging aid for the multi-threaded
   part of requirements checking.
6 years ago
Adriaan de Groot 40de1bd2eb [partition] Give requirement entry a description
- The description is used in the Details dialog when the
   requirements fail. This one should be visible.
6 years ago
Adriaan de Groot 2092ec3c9a [partition] Drop some re-parenting trickery
- Can't re-parent across threads easily
 - If device is made by immutableDeviceCopy(), then it's still owned by the
   PartitionCoreModule; giving it away to the widget is not a good idea.
6 years ago
Adriaan de Groot be5abf08dc
Merge pull request #1094 from a-wai/fix-default-fs
[partition] Fix default fs

FIXES: #1093
6 years ago
Arnaud Ferraris 74ead4c7ba [partition] improve filesystem search operation
Due to changes to the FileSsytem::typeForName() function, more
processing is needed to deal with locales and different cases.
This is done by refactoring the findFS() function, initially located in
the PartitionViewStep class, and making it available to the whole module.

Additionnally, more checks have been implemented regarding the use of
global storage in the PartitionLayout class, and the filesystem types
now use the correct FileSystem::Type, as requested.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris 5084c44b54 [partition] fix naming of PartitionLayout class member variables
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Adriaan de Groot 79c20b8fbd [partition] Fix user-visible strings
- The default window title in the designer file wasn't a good string
   to translate. Use one of the titles instanced from elsewhere.
 - The window titles set in subclasses were not translatable.

FIXES #1092
6 years ago
Arnaud Ferraris 586cb63ef5 [partition] use configured default filesystem type instead of ext4
When using the default partition layout (only a `/` partition), the
filesystem used was ext4, ignoring the `defaultFileSystemType`
configuration option.

This commit fixes this bug, so that any supported filesystem can now be
used for the default partitioning scheme.

Fixes #1093

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Dan Simmons 651b52ead9 Fix spelling typo 6 years ago
Adriaan de Groot 43eae0bc47 Merge branch 'master' into requirements-checking 6 years ago
Adriaan de Groot 723358e145 [partition] Reduce Transifex warnings
- Add a (superfluous, since they don't have their own signals or slots)
   Q_OBJECT macro to the VG jobs, to silence a Transifex warning (this
   does make sure that the tool knows about the context for the translated
   messages)
6 years ago
Adriaan de Groot 6fbc467795 [partition] Reduce Transifex warnings
- the string here has no context (no QObject-derived class that
   it is called in) so use the static method instead.
6 years ago
Adriaan de Groot 2a8960cd0f [partition] Ensure combobox pre-selects consistently
- Match the selected item in the combobox with a given default,
   which should be whatever is selected from the available set of
   choices.
6 years ago
Adriaan de Groot 5f20eedb6e [partition] Use swap-choice member, not the combobox pointer
- Store changes to the selected swap-choice when the combobox changes
 - Use that member instead of dereferencing the combobox

This avoids nullptr crashes when the combobox isn't even created
(e.g. when there is only one swap choice).
6 years ago
Adriaan de Groot a4e6d4cd35 [partition] Rename combo box
- Too much confusion possible between the different members all
   named variations of *SwapChoice*
 - Update copyright years, too
6 years ago
Adriaan de Groot 335976e32c [partition] Improve defaultFS handling
- drop the localized comparisons; that's just confusing
 - warn when no default FS is set (then use ext4)
 - fix case-insensitive fallback; it used fsType, which was
   set to Unknown in the for loop.
6 years ago
Adriaan de Groot dff5afe227 [partition] Reduce refreshes when reverting 6 years ago
Adriaan de Groot b9fa0398c0 [partition] Disable one call to updateButtons()
- suggested by @abucodonosor, removing this one call seems
   to solve the data race for the device model.
6 years ago
Adriaan de Groot 6316173f1b [partition] More conservative handling of device pointers
- thanks @abucodonosor
6 years ago
Adriaan de Groot a6edb3ed34 [partition] Refactor PartitionEntry
- add a constructor that parses size and min
 - minor reduction in code duplication
6 years ago
Adriaan de Groot 5863300f67 [partition] Use const QString&
- minor code-layout and idiomatic-C++
6 years ago
Adriaan de Groot abf1f14604 [partition] Initialize members of PartitionEntry 6 years ago
Adriaan de Groot 04b4e37bd0 [partition] Don't display unsupported swap styles
- Suppress unsupported options while reading the config file.
6 years ago
Adriaan de Groot 0fdc737968 [partition] Fix logging output
- Using the assignment-operator just generates blank lines.
 - Using QLog with a log-level avoids the cDebug()-style special
   handling of warnings and errors (useless here, but may as well
   fix code style).
6 years ago
Adriaan de Groot 2fda5957f1 [partition] Complain about unsupported swap choices 6 years ago
Adriaan de Groot 273461a497 [partition] Be verbose about handling osprober results 6 years ago
Adriaan de Groot 2c6ff26aaa [partition] Reduce warnings 6 years ago
Arnaud Ferraris cf45d55b32 [partition] Fix parsing of partition size in partition layout
When setting the size of a partition without indicating the unit, two
problems occur:

- the size is parsed as an integer, not as a string, hence the
configuration parsing fails
- the size parser doesn't recognize the fact that the size has no units
and defaults to 100%

This patch fixes the configuration parsing as well as the size string
parsing.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris 18bb71aceb [partition] Fix minimum size parsing in partition layout
When a partition doesn't have a minimum size in the partition layout
configuration, it defaults to using 100% of the available space.

This patch fixes this error by setting the minimum partition size to 0
when the attribute has been omitted.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Adriaan de Groot 73c39adf9c Merge branch 'improve-swap-ui' 6 years ago
Adriaan de Groot 02416578cd Merge branch 'release-3.2.4' 6 years ago
Adriaan de Groot b913753831 [partition] No need to re-query the current choice 6 years ago
Adriaan de Groot aef61a42bc [partition] Tidy up code
- avoid possible nullptr dereference on connect() if no swap choices
 - group retranslations together
6 years ago
Adriaan de Groot 24422b19bd [partition] Idiomatic connect() usage 6 years ago
Adriaan de Groot fbef117fc8 [partition] Remove unused code 6 years ago
Adriaan de Groot 8ecae75dc8 [partition] Simplify code a little
- Document and make pickOne() more correct
 - Reduce calls to globalStorage(), it doesn't change
6 years ago
Adriaan de Groot e85fedfd41 [partition] Drop comment that doesn't apply anymore 6 years ago
Adriaan de Groot fee1794924 [partition] Use NamedEnumTable support code
- reduce amount of custom code by using the (new) generic implementation
6 years ago
Adriaan de Groot a51a000681 Merge branch 'master' into improve-swap-ui 6 years ago
Adriaan de Groot bcce704589 Merge branch 'resize-control'
FIXES #1062 #1038
6 years ago
Adriaan de Groot 194f693412 [partition] Use new NamedEnum approach 6 years ago
Arnaud Ferraris 5cacc0ddc6 Merge remote-tracking branch 'upstream/master' into partition-layout 6 years ago
Adriaan de Groot 305249976f
Merge pull request #1069 from a-wai/preserve-selected-device
Preserve current device when going to manual partitioning and back
6 years ago
Adriaan de Groot ba63084c7e [partition] Refactor fstype naming
- Use locale "C" for checking filesystem names
 - Also check other possibilities and case-insensitive, to
   be more forgiving of weird configurations (and localizations)
6 years ago
Arnaud Ferraris dfb5412c57 [partition] Preserve current device when going to manual partitioning
Fixes #1043

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris 921f70d3bb [partition] Fix size and last sector computation
Due to a computation error when calculating the total drive space and
each partition's last sector, the last partition's last sector was out
of boundaries, leading to an error creating this partition.

This patch fixes the computation algorithm to get rid of this error.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris cb60a3e7f1 [partition] Keep copyright notice for copied code
Some code was copied and adapted from PartitionActions.cpp. For full
compliance, it is best to copy the copyright holders list from this file
to PartitionLayout.cpp.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris fcd0e8d362 [partition] Apply partition layout when replacing free space
When chosing the "Replace partition" option, free space is not handled
like any partition. In order to apply the custom partition layout in
that case too, we have to modify the code where "replace free space" is
handled.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris ba673b17ee [partition] Add configuration option to disable manual partitioning
In some cases where a custom partition layout is used, use of this
layout is mandatory (this can be the case when using a read-only rootfs
which is updated by block-cpying an image file to it).

For these cases, the user must not be able to change the partition
layout, therefore we have to disable manual partitioning.

In order to stay consistent with current behaviour, manual partitioning
is still enabled by default. It will only be disabled if the partition
module's config file contains the corresponding option set to "false".

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris 2f14a21456 [partition] Apply custom layout when installing "Alongside"
When choosing "Install alongside another system", the custom partition
layout is applied to the space freed by resizing the selected partition.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris 74a59ae68a [partition] Display partition labels when they exist
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris 0d284759f5 [partition] Apply custom partition layout for Erase and Replace choices
This patches add new methods to both PartitionLayout and
PartitionCoreModule classes which apply the partition layout to the
available drive space.

In addition, the partition creation code from PartitioinActions is
removed to call the newly created methods instead, thus applying the
custom partition layout when the "Erase whole disk" and "Replace
partition" choices are selected.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris f863912a2f [partition] export PartitionActions::bytesToSectors for future use
As we move some of the partition creation code away from
PartitionActions, we will need the bytesToSectors function. Rather than
copying it, we export it in the PartitionActions namespace, so that
other classes can use it.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris b2bf873ede [partition] Initialize partition layout from config file
In order to keep the partition layout during calamares' execution, we
add a PartitionLayout object instance to PartitionCoreModule. This class
will therefore be used to initialize the PartitionLayout object and
interact with it thoughout the program's execution.

When no partition layout is present in the config file, we initialize
the layout with a single ext4 partition mounted on '/', as it was
previously done.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris f1ead5193d [partition] Create PartitionLayout class
In order to use a custom partition layout in the partition module, we
need to write this layout in the module's config file, and store it into
a dedicated object.

As it doesn't look appropriate to extend an existing class with layout
information, we create a new PartitionLayout class, which will be used
to parse the layout from the config file and keep it in memory.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Adriaan de Groot 4973d00ace [partition] Only create drop-down if there is something to select
- Swap choices may be 0 (then choose none), 1 (choose that one)
   or more (currently undecided)
6 years ago
Adriaan de Groot 00df8a9fb1 [partition] Remove unused code
- Swap choice for replace and alongside will happen much, much later.
6 years ago
Adriaan de Groot a456687924 [partition] Include all possible SwapChoices in example 6 years ago
Adriaan de Groot a66ea106d6 [partition] Missing implicit include 6 years ago
Adriaan de Groot 2998c27545 [partition] Use configured swap choices in choice page 6 years ago
Adriaan de Groot 5945e9584d [partition] Refactor name-to-enum and back for swap choices 6 years ago
Adriaan de Groot edc6c64657 [partition] Create swap-combo from a set
- Alternate way to create swap-combobox, using configuration
   values rather than an initializer list.
6 years ago
Adriaan de Groot 988a0a5388 [partition] Changing swap choice also changes preview
- When selecting *erase*, you may be able to change the swap
   settings. If so, changing swap settings should change the
   preview.
6 years ago
Adriaan de Groot 0231619c7c [partition] Refactor slot for change in action
- Let's not go overboard on lambdas,
 - Needed for others that also want to update the partitioning preview
6 years ago
Adriaan de Groot c5d707399d Merge branch 'fix-swap-ui' 6 years ago
Adriaan de Groot 14c72824f0 [partition] Be chatty when deciding a partition isn't resizable 6 years ago
Adriaan de Groot b798c27bc4 [partition] Be more verbose while looking for fstab entries 6 years ago
Adriaan de Groot 38d58fb6ed [partition] Check for suitable FS before passing -o noload
- The noload option prevents journal re-play (so it's an extra-
   strong read-only) but is only applicable to ext3 and ext4.
   Check the FS type before mounting; other FS types don't
   accept -o noload and will fail to mount.
7 years ago
Adriaan de Groot e0ce500f36 [partition] Improve debug-output after os-prober 7 years ago
Adriaan de Groot c522004575 [partition] Mount fs read-only when searching for fstab
Submitted by aliveafter1000

FIXES: #1044
CLOSES: #1050
7 years ago
Adriaan de Groot 9459ef7d93 [partition] Set FlagBoot for the root partition
- This only applies to legacy (non-EFI) BIOS systems, and
   adds the FlagBoot to whatever is already set for the root
   filesystem, and only when autopartitioning the device.

Submitted by aliveafter1000.

FIXES: #1046
CLOSES: #1049
7 years ago
Adriaan de Groot a1143e8fef [partition] Document flags parameter to createPartition() 7 years ago
Adriaan de Groot 8144295e98 [partition] Make new partition flags explicit
Suggested by aliveafter1000: having a default value, and then
filling in the default in one place it is used and not others,
is weird. Instead of dropping the one use, remove the default
value: partition flags are important enough to be explicit.
7 years ago
Adriaan de Groot 97c9e5bdcd [partition] Debug-log available file-system types 7 years ago
Adriaan de Groot 463b1441a5 [partition] Be more verbose about default file-system settings
- Log the type that is configured
 - Document that this is a delicate setting, case-sensitive and
   dependent on KPMCore.
7 years ago
Adriaan de Groot 6de55e6951 [partition] Construct, then winnow, the fstab entries 7 years ago
Adriaan de Groot ebbc1a1bcb [partition] "constructor-like" needs to be static 7 years ago
Adriaan de Groot 516ae494bf [partition] Complain if unmount fails
- If unmount fails, then warn and don't autoremove
7 years ago
Adriaan de Groot bd1b482242 [partition] Don't autoremove the tempdir
- Dangerout since we're mounting things inside that tempdir,
   and then doing a "weak" unmount
7 years ago
Adriaan de Groot f1c1d07dca [partition] Add convenience methods to FstabEntry
- Add something like a constructor
 - Add validity checking
7 years ago
Adriaan de Groot 417eeedd9f [partition] Calamares is spaced-out enough without extra's 7 years ago
Adriaan de Groot c7645af358 [partition] Translate swap-choice-strings to enum
- Handle legacy and modern config, mixed-configs,
 - Translate strings to enum values,
 - Default and warn as appropriate.
 - Doesn't **do** anything with the config, though.
7 years ago
Adriaan de Groot f7cc571635 Merge branch 'fix-swap-ui' of github.com:calamares/calamares into fix-swap-ui 7 years ago
Adriaan de Groot 3d543e9063 [partition] Refactor to use current config-reading methods 7 years ago
Adriaan de Groot caa4b8ab53 [partition] Document intention of new-style swap config 7 years ago
Adriaan de Groot 2a61116b3c [partition] Disable swap choice for replace & alongside 7 years ago
Adriaan de Groot 779542a5d1 Merge branch 'master' into fix-swap-ui 7 years ago
Adriaan de Groot bb586de056 [partition] Remove some slowdown methods when debugging is off
- Running lsblk and mount for debugging purposes can be
   skipped when the debugging is going to be suppressed anyway.
   This will speed things up just a little for regular users.
7 years ago
Adriaan de Groot 74ab06e20a [partition] Drop redundant logging 7 years ago
Adriaan de Groot 02a6b7dd12 [partition] Log the newly-created partition table
- Log individual partitions instead of printing QObject(<ptr>)
7 years ago
Adriaan de Groot 4757496c3d [partition] Improve partition-UUID logging. 7 years ago
Adriaan de Groot 7515386cf8 CMake: clean up test setup
- Remove redundant searches for ECM and Qt::Test, move
   them to top-level.
7 years ago
Adriaan de Groot a33b0c4f24 [partition] Log the flags that are used to create a partition 7 years ago
Adriaan de Groot 292bc57523 [partition] Fix build with suitable operator << 7 years ago
Adriaan de Groot b38316365e [partition] Be more verbose about why UI buttons appear 7 years ago
Adriaan de Groot 800f9d34f9 [partition] In logging, distinguish more cases
- While winnowing devices, the zram and nullptr cases
   were mixed together; split them, for the sake of
   logging more accurately.
 - While here, fix up some coding-style issues.
7 years ago
Adriaan de Groot 29bae61610 Merge branch 'master' into fix-swap-ui 7 years ago
Adriaan de Groot 869357a89c Merge branch 'master' into oem-resizer 7 years ago
Adriaan de Groot 35ca813064 [partition] Use "" for including from current directory 7 years ago
Adriaan de Groot 88c973f7cc [partition] Simplify space calculations
- Q_ASSERT doesn't work in constexpr functions because it's not
 - May as well calculate bytes at compile-time, no need to give
   the runaround via number-of-MiB
7 years ago
Adriaan de Groot e3bf9fc220 [partition] Fix build with KPMCore <= 3.3.0
- Reported by Philip Mueller
7 years ago
Adriaan de Groot d2f4079a18 [partition] Move partitioning options into a class
- As (auto) partitioning grows more options, the parameter
   list becomes more unwieldy. Add some structure to it.
7 years ago
Adriaan de Groot 3f09857cb7
Merge pull request #1013 from cjlcarvalho/master
Some RAID fixes
7 years ago
Adriaan de Groot 5136021416 [partition] Move SwapChoice to another namespace
- The choice of swap needs to be handled in more places,
   so make the enum available in the partition module core instead
   of just inside the choice page.
7 years ago
Adriaan de Groot 846e496d76 [partition] Tidy includes 7 years ago
Adriaan de Groot 8c79c981b1 [partition] Simplify space calculations
- Q_ASSERT doesn't work in constexpr functions because it's not
 - May as well calculate bytes at compile-time, no need to give
   the runaround via number-of-MiB
7 years ago
Adriaan de Groot 959cd7b224 [partition] Simplify creation of comboboxes for swap choices 7 years ago
Adriaan de Groot cfa940b35c [partition] Support translations of swap choices
- Introduce enum to indicate what is selected
 - Support translations
 - Fill selections for erase
7 years ago
Adriaan de Groot 7d0451fe69 [partition] Rename Choice -> InstallChoice
- There are more choices to be made (or to come) when partitioning,
   so don't take the most generic term for one enum.
7 years ago
Adriaan de Groot 10f7bac2df [partition] Reorder initialization 7 years ago
Adriaan de Groot c3f3276188 [partition] Improve presentation of swap options 7 years ago
Adriaan de Groot dc492b301c [partition] Drop label on swap-options box 7 years ago
Adriaan de Groot a791818a65 [partition] Add swap drop-down
- This is WIP; the drop-down contents should be customised,
   depending on configuration and the state of the device being
   installed-to.
7 years ago
Adriaan de Groot c813375908 [partition] Prepare for swap options
- Extend PrettyRadioButton with options (combo-boxes which may
   be added later).
7 years ago
Adriaan de Groot e0cd90cab1 Update the documentation and implementation of swap calculation.
Make the ramps consistent between suspend-to-disk and not,
and don't do the weird drop from 8GiB swap down to 4GiB for
large-memory systems.
7 years ago
Adriaan de Groot c104d14086 [partition] Call the helpers in the right order.
This fixes the crash by calling the model-reset first, then
refreshing. Previously, the destructors that do the work
were still being called in the wrong order.

FIXES #1019
7 years ago
Adriaan de Groot fe662345bd [partition] Extra helper classes for doing reset and refresh
- The ResetHelper only finalized changes to the module on
   destruction, but calls to refresh() assumed it was already
   done. This leads to crashes when refresh() uses an intermediate
   state of the model.

Introduce extra helpers, and rename refresh() to avoid calling the
old implementation from any code. The new helper just creates and
destroys a ResetHelper, before creating and destroying an object
that calls the new refreshAfterModelChange().

FIXES #1019
7 years ago
Adriaan de Groot 42d606171d
Merge pull request #1020 from apachelogger/esp-eq-boot
do not set boot flag on ESP (thanks @philmmanjaro for testing)
7 years ago
Harald Sitter 84ad2852bf do not set boot flag on ESP
ESP == boot. at best this is duplicated information, at worst kpmcore may
implode if you try to set a boot flag since that is technically an MBR
type flag and means nothing within the context of GPT where ESP is the flag
to set.
7 years ago
Harald Sitter 81cab43701 do not set active flags on the to-be ESP
having ESP as active flag AND then trying to set ESP means nothing is
set since kpmcore will think ESP is already set (it is listed as active
after all). this ultimately meant that nothing was set since there was
no delta between the requested flags and the already active flags.
7 years ago
Adriaan de Groot 08d41f745b [partition] Remove superfluous null check
delete is specified to handle nullptr gracefully.

FIXES #1012
7 years ago
Caio Carvalho 01a972c6ea [partition] Fixing LVM LV name line edit visibility. 7 years ago
Caio Carvalho b5a2a5bbdd [partition] Don't show erase button for inactive RAID. 7 years ago
Caio Carvalho 7fd0ad5795 [partition] Disabling partition buttons for inactive RAID. 7 years ago
Andrius Štikonas 22aa6dc132 [partition] fix build with latest kpmcore. 7 years ago
Simon Quigley 5c50587f89
Fix LUKS deployment link. 7 years ago
Adriaan de Groot bf40f3bd23 Merge branch 'master' into requirements-checking 7 years ago
Adriaan de Groot 3b82e655d7 Merge remote-tracking branch 'origin/update-lvm-support' 7 years ago
Adriaan de Groot 238a1e812f [partition] Reduce the fudge-factor for swap size
- Reported by Bill Auger (I think), a 15GiB disk wouldn't hold
   a 8.9GiB root plus 4GiB swap -- due to 10% overprovisioning
   of swap, plus the 2.1GiB fudge factor.
7 years ago
Adriaan de Groot f10bab8a3a [partition] Minor code-styling 7 years ago
Adriaan de Groot 8ed26e537f [partition] Fix swap maximum size
- The existing calculation comment says "maximum 10% of disk"
   but the calculation itself uses 110%.
7 years ago
Adriaan de Groot 59fea041b6 [partition] Fix up calculations of sectors in auto-partition
- Calculating first free sector had an off-by-one so that
   partitioning would start at 2049.
 - EFI boot partition grew 1 sector larger than desired.
 - While here, align everything to 1MiB boundaries as well.

FIXES #1008
7 years ago
Adriaan de Groot 1cbfa9d693 [partition] Simplify code for sizing 7 years ago