Commit Graph

3523 Commits

Author SHA1 Message Date
Adriaan de Groot
44211ee19a Merge branch 'release-3.2.3'
- Pull in CHANGES and release-numbering modifications
 - Pull in locale fixes
 - Bump version again, to 3.2.4-RC1 in master
2019-01-09 13:07:32 +01:00
Adriaan de Groot
4b1b71dd3e [locale] Update Copyright statements 2019-01-08 22:30:12 +01:00
Adriaan de Groot
527392f0af [libcalamares] Update Copyright statement 2019-01-08 22:29:55 +01:00
Adriaan de Groot
200f68ae48 [locale] Reduce debug-chattiness 2019-01-08 22:18:01 +01:00
Adriaan de Groot
f1cbd5fcbf [locale] Provide API for setting language
- The language and BCP need to be in-sync
 - Existing code was inconsistent in setting things, which is why
   you could get through the locale page without setting a locale
   (at all) or it would keep English in spite of picking Germand on
   the welcome page.
 - Patch tests to use that API.
2019-01-08 18:09:34 +01:00
Adriaan de Groot
8cc0e1f5f9 [locale] Expand tests to check lang
- This shows that one constructor isn't doing it right.
2019-01-08 14:39:40 +01:00
Arnaud Ferraris
921f70d3bb [partition] Fix size and last sector computation
Due to a computation error when calculating the total drive space and
each partition's last sector, the last partition's last sector was out
of boundaries, leading to an error creating this partition.

This patch fixes the computation algorithm to get rid of this error.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-01-08 14:05:38 +01:00
Adriaan de Groot
2345b933cd [locale] Add operator << for LocaleConfiguration, for debugging 2019-01-08 13:40:20 +01:00
Adriaan de Groot
dbe50fe3db [locale] Improve LocaleConfiguration constructors
- Allow split-setting of the language and formats
 - Test new constructors
 - Since fromLanguageAndLocation can handle empty localeGen
   lists just fine, skip all the weird checks that return
   invalid guessed locale configurations.
2019-01-08 13:23:16 +01:00
Adriaan de Groot
0a526febae [locale] Refactor setting the BCP47 name and update test 2019-01-08 11:39:15 +01:00
Adriaan de Groot
b1921cced9 [locale] Add tests for some of the data classes 2019-01-08 11:30:49 +01:00
Adriaan de Groot
50e6f0fcbf [locale] Replace weird static-constructor
- Replace createDefault() with a constructor that takes a
   locale name; use it with en_US.UTF-8 in those places where
   createDefault was previously used.
2019-01-08 11:10:16 +01:00
Adriaan de Groot
093240c131 [libcalamares] Be less chatty in Python scripts
- When finding the gettext path, the debug output was very
   chatty and didn't include an indication that it was looking
   for translations.
2019-01-08 10:51:53 +01:00
Adriaan de Groot
9d871fb9db [locale] Update global locale setting when it changes
- use debugging to be a little more chatty
 - when changing the system language on the locale page,
   the global locale setting should change, too.
2019-01-07 18:49:08 +01:00
Arnaud Ferraris
cb60a3e7f1 [partition] Keep copyright notice for copied code
Some code was copied and adapted from PartitionActions.cpp. For full
compliance, it is best to copy the copyright holders list from this file
to PartitionLayout.cpp.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-01-07 18:40:12 +01:00
Adriaan de Groot
bc398756f5 [locale] Debugging support for Location
- code formatting
 - provide an operator << for debugging TZ widget
2019-01-07 18:34:25 +01:00
Adriaan de Groot
3ff480eaa9 [locale] Refactor to make updating global locale setting easier. 2019-01-07 17:29:54 +01:00
Arnaud Ferraris
fcd0e8d362 [partition] Apply partition layout when replacing free space
When chosing the "Replace partition" option, free space is not handled
like any partition. In order to apply the custom partition layout in
that case too, we have to modify the code where "replace free space" is
handled.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-01-07 17:28:02 +01:00
Arnaud Ferraris
ba673b17ee [partition] Add configuration option to disable manual partitioning
In some cases where a custom partition layout is used, use of this
layout is mandatory (this can be the case when using a read-only rootfs
which is updated by block-cpying an image file to it).

For these cases, the user must not be able to change the partition
layout, therefore we have to disable manual partitioning.

In order to stay consistent with current behaviour, manual partitioning
is still enabled by default. It will only be disabled if the partition
module's config file contains the corresponding option set to "false".

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-01-07 17:27:40 +01:00
Arnaud Ferraris
2f14a21456 [partition] Apply custom layout when installing "Alongside"
When choosing "Install alongside another system", the custom partition
layout is applied to the space freed by resizing the selected partition.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-01-07 17:27:12 +01:00
Arnaud Ferraris
74a59ae68a [partition] Display partition labels when they exist
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-01-07 17:26:53 +01:00
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>
2019-01-07 17:26:37 +01:00
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>
2019-01-07 17:26:12 +01:00
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>
2019-01-07 17:25:39 +01:00
Arnaud Ferraris
f1ead5193d [partition] Create PartitionLayout class
In order to use a custom partition layout in the partition module, we
need to write this layout in the module's config file, and store it into
a dedicated object.

As it doesn't look appropriate to extend an existing class with layout
information, we create a new PartitionLayout class, which will be used
to parse the layout from the config file and keep it in memory.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-01-07 17:25:22 +01:00
Adriaan de Groot
e52f0318fe [locale] Call timedatectl only when needed
- When testing and running not-as-root, only call the timedatectl
   when the settings actually change; this reduces the number of
   times kauth pops up.
2019-01-07 15:16:37 +01:00
Adriaan de Groot
2bb7a5f686 [branding] Document intended settings for window size
- Control Calamares window size through the branding file
 - This is for #1062 and #1038
2019-01-03 15:46:44 +01:00
Adriaan de Groot
8b72c93d67 [branding] Group the welcome-settings together 2019-01-03 15:38:20 +01:00
Adriaan de Groot
b1ea96e463 [partition] Don't autoremove the tempdir
- Dangerout since we're mounting things inside that tempdir,
   and then doing a "weak" unmount
2019-01-03 15:10:07 +01:00
Calamares CI
e572784eb5 i18n: [dummypythonqt] Automatic merge of Transifex translations 2019-01-03 15:06:55 +01:00
Adriaan de Groot
fe3a88f834 [packages] Fix cut-and-paste-o in packages try_remove
- Copied from_local from the code for install, which doesn't
   make sense and causes a NameError.

FIXES #1063
2019-01-03 14:36:48 +01:00
Adriaan de Groot
56a71c232f [locale] Use the re-factored LocaleLabel 2018-12-14 13:27:32 +01:00
Adriaan de Groot
210965aca4 [libcalamaresui] Allow always-show-country setting in locale label 2018-12-14 13:20:32 +01:00
Adriaan de Groot
8790985fca [libcalamaresui] Code-formatting, remove dead code 2018-12-14 11:33:13 +01:00
Adriaan de Groot
3dda9ab860 [libcalamaresui] LocaleLabel doesn't need to inherit QObject
- Use static QObject::tr instead.
2018-12-14 11:30:05 +01:00
Adriaan de Groot
1f4ac45bb5 [libcalamaresui] Cleanup locale-labeling code
- Support translations of the "language (country)" format instead
   of forcing English parenthesis.
2018-12-14 11:22:47 +01:00
Adriaan de Groot
084f4d2445 [libcalamaresui] Refactor: move LocaleLabel to UI library
- This is prep-work for making locale labels consistent everywhere.
 - While here, improve code documentation.
2018-12-14 10:52:55 +01:00
Harald Sitter
311af6de5d [locale] prefer native language and country names when available
This basically means we talk about localization in the respective
localized variant. e.g. "German (Germany)" ➡ "Deutsch (Deutschland)".

If geoip lookup failed or isn't configured for whatever reason it's a
stretch to expect the user to know english enough to find their own
language. Preferring the localized strings resolves this issue.

Additionally this happens to bypass #712 respectively
https://bugreports.qt.io/browse/QTBUG-34287
as the native names are properly spelled. So, as long as Qt has localized
names the names will also be properly spelled.
2018-12-13 23:18:37 +01:00
Calamares CI
bf976b3de0 i18n: [dummypythonqt] Automatic merge of Transifex translations 2018-12-11 19:31:23 +01:00
Adriaan de Groot
4973d00ace [partition] Only create drop-down if there is something to select
- Swap choices may be 0 (then choose none), 1 (choose that one)
   or more (currently undecided)
2018-12-11 13:52:23 +01:00
Adriaan de Groot
00df8a9fb1 [partition] Remove unused code
- Swap choice for replace and alongside will happen much, much later.
2018-12-04 12:21:02 +01:00
Adriaan de Groot
a456687924 [partition] Include all possible SwapChoices in example 2018-12-04 12:11:35 +01:00
Adriaan de Groot
a66ea106d6 [partition] Missing implicit include 2018-12-04 11:40:27 +01:00
Adriaan de Groot
2998c27545 [partition] Use configured swap choices in choice page 2018-12-04 11:35:35 +01:00
Adriaan de Groot
5945e9584d [partition] Refactor name-to-enum and back for swap choices 2018-12-04 11:15:38 +01:00
Adriaan de Groot
edc6c64657 [partition] Create swap-combo from a set
- Alternate way to create swap-combobox, using configuration
   values rather than an initializer list.
2018-12-04 11:01:16 +01:00
Adriaan de Groot
988a0a5388 [partition] Changing swap choice also changes preview
- When selecting *erase*, you may be able to change the swap
   settings. If so, changing swap settings should change the
   preview.
2018-12-04 10:34:02 +01:00
Adriaan de Groot
0231619c7c [partition] Refactor slot for change in action
- Let's not go overboard on lambdas,
 - Needed for others that also want to update the partitioning preview
2018-12-04 10:22:08 +01:00
Calamares CI
6ac872e724 i18n: [dummypythonqt] Automatic merge of Transifex translations 2018-12-03 21:09:30 +01:00
Adriaan de Groot
c5d707399d Merge branch 'fix-swap-ui' 2018-12-03 21:02:10 +01:00
Adriaan de Groot
14c72824f0 [partition] Be chatty when deciding a partition isn't resizable 2018-12-03 16:42:40 +01:00
Adriaan de Groot
b798c27bc4 [partition] Be more verbose while looking for fstab entries 2018-12-03 16:33:12 +01:00
Adriaan de Groot
1f2d547d5b Merge remote-tracking branch 'origin/partitioning-fixes' 2018-11-30 12:50:03 +01:00
Adriaan de Groot
e074959ede Merge remote-tracking branch 'origin/package-scripts'
FIXES #1057
2018-11-30 12:29:31 +01:00
Adriaan de Groot
1fb1189f74 Merge remote-tracking branch 'origin/mount-conf-flexible' 2018-11-30 12:28:07 +01:00
Adriaan de Groot
e4d67b5572 [mount] Handle missing configuration keys gracefully
- If a key is missing from mount.conf, don't raise KeyError
 - If both keys are missing, suggest that mount.conf might
   be missing instead (a consequence of INSTALL_CONFIG=OFF, for
   instance).
 - Simplify code a bit.
 - Don't bother returning None explicitly.
2018-11-28 13:26:40 +01:00
Adriaan de Groot
0a73d57808 [packages] Add support for pre- and post- scripts everywhere
- for remove and localInstall, add support for pre- and post-
   scripts like there already was for install.

This feels like there's code duplication going on, but I haven't
thought of an elegant way to distinguish the available operations
so that I can pass around functions instead.
2018-11-27 12:52:24 +01:00
Adriaan de Groot
34255b4cf5 [packages] Document *localInstall* operation. 2018-11-27 12:48:31 +01:00
Adriaan de Groot
05588a1ffd [packages] Improvide conf documentation
- about LOCALE packages
 - about pre- and post-scripts

CC: #1057
2018-11-27 12:39:19 +01:00
Calamares CI
94dcf56282 i18n: [dummypythonqt] Automatic merge of Transifex translations 2018-11-20 13:17:21 +01:00
Adriaan de Groot
38d58fb6ed [partition] Check for suitable FS before passing -o noload
- The noload option prevents journal re-play (so it's an extra-
   strong read-only) but is only applicable to ext3 and ext4.
   Check the FS type before mounting; other FS types don't
   accept -o noload and will fail to mount.
2018-11-12 17:07:18 +01:00
Adriaan de Groot
e0ce500f36 [partition] Improve debug-output after os-prober 2018-11-12 16:31:30 +01:00
Adriaan de Groot
c522004575 [partition] Mount fs read-only when searching for fstab
Submitted by aliveafter1000

FIXES: #1044
CLOSES: #1050
2018-11-12 15:26:15 +01:00
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
2018-11-12 15:15:22 +01:00
Adriaan de Groot
a1143e8fef [partition] Document flags parameter to createPartition() 2018-11-12 14:16:33 +01:00
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.
2018-11-09 08:25:26 -05:00
Adriaan de Groot
1def06cfd3 [calamares] Reduce warnings about signedness 2018-11-09 08:24:31 -05:00
Adriaan de Groot
97c9e5bdcd [partition] Debug-log available file-system types 2018-11-06 06:22:02 -05:00
Adriaan de Groot
463b1441a5 [partition] Be more verbose about default file-system settings
- Log the type that is configured
 - Document that this is a delicate setting, case-sensitive and
   dependent on KPMCore.
2018-11-06 05:54:45 -05:00
Adriaan de Groot
6de55e6951 [partition] Construct, then winnow, the fstab entries 2018-11-02 12:13:29 -04:00
Adriaan de Groot
ebbc1a1bcb [partition] "constructor-like" needs to be static 2018-11-02 12:13:06 -04:00
Adriaan de Groot
516ae494bf [partition] Complain if unmount fails
- If unmount fails, then warn and don't autoremove
2018-11-02 12:04:09 -04:00
Adriaan de Groot
bd1b482242 [partition] Don't autoremove the tempdir
- Dangerout since we're mounting things inside that tempdir,
   and then doing a "weak" unmount
2018-11-02 11:58:49 -04:00
Adriaan de Groot
f1c1d07dca [partition] Add convenience methods to FstabEntry
- Add something like a constructor
 - Add validity checking
2018-11-02 11:57:49 -04:00
Adriaan de Groot
417eeedd9f [partition] Calamares is spaced-out enough without extra's 2018-10-11 06:35:45 -04:00
Adriaan de Groot
c7645af358 [partition] Translate swap-choice-strings to enum
- Handle legacy and modern config, mixed-configs,
 - Translate strings to enum values,
 - Default and warn as appropriate.
 - Doesn't **do** anything with the config, though.
2018-10-11 06:27:39 -04:00
Adriaan de Groot
f7cc571635 Merge branch 'fix-swap-ui' of github.com:calamares/calamares into fix-swap-ui 2018-10-08 16:49:18 -04:00
Adriaan de Groot
3d543e9063 [partition] Refactor to use current config-reading methods 2018-10-09 05:46:12 -04:00
Adriaan de Groot
caa4b8ab53 [partition] Document intention of new-style swap config 2018-10-09 05:30:14 -04:00
Adriaan de Groot
2a61116b3c [partition] Disable swap choice for replace & alongside 2018-10-08 15:32:02 -04:00
Adriaan de Groot
779542a5d1 Merge branch 'master' into fix-swap-ui 2018-10-08 13:56:28 -04:00
Adriaan de Groot
3b8d2835e0 [calamares] Use XDG_{DATA,CONFIG}_DIRS as appropriate
- Use DATA for the qml and branding directories (looks for qml/
   and branding/<name>/ in those directories).
 - Use CONFIG for the global settings and module settings (looks
   for settings.conf and module/<name>/ in those directories).

FIXES #941
2018-10-08 10:28:30 -04:00
Adriaan de Groot
c489320af5 [calamares] Add option to obey XDG dirs
- Prep-work for #941
 - This does nothing, yet, just sets the stage for using
   XDG_CONFIG_DIRS and XDG_DATA_DIRS as well as the regular
   directories.
2018-10-08 07:02:35 -04:00
Adriaan de Groot
4a2ca8bb77 [libcalamares] Fix compilation of tests
- QCOMPARE is picky with types, enum vs unsigned int, so just
   hit it with a hammer.
2018-10-08 06:46:35 -04:00
Adriaan de Groot
fc99824c8d [fsresizer] Fix string error, thanks Lithuanian translators 2018-10-05 17:22:12 +02:00
Adriaan de Groot
bb586de056 [partition] Remove some slowdown methods when debugging is off
- Running lsblk and mount for debugging purposes can be
   skipped when the debugging is going to be suppressed anyway.
   This will speed things up just a little for regular users.
2018-10-05 09:41:37 -04:00
Adriaan de Groot
74ab06e20a [partition] Drop redundant logging 2018-10-05 09:41:37 -04:00
Adriaan de Groot
02a6b7dd12 [partition] Log the newly-created partition table
- Log individual partitions instead of printing QObject(<ptr>)
2018-10-05 09:41:37 -04:00
Adriaan de Groot
4757496c3d [partition] Improve partition-UUID logging. 2018-10-05 09:41:37 -04:00
Adriaan de Groot
5b936f33ec [libcalamares] Add tests
- Test only the new debug-level query methods
2018-10-05 09:41:37 -04:00
Adriaan de Groot
0b1c969a80 [libcalamares] Allow querying debug settings 2018-10-05 09:41:37 -04:00
Adriaan de Groot
7515386cf8 CMake: clean up test setup
- Remove redundant searches for ECM and Qt::Test, move
   them to top-level.
2018-10-05 09:41:37 -04:00
Adriaan de Groot
a33b0c4f24 [partition] Log the flags that are used to create a partition 2018-10-05 07:45:05 -04:00
Calamares CI
36161461e2 i18n: [dummypythonqt] Automatic merge of Transifex translations 2018-10-05 07:36:40 -04:00
Adriaan de Groot
292bc57523 [partition] Fix build with suitable operator << 2018-10-03 13:49:52 -04:00
Adriaan de Groot
b38316365e [partition] Be more verbose about why UI buttons appear 2018-10-03 13:58:50 +02:00
Adriaan de Groot
800f9d34f9 [partition] In logging, distinguish more cases
- While winnowing devices, the zram and nullptr cases
   were mixed together; split them, for the sake of
   logging more accurately.
 - While here, fix up some coding-style issues.
2018-10-03 13:46:08 +02:00
Adriaan de Groot
1a248e0574 [preservefiles] Apply restrictive default permissions 2018-10-01 11:31:54 +02:00
Adriaan de Groot
eb6fc01c01 [preservefiles] Document new permissions key 2018-10-01 11:22:57 +02:00
Adriaan de Groot
d3d08241e2 [preservefiles] Support perm setting
- Use settings from config file
 - Refactor copy operation
 - Apply permissions inside target system
2018-10-01 11:22:57 +02:00