- new implementation handles blank (maps to "all") configuration,
- allows specifying "$uname" as kernel name, to use `uname -r`,
- allows specifying a specific kernel.
- updateButtonLabels() knows all the special cases for
buttons, so use it when the language changes instead
of setting up some possibly-wrong values.
- One edge case that this fixes is: have **just** the welcome
page before the first exec section in sequence. Then the
*next* button label was *next* instead of *install*.
- Minimal tests just check that all the availableTranslations()
entries have a reasonable language setting.
- Checks that Esperanto is still broken as a locale in Qt.
- The component isn't ready immediately, so instatiate
once it is fully loaded and ready
- Edge case if the execution view step is already visible, then
start the show (because a previous call to onActivate() will
have missed it).
- Just translate two simple strings, to avoid burdening translators,
- Add Dutch translation already.
These translations are not yet processed by ci/txpull and push.
- By instantiating only on activation, an ugly "white" gap
appears where there is no widget at all. So instantiate
earlier so that the widget already exists and is painting
by the time the slideshow part is visible.
- This makes the net effect of this branch so far zero:
the slideshow is still loaded and started when Calamares starts.
- From an exec section, next() is called automatically when
all the jobs in that section are done.
- If there **is** no next section (e.g. there's no finished
page to show after the exec), then m_steps.at() would assert
on an out-of-range index.
- Introdcuce a helper predicate isAtVeryEnd() which handles both
out-of-range and normal at-the-end scenarios.
- If there's no page following the exec section, stay with the
slideshow but update buttons to match the normal last-page
behavior, and don't ask about cancel (since we're done).
- This avoids processes that wait on stdin, and e.g. improves
reaction to having just "cat" (no file) in a command, or
a package manager that asks for input.
- JobQueue is only needed to get global settings, which are needed
when running in the target; for host commands, allow running
without a queue.
- Settings is needed for the value of debugsettings; assume if
there's no settings object, that we're in a test and should
print debugging information.
- This is the same as EFAIL: a block is indented as if it's a multi-
line else block. This isn't Python though, and the return always
applies.
- Add the necessary braces.
- Apparently noone uses this code path (until ProcessJob was re-
factored to do so).
- Use the system runCommand() instead of a 90% copy of it.
This **does** change the overall command to `env /bin/sh -c`
rather than running only `/bin/sh -c`, though.
- Replace magic numbers like -3 with named enum values
(NoWorkingDirectory, for -3).
- Downside is big-ugly static_casts, but that's what you get
for having an int as return value for processes.
- This solves a crash where the thread is destroyed while still
running (e.g. cancelling during install).
- The thread might not cooperate in being terminated, but then we
have a bigger problem anyway (and Calamares will still crash on
exit).
FIXES#1164
- The not-publicly documented setContent() method does all the
parenting and resizing needed; some of this isn't available
from outside of the widget either.
The QML slideshow now sizes and re-sizes correctly.
- Load QML on startup, compile async
- Create QML component when the page is reached.
- On leave, stop the slideshow (otherwise, e.g. timers will keep running)
This should move some of the delay from loading a large
slideshow forward as the engine is already initialized when
we reach the install / slideshow page.
- The static destructor issues a warning on exit:
QBasicTimer::start: QBasicTimer can only be used with threads
started with QThread
so instead, heap-allocate the model. This leaks memory, but
it's a singleton *and* we're exiting anyway.
- 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).
- d78bc0c5 added an early `return false` when cancel is disabled,
before checking if we were at the last step; so last-step
didn't get any special handling.
- refactor so that last-step now gets special handling first,
**then** disable-cancel handling, and then the usual case.
- Avoid races which might double-delete the timer, or enter
the if twice (which would lead to duplicate emissions of
requirementsComplete and the associated UI glitches).
If the requirements checking is **really fast**, e.g. you don't
have a check for internet connectivity, then the checks
might be done as fast as the 0-timeout single-shot timer,
which means that finished() is called once by the QFutureWatcher,
and then after that by the QTimer .. leading to two messages
"All requirements have been checked", but also twice
requirementsComplete being emitted, so you end up with two
results lists being added by the CheckerContainer.
Stop that by using the results-progress timer as an additional
flag: the first time everything is complete, delete that timer
and set the pointer back to nullptr.
- In debug mode, hitting assert(false) is meaningless,
- In release mode, the assert is optimized out.
- So assert the condition we're actually testing, for better messages.
- It's ok to use path / filenames in images, but you can also
use icon names according to the FDO icon spec. This makes
sense for at least *productLogo*, possibly *productIcon*, but
not really for *productWelcome*.
- Using next and back buttons calls onActivate() on the view step
that you end up on.
- The first view step to be shown, though, doesn't get an onActivate()
(unless you go, say, next and then back).
- Explicitly call onActivate() on the first view step once they're
all loaded.
FIXES#1156
- Branding images might want to use os-release data as well.
- Refactor a little to keep the number of #ifdefs the same;
an intermediate expand() lambda handles expansion (or not,
if it's not enabled).
FIXES#1153
- From the debug-window, clicking *reload stylesheet* does just
that, and applies the new stylesheet to the Calamares window.
- Remove stylesheet caching from the Branding class; we only
need the sheet once (on Calamares startup) or when updating
the stylesheet, which is seldom-enough that we don't need
to keep an extra copy around.
- To use, start Calamares, open the debug window, open stylesheet.qss
in an editor. Make changes, save, then click *reload stylesheet*.
SEE #1149
- Adds another tool to the debug window, which dumps (to the debug
log) a tree-like view of all the widgets in the application.
This can be used when writing stylesheets.
- allows you to use -- at runtime -- values from os-release in the
branding file.
- WIP because the only machine I have with sufficiently new KF5
is the FreeBSD box.
- Do the checking for IsMap inside loadStrings() and use
YAML::Exception to get to bail() (since we're already dealing
with exceptions here, no extra costs). This tidies up the code
somewhat.
- Don't need an extra indirection from WITH_KF5Crash to WITH_KCRASH,
just use the cmakedefine directly.
- Since the setting is only used in main.cpp, move the define
down there and remove cmakedefine entirely.
- Checking if the **next** step is an execute-step is a little
weird, so make the API more general (and add the +1 to indexes
where it was using NextWillExecute before).
- 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.
- Clang 8 can detect that there is no need for a return if all
previous paths already return. GCC 8 does not. Clang warns if
the unreachable return is there, GCC errors out if it isn't.
- Introduce a hack NOTREACHED that comments-out on Clang, and
marks as unreachable (but still present) on GCC.
- This might go away with an [[unreachable]] annotation or
similar.
- Although None will be filtered out already by unitsComparable(),
include it in the switch to avoid a warning .. then we can
drop the post-switch return since the switch covers all possible
values of the enum.
- Use unitsComparable where applicable
- Use SizeUnit instead of unit_t -- since this is a template
specialization, we have the more meaningful type name to
use, instead of the generic one.
- Not all kinds of units are comparable. Introduce a method
in PartitionSize to check for comparability (this could
also be a free method, but seems more tidy here because it
is specifically about comparing in the context of partition sizes).
- the switch handles all values of the enum and the compiler should
be smart enough to know that (therefore default isn't needed,
nor the return afterwards).
- Declaring namespace A::B is a C++17 extension, and Calamares
is C++14. Split the namespace declarations.
- While here, fix extra const warning as well.
src/modules/bootloader/main.py (install_secureboot): Run the configured
grubMkconfig command (should be `grub-mkconfig` or `grub2-mkconfig`) to
create `/boot/efi/EFI/$efi_bootloader_id/grub.cfg`. The sb-shim is just
a chainloader to GRUB 2, which expects a grub.cfg in that location, so
something has to create it or the installed system will not boot beyond
the GRUB rescue shell.
(install_grub): Fix misleading comment above the grubMkconfig call: it
is not the file specified in grubCfg that should be already filled out
by the grubcfg job module, that file is written by `grub*-mkconfig`
using `/etc/default/grub` as the input file. It is that input file
`/etc/default/grub` that should already be filled out by the grubcfg job
module. (The same input file is used in install_secureboot.)
- The output of subprocess is a bytes object, which needs to
be decoded so we can use it like a regular string (alternatively,
we could have changed more code to manipulate bytes, but eventually
we need a string to pass to a subsequent command anyway).
- Centralize the sanitizer so that it's consistent in different
environments.
- While here, add () to the sanitizer to avoid some distro's with
parenthesized names from creating weird EFI dirs.
- FIXES#934
- Whether this is really wanted depends on the distro, and I'm not
100% convinced the likely tags from Unicode are correct (or it'd
take a lot more data). In any case, starting Calamares in "NL"
gets me "nl_NL" as translation; presumably starting it in "BE"
will get me that as well (what about Les Wallons?)
- This also shows off that it's a real hack to have so much program
logic in the *widget* parts of each ViewStep. Longer-term,
a lot of functionality should go to the ViewStep itself, which
will then control the UI.
- Which translations are available is a global property
of Calamares itself, not of the plugins, so getting
the model of available translations should live there.
Move the relevant code (which is simple) from the
Welcome module.
- Use namespace CalamaresUtils::Locale consistently for this service.
- Move locale-related non-GUI support code from the Welcome module
to libcalamares; these are generally useful. Both Label (naming a locale)
and LabelModel (managing a bunch of those Labels) have been moved.
- Lookup country data based on enum or 2-letter code
- No data yet, so return only stubs
- The (generated) data tables are not listed as sources because
they are #include'd by the API implementation; they're full of
otherwise-unused static tables, so don't make sense to compile
separately.
- While here, tidy up the CMakeLists a bit to reduce the number
of superfluous variables.
- Continuing the notion that libcalamares should provide
(non-GUI) services for modules, add a locale service.
- This will, unfortunately, roughly duplicate Qt's QLocale
database, but in a form that is public and more readable.
On systems with SELinux enabled, we have to create the directories on
top of which we mount another partition or virtual file system (e.g.,
/dev) with the correct SELinux context, BEFORE we mount the other
partition. Otherwise, SELinux will get really confused when systemd
tries to recreate the mount tree for a private file system namespace for
a service. And unfortunately, even an autorelabel does not fix it
because it runs when /dev etc. are already mounted.
Without this fix, on Fedora >= 30, the system installed with Calamares
would fail to start the dbus-broker system bus, leading to several
important pieces of functionality not working (e.g., shutdown as
non-root).
On systems without SELinux enabled, chcon (which is part of coreutils)
will just print a warning and do nothing, so this should always be safe.
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>
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>
Using PartUtils::PartSize as reference, this commit creates a new
PartitionSize class in libcalamares, which will then be used in every
module needing such a class.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
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>
In the sidebar, the "Install" step should be named "Set Up" when in
setup mode, which will be more consistent with the other UI texts,
including button labels.
Signed-off-by: Arnaud Ferraris <arnaud.ferraris@collabora.com>
- 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?
- Remove (heavy-handed) top-level include_directories, in favor
of more focused ones; this helps to make sure that the dependencies
ordering is correct.
- Currently just moves a single enum, but this is prep-work for
moving the non-GUI parts of the module system into libcalamares,
to better support GUI-less operation.
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.
src/modules/unpackfs/main.py (UnpackOperation.mount_image): Check
whether entry.source is a regular file or a device and only use
`-o loop` on regular files, not devices.
At least on Fedora >= 29, `-o loop` fails on the read-only device
`/dev/mapper/live-base` (though `-o loop,ro` would be accepted).
- Simplify delegate: unused m_parent, tidy up inheritance, then drop
unnecessary custom constructor and extra Q_OBJECT macro.
- Drop some unnecessary included headers
- Drop single-use #define. APP was used in only one place; remove it
(that would be stylistically correct, anyway).
- Update copyright headers
- Document new label-handling
- The text rectangle was **moved**, not shrunk-in-place. Add
the missing - sign for the right and bottom margin.
- While here, move from #define to constexpr.
- Use a named enum instead of a collection of booleans
- Support old-style configuration but complain about it
- Update AppImage config as well
The new setup allows four different restart modes: never,
always, user-unchecked and user-checked. The user-modes
are interactive and give the user a choice (defaulting to
unchecked-don't-restart and checked-do-restart respectively).
The non-interactive versions vary in how they are
displayed.
- deprecate the old entries
- use a geoip sub-map for GeoIP configuration
- polish up documentation
- drop mention of blank and "legacy" styles for GeoIP config,
just update your URLs already.
- Dealing with legacy formats and alternate configurations
is something that consumers should do (and then hand off
to the 3-string constructor) instead.
- 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.