Various file writes were not being checked, and the code
was a bit tangled; specifically keyboardq did **not**
configure properly on KaOS and now seems ok.
The root mount-point can end with a / while the mount-point read from
the file /etc/mtab does not end with a /.
This leads to skip the unmounting of the root mount-point and causes the
removal of the root mountpoint directory to fail with EBUSY because it
is still mounted.
This uses the python functions os.path.normpath() to normalize the root
mount-point (i.e. to drop the trailing /) and os.path.commonprefix() to
determine the longest common prefix between the two mount-points. If the
returned prefix is identical to the normalized root mount-point then the
mount-point must be added to the list of the mount-points to unmount.
More generally, the python modules should rely on the os.path functions
to compare for paths instead of using strings. It covers this way lots
of corner cases (path with "//", "/../", "/./", ...).
- put the writing of each kind of file in its own block -- this should
become separate functions -- so that variables become more local
and debugging can be improved.
- while here, fix the error message for /etc/default/keyboard:
it would complain and name the vconsole file path if it ever failed.
- factor out the flags-we-want from the flags-we-already-have
- the use of ->activeFlags() meant that the state on *disk* was
being compared with the flags-we-want; if a partition was re-edited,
then you couldn't change the flags back to the state-on-disk
(eg. enable a flag, then change your mind and disable it).
- set the flags before refreshing the partition, because the
refresh checks for EFI bootability and that needs the new flags,
not the old ones.
- remove the m_defaultFSType from PartitionLayout, because it is
set on construction -- which is too early, before the configuration
has been read.
- make the default FS explicit in the init() calls which pass in
a configuration; this needs support in the intermediate
PartitionCoreModule.
- the "simple" constructor for PartitionEntry left the FS type
set as the constructor left it -- which is Unknown by default.
This leads to install failures in systems that don't set a
special layout but just want a single / -- because the FS is
set to Unknown.
- massage the constructor and consumer of the code, push
Ext4 FS in the tests and use the configured default in production.
The return of the call to libcalamares.utils.mount is never tested and
it may fail silently; this causes some mounpoints to be missing.
This adds a warning if mountpoint cannot be mounted.
chcon: failed to get security context of '/tmp/verity': Operation not supported
06:44:23 [6]: static CalamaresUtils::ProcessResult CalamaresUtils::System::runCommand(CalamaresUtils::System::RunLocation, const QStringList&, const QString&, const QString&, std::chrono::seconds)
Running "env" ("mount", "-t", "unformatted", "/dev/sdb2", "/tmp/calamares-root-kv8dqgb5/tmp/verity")
.. Finished. Exit code: 32
.. Target cmd: ("mount", "-t", "unformatted", "/dev/sdb7", "/tmp/calamares-root-kv8dqgb5/tmp/verity") output:
mount: /tmp/calamares-root-kv8dqgb5/tmp/verity: unknown filesystem type 'unformatted'.
Some compile flags changed recently, triggering assert()
in the jobqueue when there is more than one. There's no
real reason for JobQueue to be a singleton, but it wants
to be. So clean up pointers a little more enthusiastically.
- Use classes to prompt lupdate to extract with a better
context (e.g. the class name, rather than plain "QObject")
so that the translation-lookup can use the named context.
- Add hard-coded "default" variant
- Add totally bogus Tajik translations, for testing purposes
This is the Wrong Thing To Do, but we'll do it for now: build the
keyboard translations into the executable. In the medium term
they should move to the modules that use them, with the re-vamp
of how translation changes are signalled.
Now that Calamares is compiled as C++17, we get this:
src/modules/locale/timezonewidget/TimeZoneImage.cpp:28:55: warning: out-of-line definition of constexpr static data member is redundant in C++17 and is deprecated [-Wdeprecated]
/* static constexpr */ const QSize TimeZoneImageList::imageSize;
The code doesn't match the comment: there are no by-ref captures
in the code, and the shadowing of parameters and local variables
is confusing. Remove one variable that is passed in as an argument
(and just pass the value as argument) and copy-capture the other
rather than doing weird argument passing.
- remove unused this captures from lambda
- rename variables that are short, cryptic, and shadowed
- remove documentation for parameters that don't exist
This commit adds the new configuration `swapPartitionName` to the file
partition.conf.
This option sets the partition name to the swap partition that is
created. If this option is unset, the partition is left unnamed.
- only widgets get language change events, so we need to
hook that up to the ViewSteps and inform the Config
object so that it can (re)load translations for the
keyboard data.
- Rename the "size" locals using "sectors" in their name. Size may be
confusing or not enough specific as it can be interpreted a size in
Byte.
partSizeMap -> partSectorsMap,
totalSize -> totalSectors,
availablesize -> availableSectors,
size -> sectors,
minSize -> minSectors
maxSize -> maxSectors
- Create a the new local currentSector to iterate over the sectors;
instead of using the parameter firstSector.
- Remove the variable end that does not help much; too many variable
already. Expand its expression instead.
- Introduces new constructors for PartitionEntry: copy constructory and
constructor with all attributes.
- Use the new constructor in method addEntry().
- The variant helper toString() takes a default value since commit
c9f942ad6 ([libcalamares] Add default value to variant helpers).
- Set the default value to 0 and simplify the retreival of size values
by calling the helper toString() and removing the temporary variables.
- The logic of the method initLayout belongs to the object
PartitionLayout. Move logic to that object.
- Use a single method initLayout in object PartitionCoreModule.
- Member m_partLayout in object PartitionCoreModule is no longer
allocated.
The translation happens whenever this code is run, which may
not match the language the user subsequently selects.
It also causes general problems with the translation,
since we end up with a possibly-partly-translated name.
- With debugging and untangling done, the lambdas are simple
and short, so return to using them. One point of improvement
might be to give the models suitable slots themselves,
to avoid even this indirection.
- Use the just-refactored XKBListModel to store the xkb key-value
pairs for variants, drop most of the complicated implementation,
store just a single list of values.
- Remove code that is duplicated in Config.
- Hook up UI for physical keyboard model, and back.
- For now, introduce some named slots with debugging output.
This makes debugging a lot easier since we have function names
to work with rather than anonymous lambdas
- Config already *has* everythind, but drop the useless copies
and duplicated code from the Page
- Plug the models model into the Page
- While here, document the model / layout / variant distinctions
The code doesn't fill the UI properly, and the drop-down
for the models combobox is not right, but at least the data
is shared.
- gcc (up to at least version 10) is worse at recognizing that all
cases have been handled, so it complains about all the switches
that cover enum values.
- both clang and g++ support __builtin_unreachable(); (as Kevin
Kofler pointed out) so we don't need the macro to do different things;
- the compilers have gotten better at detecting unreachable code,
so instead of inserting macros or fiddly bits, just drop them
and the unreachable code they comment.
- reduce the difference between clang and g++ builds, factor
common flags out of the CMake-if
- drop special boost-warning-suppression, we do that differently
most of the time in the affected source files
- if the partition size is invalid, then warn about it but do
not print the (uninitialized) size of the partition.
- shuffle code to continue earlier, allowing the "good path"
code to be out-dented.
The special setup for nicely-named groups which have a single
hidden subgroup containing the actual packages, has the problem
that there is a non-empty subgroups item, but this results
in zero actual children: then the number of selected and partly
selected children is also zero in updateSelected() and therefore
the item ends up unselected.
Special-case this to avoid unnecessarily unselecting the item.
Reported by Vitor L.
The status for an empty login name is '' (empty), for ok -- this is
so that there is no complaint about it. But it's not ok to
continue with an empty name.
The status for an empty login name is '' (empty), for ok -- this is
so that there is no complaint about it. But it's not ok to
continue with an empty name.
- The EXPECT_FAIL value "Abort" stops the test (I wanted 'if this
unexpectedly passes, raise an error' -- should have read the
documentation more closely).
- Set the shell in the config object, not just in GS.
- add a status member so the different steps can show progress
as the user is created and configured. The progress values
are hard-coded guesses as to how much work is done for each step.
- while here, reduce the scope of the global storage variable
This is somewhat experimental and weird; the idea is that bool
arguments are a lot easier to understand if there are proper
names attached, rather than "true" and "false".
This improves the situation for jobs that do not provide
a status: their blank status does not overwrite the status
bar, and since (previous commit) the description or name
is used to start the job if the status is empty, at least
**something** is displayed.
SEE #1528
- os-proper may return an extra file after the device:
/dev/sda1:Ubuntu 19.10 (19.10):Ubuntu:linux
/dev/sdb1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
- The API definitions are just the symbols to define; these
are variously added through add_definitions() (needs -D)
or target_add_definitions() (doesn't).
I think we had this (kind of) module a long time ago and it was
removed for over-complicating things; re-introduce one now that
KPMcore is used in 3 different places and all would benefit
from consistent API handling / defines.
- handle swapfiles when writing /etc/fstab in the target system
- special-case mountpoint
- since swapfiles are not a partition, take the setting out
of partitionChoices
- create the physical swapfile as well (there's no other place
where it would make sense)
This still won't help if there's one really huge file that takes
several seconds to write, but if there's a bunch of files together
that is less than a file_chunk_count but take more than a half-
second to write, update anyway
If there's thousands of files in a squashfs (e.g. 400000 like on
some ArcoLinux ISOs) then progress would be reported every
4000 files, which can take quite some time to write. Reduce
file_chunk_count to at most 500, so that progress is reported
more often even if that wouldn't lead to a visible change
in the percentage progress: instead we **do** get a change
in files-transferred numbers.
- The total weight is only needed by the UnpackOperation,
not by each entry.
- Use a chunk size of 107 so that the number-complete seems busy:
the whole larger-or-smaller chunk size doesn't really matter.
- The progress-report was missing the weight of the current
module, so would report way too low if weight > 1. This affects
ArcoLinux configurations where one entry is huge and one is a
single file, so weights 50 and 1 are appropriate.
When there are multiple entries, the overall weight of the
module is divided between the entries: currently each entry
takes an equal amount of space in the overall progress.
When there are multiple entries which take wildly different
amounts of time (e.g. a squash-fs and a single file) then
the progress overall looks weird: the squash-fs gets half
of this module's weight, and the single file does too.
With the new *weight* key for entries, that division can
be tweaked so that progress looks more "even".