Commit Graph

6132 Commits

Author SHA1 Message Date
Adriaan de Groot
5b4152133d [packagechooser] Look for AppStream libs 2019-08-19 06:45:05 -04:00
Adriaan de Groot
52af9dbaad [mount] Add docstrings to methods 2019-08-19 06:31:37 -04:00
Adriaan de Groot
395c375c60 [mount] Winnow partition list
- Simplify the iteration by first determining which partitions
   are mountable (at all).
 - This guards against the very rare case that a partition
   does not have a mountPoint at all (the if guarded against that)
   where the lambda passed to sort() would get a KeyError.
2019-08-19 06:28:32 -04:00
Adriaan de Groot
8aedd8b175
Merge pull request #1219 from a-wai/extra-mounts-after-root
mount: Make sure extra mounts are mounted right after /
2019-08-19 06:22:16 -04:00
Adriaan de Groot
2e8a106f2c Changes: document new stuff 2019-08-16 04:21:53 -04:00
Arnaud Ferraris
257f5da1af mount: Use a single partitions list sorted by mount point
Instead of having a special case for extra mounts to be processed right
after the rootfs, a better approach is to add them to the partitions
list, and then sort the list by mount point.

This way, we make sure every partition is mounted right when it is
needed: `/` is obviously mounted first, `/run` is mounted before
`/run/udev`, and so on.

The overall process is therefore more generic and should suit all
use-cases.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-14 09:58:40 +02:00
Adriaan de Groot
cd5277913a Merge branch 'issue-1197'
- Improves the settings in welcome.conf, allows setting URLs directly
 - Adds a *showDonateUrl* setting to add a donations-button
2019-08-13 23:23:12 +02:00
Adriaan de Groot
0b7dcf7c50 [welcome] Fix up tooltips
- the "Select language" tooltip was applied to the form, so it would
   show up inappropriately all over the place
 - the buttons didn't have useful tooltips.
2019-08-13 23:22:33 +02:00
Adriaan de Groot
c36f963954 [welcome] Adjust names of URLs to be consistent
- having show*Url and donateUrl seems inconsistent, although
   the show*Url settings were originally boolean-only.
 - add "show" to the Donate button setting, to make them
   all consistent (putting a boolean there will generate a
   warning and hide the button, that's all).
2019-08-13 23:10:56 +02:00
Adriaan de Groot
706cc73925 [branding] [welcome] Adjust documentation for welcome-overrides 2019-08-13 23:10:56 +02:00
Adriaan de Groot
341965c2b1 [welcome] Use setupButton for all four buttons
- the show* settings in welcome.conf are "upgraded" to allow
   setting the URL directly in the module configuration.
2019-08-13 23:10:56 +02:00
Adriaan de Groot
119f84d6c1 [welcome] Remove setupLinks() method, use generic
- the generic (enum-based) setupButton() can handle all four
   of the buttons, so setupLinks() can go away. Only the
   (re)translation of the text on the button needs to be
   done, so move that to the main RETRANSLATE.
2019-08-13 23:10:56 +02:00
Adriaan de Groot
64d4b0a46c [welcome] Switch API for buttons to an enum + string
- Handle buttons and their URL-opening in a more
   general way with an enum; drop existing three-boot
   method and special setupDonateButton()
 - Doesn't compile because consumers haven't changed.
2019-08-13 23:10:56 +02:00
Adriaan de Groot
03e506a826 [welcome] Add a donate button
FIXES #1197
2019-08-13 23:10:56 +02:00
Adriaan de Groot
b60ec123a0 [branding] [welcome] Document interrelationship of settings 2019-08-13 23:10:56 +02:00
Adriaan de Groot
6b8c0129fd [libcalamaresui] Add one more icon (donate) from Breeze
- LGPLv3 like the others
2019-08-13 23:10:56 +02:00
Adriaan de Groot
e7dedbbfe0 [libcalamaresui] Apply coding style to remainder 2019-08-13 21:07:46 +02:00
Adriaan de Groot
d44e8f6115 [libcalamaresui] Apply coding style to viewpages/ 2019-08-13 21:02:30 +02:00
Adriaan de Groot
6f74463a80 [libcalamaresui] Apply coding style to utils/ 2019-08-13 21:00:36 +02:00
Adriaan de Groot
1b6aed8c40 [libcalamaresui] Apply coding style to modulesystem/ 2019-08-13 20:58:39 +02:00
Adriaan de Groot
6224d6605b [libcalamaresui] Apply coding style to widgets/ 2019-08-13 20:57:52 +02:00
Adriaan de Groot
27c3a5a11d [calamares] Apply coding style 2019-08-13 20:51:46 +02:00
Adriaan de Groot
f31ff8b9ea [libcalamares] Apply coding style to PluginFactory 2019-08-13 20:50:52 +02:00
Adriaan de Groot
ccd707b23a [libcalamares] Apply coding style
- .. or, rather, avoid re-formatting tables in future.
2019-08-13 20:49:58 +02:00
Adriaan de Groot
09a36cd669
Merge pull request #1221 from a-wai/add-base-10-sizes
Add 'base 10' partition size multiples
2019-08-13 20:26:22 +02:00
Adriaan de Groot
c57a30c73f Changes: credit where due for recent PRs 2019-08-13 17:06:27 +02:00
Adriaan de Groot
54767812fe
Merge pull request #1218 from a-wai/fix-unpackfs
Fix error in unpackfs
2019-08-13 17:01:40 +02:00
Arnaud Ferraris
a51d612afa Revert "libcalamares: Align partition sizes on actual sectors"
This reverts commit 40202705ff.
2019-08-13 16:57:47 +02:00
Adriaan de Groot
1d047839c7
Merge pull request #1220 from a-wai/prevent-int-overflow
Prevent integer overflow when parsing configuration
2019-08-13 16:21:35 +02:00
Adriaan de Groot
c53b59c504 Merge branch 'require-kcoreaddons'
Require KCoreAddons. This is one of the KDE Frameworks, small
and lightweight libraries adding functionality on top of Qt.

Since lots of **other** parts of Calamares require KDE Frameworks,
including the partitioning module, requiring a tier-1 for
basic functionality seems reasonable.

This brings:
 - using KPluginLoader instead of an ancient fork
 - availability of KMacroExpander everywhere
 - kaboutdata (needed for KCrash anyway)
 - kjobs (need to look into using those as a base for Calamares jobs)
2019-08-12 16:01:51 +02:00
Arnaud Ferraris
40202705ff libcalamares: Align partition sizes on actual sectors
Currently, the `bytesToSectors()` function rounds a partition size to the
nearest MiB unit, which may lead to inconsistencies when a partition
is expected to only be a few KiB's.

This patch changes the behaviour of `bytesToSectors()` so that it aligns
on sector size, without rounding the partition size to a multiple of
1MiB.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-12 15:55:18 +02:00
Arnaud Ferraris
209e8331b7 libcalamares: Add support for KB/MB/GB size units
Currently, all size units are expressed as KiB, MiB or GiB (resp. 2^10,
2^20 or 2^30).

In order to maximize compatibility and consistent results with other
partitioning tools, this commit adds support for sizes expressed as KB,
MB or GB (resp. 10^3, 10^6 or 10^9).

This change won't affect existing users, it simply adds a new option
that wasn't previously handled.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-12 15:55:18 +02:00
Adriaan de Groot
0716a46eb2 [libcalamares] Switch to using KPluginFactory
- this is not entirely straightfoward, since  we need
   different constructor arguments for the objects
   Calamares creates (no QVariantList& args, in particular).
   Implement our own registerPlugin() and createInstance()
   for that.
 - work around a bug in K_PLUGIN_FACTORY_DECLARATION_WITH_BASEFACTORY
2019-08-12 15:52:59 +02:00
Arnaud Ferraris
3929557a5a welcome: Fix requirements parsing
As the config files integer are now of type `QVariant::LongLong` instead
of `QVariant::Int`, requirements relying on this type were not parsed
correctly.

This patch fixes this, and adds an option to the python conversion to
take into account `QVariant::LongLong` types.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-12 15:48:48 +02:00
Arnaud Ferraris
0d06e047ae libcalamares: Prevent integer overflows when parsing configuration
Currently, a number of configuration parsing-related functions and
classes use only `int` type for dealing with integers. Should the user
need a bigger integer value, this would result in an erroneous value
being used (`0`), as the correct value would overflow the 32-bits type.

In order to prevent these overflow, this patch replaces `int` with
`qint64` in the following functions & classes :

  * CalamaresUtils::yamlScalarToVariant()
  * CalamaresUtils::getInteger
  * NamedSuffix
  * PartitionSize

This way, sizes or other integer values greater than 2^31 (for signed
types) can be used.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-12 15:45:34 +02:00
Arnaud Ferraris
bf47e761b0 mount: Make sure extra mounts are mounted right after /
When the rootfs partition is read-only, mount points for the other
partitions cannot be created, therefore they need to be created in a
tmpfs, already mounted somewhere in `/`.

However, the extra mounts are only mounted at the end, which causes an
error as no tmpfs is currently mounted.

This patch makes sure all extra mounts are mounted right after the `/`
partition, allowing the use of a read-only rootfs.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-08-12 15:40:59 +02:00
Arnaud Rebillout
2ab45cf4f0 Make sure that variable num_files_total_local is declared
This variable is declared in `if m:`. Of course if this codepath doesn't
run, the variable is not declared an Python doesn't like this kind of
surprise...

Signed-off-by: Arnaud Rebillout <arnaud.rebillout@collabora.com>
2019-08-12 15:37:02 +02:00
Adriaan de Groot
9098f8d741 Changes: document KCoreAddons dependency 2019-08-12 13:29:53 +02:00
Adriaan de Groot
1711071c58 [libcalamares] Swap out own PluginLoader for KCoreAddons 2019-08-12 13:24:53 +02:00
Adriaan de Groot
44991e700b [libcalamaresui] Check KCoreAddons version directly 2019-08-12 13:24:53 +02:00
Adriaan de Groot
bcb7f17584 [calamares] Make KCoreAddons a requirement
- Require KCoreAddons for KAboutData (also, optionally, for KOSRelease)
2019-08-12 13:24:53 +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
8c78a6cdfa Documentation: match stated requirements with CMakeLists.txt 2019-08-12 12:05:50 +02:00
Adriaan de Groot
08a08f9b54 [calamares] Minor optimizations and documentation
- document the data structure; for the vector V (called m_rows)
   the values are V_i < i, so that enables microscopic optimizations.
2019-08-09 17:29:28 +02:00
Adriaan de Groot
96ef488f1b [calamares] Clean up VariantModel
- stop compiler warnings with some judicious casting;
   that's what you get when a container indexed by int
   stored those indexes as quintptr.
 - apply coding style
2019-08-09 17:17:46 +02:00
Adriaan de Groot
8a7f32d3aa [libcalamaresui] Polish ImageRegistry
- do static initialization more carefully
 - float -> qreal (double) because that's what the Qt API expects,
   to reduce type-conversion warnings
 - apply current coding style
2019-08-09 16:52:54 +02:00
Adriaan de Groot
ec08a293b2 [libcalamaresui] Reduce compile warnings
- "this" isn't used in the lambda; in future it might be if the
   lambda needs to get the configuration from settings.
2019-08-09 16:43:50 +02:00
Adriaan de Groot
91d327b224 [libcalamaresui] Paste TCP port is quint16
- no sense in feeding in an int (and getting a compiler warning
   for narrowing) into something that by spec is a 16-bit value.
2019-08-09 16:41:59 +02:00
Adriaan de Groot
41173360a7 [libcalamares] We're just testing file modes, not whole int range 2019-08-09 16:36:38 +02:00
Adriaan de Groot
76041a2184 [dummycpp] Reduce warnings and apply coding style
- tired of the (IMO, bogus) clang warnings from the
   switch() statement with a default:, so swap it out for
   some cascaded ifs.
2019-08-09 16:34:53 +02:00