Adriaan de Groot
472ec32617
[partition] Be explicit about user-visible FS names, ReplaceWidget
2020-02-13 11:49:20 +01:00
Adriaan de Groot
05dfc24af6
[partition] Be explicit about user-visible FS names, CreatePartitionDialog
2020-02-13 11:45:04 +01:00
Adriaan de Groot
88cff387c3
[partition] Be explicit about user-visible FS names, FormatPartitionJob
2020-02-13 11:33:40 +01:00
Adriaan de Groot
bacca04695
[partition] Be explicit about what's user visible in SetPartitionFlagsJob
2020-02-13 11:29:45 +01:00
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.
2020-02-13 11:22:09 +01:00
Adriaan de Groot
dac5516b2c
[partition] Update copyright, coding style
2020-02-13 11:12:22 +01:00
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.
2020-02-13 11:06:53 +01:00
Adriaan de Groot
c055e1da49
[partition] Use untranslated name of filesystem
...
- Patch from Gabriel Craciunescu
2020-02-13 09:32:06 +01:00
Adriaan de Groot
f6d89354a1
Merge branch 'master' into kpmcore-manager
2020-01-10 14:54:13 +01:00
Adriaan de Groot
7fd218d7bf
[partition] Chase deprecations in Qt
2019-11-26 16:56:45 +01:00
Andrius Štikonas
490c14d93d
QLatin1Literal->QLatin1String.
2019-09-21 20:44:33 +01:00
Adriaan de Groot
0aabc89449
[partition] [welcome] Simplify retranslation
2019-08-29 15:02:12 +02:00
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.
2019-08-12 13:23:34 +02:00
Adriaan de Groot
48a25858f0
[partition] Chase 3rdparty move
2019-08-08 12:42:47 -04:00
Adriaan de Groot
399919c49a
[partition] Swap the two implementations of getting partitions
2019-06-24 13:10:45 +02:00
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.
2019-06-24 13:09:07 +02:00
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.
2019-06-24 12:47:53 +02:00
Adriaan de Groot
b1ccd573f8
[partition] Code-formatting for tests
2019-06-24 12:37:00 +02:00
Adriaan de Groot
ecdd09edcd
[partition] Refactor getting partitions from device
...
- Split out into own function
- Prepare for implementation that doesn't use external processes
2019-06-21 21:17:43 +02:00
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.
2019-06-21 16:37:35 +02:00
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.
2019-06-21 13:43:02 +02:00
Adriaan de Groot
5597215d58
[partition] Needs to settle the disks after all the changes
2019-06-20 17:14:14 +02:00
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.
2019-06-20 17:01:57 +02:00
Adriaan de Groot
ba7259d9ee
[partition] Use TemporaryMount support class
...
- While here, fix up compile warning
- add -R to umount for good measure
2019-06-20 14:49:44 +02:00
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
2019-06-14 23:57:07 +02:00
Adriaan de Groot
f6373561d3
[partition] One more job that uses KPMCore
2019-06-14 23:39:44 +02:00
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.
2019-06-14 23:32:34 +02:00
Adriaan de Groot
042cef0945
[partition] Make kpmcore includes consistent
2019-06-14 23:20:26 +02:00
Adriaan de Groot
c7da99d870
[partition] More includes fixes, "" instead of <>
2019-06-14 23:14:11 +02:00
Adriaan de Groot
e8408cb5b2
[partition] Fix include path type
...
- Don't use #include <> for files in the current source directory.
2019-06-14 22:59:40 +02:00
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.
2019-06-14 22:51:35 +02:00
Adriaan de Groot
d0d017f5fe
[libcalamares] Add convenience backend() to KPMManager
2019-06-13 23:39:06 +02:00
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.
2019-06-13 23:39:06 +02:00
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.
2019-06-13 14:55:43 +02:00
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.
2019-06-13 14:41:33 +02:00
Adriaan de Groot
3930826e93
[fsresizer] [partition] Drop special cases for kpmcore 3.3.1
2019-06-13 14:10:49 +02:00
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.
2019-06-13 14:02:43 +02:00
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
2019-06-13 12:27:39 +02:00
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.
2019-06-13 12:12:47 +02:00
Adriaan de Groot
f1822c2adb
[partition] [fsresizer] For simplicity, disallow beta KPMcore
2019-06-13 11:45:20 +02:00
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).
2019-06-08 14:36:11 +02:00
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.
2019-06-08 07:48:47 -04:00
Adriaan de Groot
b5c50c8d04
[partition] Update canBeReplaced
...
- Use GiB consistently
- Provide same kind of debugging information as canBeResized()
2019-06-07 23:19:24 +02:00
Adriaan de Groot
79934aa513
[partition] Use GiB consistently in code
2019-06-07 23:04:24 +02:00
Adriaan de Groot
acf3dbcdcb
[partition] Refactor getting the globalStorage value
2019-06-07 22:55:50 +02:00
Adriaan de Groot
3548792d1b
[partition] Improve check canBeResized
...
- Report the globalSettings name properly (with "GiB")
- Bail out on bad conversion early.
2019-06-07 22:51:33 +02:00
Adriaan de Groot
a263381996
[partition] Avoid an assert when running Calamares as user.
2019-05-31 12:27:32 +02:00
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.
2019-05-31 12:11:48 +02:00
Adriaan de Groot
d5f0bdd28c
[partition] Simplify negative logic
...
- Instead of multiple continue statements to avoid negative cases,
state the one positive case instead.
2019-05-31 12:08:58 +02:00
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.
2019-05-31 12:08:58 +02:00
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.
2019-05-31 12:08:58 +02:00
Adriaan de Groot
353e713f81
[partition] Complain loudly on dangling Partition pointers
...
- Don't crash if a bad pointer gets into colorutils.
2019-05-31 12:08:58 +02:00
Adriaan de Groot
2bc95d11d3
[partition] Unrelated typo in comment
2019-05-31 12:08:58 +02:00
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).
2019-05-31 12:08:58 +02:00
Adriaan de Groot
0ebabfafd4
[partition] Move BootLoaderModel convenience functions
...
- These were hidden inside PartitionPage, but are useful elsewhere.
2019-05-31 12:08:58 +02:00
Adriaan de Groot
8d451622db
[partition] Idiomatic use of Calamares::JobList
2019-05-28 16:39:00 +02:00
Adriaan de Groot
e2b71e669e
[partition] When running UNSAFE, no-install-partition is a warning
2019-05-28 16:29:45 +02:00
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.
2019-05-14 05:52:58 -04:00
Adriaan de Groot
80606cc38d
[partition] Reduce test warnings through consistent signedness
2019-05-14 05:29:19 -04:00
Adriaan de Groot
7e12b65c94
[partition] Silence warnings about missing vtable
2019-05-14 05:29:19 -04:00
Adriaan de Groot
81715ba199
[partition] Warnings-- by using nullptr instead of 0
2019-05-14 05:29:19 -04:00
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.
2019-05-14 05:29:19 -04:00
Adriaan de Groot
fd4bc4bb17
[partition] Avoid UB by initializing size everywhere
2019-05-14 05:29:18 -04:00
Adriaan de Groot
bffaf47900
[partition] Reduce warnings about integer size
2019-05-14 05:29:18 -04:00
Adriaan de Groot
3b0d778d1e
[partition] Mention that reuse-swap isn't supported now
2019-05-12 16:34:57 +02:00
Adriaan de Groot
bbd2afc20f
Merge branch 'issue-1129'
...
FIXES #1129
2019-05-09 08:14:25 -04:00
Adriaan de Groot
53230d73e2
[partition] Replace user-visible MB with MiB
2019-05-09 08:13:58 -04:00
Adriaan de Groot
b08de96315
[partition] Comment w/ MiB instead of MB
2019-05-09 08:00:23 -04:00
Adriaan de Groot
707ec98553
[partition] Tidy labels view
...
- Use MiB terminology and support code
- Remove debugging chattiness
- Fix up include style
2019-05-09 07:58:20 -04:00
Adriaan de Groot
50857dcfec
[partition] Fix tests to use "MiB" terminology
2019-05-09 07:51:35 -04:00
Arnaud Ferraris
eb57be1be8
[partition] Remove deprecated sizeToSectors() function
...
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-05-08 19:31:41 +02:00
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>
2019-05-08 19:31:20 +02:00
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>
2019-05-08 19:20:38 +02:00
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?
2019-05-07 09:51:23 -04:00
Adriaan de Groot
d3783ef293
[partition] Use GiB and MiB consistently
2019-05-06 16:47:11 +02:00
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.
2019-05-06 16:39:14 +02:00
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.
2019-05-06 15:08:10 +02:00
Adriaan de Groot
e0a79f4c0f
[partition] Reduce scope for nullptr dereference
...
- document what types are in use
- avoid at least one nullptr deref
2019-05-03 08:47:34 -04:00
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.
2019-04-30 13:38:46 +02:00
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.
2019-04-29 06:14:21 -04:00
Adriaan de Groot
ca3110d429
[partition] Drop extra ; (warnings--)
2019-04-25 10:17:07 -04:00
Adriaan de Groot
e8264a4503
[partition] Prefer GPT on EFI systems for new partition table
2019-04-25 14:40:27 +02:00
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.
2019-04-25 13:42:59 +02:00
Adriaan de Groot
3533bb3c2d
Merge branch 'master' into issue-1061
2019-04-24 12:26:01 -04:00
Adriaan de Groot
08e4090354
Merge remote-tracking branch 'origin/raurodse-branding'
...
FIXES #961
2019-04-23 16:41:22 -04:00
Adriaan de Groot
c99742bc70
Merge pull request #1127 from a-wai/partition-layout-size-checks
...
Add various checks for partition layout configuration
2019-04-18 13:48:50 +02:00
Adriaan de Groot
cef2f50510
Reduce warnings about extra ;
...
- Trailing ; after Q_UNUSED
- Trailing ; after CALAMARES_RETRANSLATE
2019-04-18 12:06:09 +02:00
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>
2019-04-18 10:55:47 +02:00
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>
2019-04-18 10:55:47 +02:00
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>
2019-04-18 10:55:47 +02:00
Adriaan de Groot
93be1a6582
[partition] Remove confusing spaces in logging
2019-04-15 10:16:09 -04:00
Adriaan de Groot
dbac9ecf7b
[partition] Remove unused code
...
- The name table is in PartitionActions::Choices
2019-04-15 10:14:37 -04:00
Adriaan de Groot
d2404851cd
[partition] Reduce warnings (shadow, ;, types)
2019-04-15 10:06:21 -04:00
Adriaan de Groot
1a4a265262
[partition] Refactor check for ISO9660
2019-04-15 10:06:03 -04:00
Adriaan de Groot
75f1a05fec
[partition] No copy-constructor for CDebug
2019-04-15 10:05:29 -04:00
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.
2019-04-15 09:02:21 -04:00
Adriaan de Groot
63b317902d
[libcalamares] [partition] Adjust to logging changes
...
- Use the un-paren'ed Continuation and SubEntry
2019-04-15 08:27:43 -04:00
Adriaan de Groot
198acadd23
[partition] [fsresizer] Fix KPMCore API versions
...
- tests need the defines as well
- scandevices API changed with API 3.3.1
2019-04-12 13:17:38 +02:00
Adriaan de Groot
c844188907
[partition] Fix build w/ "3.3.1" API
...
- Need older-style scanning, but new-style iteration
2019-04-12 12:54:13 +02:00
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.
2019-04-12 12:44:59 +02:00