107 Commits (d039f9bbb849f7048264204a1c0bafaa77cfaef3)

Author SHA1 Message Date
Adriaan de Groot d039f9bbb8 [partition] Remove initKPMCore() from KPMHelpers
- This is a job for KPMManager, from the partition service.
 - In tests, needs to be a little hackish.
6 years ago
Adriaan de Groot 4b3bb54320 [libcalamares] Move partition-finding into libcalamares
- Moved from KPMHelpers to the partition service
 - The is-partition and find-partition methods that make sense
   in general, are moved to libcalamares.
6 years ago
Adriaan de Groot 3930826e93 [fsresizer] [partition] Drop special cases for kpmcore 3.3.1 6 years ago
Adriaan de Groot 4202126f34 [fsresizer] [partition] Fix build with moved headers
- PartitionIterator has moved into libcalamares
 - While here, sort and organize #include lines
 - Add using to keep code impact small
6 years ago
Adriaan de Groot d5f0bdd28c [partition] Simplify negative logic
- Instead of multiple continue statements to avoid negative cases,
   state the one positive case instead.
6 years ago
Adriaan de Groot 8d451622db [partition] Idiomatic use of Calamares::JobList 6 years ago
Adriaan de Groot 9331a25905 [libcalamares] Remove Typedefs.h
- This small header file contained a few unrelated typedefs.
   Move those typedefs to the classes they relate to. This
   **does** mean that some consumers need to #include something
   else instead.
 - Use type names more consistently.

Editorial: why are **pages** responsible for creating the jobs?
6 years ago
Adriaan de Groot e0a79f4c0f [partition] Reduce scope for nullptr dereference
- document what types are in use
 - avoid at least one nullptr deref
6 years ago
Adriaan de Groot 090aee9196 Modules: adjust to split-out utils/Variant.h
- Most modules only needed the variant support, not the "whole"
   CalamaresUtils header.
 - While here improve ordering of headers as well.
6 years ago
Adriaan de Groot 3533bb3c2d Merge branch 'master' into issue-1061 6 years ago
Arnaud Ferraris 123222c0a8 Add global checks for partition layout
This commit adds several checks while reading the configuration of the
`partition` module, in case the partition layout configuration is
misformed. If an error is encountered, an message is printed to the
console and the module reverts to the default partition layout.

Checks are also added when implementing the partition layout, in case a
problem occurs that couldn't be anticipated (for example, when a
partition size is in %, checking its absolute value require knowing the
total device size, which is not the case when the configuration is
being read).

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Adriaan de Groot 520478847c Make logging more consistent.
- Across all the C++ modules, use Logger::SubEntry for sub/continues
   log lines, instead of somewhat-random indent strings.
6 years ago
Adriaan de Groot c844188907 [partition] Fix build w/ "3.3.1" API
- Need older-style scanning, but new-style iteration
6 years ago
Adriaan de Groot c0710cabe4 [partition] [fsresizer] Adjust to new #define
- Using KPMCORE4API is clearer than just relying on a version number
6 years ago
Adriaan de Groot 9917bc27fc
Merge pull request #1119 from cjlcarvalho/master
[partition] Fixing LVM scanning according to new kpmcore API
6 years ago
Adriaan de Groot 547dc7d334
Merge pull request #1117 from a-wai/partition-layout-add-maxsize
[partition] Add max size parameter
6 years ago
Caio Carvalho 2c33535ee8 [partition] Using std::find_if to search in container for elements according to a condition 6 years ago
Caio Carvalho 34e091833d [partition] Fixing LVM scanning according to new kpmcore API 6 years ago
Arnaud Ferraris 5358e2314d [partition] Add max size parameter
When using a custom partition layout with partition sizes in %, it can
be useful to set an upper limit to the partition size.

For instance, using a 20% size for the `/` partition will create a 24G
partition on a 120GB drive, but a 200GB partition on a 1TB drive, which
is not useful, and could be avoided by setting a maximum partition size.

This commit adds the `maxSize` parameter (with a default value of 100%).

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Adriaan de Groot df921606b9 [partition] Update copyright headers
- Files modified in 2019 by me
6 years ago
Adriaan de Groot 2a2795c54c [partition] Avoid KPMCore warnings
- Get ready for KPMCore post-3.3.0, which deprecates a bunch of
   Flag<foo> and State<foo> in preparation of enum classes.
6 years ago
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 dff5afe227 [partition] Reduce refreshes when reverting 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 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 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 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
Adriaan de Groot 74ab06e20a [partition] Drop redundant logging 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
Andrius Štikonas 22aa6dc132 [partition] fix build with latest kpmcore. 7 years ago
Adriaan de Groot 5d5feeb0ab Merge branch 'master' of https://github.com/cjlcarvalho/calamares into lvm-update 7 years ago
Caio Carvalho 295e14530e [partition] Adding resizing, deactivating and removing procedures for LVM VGs. 7 years ago
Adriaan de Groot fa08e0ad73 Copyright: fix bad email address 7 years ago
Adriaan de Groot dd8e53dc22 Copyright: update copyright lines on files touched in 2018
Contributions from:
  Adriaan de Groot <groot@kde.org>
  Gabriel Craciunescu <crazy@frugalware.org>
  AlmAck <gluca86@gmail.com>
  Andrius Štikonas <andrius@stikonas.eu>
  Caio Carvalho <caiojcarvalho@gmail.com>
  Raul Rodrigo Segura <raurodse@gmail.com>
7 years ago
Caio Carvalho 98a158c6e5 [partition] kpmcore latest release doesn't support FileSystem::Type::Luks2 7 years ago
Caio Carvalho 3b6c764f75 [partition] Fixing revert device loop error in PartitionCoreModule::revertAllDevices. 7 years ago
Caio 0465cc4214 [partition] Including revert on creation of LVM VGs. 7 years ago
Caio f8897e0e0b [partition] Including new LVM PVs in LVM VG creation GUI. 7 years ago
Caio 208d58bcd9 [partition] Including CreateVolumeGroupDialog and fixing some of its GUI issues. 7 years ago
Caio d15ce56c97 [partition] Initial implementation of VolumeGroupBaseDialog. 7 years ago
Adriaan de Groot 6739b81c2a [partition] Tell PartitionInfo about desired flags
- When creating a partition, or changing flags, tell
   the PartitionInfo about those desired flags.
7 years ago
Caio Carvalho f72f7bd8fe [partition] Only bootloader model should ignore devices that are not of Disk_Device type. 7 years ago
Adriaan de Groot 3315df5df1 [modules] Use new convenience logging methods across the board 7 years ago
Adriaan de Groot 637d6ad752 [partition] Find Esp partition with modern flags. 7 years ago
Adriaan de Groot 762ad54344 Documentation: change http links to GitHub to https 7 years ago
Adriaan de Groot e3e519c06f Clang: reduce warnings, nullptr, unused parameters 8 years ago
Adriaan de Groot 0e96621b94 Don't leak memory when winnowing disk devices
- Improve logging a little
 - Don't leak Device*, but delete the raw pointer when erasing
 - Document that DeviceInfo takes ownership and doesn't leak
8 years ago
Adriaan de Groot 7e66499f36 Refactor check for EFI system.
The TODO stands, to delegate this to KPMCore.
8 years ago
Adriaan de Groot 7d49255a78 Partitions: use an enum with clear semantics instead of bool 8 years ago