- Need to create just one QApplication (subclass) with the right
parameters for the UI to work.
- If the UI is enabled and it's a View module, then show the widget
rather than running the jobs.
- The ViewManager needs branding information, which wasn't
initialized -- leading to crashes. Add -b option to give
a specific branding, and default to something take makes
sense when testing modules from the build directory.
- Allows the module to load; doesn't show the UI though.
Package chooser is a **low density** package selector -- unlike
netinstall which offers a high density tree view -- for picking
zero, one, or more items from a small collection of packages.
This can be used, e.g., for "pick exactly one desktop environment",
"pick zero or more text editors" which can then be installed
by another module. The UI is big and shiny (rather than netinstall's
text-based tree view) and isn't suitable for more than a dozen or
so items.
- preservefiles generally needs to have the target filesystems
mounted, so that it can preserve to them; but you can also
configure it such that there is no need for mounted filesystems
(e.g. in OEM setup).
- Add an example line in CMakeLists.txt to show how that would be done.
- The mount module must happen before unpackfs because that (mount)
module sets up the root mount point (in /tmp) and some other
variables needed later.
- While called from the ViewManager (to post the debug log)
this isn't really part of the ViewManager itself, so factor
out the pasting code into its own file.
Added new configuration "efiMountOptions" to fstab.conf
When generating the fstab entry for the ESP, take the mount options from
the new configuration or fall back to "mountOptions".
- The mitigations are slightly intrusive, and may clash
with other, similar mitigations (especially for initramfs,
the recommended solution is to configure the system with
the snippet outside of Calamares).
- These tests exercise the createTargetFile() logic,
which is essential for creating a safe initramfs
configuration snippet.
- Could be moved into libcalamares instead, since the tests
are not really initramfs specific.
- In tests, a System object might be created without first
setting up a JobQueue. In that case, there's no instance,
so no GS to insert into. Avoid crash here.
- Calamares may need to create files in the target system;
provide a convenient API for doing so.
- This is mostly intended for small files with constant contents.
- This is a simple variation on the theme of things-that-call-a-
initramfs-updater, so the code is mostly a copy of initramfs/
module. I didn't even bother to strip out the configuration-
handling (I figure it might be good for *something*) so now
"" and "$uname" are valid kernel names as well.
- Fixes security issue where the initramfs ends up readable
by all, and that includes the cryptfile for LUKS.
SEE #1190
- Rename classes and functions to be more descriptive
(a LuksDevice is .. information for a LUKS device, for instance).
- Move the smarts of unpacking a QVariantMap to LuksDevice.
- Apply code formatting
- Having an int timeoutSec is suggestive -- it's probably a number
of seconds -- but having an explicit type that says it's seconds
is better.
- Doesn't compile, because the implementation and consumers have
not changed.
- Use 120 seconds for update-initramfs, instead of 10. Previous
Python code had no timeout at all, which wasn't so hot either.
10 seconds, though, is too short for slow CPU & slow disk.
- Give each check a name (based on the module it runs for, so
there might be overlaps when there are multiple module instances).
- Log the remaining checks each time the timeout fires, to help
figure out which one is hanging.
- 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.)