Commit Graph

4037 Commits

Author SHA1 Message Date
Adriaan de Groot
cd92b8dd5e [libcalamares] Simplify logging code
- log() was never called with a non-default value for toDisk,
   so simplify to true. Keep the if() around to indicate block scope.
2019-02-22 09:21:22 -05:00
Arnaud Ferraris
5084c44b54 [partition] fix naming of PartitionLayout class member variables
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-02-22 13:08:59 +01:00
Adriaan de Groot
79c20b8fbd [partition] Fix user-visible strings
- The default window title in the designer file wasn't a good string
   to translate. Use one of the titles instanced from elsewhere.
 - The window titles set in subclasses were not translatable.

FIXES #1092
2019-02-22 07:03:38 -05:00
Arnaud Ferraris
586cb63ef5 [partition] use configured default filesystem type instead of ext4
When using the default partition layout (only a `/` partition), the
filesystem used was ext4, ignoring the `defaultFileSystemType`
configuration option.

This commit fixes this bug, so that any supported filesystem can now be
used for the default partitioning scheme.

Fixes #1093

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-02-22 12:58:55 +01:00
Adriaan de Groot
3ea6c6cfbe [users] Rename badly-named variable 2019-02-21 06:40:49 -05:00
Adriaan de Groot
c678cd80b4 [libcalamaresui] Refactor Requirements-Checking
- Move the actual checking into a separate object with some lifecycle-
   management signals.
 - Right now this is still single-threaded and blocking, so no net gain.
2019-02-20 05:48:15 -05:00
Dan Simmons
651b52ead9 Fix spelling typo 2019-02-20 05:00:58 -05:00
Adriaan de Groot
bbb9ff0cbf [libcalamaresui] Remove useless #define 2019-02-18 10:19:06 -05:00
Adriaan de Groot
ff10e1301d [libcalamaresui] Fix struct/class mismatch 2019-02-18 10:10:16 -05:00
Adriaan de Groot
18efcf2200 [welcome] Drop unnecessary parameter 2019-02-18 09:42:22 -05:00
Adriaan de Groot
5aa4e52452 [libcalamaresui] Improve debug-logging 2019-02-18 09:09:37 -05:00
Adriaan de Groot
946c5a493f [services-*] Fix translations
- Strings like "{} the {} with {}" are terrible for translators:
   - no context
   - no possibility to re-order grammatical units
   - substituting in English parts-of-speech is going to make a mess
 - Write the strings out with explicitly named substitutions,
   no part-of-speech substitution, and better formatting.
2019-02-18 06:27:36 -05:00
Adriaan de Groot
d33752c66c [libcalamaresui] Refactor Requirements classes
- improve naming of member variables
 - expand documentation
2019-02-15 20:53:55 +01:00
Adriaan de Groot
43eae0bc47 Merge branch 'master' into requirements-checking 2019-02-15 00:32:45 +01:00
Adriaan de Groot
723358e145 [partition] Reduce Transifex warnings
- Add a (superfluous, since they don't have their own signals or slots)
   Q_OBJECT macro to the VG jobs, to silence a Transifex warning (this
   does make sure that the tool knows about the context for the translated
   messages)
2019-02-14 16:12:43 -05:00
Adriaan de Groot
6fbc467795 [partition] Reduce Transifex warnings
- the string here has no context (no QObject-derived class that
   it is called in) so use the static method instead.
2019-02-14 16:08:55 -05:00
Adriaan de Groot
b7c77e7323 [services-systemd] Make user-visible messages translatable 2019-02-14 18:52:19 +01:00
Adriaan de Groot
544c1b708c [services-openrc] Make user-visible messages translatable 2019-02-14 18:50:29 +01:00
Adriaan de Groot
c9f89e2929 [modules] Translate name of services-* modules. 2019-02-14 15:30:48 +01:00
Adriaan de Groot
4178d5841c [modules] Enable translations on some Python modules
- Python modules should have human-readable names, which
   means that the description should be translated in `pretty_name()`
2019-02-14 15:30:48 +01:00
Adriaan de Groot
0f80a6295b [libcalamares] Reduce warnings about trailing ; 2019-02-12 17:11:01 +01:00
Philip Müller
870d9200e8 Release v3.2.4
-----BEGIN PGP SIGNATURE-----
 
 iHUEABEIAB0WIQTnwx6uJD15hBW87wASjwCHPgWvHQUCXGLH4QAKCRASjwCHPgWv
 HeCzAP4/cwoZOBtOFAdDy6IlolCC42wAyTdW8NOrA8A7jNmETAD/bIsYGRlVEQeG
 i9CW7IgRLRjlSM+hJPVYY8GYbF3k0Us=
 =0y3i
 -----END PGP SIGNATURE-----

Merge tag 'v3.2.4' of https://github.com/calamares/calamares into development

Release v3.2.4
2019-02-12 15:43:56 +01:00
Adriaan de Groot
496f9fdaf1 [libcalamares] Fix tests
- The test wants to read settings.conf, but by default it's run
   from way inside the build dir, where there is no such file.
   Go looking for one (but not too far).
2019-02-12 08:15:05 -05:00
Adriaan de Groot
9b36783961 [rawfs] Add example configuration
- Part of the tests checks that the example configuration
   is not empty. So uncomment the example. (Distro's should
   not be installing the example configs, and this one in
   particular needs to be customized).
2019-02-12 08:03:45 -05:00
Adriaan de Groot
f825a63bfe [fsresizer] Fix tests
- Test used 127% as value; this is now considered an invalid
   percentage (greater than 100%) and yields different values.
2019-02-12 07:57:35 -05:00
Philip Müller
9baebce7fd Merge branch 'master' of https://github.com/calamares/calamares into development 2019-02-12 13:45:54 +01:00
Adriaan de Groot
2a8960cd0f [partition] Ensure combobox pre-selects consistently
- Match the selected item in the combobox with a given default,
   which should be whatever is selected from the available set of
   choices.
2019-02-12 07:30:34 -05:00
Adriaan de Groot
5f20eedb6e [partition] Use swap-choice member, not the combobox pointer
- Store changes to the selected swap-choice when the combobox changes
 - Use that member instead of dereferencing the combobox

This avoids nullptr crashes when the combobox isn't even created
(e.g. when there is only one swap choice).
2019-02-12 07:21:35 -05:00
Adriaan de Groot
a4e6d4cd35 [partition] Rename combo box
- Too much confusion possible between the different members all
   named variations of *SwapChoice*
 - Update copyright years, too
2019-02-12 05:40:11 -05:00
Adriaan de Groot
335976e32c [partition] Improve defaultFS handling
- drop the localized comparisons; that's just confusing
 - warn when no default FS is set (then use ext4)
 - fix case-insensitive fallback; it used fsType, which was
   set to Unknown in the for loop.
2019-02-12 05:15:56 -05:00
Adriaan de Groot
faa3392cc5 Merge branch 'smooth-partition-crash' 2019-02-11 19:07:32 -05:00
Adriaan de Groot
dff5afe227 [partition] Reduce refreshes when reverting 2019-02-11 19:03:09 -05:00
Adriaan de Groot
b9fa0398c0 [partition] Disable one call to updateButtons()
- suggested by @abucodonosor, removing this one call seems
   to solve the data race for the device model.
2019-02-11 18:26:45 -05:00
Adriaan de Groot
ebc9a00bcf [users] Massage text widths
- Make the explanations about 3 times as wide as the text-boxes
   that they are explaining. This is partly moot because the
   text-boxes have fixed pixel sizes in the designer file, but keep
   it flexible for now.
2019-02-11 18:18:34 -05:00
Adriaan de Groot
1adf4da736 [users] Small space between password explanation and checkboxes 2019-02-11 18:07:27 -05:00
Adriaan de Groot
6316173f1b [partition] More conservative handling of device pointers
- thanks @abucodonosor
2019-02-11 17:45:23 -05:00
Adriaan de Groot
a6edb3ed34 [partition] Refactor PartitionEntry
- add a constructor that parses size and min
 - minor reduction in code duplication
2019-02-11 17:37:14 -05:00
Adriaan de Groot
5863300f67 [partition] Use const QString&
- minor code-layout and idiomatic-C++
2019-02-11 17:27:45 -05:00
Adriaan de Groot
abf1f14604 [partition] Initialize members of PartitionEntry 2019-02-11 17:14:39 -05:00
Adriaan de Groot
04b4e37bd0 [partition] Don't display unsupported swap styles
- Suppress unsupported options while reading the config file.
2019-02-11 09:23:50 -05:00
Adriaan de Groot
0fdc737968 [partition] Fix logging output
- Using the assignment-operator just generates blank lines.
 - Using QLog with a log-level avoids the cDebug()-style special
   handling of warnings and errors (useless here, but may as well
   fix code style).
2019-02-11 09:21:43 -05:00
Adriaan de Groot
2fda5957f1 [partition] Complain about unsupported swap choices 2019-02-11 09:06:27 -05:00
Calamares CI
33ed176b2e i18n: [dummypythonqt] Automatic merge of Transifex translations 2019-02-11 08:52:00 -05:00
Adriaan de Groot
7711cb0ad3
Merge pull request #1080 from a-wai/fix-systemd-boot-install
[bootloader] Fix systemd-boot installation
2019-02-11 08:49:22 -05:00
Adriaan de Groot
273461a497 [partition] Be verbose about handling osprober results 2019-02-11 05:32:42 -05:00
Arnaud Ferraris
91430a3cdb [rawfs] Add rawfs source to the partitions entry in global storage
When using the `rawfs` module for copying data, it may be useful to
save the source device used for later checks or actions. This commit
therefore adds a `source` field to each corresponding partition entry in
global storage, so that this information can be retrieved later during
the installation process.

Another small improvement is that global storage is now modified only
once (it was previously modified as many times as there were entries
processed by the `rawfs` module).

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-02-08 18:11:06 +01:00
Arnaud Ferraris
a14968a646 [bootloader] Fix systemd-boot installation
When choosing `systemd-boot` as the bootloader, numerous problems
occurred:

- the kernel and initrd were not copied to the EFI System Partition,
and therefore could not be reached by the bootloader
- the fallback entry used the default initramfs image instead of the
fallback image

`systemd-boot` provides the `kernel-install` utility, which
automatically copies the kernel + initramfs to the EFI partition, and
creates the corresponding bootloader entry.

Unfortunately, `kernel-install` cannot be used here as the module is not
executed in a chroot. As setting up one only for running a single
command would be overkill, this patch re-creates what `kernel-install`
usually does:

- copy the kernel and initramfs to their own subdirectory at the root of
the EFI partition
- create the corresponding entry configuration file

To this end, the `systemd-boot` installation code in the `bootloader`
module has been largely refactored, including removing a few duplicate
LOCs.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-02-08 18:00:58 +01:00
Adriaan de Groot
2c6ff26aaa [partition] Reduce warnings 2019-02-06 04:08:21 -05:00
Adriaan de Groot
d3ac29d98c
Merge pull request #1077 from a-wai/partition-layout-fix-sizes
Fix partition layout sizes parsing
2019-02-06 03:48:27 -05:00
Arnaud Ferraris
32a5a796f7 [rawfs] Allow use of symlinks in configuration
In its current state, the 'rawfs' module requires the source partition 
to be identified either by its mount point or device name, but using a 
symlink to either one (e.g '/dev/disk/by-uuid/...') would fail.

This patch fetches the real path of source partition, allowing the use 
of symlinks.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-02-01 14:23:59 +01:00
Arnaud Ferraris
cf45d55b32 [partition] Fix parsing of partition size in partition layout
When setting the size of a partition without indicating the unit, two
problems occur:

- the size is parsed as an integer, not as a string, hence the
configuration parsing fails
- the size parser doesn't recognize the fact that the size has no units
and defaults to 100%

This patch fixes the configuration parsing as well as the size string
parsing.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-02-01 14:02:40 +01:00
Arnaud Ferraris
18bb71aceb [partition] Fix minimum size parsing in partition layout
When a partition doesn't have a minimum size in the partition layout
configuration, it defaults to using 100% of the available space.

This patch fixes this error by setting the minimum partition size to 0
when the attribute has been omitted.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-02-01 13:57:33 +01:00
Adriaan de Groot
fe0c57c7af [calamares] Make loadmodule --help consistent
- Name job.yaml consistently, call it "job settings document"
2019-01-29 07:52:45 -05:00
Adriaan de Groot
958d15fb71 [libcalamares] Improve saveYaml()
- Write out Int, Double
 - Special-case empty lists
 - Do objects (not lists of objects) correctly

Now passes the tests for all the example config files.
2019-01-29 07:47:38 -05:00
Adriaan de Groot
3d6dd1202a [libcalamares] Extend tests to all example config files
- Do a `find ../src/ -name *.conf` to get files to load
 - Load and save all of them to check for correctness
2019-01-29 07:31:29 -05:00
Adriaan de Groot
e25deffa74 [libcalamares] Implement most of dumpYaml
- Write out bools, strings, lists and maps; this is enough to
   read and reproduce settings.conf
 - Fix infinite loop in writeIndent()
2019-01-28 18:25:47 -05:00
Adriaan de Groot
f72d6ca403 [libcalamares] Add very basic test for load/save YAML 2019-01-28 08:25:13 -05:00
Adriaan de Groot
8789b52cb1 Tests: add language and global-settings options
- The test-loader can be set to a specific language through the
   -l option (just like the Python one can) and can load a global
   configuration file.
2019-01-28 07:52:38 -05:00
Adriaan de Groot
5e1bcd9b4a [libcalamares] Stub of saveYaml
- This belongs alongside loadYaml, so place it in libcalamares
 - Doesn't actually save anything yet (it isn't used yet)
2019-01-28 07:50:30 -05:00
Adriaan de Groot
5efbf51ed3 [libcalamares] Improve naming in implementation
- The code in loadYaml was refactored out of the module-descriptor
   loading code, but the variable names in the implementation were
   not changed and still strangely specific to the prior task.
2019-01-25 11:59:17 -05:00
Adriaan de Groot
b3a7545217 [unpackfs] One more test case 2019-01-25 11:43:33 -05:00
Adriaan de Groot
b44fd65986 [libcalamares] load/save globals in YAML format 2019-01-25 10:58:43 -05:00
Adriaan de Groot
a36afc52df Tests: add command-line options to loadmodule
- The testing-application loadmodule gets -g and -j options
   for loading configurations (although -g is not implemented yet).
2019-01-25 10:01:12 -05:00
Adriaan de Groot
aebe67fde7 [libcalamares] Improve debug message while looking for gettext 2019-01-25 09:43:16 -05:00
Adriaan de Groot
d95193f646 [unpackfs] Translate and log other error messages 2019-01-25 08:02:56 -05:00
Adriaan de Groot
79ce2c2d0f [unpackfs] Translate pretty module name 2019-01-25 07:54:51 -05:00
Adriaan de Groot
28efe2b85a [unpackfs] Log messages in English, too
- For debugging purposes, need to log the message in English before
   returning the (user-visible) error description.
2019-01-25 07:53:39 -05:00
Adriaan de Groot
8ddf801bfb [unpackfs] Switch on translations for user-visible strings 2019-01-25 07:46:19 -05:00
Adriaan de Groot
18f172e80c [unpackfs] Add tests
- Add global- and job-configurations for test runs.
 - Add a driver script that sets up some assumptions on the host
   system so that the tests can complete.
 - The idea is that these tests together get a decent code-coverage
   for the module.
2019-01-25 07:20:16 -05:00
Adriaan de Groot
2d684bb385 [unpackfs] Be more resilient to globalStorage weirdness
- If no extraMount is defined, just don't mount anything
2019-01-25 07:14:23 -05:00
Adriaan de Groot
823b5e480e Tests: add script for running multiple Python-module tests
- This is a driver script for running testmodule.py multiple times
   with different global- and job-configurations.
 - Usage: testpythonrun.sh <modulename>
 - Run the script from the build-directory. It uses files from the
   tests/ (source) subdirectory to drive the test runs.
2019-01-25 06:42:26 -05:00
Adriaan de Groot
e96a29b1b9 [unpackfs] Improve error message wording 2019-01-25 06:08:56 -05:00
Adriaan de Groot
56d05d5834 [unpackfs] Reduce file-reading
- Only need to get the list of supported filesystems *once*,
   not for each and every filesystem that is going to be unpacked.
 - Be more Python-idiomatic.
2019-01-25 06:01:49 -05:00
Adriaan de Groot
4ceedf239c Merge remote-tracking branch 'origin/master' 2019-01-24 15:25:22 -05:00
Adriaan de Groot
73c39adf9c Merge branch 'improve-swap-ui' 2019-01-24 15:20:06 -05:00
Adriaan de Groot
ee5eef36d2
Merge pull request #1075 from a-wai/rawfs-module
Add a raw filesystem copy module
2019-01-24 21:08:52 +01:00
Adriaan de Groot
667c0594a4
Merge pull request #1074 from a-wai/disable-cancel-button
Add a settings.conf option to disable "Cancel" button
2019-01-24 21:05:38 +01:00
Adriaan de Groot
02416578cd Merge branch 'release-3.2.4' 2019-01-24 11:22:04 -05:00
Calamares CI
2f35ff96bb i18n: [dummypythonqt] Automatic merge of Transifex translations 2019-01-24 08:19:40 -05:00
Arnaud Ferraris
902772d9f8 [rawfs] Fix copyright notice in module header
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-01-24 12:46:13 +01:00
Arnaud Ferraris
4e6492de28 Add a raw filesystem copy module
In some cases, we might want to copy a filesystem as if we were using a
simple 'dd' command, in order to create an exact copy, down to the block
level.
This can be useful in particular when working with dm-verity for
checking the rootfs integrity: that way, we can make a direct copy of
the rootfs and its verity partition and keep the system usable.

This patch adds a new 'rawfs' module to calamares, making possible to
block-copy a filesystem to a block device.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-01-23 16:36:31 +01:00
Arnaud Ferraris
db3d3a7d03 Add a settings.conf option to disable "Cancel" button
In some cases, e.g. when calamares is used as an "initial setup" tool,
we may want to user to go through all the configuration steps in order
to end up with a usable system.
Therefore, disabling the "Cancel" button can be useful in this case.

This commit adds an option to settings.conf which disables this button
when set to "true". If the option is not present in the settings file,
the default behavior ("Cancel" button enabled & visible) is enforced.

Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
2019-01-23 15:56:07 +01:00
Adriaan de Groot
b913753831 [partition] No need to re-query the current choice 2019-01-21 08:54:09 -05:00
Adriaan de Groot
aef61a42bc [partition] Tidy up code
- avoid possible nullptr dereference on connect() if no swap choices
 - group retranslations together
2019-01-21 08:22:17 -05:00
Adriaan de Groot
24422b19bd [partition] Idiomatic connect() usage 2019-01-21 08:20:01 -05:00
Adriaan de Groot
fbef117fc8 [partition] Remove unused code 2019-01-21 07:52:23 -05:00
Adriaan de Groot
8ecae75dc8 [partition] Simplify code a little
- Document and make pickOne() more correct
 - Reduce calls to globalStorage(), it doesn't change
2019-01-21 07:41:47 -05:00
Philip Müller
2b32e1ac5c [branding] update colours 2019-01-19 20:40:19 +01:00
Philip Müller
067ca16112 Merge branch 'improve-swap-ui' of https://github.com/calamares/calamares into development 2019-01-18 18:11:25 +01:00
Adriaan de Groot
e85fedfd41 [partition] Drop comment that doesn't apply anymore 2019-01-18 15:57:21 +01:00
Adriaan de Groot
fee1794924 [partition] Use NamedEnumTable support code
- reduce amount of custom code by using the (new) generic implementation
2019-01-18 15:56:51 +01:00
Philip Müller
25d1022c4c Merge branch 'master' of https://github.com/calamares/calamares into development 2019-01-16 23:04:34 +01:00
Adriaan de Groot
a51a000681 Merge branch 'master' into improve-swap-ui 2019-01-14 15:57:22 +01:00
Adriaan de Groot
bcce704589 Merge branch 'resize-control'
FIXES #1062 #1038
2019-01-14 15:31:25 +01:00
Adriaan de Groot
12665192ae [libcalamaresui] Defend against missing config settings 2019-01-14 15:30:44 +01:00
Adriaan de Groot
ef94b1f689 [calamares] Support noexpand
- When in noexpand mode, just don't grow the window, and assume
   widgets elsewhere will get scrollbars automatically.
2019-01-14 14:25:01 +01:00
Adriaan de Groot
866797a6c9 [calamares] Support starting fullscreen 2019-01-14 14:17:39 +01:00
Adriaan de Groot
80569a746f [libcalamaresui] Relax validity check in branding
- A size of 64em has a value less than 1024, which is the minimum
   size **in pixels**. The check doesn't make sense as-is and would
   have to take the unit into account. Leave that to clients of
   branding (e.g. CalamaresWindow, which already does this).
2019-01-14 13:42:41 +01:00
Adriaan de Groot
79cee26b33 [libcalamares] Switch to std::vector
Keeping std::initializer_list around is fraught. Causes segfaults
because I'm not keeping the underlying temporary array around
properly. Switch to vectors because those initialize from the
underlying array.

TODO: look into making this sufficiently constexpr -- perhaps
just use std::array and make find() work on that.
2019-01-14 13:23:44 +01:00
Adriaan de Groot
097927eb3e [libcalamares] Fix off-by-one in taking substring for value 2019-01-14 13:23:14 +01:00