1507 Commits (fac0c90de18cc41247b1bf6c5bb786c9689cac0d)

Author SHA1 Message Date
Adriaan de Groot 948c078e1a [partition] winnow floppy drives
- don't list floppy drives

FIXES #1393
5 years ago
Adriaan de Groot 46ad704ede [partition] Fix build for old KPMCore
SEE #1444
5 years ago
Adriaan de Groot 36a9088480
Merge pull request #1444 from gportay/add-parttype-partattrs-to-global-storage
[partition] Add the GPT type and attributes to global storage
5 years ago
Adriaan de Groot e206eb086b [partition] Missing includes for Qt-compatibility 5 years ago
Adriaan de Groot 22fdca8f44 [libcalamares] Use Logger::Pointer for logging void-pointers 5 years ago
Adriaan de Groot 192263cf9d [libcalamares][modules] Use compatibility for QString::split()
- Use the compatibility value, which has an enum value suitable
  for the Qt version in use.
5 years ago
Gaël PORTAY 9392473fec [partition] Add the GPT type and attributes to global storage 5 years ago
Gaël PORTAY 4974d86932 [partition] Fix missing initialization of the attribute partAttributes
- Initialize the attribute partAttributes to 0; it is a primitive type
  and it is not initialized in some constructors.
  Fixes commit c1b5426c6 ([partition] Add support for partition attributes).
- Move implementation of default constructor to cpp.
5 years ago
Adriaan de Groot e3b8570d61 Merge remote-tracking branch 'origin/master' into calamares
Pick up some older MRs that apply to the older branch.
5 years ago
Adriaan de Groot bfefbd117d
Merge pull request #1435 from gportay/partition-attributes
Partition Attributes
5 years ago
Adriaan de Groot 91f87ba838
Merge pull request #1409 from gportay/partition-uuid
Partition UUID
5 years ago
Adriaan de Groot 4a07bd4ae3 CI: import all the rest of the YAML schema
- These have **not** been fixed for validation, so the schema's themselves
  will fail to load. This is a consequence of variations in JSON-Schema
  representations through various drafts. Fixing the schemata is
  fairly straightforward.

This gives us 19 new tests, all of which fail.
5 years ago
Gaël PORTAY c1b5426c66 [partition] Add support for partition attributes 5 years ago
Adriaan de Groot 0e7c984854 [partition] Add missing includes for Qt 5.15 compatibility 5 years ago
Adriaan de Groot 1c598d769b [partition] Apply coding style (to just this one file) 5 years ago
Gaël PORTAY 629bb2e2f6 [partition] Remove unused locals
- Unused since commit 0d284759f5
5 years ago
Adriaan de Groot 3e51fe4651 [partition] Remove spurious Q_FUNC_INFO from logging
- The Q_FUNC_INFO was integrated into regular logging with commit
  5248a37eb3
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
Adriaan de Groot 4ae398c18d [partition] Move swap choices into config 5 years ago
Adriaan de Groot a381d6794f [partition] Migrate required-storage setting to Config object
- Create and use the config object in the view step
- Add setConfigurationMap() to Config
5 years ago
Adriaan de Groot c7857b7749 [partition] Coding style on tests 5 years ago
Adriaan de Groot b33e54abb9 [partition] Stub of a Config object
- Even though this isn't a QML'able module, work towards
  a decoupled Config object anyway
- Not actually used yet.
5 years ago
Adriaan de Groot ca59c8419c [partition] Goal of this branch: configurable default action 5 years ago
Adriaan de Groot 6d07527123 [partition] Comment-out unsupported swap options
- I notice they get copied into distro configurations a lot,
   leading to warnings in the logs
5 years ago
Adriaan de Groot 72857b75d0 [partition] Chase moving PrettyRadioButton to libcalamaresui
- Update includes
- Use exposed API instead of accessing internals of the button
5 years ago
Adriaan de Groot c4951d5090 [libcalamaresui] Move PrettyRadioButton from partition 5 years ago
Adriaan de Groot 4c0a212b68 [partition] Warnings-- (Qt 5.14)
QVariant::fromValue doesn't have *since* documentation, so I expect it to be 5.6-and-later.
5 years ago
Gaël PORTAY 3d2b9053b0 [partition] Add the GPT label and UUID to global storage 5 years ago
Gaël PORTAY da6f728cd4 [partition] Add support for partition uuid 5 years ago
Adriaan de Groot c0a3614f09 [partition] Chase Branding API change 5 years ago
Adriaan de Groot cb99f446b3 Merge branch 'issue-1192'
FIXES #1192

(Calls it the *boot* flag when using KPMCore4, which also shows the
flag *boot* in the flags list of the partitioning dialogs)
5 years ago
Adriaan de Groot 479b467bb6 [partition] Substitute in the right flag name
- This uses "esp" in KPMCore 3 and "boot" in KPMCore 4
5 years ago
Adriaan de Groot 23af4fcdac
Merge pull request #1387 from gportay/set-efi-system-partition-name
[partition] Allow a configurable EFI System Partition name
5 years ago
Gaël PORTAY 77a31ac3b2 [partition] Update debug output
The mount-point is known as mountPoint in the global storage.

This commit updates the trace to reflect its real name.
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 f8df49e40f [partition] Fix up tests
- Although we long ago replaced the getPartitions implementation, the
  test is still there, and on a machine with no /dev/sda (e.g. because
  root is on nvme) the echo-awk-shell-pipeline can give an empty string;
  this is turned into a QStringList{""} which has one element, while
  the new version has 0 elements.
- Special-case the test that empty strings should be empty lists, rather
  than 1-element lists with an empty element.
5 years ago
Adriaan de Groot 05990fb287 CMake: handle DEBUG_* consistently
- Make all four DEBUG_ flags actual CMake options, rather than
  stuffing some of them in the rather-peculiar _enable_debug_flags.
  Each debug option turns on suitable compile flags in the module(s)
  that are affected.
5 years ago
Adriaan de Groot 8b41a71668 [partition] Apply coding style to core/ 5 years ago
Adriaan de Groot b08cb52d0a [partition] Mark /boot or / as bootable
FIXES #1175
5 years ago
Adriaan de Groot 0c6dd4e788 [partition] No "jobs/" needed in jobs includes 5 years ago
Adriaan de Groot f85732ccb0 [partition] Coding style on Jobs 5 years ago
Adriaan de Groot b271ed19b7 [partition] Fix typo in message 5 years ago
demmm 8dc81b6987 Increase Manual Partition instructions
used downstream since 2014, has helped a lot with increaisng correct setups
5 years ago
Adriaan de Groot 26dd93b67c [partition] Simplify code
- isEfi only used meaningfully once
- if (isEfi) followed by if (!isEfi) can be simpler
- create bios-but-not-GPT strings in one go
- mark TODO that this should warn only if needed
- use weird * notation for branding-strings
5 years ago
Adriaan de Groot b57e198c29 [partition] Apply coding style
- This isn't particularly related to the change at hand, though.
5 years ago
demmm b6228d137c Adding popup warning/instructions for GPT with BIOS
see https://github.com/calamares/calamares/issues/1339#issuecomment-600862507
this is a very generic warning, used downstream since 2016
stopped virtual all BIOS GPT failures and questions
5 years ago
Adriaan de Groot 1718f7a8a8
Merge branch 'master' into partition-type 5 years ago
Adriaan de Groot 377a78a405
Merge pull request #1347 from gportay/partition-name
[partition] Name partition using filesystem label
5 years ago
Gaël PORTAY 15cce29a51 [partition] Add support for filesystem-specific features 5 years ago
Gaël PORTAY c5ebe13aeb [partition] Add support for partition type 5 years ago
Gaël PORTAY cba4d2e93b [partition] Name partition using filesystem label 5 years ago
Adriaan de Groot 2eb84e2de1 [partition] [tracking] [welcome] Missing Q_OBJECT
- These aren't strictly necessary for the code, but they
  help with translations.
5 years ago
Adriaan de Groot 220fd31226 [partition] Improve EncryptionWidget
- Use normal translation framework. The EncryptWidget was the one place
  not using the "usual" translation framework, but rolled its own.
- Emphasize that the checkbox-state (checked-ness) is the parameter,
  not a state of the EncryptWidget.
- All other instances of UI classes from Designer use a pointer-to-UI,
  not multiple inheritance.
- Convenience method for setting the pixmap in response to
  changes in the passphrase
- Tighten up types: enum -> enum class
- Reduce the scope for int-confusion by using an enum-class for
  the encryption state of the widget
- Include UI implementation header only in .cpp
- Apply coding style
- Update copyright
5 years ago
Adriaan de Groot 350627172d [partition] Tidy up includes 5 years ago
Adriaan de Groot ebb3f319cc [modules] Be more consistent in include punctuation
- Use <> for Qt, system, externals
 - Use double-quotes for Calamares headers
5 years ago
Adriaan de Groot 5248a37eb3 [libcalamares] Add FUNC_INFO into all debug messages
- This is needlessly verbose
- Chase CreatePartitionTableJob which needs to bind to a temporary
5 years ago
Adriaan de Groot 54a4644893 [partition] Store filesystem types
- Write a new GS key filesystems_use, which is a map of filesystems
  in use on the target system.
5 years ago
Adriaan de Groot d4b26bbaf0 [partition] Tighten up the types of internal methods 5 years ago
Adriaan de Groot f818d4b446 [libcalamares] Log Q_FUNC_INFO as part of debug
- Warnings, errors, don't get funcinfo, but regular cDebug()
  calls do. Other special-cases, like calling Logger::CDebug()
  constructor explicitly, don't get funcinfo either.

FIXES #1328
5 years ago
Adriaan de Groot 61ca6384cc [partition] Fix tests
- One of the files listed in the test has moved (to libcalamares),
- Don't bother with an extra intermediate SRCS variable.
5 years ago
Adriaan de Groot 6d0f5e4111 Merge branch 'kpmcore-manager' 5 years ago
Adriaan de Groot 5247c13f98 [partition] Follow 'claimed' settings for claiming swap
- By the time the GS is actually written, new (for partition state)
  is always false. So "new" is the wrong thing to track. It should
  have had a better name anyway,
- We store custom properties on the partition objects to indicate
  what happens to them; use those properties (instead of state,
  as done originally), call it "claimed" to indicate that the partition
  is part of this installation.

For now, only new (as in, formatted, created-by-us) partitions are
claimed.

- The effect here is that only "new" swap will be added to the system,
  so in erase-disk installations, or manual partitioning.
- Install-alongside and replace will now **not** claim the swap already
  on the disk; I think we'll need another UI knob for that one.

FIXES #1316
5 years ago
Adriaan de Groot 35a2db064b [partition] Make debug-logging match the functionality
- `createPartitionList()` is called for the summary widget (via
  `prettyDescription()`), and from `exec()`. Only the latter
  actually *writes* to Global Storage, so it's misleading to
  think that the pretty-printed version ends up in GS.
- This makes the "new" key useless, since by the time `exec()` is called
  the partitoons are no longer new.
5 years ago
Adriaan de Groot fba1bf7072 CMake: add DEFINITIONS option to calamares_add_test
- There's a handful of tests that need this, it's possible
  there will be more, so just add it to the infrastructure.
5 years ago
Adriaan de Groot 1bb43e06e2 Merge branch 'master' into kpmcore-manager 5 years ago
Adriaan de Groot 158e11de1e [partition] Indicate that a filesystem is new in GS 5 years ago
Adriaan de Groot 4495a4c739 CMake: Allow extra libraries in calamares_add_test
- Extra libraries specified via LIBRARIES part of CMake function
 - Convert all the other module tests
5 years ago
Adriaan de Groot b044549013 [libcalamares] Merge PluginDllMacro.h into DllMacro.h
- Let's just have one header definining export- and visibility-
   macros for Calamares. They are still selected based on the
   export flags (*_PRO), just defined in one header instead of two.
5 years ago
Yuri Chornoivan ea82a26dae
Fix typo:; partitons -> partitions
Many thanks in advance for reviewing.
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 45a31a3022 [partition] Tidy includes
- sort includes a little
 - remove superfluous includes
 - update copyright
5 years ago
Adriaan de Groot d931b146e3 [partition] Shuffle new conveniences into partition service
- the general stuff from KPMHelpers ends up in the partition
   service; that only gets compiled when KPMCore is available anyway.
5 years ago
Adriaan de Groot e72ecaafd3 Merge branch 'kpmcore-manager'
Introduces a "partitioning service" into libcalamares,
shuffles a bunch of things into it, tries to help out
with settling the system between partitioning actions.
5 years ago
Adriaan de Groot 5a50a3a40c [partition] Consistent FS name usage
- explicit use of user-visible names in EditExistingPartitionDialog
 - consistent conversion of config-values to FS names (user-visible).
   The GS value comes from the ViewStep, and should always match
   something -- it's already converted to the canonical un-translated
   so the type should be good.
5 years ago
Adriaan de Groot 57b608083e [partition] Fix build - missing ) 5 years ago
Adriaan de Groot ca67534cd2 [partition] Improve logging of bad configs 5 years ago
Adriaan de Groot 472ec32617 [partition] Be explicit about user-visible FS names, ReplaceWidget 5 years ago
Adriaan de Groot 05dfc24af6 [partition] Be explicit about user-visible FS names, CreatePartitionDialog 5 years ago
Adriaan de Groot 88cff387c3 [partition] Be explicit about user-visible FS names, FormatPartitionJob 5 years ago
Adriaan de Groot bacca04695 [partition] Be explicit about what's user visible in SetPartitionFlagsJob 5 years ago
Adriaan de Groot 29894cec6a [partition] Convenience userVisibleFS()
- Mark uses of filesystem-name where it's intentional that they
   are user-visible, with a new convenience function.
5 years ago
Adriaan de Groot dac5516b2c [partition] Update copyright, coding style 5 years ago
Adriaan de Groot a0449abab9 [partition] Do not translate filesystem names
- Move contents of FSName to KPMHelpers
 - Use the new functions from FillGlobalStorage

Needs more use in the rest of the partition module.
5 years ago
Adriaan de Groot c055e1da49 [partition] Use untranslated name of filesystem
- Patch from Gabriel Craciunescu
5 years ago
Adriaan de Groot f6d89354a1 Merge branch 'master' into kpmcore-manager 5 years ago
Adriaan de Groot 7fd218d7bf [partition] Chase deprecations in Qt 5 years ago
Andrius Štikonas 490c14d93d QLatin1Literal->QLatin1String. 6 years ago
Adriaan de Groot 0aabc89449 [partition] [welcome] Simplify retranslation 6 years ago
Adriaan de Groot a6db224fcb [fsresizer] [partition] Gracefully fail on missing dependencies
- If KPMcore is found -- it requires some other KDE Frameworks but
   at least in pre-4.0 versions doesn't check very well for them --
   then missing its dependencies is no cause for CMake failure.
   Instead, log it nicely and suppress the module.
6 years ago
Adriaan de Groot 48a25858f0 [partition] Chase 3rdparty move 6 years ago
Adriaan de Groot 399919c49a [partition] Swap the two implementations of getting partitions 6 years ago
Adriaan de Groot f2438a5bf4 [partition] Implement other way of getting partitions
- Just read /proc/partitions and process it; split into columns,
   add relevant bits.
 - This implementation supports devices named "name", which the other
   didn't (but that would be really weird).

The tests now pass.
6 years ago
Adriaan de Groot d16c75b15c [partition] Expand tests to ClearMountsJob
- This is a tiny bit of TDD to replace the existing implementation
   (a shell pipeline) with processing inside Calamares.
 - The test fails right now, since the implementations are not
   the same.
6 years ago
Adriaan de Groot b1ccd573f8 [partition] Code-formatting for tests 6 years ago
Adriaan de Groot ecdd09edcd [partition] Refactor getting partitions from device
- Split out into own function
 - Prepare for implementation that doesn't use external processes
6 years ago
Adriaan de Groot d3df346ce7 [libcalamares] Move TemporaryDir into TemporaryMount
- Only one user of TemporaryMount, and we should distinguish
   "regular" temp mounts from temp mounts with a hand-picked
   mount point.
6 years ago
Adriaan de Groot 5876c3fdd7 [partition] Warn about storage setting in partition.conf
- This is really a specialised setting, not something for
   general use. People should be using `welcome.conf` instead.
6 years ago
Adriaan de Groot 5597215d58 [partition] Needs to settle the disks after all the changes 6 years ago
Adriaan de Groot 5a18a6cba9 [partition] Mark this use of "mount" as debugging-only
- This call doesn't need to be replaced by the mount helpers
   in the partition service, since it's just debug output telling
   what *is* mounted.
6 years ago
Adriaan de Groot ba7259d9ee [partition] Use TemporaryMount support class
- While here, fix up compile warning
 - add -R to umount for good measure
6 years ago
Adriaan de Groot 8e4a2b3543 CMake: Handle KPMCore version better
- provide complete information for feature_summary
 - set the right API version when building libcalamares
 - report the beta version number when it's wrong
6 years ago
Adriaan de Groot f6373561d3 [partition] One more job that uses KPMCore 6 years ago
Adriaan de Groot 9c85537659 [partition] The VG jobs also use KPMCore
- Give them a manager just like other KPMCore-based jobs,
   so that the privileged helper can be shut off on time.
6 years ago
Adriaan de Groot 042cef0945 [partition] Make kpmcore includes consistent 6 years ago
Adriaan de Groot c7da99d870 [partition] More includes fixes, "" instead of <> 6 years ago
Adriaan de Groot e8408cb5b2 [partition] Fix include path type
- Don't use #include <> for files in the current source directory.
6 years ago
Adriaan de Groot 4df9bd8917 [partition] Use KPM manager in partitioning jobs
- This gives all the partition-changing jobs an easy way to
   manage the lifetime of the privileged helper.
6 years ago
Adriaan de Groot d0d017f5fe [libcalamares] Add convenience backend() to KPMManager 6 years ago
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 8eb04a082e [libcalamares] Move FS-related code to partition service
- only moves one function right now, providing user-visible
   name for filesystem name.
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 9f0f08b571 [partition] Replace useless qobject_cast
- We know the type of the widget, but were declaring it as
   a QWidget. Just forward-declare the class and be done with it.
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 d8dc512f45 [libcalamares] Move PartitionIterator to partition service.
- Starting to centralize utility code for partitioning into
   libcalamares instead of scattered and weirdly shared between
   modules.
 - This particular commit breaks compiling the modules, though.
6 years ago
Adriaan de Groot f1822c2adb [partition] [fsresizer] For simplicity, disallow beta KPMcore 6 years ago
Adriaan de Groot 74432f698f [partition] Allow the requiredStorage setting to propagate
- store into globalStorage if the welcome module hasn't already done so.
 - this ends up used in PartUtils (via globalStorage).
6 years ago
Adriaan de Groot e6a2cb607f [partition] Add setting for requiredstorage
- If the welcome module isn't used, can set a required amount
   of storage for the installation here.
6 years ago
Adriaan de Groot b5c50c8d04 [partition] Update canBeReplaced
- Use GiB consistently
 - Provide same kind of debugging information as canBeResized()
6 years ago
Adriaan de Groot 79934aa513 [partition] Use GiB consistently in code 6 years ago
Adriaan de Groot acf3dbcdcb [partition] Refactor getting the globalStorage value 6 years ago
Adriaan de Groot 3548792d1b [partition] Improve check canBeResized
- Report the globalSettings name properly (with "GiB")
 - Bail out on bad conversion early.
6 years ago
Adriaan de Groot a263381996 [partition] Avoid an assert when running Calamares as user. 6 years ago
Adriaan de Groot 4a6b9f3528 [partition] Call update from init() in BootLoaderModel
- update() (might) add some extra rows for boot and root,
   which otherwise vanish temporarily when calling init.
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 3bdbfe6bff [partition] Avoid crash if combobox is gone and model resets
- Since the lambda is connected to the model only, it should
   check that the target combo exists as well.
6 years ago
Adriaan de Groot 2ce2b08027 [partition] Indent lambdas to tab-stop.
- Lambdas are all over the place in this codebase, formulate
   a standard and start adjusting code to it in passing.
6 years ago
Adriaan de Groot 353e713f81 [partition] Complain loudly on dangling Partition pointers
- Don't crash if a bad pointer gets into colorutils.
6 years ago
Adriaan de Groot 2bc95d11d3 [partition] Unrelated typo in comment 6 years ago
Adriaan de Groot f1f5b6c1bb [partition] Restore BootLoader path in Choice Page
- after model resets, restore what was previously selected.
 - This avoids having an **empty** combobox, SEE #1141 but does
   not actually set it back to the value the user had previously
   picked (e.g. changing swap settings **still** breaks the
   selection).
6 years ago
Adriaan de Groot 0ebabfafd4 [partition] Move BootLoaderModel convenience functions
- These were hidden inside PartitionPage, but are useful elsewhere.
6 years ago
Adriaan de Groot 8d451622db [partition] Idiomatic use of Calamares::JobList 6 years ago
Adriaan de Groot e2b71e669e [partition] When running UNSAFE, no-install-partition is a warning 6 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
Adriaan de Groot 80606cc38d [partition] Reduce test warnings through consistent signedness 6 years ago
Adriaan de Groot 7e12b65c94 [partition] Silence warnings about missing vtable 6 years ago
Adriaan de Groot 81715ba199 [partition] Warnings-- by using nullptr instead of 0 6 years ago
Adriaan de Groot 54108d2bab [partition] Fix up logging of jobs
- Logging `*it` was printing raw pointers, logging (plain) `it`
   needs the specialized logging `operator<<` to DTRT with temporaries.
6 years ago
Adriaan de Groot fd4bc4bb17 [partition] Avoid UB by initializing size everywhere 6 years ago
Adriaan de Groot bffaf47900 [partition] Reduce warnings about integer size 6 years ago
Adriaan de Groot 3b0d778d1e [partition] Mention that reuse-swap isn't supported now 6 years ago
Adriaan de Groot bbd2afc20f Merge branch 'issue-1129'
FIXES #1129
6 years ago
Adriaan de Groot 53230d73e2 [partition] Replace user-visible MB with MiB 6 years ago
Adriaan de Groot b08de96315 [partition] Comment w/ MiB instead of MB 6 years ago
Adriaan de Groot 707ec98553 [partition] Tidy labels view
- Use MiB terminology and support code
 - Remove debugging chattiness
 - Fix up include style
6 years ago
Adriaan de Groot 50857dcfec [partition] Fix tests to use "MiB" terminology 6 years ago
Arnaud Ferraris eb57be1be8 [partition] Remove deprecated sizeToSectors() function
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
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 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 d3783ef293 [partition] Use GiB and MiB consistently 6 years ago
Adriaan de Groot 502d43d111 [welcome] [partition] Rename GlobalStorage variable used for storage
- Change name passed into GS to use "GiB" instead of "GB", for
   consistency. This needs to be done in consumers as well.
6 years ago
Kevin Kofler a01d4707e1 [partition] Do not unmount /dev/mapper/live-* in ClearMountsJob
src/modules/partition/jobs/ClearMountsJob.cpp
(ClearMountsJob::getCryptoDevices): Skip not only `/dev/mapper/control`,
but also `/dev/mapper/live-*`. Fedora live images use
`/dev/mapper/live-*` internally. We must not unmount those devices,
because they are used by the live image and because we need
`/dev/mapper/live-base` in the `unpackfs` module.
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 a01262a535 CMake: massage dependency-finding
- If KPMCore is not found, don't require the KF5 components
   that it would depend on.
 - If ECM is found, use KDEInstallDirs always, not just when
   the partitioning module is used.
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 ca3110d429 [partition] Drop extra ; (warnings--) 6 years ago
Adriaan de Groot e8264a4503 [partition] Prefer GPT on EFI systems for new partition table 6 years ago
Adriaan de Groot 516b3b4b6c [partition] Adjust to logging-API changes
- missed due to #ifdef on a KPMcore API version I don't have on
   my main workstation.
6 years ago
Adriaan de Groot 3533bb3c2d Merge branch 'master' into issue-1061 6 years ago
Adriaan de Groot 08e4090354 Merge remote-tracking branch 'origin/raurodse-branding'
FIXES #961
6 years ago
Adriaan de Groot c99742bc70
Merge pull request #1127 from a-wai/partition-layout-size-checks
Add various checks for partition layout configuration
6 years ago
Adriaan de Groot cef2f50510 Reduce warnings about extra ;
- Trailing ; after Q_UNUSED
 - Trailing ; after CALAMARES_RETRANSLATE
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
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
Arnaud Ferraris 3a58ae5e8b Introduce new partition size class based on NamedSuffix
In order to maintain consistency, and make use, create a new PartSize
class in the PartUtils namespace, which inherits from NamedSuffix for
easier parsing and handling of size strings.

The switch to using this class instead of the previous functions will be
done in a follow-up commit.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
6 years ago
Adriaan de Groot 93be1a6582 [partition] Remove confusing spaces in logging 6 years ago
Adriaan de Groot dbac9ecf7b [partition] Remove unused code
- The name table is in PartitionActions::Choices
6 years ago
Adriaan de Groot d2404851cd [partition] Reduce warnings (shadow, ;, types) 6 years ago
Adriaan de Groot 1a4a265262 [partition] Refactor check for ISO9660 6 years ago
Adriaan de Groot 75f1a05fec [partition] No copy-constructor for CDebug 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 63b317902d [libcalamares] [partition] Adjust to logging changes
- Use the un-paren'ed Continuation and SubEntry
6 years ago
Adriaan de Groot 198acadd23 [partition] [fsresizer] Fix KPMCore API versions
- tests need the defines as well
 - scandevices API changed with API 3.3.1
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 4e24ea29e2 [partition] [fsresizer] Adjust to post-3.3.0 API
- KDE neon ships a post-3.3.0 KPMCore, with deprecations, but not yet
   the KPMCore 4 API, so add another API-version check to handle the
   deprecations. Keeps warnings down.
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 9159761171 [partition] [fsresizer] Fix KPMCore API detection
- There will be a 3.3.1 which still has the "old" API,
   so look at 3.3.80 (pre-4.0) instead. Make the way
   compile flags are passed consistent.
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 1a063a9b5d [partition] Use modern tr() annotation 6 years ago
Adriaan de Groot 78d6b51c3c [partition] Don't translate placeholder --- 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 4caa401a07 [partition] Use structured logging
- Structured logging
 - Reduce chattiness
 - Use helper functions
 - Some TODO were done a while ago
6 years ago
Adriaan de Groot 04146df36b [partition] Reduce logging for mounted partitions
- The other log entries say when something is possible,
   not when something is **not** possible.
6 years ago
Adriaan de Groot 6bccbcd1f5 [partition] Improve logging of status of choice buttons 6 years ago
Adriaan de Groot b5a997d11e [partition] Use structured logging 6 years ago
Adriaan de Groot 4282e4c31f [partition] Instantiate the manual-partitioning page on-demand
- When the manual partitioning page exists, it reacts to
   changes in a bunch of models; these models can be changed
   repeatedly from the choice page.
 - the manual partitioning page really only needs to deal with
   the relevant selections at the moment it is instantiated.
6 years ago
Adriaan de Groot 71fd3ab010 [partition] Check-which-page consistently 6 years ago
Adriaan de Groot 8f9b9a2ccf [partition] Remove unused include 6 years ago
Adriaan de Groot 7074829c24 [partition] Initialising BootLoader model is atomic
- don't send a bunch of update signals, do only a single
   model-reset when the BootLoaderModel is (re-)initialised.
6 years ago
Adriaan de Groot cccd4402d8 [partition] Simplify DeviceModel sorting 6 years ago
Adriaan de Groot 544131c4bc [partition] Improve type notation 6 years ago
Adriaan de Groot dd6d1bf1c1 [partition] Protect PartitionModel against concurrent access
- Try to avoid concurrent access while the model is being reset.
6 years ago
Adriaan de Groot df921606b9 [partition] Update copyright headers
- Files modified in 2019 by me
6 years ago
Adriaan de Groot b55a6cf716 [partition] Improve type-constness
- Don't bother copying the vector of available PVs, we need the
   contained pointers.
6 years ago
Adriaan de Groot 7806ccbe72 [partition] Drop superfluous debug logging
- While here, update copyright header
6 years ago
Adriaan de Groot 752a922bde [partition] Lock the bootloader model during reset
- Try to avoid races between resetting the model and getting
   data from it for the UI.
6 years ago