65 Commits (88b1d36009af3cf12f3a41762b5aec7cb4dd99b5)

Author SHA1 Message Date
Adriaan de Groot 0f4fe6294c [partition] Migrate type for SwapChoice to Config object 5 years ago
Adriaan de Groot 881661e94b [partition] Migrate InstallChoice to the Config object 5 years ago
Adriaan de Groot 1cd9b93a22 REUSE: Giant boilerplate cleanup
- point to main Calamares site in the 'part of' headers instead
  of to github (this is the "this file is part of Calamares"
  opening line for most files).
- remove boilerplate from all source files, CMake modules and completions,
  this is the 3-paragraph summary of the GPL-3.0-or-later, which has
  a meaning entirely covered by the SPDX tag.
5 years ago
Adriaan de Groot 30a85668b7 REUSE: (GPL-3.0-or-later) C++ modules 5 years ago
Adriaan de Groot e21a2f0676 [partition] Add InitialInstallChoice to Config
- add an option to select what button should be selected when the
  partitioning module is started; TODO: the actual functionality is
  **not** implemented.
- drop the previously suggested name, which didn't get beyond the
  comments-in-the-config-file stage (but which intended to do the
  same things as this one)
- add option to schema already, even if it's not implemented.

See #1297

FIXUP conf
5 years ago
Adriaan de Groot fec8361ed5 [partition] Drop "convenience" functions
- the functions are used just once
- thin wrappers for named-enum methods that are just as convenient
5 years ago
Adriaan de Groot baabcc5bb4 Merge branch 'calamares' into issue-1297 5 years ago
Gaël PORTAY 629bb2e2f6 [partition] Remove unused locals
- Unused since commit 0d284759f5
5 years ago
Adriaan de Groot 68bb066755 [partition] Consolidate SwapChoice handling
- pickOne() may be useful, given a set of swap choices; expose it
- move type definitions to PartitionActions, where some of them
  come from.
5 years ago
Gaël PORTAY d6c373c48d [partition] Allow a configurable EFI System Partition name
This commit adds the new configuration `efiSystemPartitionName` to the
file partition.conf.

This option sets the partition name to the EFI System Partition that is
created. If this option is unset, the partition is left unnamed.
5 years ago
Adriaan de Groot 7f295d9565 [partition] Apply coding style to core/ subdir
Because this is a giant code change, with no functional effect,
I've been saving this until the end of the kpmcore-manager branch.
5 years ago
Adriaan de Groot 34ffc7a20a [libcalamares] Consistent namespace usage in partition service
- The sub-directories under libcalamares (e.g. Utils, ..)
   all live in namespace CalamaresUtils (well, except for Logger).
   The services (e.g. subdirs other than utils/) live in their
   own nested namespace, so partitioning should go into
   CalamaresUtils::Partition for consistency.
6 years ago
Arnaud Ferraris 80fd3d3353 [partition] Switch to using the generic PartitionSize class
Instead of relying on a module-specific implementation, use the new
PartitionSize class for storing partition sizes.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Arnaud Ferraris 36bc0e6308 [partition] Move bytesToSectors() to CalamaresUtils namespace
In order to prepare for future refactoring of the PartSize class, move
the bytesToSectors() function to libcalamares in the CalamaresUtils
namespace.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Adriaan de Groot 3533bb3c2d Merge branch 'master' into issue-1061 6 years ago
Arnaud Ferraris d32733bf59 Switch to using PartSize class for partition sizes
Every call of `ParseStringSize` is replaced by using an instance of the
`PartUtils::PartSize` class.

This commit also removes the now-unused previous size parsing functions.

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 68f29ebf20 [partition] Handle partition flag FlagEsp post KPMCore 3.3.0 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
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
Adriaan de Groot 73c39adf9c Merge branch 'improve-swap-ui' 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
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
Adriaan de Groot 5945e9584d [partition] Refactor name-to-enum and back for swap choices 6 years ago
Adriaan de Groot c5d707399d Merge branch 'fix-swap-ui' 6 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
6 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.
6 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 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 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 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 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 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
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
Adriaan de Groot 3315df5df1 [modules] Use new convenience logging methods across the board 7 years ago
Adriaan de Groot 762ad54344 Documentation: change http links to GitHub to https 7 years ago
Adriaan de Groot 9693d7a5bd Memory: clean up interface used to get memory (RAM) size 8 years ago
Adriaan de Groot a06911e9aa Clang: refactor units-converters, reduce warnings 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 e92d82c5db Cleanup: add copyright lines 8 years ago
Adriaan de Groot 5382a510a9 Cleanup: switch to C++11 user-defined literals 8 years ago
Adriaan de Groot 829f72363e Cleanup: remove duplicate #define 8 years ago