Commit Graph

82 Commits (0d284759f59a2e1c282f86255d3da8d4542fce9d)

Author SHA1 Message Date
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>
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>
Adriaan de Groot 74ab06e20a [partition] Drop redundant logging
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 
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 
Andrius Štikonas 22aa6dc132 [partition] fix build with latest kpmcore.
Adriaan de Groot 5d5feeb0ab Merge branch 'master' of https://github.com/cjlcarvalho/calamares into lvm-update
Caio Carvalho 295e14530e [partition] Adding resizing, deactivating and removing procedures for LVM VGs.
Adriaan de Groot fa08e0ad73 Copyright: fix bad email address
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>
Caio Carvalho 98a158c6e5 [partition] kpmcore latest release doesn't support FileSystem::Type::Luks2
Caio Carvalho 3b6c764f75 [partition] Fixing revert device loop error in PartitionCoreModule::revertAllDevices.
Caio 0465cc4214 [partition] Including revert on creation of LVM VGs.
Caio f8897e0e0b [partition] Including new LVM PVs in LVM VG creation GUI.
Caio 208d58bcd9 [partition] Including CreateVolumeGroupDialog and fixing some of its GUI issues.
Caio d15ce56c97 [partition] Initial implementation of VolumeGroupBaseDialog.
Adriaan de Groot 6739b81c2a [partition] Tell PartitionInfo about desired flags
- When creating a partition, or changing flags, tell
   the PartitionInfo about those desired flags.
Caio Carvalho f72f7bd8fe [partition] Only bootloader model should ignore devices that are not of Disk_Device type.
Adriaan de Groot 3315df5df1 [modules] Use new convenience logging methods across the board
Adriaan de Groot 637d6ad752 [partition] Find Esp partition with modern flags.
Adriaan de Groot 762ad54344 Documentation: change http links to GitHub to https
Adriaan de Groot e3e519c06f Clang: reduce warnings, nullptr, unused parameters
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
Adriaan de Groot 7e66499f36 Refactor check for EFI system.
The TODO stands, to delegate this to KPMCore.
Adriaan de Groot 7d49255a78 Partitions: use an enum with clear semantics instead of bool
Adriaan de Groot 102bed1805 Partitions: split device-listing (and winnowing) into separate source file.
The grab-list-of-writable-devices code is usable for the partition module, but
also useful for welcome module, so reduce its footprint.
Adriaan de Groot 5bf03cc515 Partitions: shuffle some device-detection code off to PartUtils.cpp
Adriaan de Groot aeb0cd0d3f Partitions: drop devices with mounted partitions.
FIXES 
Adriaan de Groot cc7631dd99 Partitions: code-formatting
Adriaan de Groot 232bbe18bc Be more verbose while scanning devices
Adriaan de Groot 8ea14d7957 Release: add copyright to files I've touched
Adriaan de Groot 46a2503c87 PartitionModule: skip nullptr devices, and report count
FIXES 
Adriaan de Groot 92a2c7aa70 PartitionModule: avoid nullptr crashes
Fix up iterator code so that it handles nullptr better.
This avoids part of .
Teo Mrnjavac 45315e6ae9 Improve debug output for bootloader code path.
Kevin Kofler 1548fe4810 [partition] Use FlagEsp instead of sgdisk to scan for ESPs.
Address an old FIXME in
PartitionCoreModule::scanForEfiSystemPartitions(): Check the FlagEsp on
the Partition object (that KPMcore has been supporting since 2.1.0)
instead of running sgdisk.
Chantara Tith 64db6d5ba1 Use device's immutable copy instead of rescanning.
Teo Mrnjavac c316d22b08 Keep an immutable copy for every scanned Device* to avoid rescans.
Teo Mrnjavac cbb2162ee9 Merge pull request from stikonas/master
Port away from most cases of Q_FOREACH to C++11 ranged for loop.
Teo Mrnjavac 6c928e0404 Exclude ISO9660 volumes.
Teo Mrnjavac ad219e1b8e Exclude loop devices with mounted children from devices list.
Andrius Štikonas 9f0ca042fe Port away from most cases of Q_FOREACH to C++11 ranged for loop.
In order to avoid deep copies, Qt containers over which we iterate must be const
The remaining unported cases require qAsConst (Qt 5.7) or std::as_const (C++17)
Teo Mrnjavac 811261258b Try to load filesystem UUIDs into the OsproberEntryList structure.
Teo Mrnjavac 003456594e Try with new enumeration but no cache reset.
Teo Mrnjavac c08eecbbaf Invalidate colors cache on delete.
Teo Mrnjavac 2951c88990 Init filesystems asynchronously.
Teo Mrnjavac 45f6e6c55b Rearrange asynchronous scan in PartitionCoreModule a bit.
Teo Mrnjavac a252f7ff32 Debug output.
Teo Mrnjavac 167b4fc0a2 Exclude zram from devices list.
Teo Mrnjavac 4f5230fc63 Revert "Temporarily allow read-only devices."
This reverts commit fc4a8b8628.
Teo Mrnjavac fc4a8b8628 Temporarily allow read-only devices.
This way the KPMcore libpartedbackend scanner won't filter out Parted
devices of type UNKNOWN.
CAL-349