Compare commits
92 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81b4f01fe8 | ||
|
|
cfdf15f9bd | ||
|
|
36f99b1291 | ||
|
|
e4f38b235e | ||
|
|
a50195e372 | ||
|
|
86e24fad9a | ||
|
|
0186985726 | ||
|
|
7bec3f6107 | ||
|
|
657207374e | ||
|
|
9661b70c57 | ||
|
|
aa382db619 | ||
|
|
7ab294176a | ||
|
|
730b9fa983 | ||
|
|
2abe92a0f4 | ||
|
|
0fe1341c25 | ||
|
|
c51d68828a | ||
|
|
a61c0c6890 | ||
|
|
47cda51f8f | ||
|
|
18e68245c1 | ||
|
|
15a2369a98 | ||
|
|
0b6b923480 | ||
|
|
1b594b7125 | ||
|
|
f1ce9235ac | ||
|
|
51e89e58dd | ||
|
|
d8d5a1fb26 | ||
|
|
85f05e8121 | ||
|
|
c28c9b8114 | ||
|
|
935f21ace5 | ||
|
|
14301dbc0b | ||
|
|
a26a7b2e3a | ||
|
|
d594db2308 | ||
|
|
f29e3aaf4f | ||
|
|
aeec465e63 | ||
|
|
a7dcf46f95 | ||
|
|
575c000d5d | ||
|
|
7a6e6c63b7 | ||
|
|
03e0d3e4df | ||
|
|
f06744bacf | ||
|
|
36f2589067 | ||
|
|
6f6bc4de5e | ||
|
|
86db905e1e | ||
|
|
ebb7511f5e | ||
|
|
0dc15edb8f | ||
|
|
bc0742be43 | ||
|
|
6bd75570de | ||
|
|
acdcdea668 | ||
|
|
edb405a4d1 | ||
|
|
3ad9c221d4 | ||
|
|
4412694cac | ||
|
|
8f3f6090c3 | ||
|
|
3d05a0d66e | ||
|
|
7c6e73cedb | ||
|
|
ea01b275d3 | ||
|
|
ab5623018a | ||
|
|
ecee3d746c | ||
|
|
c7d989dd36 | ||
|
|
fe9c71d4fc | ||
|
|
59a4ea58e9 | ||
|
|
9b12dd711d | ||
|
|
6e4c2e728c | ||
|
|
98b72d79ea | ||
|
|
c5377b75ac | ||
|
|
c5bae4b0cc | ||
|
|
dc3550eccd | ||
|
|
fac16ac6a7 | ||
|
|
a442ed8c12 | ||
|
|
e08d687061 | ||
|
|
15f6369537 | ||
|
|
f01b4ed2f8 | ||
|
|
ea762b0945 | ||
|
|
cae8acb4a4 | ||
|
|
ae204d0108 | ||
|
|
a2fae600c4 | ||
|
|
349acad491 | ||
|
|
9b4c4876bc | ||
|
|
cc02baed9a | ||
|
|
dfab089938 | ||
|
|
2dd9a7ba8a | ||
|
|
82f31f3cd9 | ||
|
|
c5b01a574d | ||
|
|
bc4789d57f | ||
|
|
0962b98494 | ||
|
|
108476c025 | ||
|
|
04a1bc9e2c | ||
|
|
bff5e485f4 | ||
|
|
3c838436c2 | ||
|
|
644c9cf4f3 | ||
|
|
dcaa378ddd | ||
|
|
14fd23dcef | ||
|
|
f4bc7052e0 | ||
|
|
4f0f48d99d | ||
|
|
1344880f2e |
@@ -22,14 +22,16 @@ Cpp11BracedListStyle: "false"
|
|||||||
FixNamespaceComments: "true"
|
FixNamespaceComments: "true"
|
||||||
IncludeBlocks: Preserve
|
IncludeBlocks: Preserve
|
||||||
IndentWidth: "4"
|
IndentWidth: "4"
|
||||||
|
InsertBraces: "true"
|
||||||
MaxEmptyLinesToKeep: "2"
|
MaxEmptyLinesToKeep: "2"
|
||||||
NamespaceIndentation: None
|
NamespaceIndentation: None
|
||||||
PointerAlignment: Left
|
PointerAlignment: Left
|
||||||
ReflowComments: "false"
|
ReflowComments: "false"
|
||||||
SortIncludes: "true"
|
SortIncludes: "true"
|
||||||
SpaceAfterCStyleCast: "false"
|
SpaceAfterCStyleCast: "false"
|
||||||
|
SpaceInEmptyBlock: "false"
|
||||||
SpacesBeforeTrailingComments: "2"
|
SpacesBeforeTrailingComments: "2"
|
||||||
SpacesInAngles: "true"
|
SpacesInAngles: "true"
|
||||||
SpacesInParentheses: "true"
|
SpacesInParentheses: "true"
|
||||||
SpacesInSquareBrackets: "true"
|
SpacesInSquareBrackets: "true"
|
||||||
Standard: Cpp11
|
Standard: c++17
|
||||||
|
|||||||
42
CHANGES
42
CHANGES
@@ -6,6 +6,48 @@ This is the changelog for Calamares-Extensions. For each release, the major
|
|||||||
changes and contributors are listed. Note that Calamares-Extensions does not
|
changes and contributors are listed. Note that Calamares-Extensions does not
|
||||||
have a historical changelog -- this log starts with version 1.0.0.
|
have a historical changelog -- this log starts with version 1.0.0.
|
||||||
|
|
||||||
|
# 3.3.12 (2024-11-21)
|
||||||
|
|
||||||
|
This is a release to match Calamares 3.3.12. The *unpackfsc* module has
|
||||||
|
moved to Calamares proper. There is a new module *flatpakinfo* that
|
||||||
|
tries to populate a netinstall key with packages available as flatpak.
|
||||||
|
|
||||||
|
This release contains contributions from (alphabetically by first name):
|
||||||
|
- Adriaan de Groot
|
||||||
|
- Sławomir Lach
|
||||||
|
|
||||||
|
|
||||||
|
# 3.3.1 (2024-01-15)
|
||||||
|
|
||||||
|
This is the first *calamares-extensions* release to go with a Calamares 3.3
|
||||||
|
release. The extensions now require Calamares 3.3. There is a branch for
|
||||||
|
3.2 legacy support but no releases are planned for it. The main reason
|
||||||
|
for this release is to have a 3.3-compatible release of *-extensions* at all.
|
||||||
|
|
||||||
|
This release contains contributions from (alphabetically by first name):
|
||||||
|
- Adriaan de Groot
|
||||||
|
- Anke Boersma
|
||||||
|
- undef
|
||||||
|
|
||||||
|
|
||||||
|
# 1.3.2 (2023-08-28)
|
||||||
|
|
||||||
|
We skipped a couple of releases in the release-notes, then tagged
|
||||||
|
1.3.1 without a version bump or release-notes. So 1.3.2 brings us
|
||||||
|
back to "regular releases".
|
||||||
|
|
||||||
|
This release contains contributions from (alphabetically by first name):
|
||||||
|
- Anke Boersma
|
||||||
|
- Nathan Schulte
|
||||||
|
- Oliver Smith
|
||||||
|
- stravanpannala
|
||||||
|
- undef
|
||||||
|
|
||||||
|
Changes and new modules in this release:
|
||||||
|
- *mobile* Has new configuration options. (Thanks Nathan, Oliver)
|
||||||
|
- *unpackfsc* Uses a more portable invocation of tar. (Thanks sravanpannala)
|
||||||
|
|
||||||
|
|
||||||
# 1.2.1 (2021-11-16)
|
# 1.2.1 (2021-11-16)
|
||||||
|
|
||||||
The 1.2.0 release had no release-notes for that version, and failed to
|
The 1.2.0 release had no release-notes for that version, and failed to
|
||||||
|
|||||||
@@ -32,15 +32,18 @@
|
|||||||
# In this repository, there is just one "group" to which USE_* applies:
|
# In this repository, there is just one "group" to which USE_* applies:
|
||||||
# USE_os : operating-system-specific modules.
|
# USE_os : operating-system-specific modules.
|
||||||
#
|
#
|
||||||
|
# There is a knob WITH_QT6 which can be used to build against Qt6 rather
|
||||||
|
# than Qt5. This must match what Calamares itself is built with.
|
||||||
|
#
|
||||||
### NOTES
|
### NOTES
|
||||||
#
|
#
|
||||||
# Call this CMake file in script mode, e.g. `cmake -P CMakeLists.txt`
|
# Call this CMake file in script mode, e.g. `cmake -P CMakeLists.txt`
|
||||||
# to print out version information. Use `cmake -DVERSION_STYLE=short`
|
# to print out version information. Use `cmake -DVERSION_STYLE=short`
|
||||||
# to get just the short versioning.
|
# to get just the short versioning.
|
||||||
#
|
#
|
||||||
cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
|
||||||
|
|
||||||
set( CALAMARES_EXTENSIONS_VERSION 1.2.1 )
|
set( CALAMARES_EXTENSIONS_VERSION 3.3.12 )
|
||||||
|
|
||||||
include( ${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake )
|
include( ${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake )
|
||||||
if ( CMAKE_SCRIPT_MODE_FILE )
|
if ( CMAKE_SCRIPT_MODE_FILE )
|
||||||
@@ -60,12 +63,44 @@ set( CMAKE_CXX_STANDARD_REQUIRED ON )
|
|||||||
# consumers by loading the developer's config from a build
|
# consumers by loading the developer's config from a build
|
||||||
# directory (which doesn't have the rest of the config
|
# directory (which doesn't have the rest of the config
|
||||||
# installed inside it).
|
# installed inside it).
|
||||||
set( CALAMARES_VERSION_REQUIRED 3.2.46 )
|
set( CALAMARES_VERSION_REQUIRED 3.3.12 )
|
||||||
find_package(Calamares ${CALAMARES_VERSION_REQUIRED} NO_CMAKE_PACKAGE_REGISTRY)
|
message(STATUS "Looking for Calamares system-wide")
|
||||||
|
find_package(Calamares ${CALAMARES_VERSION_REQUIRED} CONFIG NO_CMAKE_PACKAGE_REGISTRY)
|
||||||
if (NOT TARGET Calamares::calamares OR NOT TARGET Calamares::calamaresui)
|
if (NOT TARGET Calamares::calamares OR NOT TARGET Calamares::calamaresui)
|
||||||
find_package(Calamares ${CALAMARES_VERSION_REQUIRED} REQUIRED)
|
message(STATUS "Looking for Calamares in the package registry")
|
||||||
|
find_package(Calamares ${CALAMARES_VERSION_REQUIRED} CONFIG REQUIRED)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
message(STATUS "Found Calamares version ${Calamares_VERSION}")
|
||||||
|
message(STATUS " libraries ${Calamares_LIB_DIRS}")
|
||||||
|
message(STATUS "")
|
||||||
|
|
||||||
|
### EXTRACTING DEPENDENCIES AND CONFIGURATION FROM CALAMARES
|
||||||
|
#
|
||||||
|
#
|
||||||
|
if(Calamares_WITH_QT6)
|
||||||
|
set(kfname "KF6")
|
||||||
|
set(KF_VERSION 5.240) # KDE Neon weirdness
|
||||||
|
else()
|
||||||
|
message(STATUS "Building Calamares-extensions with Qt5")
|
||||||
|
set(kfname "KF5")
|
||||||
|
set(KF_VERSION 5.78)
|
||||||
|
# API that was deprecated before Qt 5.15 causes a compile error
|
||||||
|
add_compile_definitions(QT_DISABLE_DEPRECATED_BEFORE=0x050f00)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
include( FeatureSummary )
|
||||||
|
find_package(${kfname}CoreAddons ${KF_VERSION} QUIET)
|
||||||
|
set_package_properties(
|
||||||
|
${kfname}CoreAddons
|
||||||
|
PROPERTIES
|
||||||
|
TYPE REQUIRED
|
||||||
|
DESCRIPTION "KDE Framework CoreAddons"
|
||||||
|
URL "https://api.kde.org/frameworks/"
|
||||||
|
PURPOSE "Essential Framework for AboutData and Macros"
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
### CMAKE SETUP
|
### CMAKE SETUP
|
||||||
#
|
#
|
||||||
# Enable IN_LIST
|
# Enable IN_LIST
|
||||||
@@ -117,7 +152,11 @@ calamares_add_module_subdirectory( modules/os-freebsd LIST_SKIPPED_MODULES )
|
|||||||
calamares_add_module_subdirectory( modules/os-nixos LIST_SKIPPED_MODULES )
|
calamares_add_module_subdirectory( modules/os-nixos LIST_SKIPPED_MODULES )
|
||||||
calamares_add_module_subdirectory( modules/refind LIST_SKIPPED_MODULES )
|
calamares_add_module_subdirectory( modules/refind LIST_SKIPPED_MODULES )
|
||||||
calamares_add_module_subdirectory( modules/slowpython LIST_SKIPPED_MODULES ) # Python job
|
calamares_add_module_subdirectory( modules/slowpython LIST_SKIPPED_MODULES ) # Python job
|
||||||
calamares_add_module_subdirectory( modules/unpackfsc LIST_SKIPPED_MODULES )
|
# The unpackfsc module moved into Calamares proper in 3.3.11
|
||||||
|
#
|
||||||
|
# calamares_add_module_subdirectory( modules/unpackfsc LIST_SKIPPED_MODULES )
|
||||||
|
|
||||||
|
message(STATUS "Calamares extensions ${CALAMARES_EXTENSIONS_VERSION} for Calamares version ${Calamares_VERSION}")
|
||||||
|
|
||||||
# If modules cannot be built, they usually call a macro
|
# If modules cannot be built, they usually call a macro
|
||||||
# which builds a list of explanations; show that list.
|
# which builds a list of explanations; show that list.
|
||||||
|
|||||||
@@ -29,15 +29,12 @@ rules of decent behavior in both communities are pretty much the same).
|
|||||||
|
|
||||||
GitHub Issues are **one** place for discussing Calamares and its extensions if there are concrete
|
GitHub Issues are **one** place for discussing Calamares and its extensions if there are concrete
|
||||||
problems or a new feature to discuss.
|
problems or a new feature to discuss.
|
||||||
|
Issues are not a help channel.
|
||||||
|
Visit Matrix for help with configuration or compilation.
|
||||||
|
|
||||||
Regular Calamares development chit-chat happens in a [Matrix](https://matrix.org/)
|
Regular Calamares development chit-chat happens in a [Matrix](https://matrix.org/)
|
||||||
room, `#calamares:kde.org`. The conversation is bridged with IRC
|
room, `#calamares:kde.org`. Responsiveness is best during the day
|
||||||
on [Libera.Chat](https://libera.chat/).
|
in Europe, but feel free to idle.
|
||||||
Responsiveness is best during the day
|
|
||||||
in Europe, but feel free to idle. If you use IRC, **DO NOT** ask-and-leave. Keep
|
|
||||||
that chat window open because it can easily take a few hours for
|
|
||||||
someone to notice a message.
|
|
||||||
Matrix is persistent, and we'll see your message eventually.
|
Matrix is persistent, and we'll see your message eventually.
|
||||||
|
|
||||||
* [](https://webchat.kde.org/#/room/%23calamares:kde.org)
|
* [](https://webchat.kde.org/#/room/%23calamares:kde.org)
|
||||||
* [](https://kiwiirc.com/client/irc.libera.chat/#calamares)
|
|
||||||
|
|||||||
20
README.md
20
README.md
@@ -40,7 +40,10 @@ and documentation for the framework that Calamares ships with.
|
|||||||
(probably moreso than the default slideshow).
|
(probably moreso than the default slideshow).
|
||||||
- [`kaos_branding/`](branding/kaos_branding/branding.desc)
|
- [`kaos_branding/`](branding/kaos_branding/branding.desc)
|
||||||
is a copy of the KaOS branding component, which
|
is a copy of the KaOS branding component, which
|
||||||
has translations and a bunch of fancy graphics.
|
has translations and a bunch of fancy graphics for the
|
||||||
|
slideshow. Plus it includes examples of using different
|
||||||
|
QML options for a vertical navigation bar and horizontal
|
||||||
|
sidebar.
|
||||||
- [`samegame/` ](branding/default/branding.desc)
|
- [`samegame/` ](branding/default/branding.desc)
|
||||||
is a copy of the Qt Company "Same Game" QML demo. It
|
is a copy of the Qt Company "Same Game" QML demo. It
|
||||||
shows that **any** QML can be used for branding purposes.
|
shows that **any** QML can be used for branding purposes.
|
||||||
@@ -161,10 +164,6 @@ phase).
|
|||||||
|
|
||||||
### Example Modules
|
### Example Modules
|
||||||
|
|
||||||
- [filekeeper](modules/filekeeper/CMakeLists.txt) is a C++ **job** module
|
|
||||||
to copy files from the host (live) system to the target system at
|
|
||||||
the end of installation, like logfiles. (This module is made obsolete
|
|
||||||
by the *preservefiles* module included with Calamares proper)
|
|
||||||
- [freebsddisk](modules/freebsddisk/CMakeLists.txt) is a C++ **view**
|
- [freebsddisk](modules/freebsddisk/CMakeLists.txt) is a C++ **view**
|
||||||
module with a QML-based UI. It has no actual functionality, and serves
|
module with a QML-based UI. It has no actual functionality, and serves
|
||||||
as a test that view modules can be built out-of-tree.
|
as a test that view modules can be built out-of-tree.
|
||||||
@@ -217,15 +216,12 @@ The API is loosely documented in the
|
|||||||
GitHub Issues are **one** place for discussing Calamares (and Calamares Extensions)
|
GitHub Issues are **one** place for discussing Calamares (and Calamares Extensions)
|
||||||
if there are concrete
|
if there are concrete
|
||||||
problems or a new feature to discuss.
|
problems or a new feature to discuss.
|
||||||
|
Issues are not a help channel.
|
||||||
|
Visit Matrix for help with configuration or compilation.
|
||||||
|
|
||||||
Regular Calamares development chit-chat happens in a [Matrix](https://matrix.org/)
|
Regular Calamares development chit-chat happens in a [Matrix](https://matrix.org/)
|
||||||
room, `#calamares:kde.org`. The conversation is bridged with IRC
|
room, `#calamares:kde.org`. Responsiveness is best during the day
|
||||||
on [Libera.Chat](https://libera.chat/).
|
in Europe, but feel free to idle.
|
||||||
Responsiveness is best during the day
|
|
||||||
in Europe, but feel free to idle. If you use IRC, **DO NOT** ask-and-leave. Keep
|
|
||||||
that chat window open because it can easily take a few hours for
|
|
||||||
someone to notice a message.
|
|
||||||
Matrix is persistent, and we'll see your message eventually.
|
Matrix is persistent, and we'll see your message eventually.
|
||||||
|
|
||||||
* [](https://webchat.kde.org/#/room/%23calamares:kde.org)
|
* [](https://webchat.kde.org/#/room/%23calamares:kde.org)
|
||||||
* [](https://kiwiirc.com/client/irc.libera.chat/#calamares)
|
|
||||||
|
|||||||
101
branding/kaos_branding/about.qml
Normal file
101
branding/kaos_branding/about.qml
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||||
|
*
|
||||||
|
* SPDX-FileCopyrightText: 2020 2022 Anke Boersma <demm@kaosx.us>
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* Calamares is Free Software: see the License-Identifier above.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
import io.calamares.core 1.0
|
||||||
|
import io.calamares.ui 1.0
|
||||||
|
|
||||||
|
import QtQuick 2.7
|
||||||
|
import QtQuick.Controls 2.0
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
import QtQuick.Window 2.3
|
||||||
|
|
||||||
|
ApplicationWindow {
|
||||||
|
id: about
|
||||||
|
visible: true
|
||||||
|
width: 760
|
||||||
|
height: 400
|
||||||
|
title: qsTr("About Calamares")
|
||||||
|
|
||||||
|
property var appName: "Calamares"
|
||||||
|
property var appVersion: "3.3 RC"
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: textArea
|
||||||
|
anchors.fill: parent
|
||||||
|
color: "#f2f2f2"
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: column
|
||||||
|
anchors.centerIn: parent
|
||||||
|
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
width: 560
|
||||||
|
height: 250
|
||||||
|
radius: 10
|
||||||
|
border.width: 0
|
||||||
|
|
||||||
|
Text {
|
||||||
|
width: 400
|
||||||
|
height: 250
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: qsTr("<h1>%1</h1><br/>
|
||||||
|
<strong>%2<br/>
|
||||||
|
for %3</strong><br/><br/>
|
||||||
|
Copyright 2014-2017 Teo Mrnjavac <teo@kde.org><br/>
|
||||||
|
Copyright 2017-2022 Adriaan de Groot <groot@kde.org><br/>
|
||||||
|
Thanks to <a href='https://calamares.io/team/'>the Calamares team</a>
|
||||||
|
and the <a href=\"https://www.transifex.com/kaos/kaos/\">KaOS
|
||||||
|
translators team</a>.<br/><br/>
|
||||||
|
<a href='https://calamares.io/'>Calamares</a>
|
||||||
|
development is sponsored by <br/>
|
||||||
|
<a href='http://www.blue-systems.com/'>Blue Systems</a> -
|
||||||
|
Liberating Software." )
|
||||||
|
.arg(appName)
|
||||||
|
.arg(appVersion)
|
||||||
|
.arg(Branding.string(Branding.VersionedName))
|
||||||
|
|
||||||
|
onLinkActivated: Qt.openUrlExternally(link)
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
acceptedButtons: Qt.NoButton
|
||||||
|
cursorShape: parent.hoveredLink ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
|
}
|
||||||
|
|
||||||
|
font.pointSize: 10
|
||||||
|
anchors.verticalCenterOffset: 10
|
||||||
|
anchors.horizontalCenterOffset: 40
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
}
|
||||||
|
|
||||||
|
Image {
|
||||||
|
id: image
|
||||||
|
x: 8
|
||||||
|
y: 12
|
||||||
|
height: 100
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
source: "squid.png"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Button {
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
icon.name: "window-close"
|
||||||
|
text: qsTr("Close")
|
||||||
|
hoverEnabled: true
|
||||||
|
onClicked: about.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,22 +1,32 @@
|
|||||||
---
|
---
|
||||||
componentName: kaos
|
componentName: kaos
|
||||||
|
|
||||||
|
welcomeStyleCalamares: false
|
||||||
|
|
||||||
# Should the welcome image (productWelcome, below) be scaled
|
# Should the welcome image (productWelcome, below) be scaled
|
||||||
# up beyond its natural size?
|
# up beyond its natural size?
|
||||||
welcomeExpandingLogo: true
|
welcomeExpandingLogo: true
|
||||||
|
|
||||||
|
windowExpanding: normal
|
||||||
|
windowSize: 920px,630px
|
||||||
|
windowPlacement: center
|
||||||
|
|
||||||
|
sidebar: qml,bottom
|
||||||
|
navigation: qml,right
|
||||||
|
|
||||||
strings:
|
strings:
|
||||||
productName: KaOS
|
productName: KaOS
|
||||||
shortProductName: KaOS
|
shortProductName: KaOS
|
||||||
version: 2018.03
|
version: 2022.08
|
||||||
shortVersion: KaOS
|
shortVersion: KaOS
|
||||||
versionedName: KaOS 2018.03
|
versionedName: KaOS 2022.08
|
||||||
shortVersionedName: KaOS 2018.03
|
shortVersionedName: KaOS 2018.03
|
||||||
bootloaderEntryName: KaOS
|
bootloaderEntryName: KaOS
|
||||||
productUrl: https://kaosx.us/
|
productUrl: https://kaosx.us/
|
||||||
supportUrl: https://kaosx.us/docs/
|
supportUrl: https://kaosx.us/docs/
|
||||||
knownIssuesUrl: https://kaosx.us/pages/download/#known-issues
|
knownIssuesUrl: https://kaosx.us/pages/download/#known-issues
|
||||||
releaseNotesUrl: https://kaosx.us/pages/release_notes
|
releaseNotesUrl: https://kaosx.us/pages/release_notes
|
||||||
|
donateUrl: https://kaosx.us/about/donors
|
||||||
|
|
||||||
images:
|
images:
|
||||||
productLogo: "kaos.png"
|
productLogo: "kaos.png"
|
||||||
@@ -27,6 +37,7 @@ slideshow: "show.qml"
|
|||||||
slideshowAPI: 1
|
slideshowAPI: 1
|
||||||
|
|
||||||
style:
|
style:
|
||||||
sidebarBackground: "#bdc3c7"
|
SidebarBackground: "#bdc3c7"
|
||||||
sidebarText: "#1F1F1F"
|
SidebarText: "#1F1F1F"
|
||||||
sidebarTextSelect: "#3498DB"
|
SidebarTextCurrent: "#3498DB"
|
||||||
|
SidebarBackgroundCurrent: "#eff0f1"
|
||||||
|
|||||||
224
branding/kaos_branding/calamares-navigation.qml
Normal file
224
branding/kaos_branding/calamares-navigation.qml
Normal file
@@ -0,0 +1,224 @@
|
|||||||
|
/* Sample of QML navigation.
|
||||||
|
|
||||||
|
SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
||||||
|
SPDX-FileCopyrightText: 2021 - 2022 Anke Boersma <demm@kaosx.us>
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
|
||||||
|
This navigation panel is for a "vertical" layout, with
|
||||||
|
mouse areas for next and previous and it includes the logo
|
||||||
|
plus About & Debug buttons.
|
||||||
|
*/
|
||||||
|
import io.calamares.ui 1.0
|
||||||
|
import io.calamares.core 1.0
|
||||||
|
|
||||||
|
import QtQuick 2.3
|
||||||
|
import QtQuick.Controls 2.10
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: navigationBar;
|
||||||
|
color: Branding.styleString( Branding.SidebarBackground );
|
||||||
|
height: parent.height;
|
||||||
|
width:64;
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
id: buttonBar
|
||||||
|
anchors.fill: parent;
|
||||||
|
spacing: 1
|
||||||
|
|
||||||
|
Image {
|
||||||
|
Layout.topMargin: 1;
|
||||||
|
Layout.bottomMargin:parent.height / 7;
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
|
||||||
|
id: logo;
|
||||||
|
width: 62;
|
||||||
|
height: width; // square
|
||||||
|
source: "file:/" + Branding.imagePath(Branding.ProductLogo);
|
||||||
|
sourceSize.width: width;
|
||||||
|
sourceSize.height: height;
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: backArea
|
||||||
|
Layout.fillWidth: true;
|
||||||
|
Layout.preferredHeight: parent.height / 7;
|
||||||
|
color: mouseBack.containsMouse ? "#e6e9ea" : "#d9dcde";
|
||||||
|
enabled: ViewManager.backEnabled;
|
||||||
|
visible: ViewManager.backAndNextVisible;
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseBack
|
||||||
|
anchors.fill: parent;
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
hoverEnabled: true
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: qsTr("Back")
|
||||||
|
color: Branding.styleString( !backArea.enabled ? Branding.SidebarBackground : (mouseBack.containsMouse ? Branding.SidebarTextCurrent : Branding.SidebarText ));
|
||||||
|
font.pointSize : 8
|
||||||
|
}
|
||||||
|
Image {
|
||||||
|
source: "pan-start-symbolic.svg"
|
||||||
|
anchors.centerIn: parent
|
||||||
|
anchors.verticalCenterOffset : 18
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
height: 32
|
||||||
|
opacity: backArea.enabled ? 1 : 0.2
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: { ViewManager.back(); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: nextArea
|
||||||
|
Layout.preferredHeight: parent.height / 7;
|
||||||
|
Layout.fillWidth: true
|
||||||
|
color: mouseNext.containsMouse ? "#f4f5f6" : "#e6e9ea";
|
||||||
|
enabled: ViewManager.nextEnabled;
|
||||||
|
visible: ViewManager.backAndNextVisible;
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseNext
|
||||||
|
anchors.fill: parent;
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
hoverEnabled: true
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: qsTr("Next")
|
||||||
|
color: Branding.styleString( !nextArea.enabled ? Branding.SidebarBackground : (mouseNext.containsMouse ? Branding.SidebarTextCurrent : Branding.SidebarText ));
|
||||||
|
font.pointSize : 8
|
||||||
|
}
|
||||||
|
Image {
|
||||||
|
source: "pan-end-symbolic.svg"
|
||||||
|
anchors.centerIn: parent
|
||||||
|
anchors.verticalCenterOffset : 18
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
height: 32
|
||||||
|
opacity: nextArea.enabled ? 1 : 0.2
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: { ViewManager.next(); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: cancelArea
|
||||||
|
height: parent.height / 7;
|
||||||
|
Layout.fillWidth: true
|
||||||
|
color: mouseCancel.containsMouse ? "#e6e9ea" : "#d9dcde";
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The ViewManager has settings -- user-controlled via the
|
||||||
|
* branding component, and party based on program state --
|
||||||
|
* whether the quit button should be enabled and visible.
|
||||||
|
*
|
||||||
|
* QML navigation *should* follow this pattern, but can also
|
||||||
|
* add other qualifications. For instance, you may have a
|
||||||
|
* "finished" module that handles quit in its own way, and
|
||||||
|
* want to hide the quit button then. The ViewManager has a
|
||||||
|
* current step and a total count, so compare them:
|
||||||
|
*
|
||||||
|
* visible: ViewManager.quitVisible && ( ViewManager.currentStepIndex < ViewManager.rowCount()-1);
|
||||||
|
*/
|
||||||
|
|
||||||
|
enabled: ViewManager.quitEnabled;
|
||||||
|
visible: ViewManager.quitVisible && ( ViewManager.currentStepIndex < ViewManager.rowCount()-1);
|
||||||
|
|
||||||
|
ToolTip {
|
||||||
|
width: 59
|
||||||
|
visible: mouseCancel.containsMouse
|
||||||
|
timeout: 5000
|
||||||
|
delay: 1000
|
||||||
|
text: ViewManager.quitTooltip;
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseCancel
|
||||||
|
anchors.fill: parent;
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
hoverEnabled: true
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: qsTr("Cancel")
|
||||||
|
color: Branding.styleString( !cancelArea.enabled ? Branding.SidebarBackground : (mouseCancel.containsMouse ? Branding.SidebarTextCurrent : Branding.SidebarText ));
|
||||||
|
font.pointSize : 8
|
||||||
|
}
|
||||||
|
Image {
|
||||||
|
source: "draw-rectangle.svg"
|
||||||
|
anchors.centerIn: parent
|
||||||
|
anchors.verticalCenterOffset : 18
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
height: 9
|
||||||
|
opacity: cancelArea.enabled ? 1 : 0.2
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: { ViewManager.quit(); }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.fillHeight: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: debugArea
|
||||||
|
Layout.fillWidth: true;
|
||||||
|
height: 35
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
||||||
|
color: Branding.styleString( mouseAreaDebug.containsMouse ? Branding.SidebarBackgroundCurrent : Branding.SidebarBackground);
|
||||||
|
visible: debug.enabled
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseAreaDebug
|
||||||
|
anchors.fill: parent;
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
hoverEnabled: true
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: qsTr("Debug")
|
||||||
|
color: Branding.styleString( mouseAreaDebug.containsMouse ? Branding.SidebarTextCurrent : Branding.SidebarBackground );
|
||||||
|
font.pointSize : 8
|
||||||
|
}
|
||||||
|
|
||||||
|
onClicked: debug.toggle()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: aboutArea
|
||||||
|
Layout.fillWidth: true;
|
||||||
|
height: 35
|
||||||
|
Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
|
||||||
|
color: Branding.styleString( mouseAreaAbout.containsMouse ? Branding.SidebarBackgroundCurrent : Branding.SidebarBackground);
|
||||||
|
visible: true
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: mouseAreaAbout
|
||||||
|
anchors.fill: parent;
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
hoverEnabled: true
|
||||||
|
Text {
|
||||||
|
anchors.centerIn: parent
|
||||||
|
text: qsTr("About")
|
||||||
|
ToolTip {
|
||||||
|
visible: mouseAreaAbout.containsMouse
|
||||||
|
delay: 1000
|
||||||
|
text: qsTr("Info about Calamares")
|
||||||
|
}
|
||||||
|
color: Branding.styleString( mouseAreaAbout.containsMouse ? Branding.SidebarTextCurrent : Branding.SidebarBackgroundCurrent );
|
||||||
|
font.pointSize : 8
|
||||||
|
}
|
||||||
|
|
||||||
|
property variant window;
|
||||||
|
onClicked: {
|
||||||
|
var component = Qt.createComponent("about.qml");
|
||||||
|
window = component.createObject();
|
||||||
|
window.show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
72
branding/kaos_branding/calamares-sidebar.qml
Normal file
72
branding/kaos_branding/calamares-sidebar.qml
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
/* Sample of QML progress tree.
|
||||||
|
|
||||||
|
SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
||||||
|
SPDX-FileCopyrightText: 2021 - 2022 Anke Boersma <demm@kaosx.us>
|
||||||
|
SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
|
|
||||||
|
The progress tree (actually a list) is "horizontal" in this example,
|
||||||
|
with the steps going to the right.
|
||||||
|
*/
|
||||||
|
import io.calamares.ui 1.0
|
||||||
|
import io.calamares.core 1.0
|
||||||
|
|
||||||
|
import QtQuick 2.3
|
||||||
|
import QtQuick.Layouts 1.3
|
||||||
|
import QtQuick.Controls 2.15
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
id: sideBar;
|
||||||
|
color: Branding.styleString( Branding.SidebarBackground );
|
||||||
|
height: 48;
|
||||||
|
width: parent.width
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
anchors.fill: parent;
|
||||||
|
spacing: 2;
|
||||||
|
|
||||||
|
Item {
|
||||||
|
Layout.fillHeight: true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Repeater {
|
||||||
|
model: ViewManager
|
||||||
|
Rectangle {
|
||||||
|
Layout.leftMargin: 0;
|
||||||
|
Layout.fillWidth: true;
|
||||||
|
Layout.alignment: Qt.AlignTop;
|
||||||
|
height: 42;
|
||||||
|
radius: 0;
|
||||||
|
color: Branding.styleString( index == ViewManager.currentStepIndex ? Branding.SidebarBackgroundCurrent : Branding.SidebarBackground );
|
||||||
|
|
||||||
|
Text {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
x: parent.x + 12;
|
||||||
|
color: Branding.styleString( index == ViewManager.currentStepIndex ? Branding.SidebarTextCurrent : Branding.SidebarText );
|
||||||
|
text: display;
|
||||||
|
font.pointSize : index == ViewManager.currentStepIndex ? 10 : 9
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
height: 2
|
||||||
|
width: 800
|
||||||
|
anchors.bottom: parent.bottom;
|
||||||
|
border.color: Branding.styleString(ViewManager.currentStepIndex === index ? Branding.SidebarTextCurrent : (ViewManager.currentStepIndex >= index ? Branding.SidebarTextCurrent : Branding.SidebarBackgroundCurrent))
|
||||||
|
border.width: 3
|
||||||
|
|
||||||
|
Image {
|
||||||
|
source: "pan-up-symbolic.svg"
|
||||||
|
id: image
|
||||||
|
anchors.verticalCenter: parent.verticalCenter;
|
||||||
|
anchors.verticalCenterOffset : -3
|
||||||
|
x: parent.x + 35;
|
||||||
|
fillMode: Image.PreserveAspectFit
|
||||||
|
height: 32
|
||||||
|
visible: index == ViewManager.currentStepIndex ? true : false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
1
branding/kaos_branding/draw-rectangle.svg
Normal file
1
branding/kaos_branding/draw-rectangle.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 22 22"><path d="m2 1034.36v16h16v-16z" fill="#566060" transform="translate(1-1031.36)"/></svg>
|
||||||
|
After Width: | Height: | Size: 147 B |
Binary file not shown.
|
Before Width: | Height: | Size: 292 KiB After Width: | Height: | Size: 106 KiB |
15
branding/kaos_branding/pan-end-symbolic.svg
Normal file
15
branding/kaos_branding/pan-end-symbolic.svg
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
|
<svg height="16" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" version="1.1" width="16" xmlns="http://www.w3.org/2000/svg" enable-background="new">
|
||||||
|
<metadata id="metadata90"/>
|
||||||
|
<defs id="defs7386">
|
||||||
|
<linearGradient id="linearGradient5606" osb:paint="solid">
|
||||||
|
<stop id="stop5608"/>
|
||||||
|
</linearGradient>
|
||||||
|
<filter inkscape:collect="always" color-interpolation-filters="sRGB" id="filter7554">
|
||||||
|
<feBlend inkscape:collect="always" id="feBlend7556" in2="BackgroundImage" mode="darken"/>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
<g inkscape:groupmode="layer" id="layer12" inkscape:label="actions" transform="translate(-445.0002,-129)">
|
||||||
|
<path inkscape:connector-curvature="0" d="m 451.0002,142 5,-5 -5,-5 z" id="path6412" sodipodi:nodetypes="cccc" fill="#555555"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 896 B |
15
branding/kaos_branding/pan-start-symbolic.svg
Normal file
15
branding/kaos_branding/pan-start-symbolic.svg
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
|
<svg height="16" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" version="1.1" width="16" xmlns="http://www.w3.org/2000/svg" enable-background="new">
|
||||||
|
<metadata id="metadata90"/>
|
||||||
|
<defs id="defs7386">
|
||||||
|
<linearGradient id="linearGradient5606" osb:paint="solid">
|
||||||
|
<stop id="stop5608"/>
|
||||||
|
</linearGradient>
|
||||||
|
<filter inkscape:collect="always" color-interpolation-filters="sRGB" id="filter7554">
|
||||||
|
<feBlend inkscape:collect="always" id="feBlend7556" in2="BackgroundImage" mode="darken"/>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
<g inkscape:groupmode="layer" id="layer12" inkscape:label="actions" transform="translate(-425.0002,-129)">
|
||||||
|
<path inkscape:connector-curvature="0" d="m 435.0002,142 -5,-5 5,-5 z" id="path6400-8" sodipodi:nodetypes="cccc" fill="#555555"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 898 B |
15
branding/kaos_branding/pan-up-symbolic.svg
Normal file
15
branding/kaos_branding/pan-up-symbolic.svg
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
<?xml version='1.0' encoding='UTF-8' standalone='no'?>
|
||||||
|
<svg height="16" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" version="1.1" width="16" xmlns="http://www.w3.org/2000/svg" enable-background="new">
|
||||||
|
<metadata id="metadata90"/>
|
||||||
|
<defs id="defs7386">
|
||||||
|
<linearGradient id="linearGradient5606" osb:paint="solid">
|
||||||
|
<stop id="stop5608"/>
|
||||||
|
</linearGradient>
|
||||||
|
<filter inkscape:collect="always" color-interpolation-filters="sRGB" id="filter7554">
|
||||||
|
<feBlend inkscape:collect="always" id="feBlend7556" in2="BackgroundImage" mode="darken"/>
|
||||||
|
</filter>
|
||||||
|
</defs>
|
||||||
|
<g inkscape:groupmode="layer" id="layer12" inkscape:label="actions" transform="translate(-465.0002,-129.00001)">
|
||||||
|
<path inkscape:connector-curvature="0" d="m 478.0002,139 -5,-5 -5,5 z" id="path6418" sodipodi:nodetypes="cccc" fill="#3498DB"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 902 B |
@@ -1,6 +1,7 @@
|
|||||||
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
/* === This file is part of Calamares - <https://github.com/calamares> ===
|
||||||
*
|
*
|
||||||
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
|
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
|
||||||
|
* Copyright 2015-2018, Anke Boersma <demm@kaosx.us>
|
||||||
*
|
*
|
||||||
* Calamares is free software: you can redistribute it and/or modify
|
* Calamares is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -24,7 +25,6 @@ Presentation
|
|||||||
id: presentation
|
id: presentation
|
||||||
|
|
||||||
Timer {
|
Timer {
|
||||||
id: advanceTimer
|
|
||||||
interval: 5000
|
interval: 5000
|
||||||
running: false
|
running: false
|
||||||
repeat: true
|
repeat: true
|
||||||
@@ -96,8 +96,8 @@ Presentation
|
|||||||
anchors.horizontalCenterOffset: -100
|
anchors.horizontalCenterOffset: -100
|
||||||
font.pixelSize: parent.width *.015
|
font.pixelSize: parent.width *.015
|
||||||
color: 'white'
|
color: 'white'
|
||||||
text: qsTr("The default Office Suite is Calligra.<br/>"+
|
text: qsTr("The default Office Suite is LibreOffice.<br/>"+
|
||||||
"LibreOffice is available in the repositories. <br/>")
|
"Calligra is available in the repositories. <br/>")
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
width: 450
|
width: 450
|
||||||
horizontalAlignment: Text.AlignLeft
|
horizontalAlignment: Text.AlignLeft
|
||||||
@@ -120,7 +120,7 @@ Presentation
|
|||||||
font.pixelSize: parent.width *.015
|
font.pixelSize: parent.width *.015
|
||||||
color: 'white'
|
color: 'white'
|
||||||
text: qsTr("Qt/KDE specific internet applications include the <br/>"+
|
text: qsTr("Qt/KDE specific internet applications include the <br/>"+
|
||||||
"Qupzilla web-browser and kde-telepathy for <br/>"+
|
"Falkon web-browser and kde-telepathy for <br/>"+
|
||||||
"chat and Instant Messaging. <br/>")
|
"chat and Instant Messaging. <br/>")
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
width: 450
|
width: 450
|
||||||
@@ -172,6 +172,4 @@ Presentation
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: advanceTimer.running = true
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
# NOTE: this is largely a copy of the release script for Calamares,
|
# NOTE: this is largely a copy of the release script for Calamares,
|
||||||
# with not-applicable parts (such as translation-freeze) either
|
# with not-applicable parts (such as translation-freeze) either
|
||||||
# commented-out, or skipped with if(false).
|
# commented-out, or skipped with if(false).
|
||||||
# NOTE: this script contains Linuxisms (in particular, expects GNU mktemp(1))
|
# NOTE: this script may contain Linuxisms
|
||||||
#
|
#
|
||||||
# This attempts to perform the different steps of the RELEASE.md
|
# This attempts to perform the different steps of the RELEASE.md
|
||||||
# document automatically. It's not tested on other machines or
|
# document automatically. It's not tested on other machines or
|
||||||
@@ -93,7 +93,7 @@ fi
|
|||||||
### Setup
|
### Setup
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
BUILDDIR=$(mktemp -d --suffix=-build --tmpdir=.)
|
BUILDDIR=$(mktemp -d -p . -t cala-tmp-XXXXX)
|
||||||
|
|
||||||
### Build with default compiler
|
### Build with default compiler
|
||||||
#
|
#
|
||||||
@@ -148,7 +148,7 @@ test -n "$V" || { echo "Could not obtain version in $BUILDDIR ." ; exit 1 ; }
|
|||||||
# This is the signing key ID associated with the GitHub account adriaandegroot,
|
# This is the signing key ID associated with the GitHub account adriaandegroot,
|
||||||
# which is used to create all "verified" tags in the Calamares repo.
|
# which is used to create all "verified" tags in the Calamares repo.
|
||||||
#
|
#
|
||||||
KEY_ID="CFDDC96F12B1915C"
|
KEY_ID="328D742D8807A435"
|
||||||
git tag -u "$KEY_ID" -m "Release v$V" "v$V" || { echo "Could not sign tag v$V." ; exit 1 ; }
|
git tag -u "$KEY_ID" -m "Release v$V" "v$V" || { echo "Could not sign tag v$V." ; exit 1 ; }
|
||||||
|
|
||||||
### Create the tarball
|
### Create the tarball
|
||||||
@@ -167,7 +167,7 @@ gpg -s -u $KEY_ID --detach --armor $TAR_FILE # Sign the tarball
|
|||||||
#
|
#
|
||||||
#
|
#
|
||||||
D=$(date +%Y%m%d-%H%M%S)
|
D=$(date +%Y%m%d-%H%M%S)
|
||||||
TMPDIR=$(mktemp -d --suffix="-calamares-$D")
|
TMPDIR=$(mktemp -d -p . -t calamares.XXXXX)
|
||||||
test -d "$TMPDIR" || { echo "Could not create tarball-build directory." ; exit 1 ; }
|
test -d "$TMPDIR" || { echo "Could not create tarball-build directory." ; exit 1 ; }
|
||||||
tar xzf "$TAR_FILE" -C "$TMPDIR" || { echo "Could not unpack tarball." ; exit 1 ; }
|
tar xzf "$TAR_FILE" -C "$TMPDIR" || { echo "Could not unpack tarball." ; exit 1 ; }
|
||||||
test -d "$TMPDIR/$TAR_V" || { echo "Tarball did not contain source directory." ; exit 1 ; }
|
test -d "$TMPDIR/$TAR_V" || { echo "Tarball did not contain source directory." ; exit 1 ; }
|
||||||
|
|||||||
@@ -4,12 +4,14 @@
|
|||||||
# SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
|
# SPDX-FileCopyrightText: 2019 Adriaan de Groot <groot@kde.org>
|
||||||
# SPDX-License-Identifier: BSD-2-Clause
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
#
|
#
|
||||||
# Calls astyle with settings matching Calamares coding style
|
# Apply Calamares-style formatting to sources. Requires clang-format-15.
|
||||||
# Requires astyle >= 2.04 and clang-format-8 or later
|
|
||||||
#
|
#
|
||||||
# You can pass in directory names, in which case the files
|
# You can pass in directory names, in which case the files
|
||||||
# in that directory (NOT below it) are processed.
|
# in that directory (NOT below it) are processed.
|
||||||
#
|
#
|
||||||
|
# If the environment variable CLANG_FORMAT is set to a (full path) and
|
||||||
|
# that path is executable, it will be used if possible.
|
||||||
|
#
|
||||||
LANG=C
|
LANG=C
|
||||||
LC_ALL=C
|
LC_ALL=C
|
||||||
LC_NUMERIC=C
|
LC_NUMERIC=C
|
||||||
@@ -19,12 +21,19 @@ BASEDIR=$(dirname $0)
|
|||||||
TOPDIR=$( cd $BASEDIR/.. && pwd -P )
|
TOPDIR=$( cd $BASEDIR/.. && pwd -P )
|
||||||
test -d "$BASEDIR" || { echo "! Could not determine base for $0" ; exit 1 ; }
|
test -d "$BASEDIR" || { echo "! Could not determine base for $0" ; exit 1 ; }
|
||||||
test -d "$TOPDIR" || { echo "! Cound not determine top-level source dir" ; exit 1 ; }
|
test -d "$TOPDIR" || { echo "! Cound not determine top-level source dir" ; exit 1 ; }
|
||||||
test -f "$TOPDIR/.clang-format.base" || { echo "! No .clang-format support files in $TOPDIR" ; exit 1 ; }
|
test -f "$TOPDIR/.clang-format" || { echo "! No .clang-format support files in $TOPDIR" ; exit 1 ; }
|
||||||
|
|
||||||
AS=$( which astyle )
|
# Start with CLANG_FORMAT, if it is specified
|
||||||
|
CF_VERSIONS=""
|
||||||
# Allow specifying CF_VERSIONS outside already
|
if test -n "$CLANG_FORMAT" && test -x "$CLANG_FORMAT" ; then
|
||||||
CF_VERSIONS="$CF_VERSIONS clang-format-8 clang-format80 clang-format90 clang-format-9.0.1 clang-format"
|
CF_VERSIONS="$CLANG_FORMAT"
|
||||||
|
fi
|
||||||
|
# And a bunch of other potential known versions of clang-format, newest first
|
||||||
|
CF_VERSIONS="$CF_VERSIONS clang-format-17"
|
||||||
|
CF_VERSIONS="$CF_VERSIONS clang-format-16 clang-format-16.0.6 "
|
||||||
|
CF_VERSIONS="$CF_VERSIONS clang-format15 clang-format-15 "
|
||||||
|
# Generic name of clang-format
|
||||||
|
CF_VERSIONS="$CF_VERSIONS clang-format"
|
||||||
for _cf in $CF_VERSIONS
|
for _cf in $CF_VERSIONS
|
||||||
do
|
do
|
||||||
# Not an error if this particular clang-format isn't found
|
# Not an error if this particular clang-format isn't found
|
||||||
@@ -32,39 +41,33 @@ do
|
|||||||
test -n "$CF" && break
|
test -n "$CF" && break
|
||||||
done
|
done
|
||||||
|
|
||||||
test -n "$AS" || { echo "! No astyle found in PATH"; exit 1 ; }
|
|
||||||
test -n "$CF" || { echo "! No clang-format ($CF_VERSIONS) found in PATH"; exit 1 ; }
|
test -n "$CF" || { echo "! No clang-format ($CF_VERSIONS) found in PATH"; exit 1 ; }
|
||||||
test -x "$AS" || { echo "! $AS is not executable."; exit 1 ; }
|
|
||||||
test -x "$CF" || { echo "! $CF is not executable."; exit 1 ; }
|
test -x "$CF" || { echo "! $CF is not executable."; exit 1 ; }
|
||||||
|
|
||||||
### CLANG-FORMAT-WRANGLING
|
### CLANG-FORMAT-WRANGLING
|
||||||
#
|
#
|
||||||
# Version 7 and earlier doesn't understand all the options we would like
|
# Version 7 and earlier doesn't understand all the options we would like.
|
||||||
# Version 8 is ok
|
# Version 12 handled lambdas nicely and was the norm for Calamares 3.2.
|
||||||
# Version 9 is ok
|
# Version 13 was also ok.
|
||||||
# Later versions change some defaults so need extra wrangling.
|
# Version 14 behaves differently with short-functions-in-class,
|
||||||
# .. there are extra files that are appended to the settings, per
|
# spreading functions out that 13 keeps on one line. To avoid
|
||||||
# .. clang-format version.
|
# ping-pong commits, forbid 14.
|
||||||
|
# Version 15 is available on recent-ish Ubuntus and FreeBSD, pick it.
|
||||||
|
# It also supports inserting braces, which is the one thing we kept
|
||||||
|
# astyle around for.
|
||||||
|
# Version 16 is available on openSUSE and is ok as well.
|
||||||
|
# Version 17 is available on FreeBSD and KaOS and is ok as well.
|
||||||
|
|
||||||
format_version=`"$CF" --version | tr -dc '[^.0-9]' | cut -d . -f 1`
|
format_version=`"$CF" --version | tr -dc '[^.0-9]' | cut -d . -f 1`
|
||||||
case "$format_version" in
|
case "$format_version" in
|
||||||
[0-7] )
|
15|16|17 )
|
||||||
echo "! Clang-format version 8+ required"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
[89] )
|
|
||||||
:
|
:
|
||||||
;;
|
;;
|
||||||
* )
|
* )
|
||||||
echo "! Clang-format version '$format_version' unsupported."
|
echo "! Clang-format version '$format_version' unsupported, versions 15-17 are ok."
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
_fmt="$TOPDIR/.clang-format"
|
|
||||||
cp "$_fmt.base" "$_fmt"
|
|
||||||
for f in "$extra_settings" ; do
|
|
||||||
test -f "$_fmt.$f" && cat "$_fmt.$f" >> "$_fmt"
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
### FILE PROCESSING
|
### FILE PROCESSING
|
||||||
@@ -81,7 +84,6 @@ done
|
|||||||
style_some()
|
style_some()
|
||||||
{
|
{
|
||||||
if test -n "$*" ; then
|
if test -n "$*" ; then
|
||||||
$AS --options=$BASEDIR/astylerc --quiet "$@"
|
|
||||||
$CF -i -style=file "$@"
|
$CF -i -style=file "$@"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
@@ -98,8 +100,3 @@ if test "x$any_dirs" = "xyes" ; then
|
|||||||
else
|
else
|
||||||
style_some "$@"
|
style_some "$@"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
### CLANG-FORMAT-WRANGLING
|
|
||||||
#
|
|
||||||
# Restore the original .clang-format
|
|
||||||
cp "$_fmt.base" "$_fmt"
|
|
||||||
|
|||||||
17
modules/flatpakinfo/CMakeLists.txt
Normal file
17
modules/flatpakinfo/CMakeLists.txt
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# === This file is part of Calamares - <https://calamares.io> ===
|
||||||
|
#
|
||||||
|
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
||||||
|
# SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
#
|
||||||
|
calamares_add_plugin(flatpakInfo
|
||||||
|
TYPE job
|
||||||
|
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
||||||
|
SOURCES
|
||||||
|
FlatpakInfoJob.h
|
||||||
|
ItemFlatpak.h
|
||||||
|
PackagePool.h
|
||||||
|
FlatpakInfoJob.cpp
|
||||||
|
ItemFlatpak.cpp
|
||||||
|
PackagePool.cpp
|
||||||
|
SHARED_LIB
|
||||||
|
)
|
||||||
63
modules/flatpakinfo/FlatpakInfoJob.cpp
Normal file
63
modules/flatpakinfo/FlatpakInfoJob.cpp
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||||
|
*
|
||||||
|
* SPDX-FileCopyrightText: 2023 Sławomir Lach <slawek@lach.art.pl>
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* Calamares is Free Software: see the License-Identifier above.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "FlatpakInfoJob.h"
|
||||||
|
|
||||||
|
#include "utils/Runner.h"
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
#include "utils/Variant.h"
|
||||||
|
|
||||||
|
#include "GlobalStorage.h"
|
||||||
|
#include "JobQueue.h"
|
||||||
|
#include "Settings.h"
|
||||||
|
|
||||||
|
#include <QProcess>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "ItemFlatpak.h"
|
||||||
|
#include "PackagePool.h"
|
||||||
|
|
||||||
|
FlatpakInfoJob::FlatpakInfoJob( QObject* parent )
|
||||||
|
: Calamares::CppJob( parent )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
FlatpakInfoJob::~FlatpakInfoJob()
|
||||||
|
{
|
||||||
|
ItemFlatpak_freeMem();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString
|
||||||
|
FlatpakInfoJob::prettyName() const
|
||||||
|
{
|
||||||
|
return tr( "Fill netinstall with flatpak packages" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Calamares::JobResult
|
||||||
|
FlatpakInfoJob::exec()
|
||||||
|
{
|
||||||
|
QVariantList partitions;
|
||||||
|
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||||
|
|
||||||
|
|
||||||
|
downloadPackagesInfo();
|
||||||
|
serializePackagesInfo();
|
||||||
|
|
||||||
|
return Calamares::JobResult::ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
FlatpakInfoJob::setConfigurationMap( const QVariantMap& map )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CALAMARES_PLUGIN_FACTORY_DEFINITION( FlatpakInfoJobFactory, registerPlugin< FlatpakInfoJob >(); )
|
||||||
43
modules/flatpakinfo/FlatpakInfoJob.h
Normal file
43
modules/flatpakinfo/FlatpakInfoJob.h
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||||
|
*
|
||||||
|
* SPDX-FileCopyrightText: 2023 Sławomir Lach <slawek@lach.art.pl>
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* Calamares is Free Software: see the License-Identifier above.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef FLATPAKINFOJOB_H
|
||||||
|
#define FLATPAKINFOJOB_H
|
||||||
|
|
||||||
|
#include <QObject>
|
||||||
|
#include <QStringList>
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
#include "CppJob.h"
|
||||||
|
|
||||||
|
#include "utils/PluginFactory.h"
|
||||||
|
|
||||||
|
#include "DllMacro.h"
|
||||||
|
|
||||||
|
/** @brief Create zpools and zfs datasets
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
class PLUGINDLLEXPORT FlatpakInfoJob : public Calamares::CppJob
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit FlatpakInfoJob( QObject* parent = nullptr );
|
||||||
|
~FlatpakInfoJob() override;
|
||||||
|
|
||||||
|
QString prettyName() const override;
|
||||||
|
|
||||||
|
Calamares::JobResult exec() override;
|
||||||
|
|
||||||
|
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
CALAMARES_PLUGIN_FACTORY_DECLARATION( FlatpakInfoJobFactory )
|
||||||
|
|
||||||
|
#endif // ZFSJOB_H
|
||||||
66
modules/flatpakinfo/ItemFlatpak.cpp
Normal file
66
modules/flatpakinfo/ItemFlatpak.cpp
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||||
|
*
|
||||||
|
* SPDX-FileCopyrightText: 2023 Sławomir Lach <slawek@lach.art.pl>
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* Calamares is Free Software: see the License-Identifier above.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* Qt */
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
/* CPP */
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
/* Calamares */
|
||||||
|
#include "utils/Runner.h"
|
||||||
|
|
||||||
|
/* Module */
|
||||||
|
#include "ItemFlatpak.h"
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
#include "utils/Variant.h"
|
||||||
|
|
||||||
|
PackageItem
|
||||||
|
fromFlatpak( const QVariantMap& itemMap, InstalledList &installed )
|
||||||
|
{
|
||||||
|
// check if it is installed
|
||||||
|
PackageItem item( Calamares::getString( itemMap, "appstream" ) );
|
||||||
|
item.setInstalled( false );
|
||||||
|
|
||||||
|
item.setInstalled( installed.contains( Calamares::getString( itemMap, "appstream" ) ) );
|
||||||
|
|
||||||
|
return item;
|
||||||
|
}
|
||||||
|
|
||||||
|
InstalledList::InstalledList()
|
||||||
|
{
|
||||||
|
long long int prev_pos;
|
||||||
|
long long int pos = 0;
|
||||||
|
QString line;
|
||||||
|
auto process = Calamares::System::instance()->targetEnvCommand(
|
||||||
|
QStringList { QString::fromLatin1( "flatpak" ),
|
||||||
|
QString::fromLatin1( "list" ),
|
||||||
|
QString::fromLatin1( "--app" ),
|
||||||
|
QString::fromLatin1( "--columns=application" ) } );
|
||||||
|
auto outputStr = process.second;
|
||||||
|
|
||||||
|
do {
|
||||||
|
prev_pos = pos;
|
||||||
|
|
||||||
|
pos = outputStr.indexOf('\n', prev_pos);
|
||||||
|
QString line = outputStr.mid(prev_pos, pos);
|
||||||
|
installed.append(line);
|
||||||
|
|
||||||
|
/* Increase by 1 to not stuck on newline */
|
||||||
|
++pos;
|
||||||
|
|
||||||
|
/* QString::indexOf returns -1 since no occurences. 0 = -1 + 1.*/
|
||||||
|
} while (0 != pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
InstalledList::~InstalledList()
|
||||||
|
{
|
||||||
|
installed.clear();
|
||||||
|
}
|
||||||
0
modules/flatpakinfo/ItemFlatpak.h
Normal file
0
modules/flatpakinfo/ItemFlatpak.h
Normal file
110
modules/flatpakinfo/PackagePool.cpp
Normal file
110
modules/flatpakinfo/PackagePool.cpp
Normal file
@@ -0,0 +1,110 @@
|
|||||||
|
/* === This file is part of Calamares - <https://calamares.io> ===
|
||||||
|
*
|
||||||
|
* SPDX-FileCopyrightText: 2023 Sławomir Lach <slawek@lach.art.pl>
|
||||||
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
*
|
||||||
|
* Calamares is Free Software: see the License-Identifier above.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <fstream>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QDesktopServices>
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
#include "GlobalStorage.h"
|
||||||
|
#include "JobQueue.h"
|
||||||
|
#include "utils/Logger.h"
|
||||||
|
#include "utils/Variant.h"
|
||||||
|
#include "ItemFlatpak.h"
|
||||||
|
#include "PackagePool.h"
|
||||||
|
|
||||||
|
#include "utils/System.h"
|
||||||
|
|
||||||
|
void PackagePool::downloadPackagesInfo(InstalledList &list)
|
||||||
|
{
|
||||||
|
QHash<QString,bool> addedPackages;
|
||||||
|
QString line;
|
||||||
|
auto process = Calamares::System::instance()->targetEnvCommand( QStringList { QString::fromStdString( "flatpak" ), QString::fromStdString( "remotes" ), QString::fromStdString( "--columns=name" ) });
|
||||||
|
auto outputStr = process.second;
|
||||||
|
QTextStream output(&outputStr);
|
||||||
|
|
||||||
|
while (output.readLineInto(&line))
|
||||||
|
{
|
||||||
|
QString line2;
|
||||||
|
auto process2 = Calamares::System::instance()->targetEnvCommand(
|
||||||
|
QStringList { QString::fromStdString( "flatpak" ),
|
||||||
|
QString::fromStdString( "remote-ls" ),
|
||||||
|
QString::fromStdString( "--app" ),
|
||||||
|
QString::fromStdString( "--columns=application" ),
|
||||||
|
line } );
|
||||||
|
auto output2Str = process2.second;
|
||||||
|
QTextStream output2( &output2Str );
|
||||||
|
|
||||||
|
while ( output2.readLineInto( &line2 ) )
|
||||||
|
{
|
||||||
|
if ( line2 == "" )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
QVariantMap itemMap;
|
||||||
|
|
||||||
|
if ( addedPackages.contains( line2 ) )
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
addedPackages.insert( line2, true );
|
||||||
|
|
||||||
|
itemMap.insert( "appstream", QVariant( line2 ) );
|
||||||
|
itemMap.insert( "id", QVariant( line2 ) );
|
||||||
|
|
||||||
|
PackageItem item = fromFlatpak( itemMap, list );
|
||||||
|
packages.append( item );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
serializePackagesInfo();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PackagePool::serializePackagesInfo()
|
||||||
|
{
|
||||||
|
QList<QVariant> changedValue;
|
||||||
|
auto* gs = Calamares::JobQueue::instance()->globalStorage();
|
||||||
|
|
||||||
|
// If an earlier packagechooser instance added this data to global storage, combine them
|
||||||
|
if ( gs->contains( "netinstallAdd" ) )
|
||||||
|
{
|
||||||
|
auto selectedOrig = gs->value( "netinstallAdd" );
|
||||||
|
|
||||||
|
changedValue = selectedOrig.toList();
|
||||||
|
for (auto current: packages)
|
||||||
|
{
|
||||||
|
QStringList selfInstall;
|
||||||
|
QVariantMap newValue;
|
||||||
|
newValue.insert("name", current.getAppStreamId());
|
||||||
|
|
||||||
|
if (current.getInstalled())
|
||||||
|
{
|
||||||
|
newValue.insert("selected", true);
|
||||||
|
newValue.insert("immutable", true);
|
||||||
|
newValue.insert("description", "[Already installed; cannot be uninstalled]");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
newValue.insert("selected", false);
|
||||||
|
}
|
||||||
|
selfInstall.append(current.getAppStreamId());
|
||||||
|
newValue.insert("packages", selfInstall);
|
||||||
|
changedValue.append(newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
gs->remove( "netinstallAdd" );
|
||||||
|
}
|
||||||
|
gs->insert( "netinstallAdd", changedValue );
|
||||||
|
}
|
||||||
0
modules/flatpakinfo/PackagePool.h
Normal file
0
modules/flatpakinfo/PackagePool.h
Normal file
8
modules/flatpakinfo/flatpakInfo.conf
Normal file
8
modules/flatpakinfo/flatpakInfo.conf
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
# SPDX-FileCopyrightText: no
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
#
|
||||||
|
# The flatpakinfo module will collect package list from configured flatpak repositories
|
||||||
|
#
|
||||||
|
#
|
||||||
|
#
|
||||||
|
---
|
||||||
7
modules/flatpakinfo/module.desc
Normal file
7
modules/flatpakinfo/module.desc
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# SPDX-FileCopyrightText: no
|
||||||
|
# SPDX-License-Identifier: CC0-1.0
|
||||||
|
---
|
||||||
|
type: "job"
|
||||||
|
name: "flatpakinfo"
|
||||||
|
interface: "qtplugin"
|
||||||
|
load: "libcalamares_job_flatpakInfo.so"
|
||||||
@@ -18,7 +18,7 @@ Config::Config( QObject* parent )
|
|||||||
void
|
void
|
||||||
Config::setConfigurationMap( const QVariantMap& cfgMap )
|
Config::setConfigurationMap( const QVariantMap& cfgMap )
|
||||||
{
|
{
|
||||||
using namespace CalamaresUtils;
|
using namespace Calamares;
|
||||||
|
|
||||||
if ( getBool( cfgMap, "bogus", false ) )
|
if ( getBool( cfgMap, "bogus", false ) )
|
||||||
{
|
{
|
||||||
@@ -30,6 +30,13 @@ Config::setConfigurationMap( const QVariantMap& cfgMap )
|
|||||||
m_device = getString( cfgMap, "device", "(unknown)" );
|
m_device = getString( cfgMap, "device", "(unknown)" );
|
||||||
m_userInterface = getString( cfgMap, "userInterface", "(unknown)" );
|
m_userInterface = getString( cfgMap, "userInterface", "(unknown)" );
|
||||||
m_version = getString( cfgMap, "version", "(unknown)" );
|
m_version = getString( cfgMap, "version", "(unknown)" );
|
||||||
|
|
||||||
|
m_reservedUsernames = getStringList( cfgMap, "reservedUsernames", QStringList { "adm", "at ", "bin", "colord",
|
||||||
|
"cron", "cyrus", "daemon", "ftp", "games", "geoclue", "guest", "halt", "lightdm", "lp", "mail", "man",
|
||||||
|
"messagebus", "news", "nobody", "ntp", "operator", "polkitd", "postmaster", "pulse", "root", "shutdown",
|
||||||
|
"smmsp", "squid", "sshd", "sync", "uucp", "vpopmail", "xfs" } );
|
||||||
|
|
||||||
|
// ensure m_cmdUsermod matches m_username
|
||||||
m_username = getString( cfgMap, "username", "user" );
|
m_username = getString( cfgMap, "username", "user" );
|
||||||
m_userPasswordNumeric = getBool( cfgMap, "userPasswordNumeric", true );
|
m_userPasswordNumeric = getBool( cfgMap, "userPasswordNumeric", true );
|
||||||
|
|
||||||
@@ -54,6 +61,8 @@ Config::setConfigurationMap( const QVariantMap& cfgMap )
|
|||||||
|
|
||||||
m_cmdInternalStoragePrepare = getString( cfgMap, "cmdInternalStoragePrepare", "ondev-internal-storage-prepare" );
|
m_cmdInternalStoragePrepare = getString( cfgMap, "cmdInternalStoragePrepare", "ondev-internal-storage-prepare" );
|
||||||
m_cmdPasswd = getString( cfgMap, "cmdPasswd", "passwd" );
|
m_cmdPasswd = getString( cfgMap, "cmdPasswd", "passwd" );
|
||||||
|
m_cmdUsermod = getString( cfgMap, "cmdUsermod", "xargs -I{} -n1 usermod -m -d /home/{} -l {} -c {} user");
|
||||||
|
|
||||||
m_cmdSshdEnable = getString( cfgMap, "cmdSshdEnable", "systemctl enable sshd.service" );
|
m_cmdSshdEnable = getString( cfgMap, "cmdSshdEnable", "systemctl enable sshd.service" );
|
||||||
m_cmdSshdDisable = getString( cfgMap, "cmdSshdDisable", "systemctl disable sshd.service" );
|
m_cmdSshdDisable = getString( cfgMap, "cmdSshdDisable", "systemctl disable sshd.service" );
|
||||||
m_cmdSshdUseradd = getString( cfgMap, "cmdSshdUseradd", "useradd -G wheel -m" );
|
m_cmdSshdUseradd = getString( cfgMap, "cmdSshdUseradd", "useradd -G wheel -m" );
|
||||||
@@ -68,6 +77,7 @@ Config::createJobs()
|
|||||||
/* Put users job in queue (should run after unpackfs) */
|
/* Put users job in queue (should run after unpackfs) */
|
||||||
Calamares::Job* j = new UsersJob( m_featureSshd,
|
Calamares::Job* j = new UsersJob( m_featureSshd,
|
||||||
m_cmdPasswd,
|
m_cmdPasswd,
|
||||||
|
m_cmdUsermod,
|
||||||
cmdSshd,
|
cmdSshd,
|
||||||
m_cmdSshdUseradd,
|
m_cmdSshdUseradd,
|
||||||
m_isSshEnabled,
|
m_isSshEnabled,
|
||||||
@@ -132,6 +142,13 @@ Config::runPartitionJobThenLeave( bool b )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
Config::setUsername( const QString& username )
|
||||||
|
{
|
||||||
|
m_username = username;
|
||||||
|
emit usernameChanged( m_username );
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
Config::setUserPassword( const QString& userPassword )
|
Config::setUserPassword( const QString& userPassword )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -20,8 +20,11 @@ class Config : public QObject
|
|||||||
Q_PROPERTY( QString userInterface READ userInterface CONSTANT FINAL )
|
Q_PROPERTY( QString userInterface READ userInterface CONSTANT FINAL )
|
||||||
Q_PROPERTY( QString version READ version CONSTANT FINAL )
|
Q_PROPERTY( QString version READ version CONSTANT FINAL )
|
||||||
|
|
||||||
|
/* reserved usernames (user_pass, ssh_credentials )*/
|
||||||
|
Q_PROPERTY( QStringList reservedUsernames READ reservedUsernames CONSTANT FINAL )
|
||||||
|
|
||||||
/* default user */
|
/* default user */
|
||||||
Q_PROPERTY( QString username READ username CONSTANT FINAL )
|
Q_PROPERTY( QString username READ username WRITE setUsername NOTIFY usernameChanged )
|
||||||
Q_PROPERTY( QString userPassword READ userPassword WRITE setUserPassword NOTIFY userPasswordChanged )
|
Q_PROPERTY( QString userPassword READ userPassword WRITE setUserPassword NOTIFY userPasswordChanged )
|
||||||
Q_PROPERTY( bool userPasswordNumeric READ userPasswordNumeric CONSTANT FINAL )
|
Q_PROPERTY( bool userPasswordNumeric READ userPasswordNumeric CONSTANT FINAL )
|
||||||
|
|
||||||
@@ -72,13 +75,17 @@ public:
|
|||||||
QString userInterface() const { return m_userInterface; }
|
QString userInterface() const { return m_userInterface; }
|
||||||
QString version() const { return m_version; }
|
QString version() const { return m_version; }
|
||||||
|
|
||||||
/* default user */
|
/* reserved usernames (user_pass, ssh_credentials) */
|
||||||
|
QStringList reservedUsernames() const { return m_reservedUsernames; };
|
||||||
|
|
||||||
|
/* user */
|
||||||
QString username() const { return m_username; }
|
QString username() const { return m_username; }
|
||||||
QString userPassword() const { return m_userPassword; }
|
QString userPassword() const { return m_userPassword; }
|
||||||
|
void setUsername( const QString& username );
|
||||||
void setUserPassword( const QString& userPassword );
|
void setUserPassword( const QString& userPassword );
|
||||||
bool userPasswordNumeric() const { return m_userPasswordNumeric; }
|
bool userPasswordNumeric() const { return m_userPasswordNumeric; }
|
||||||
|
|
||||||
/* ssh server + credetials */
|
/* ssh server + credentials */
|
||||||
bool featureSshd() { return m_featureSshd; }
|
bool featureSshd() { return m_featureSshd; }
|
||||||
QString sshdUsername() const { return m_sshdUsername; }
|
QString sshdUsername() const { return m_sshdUsername; }
|
||||||
QString sshdPassword() const { return m_sshdPassword; }
|
QString sshdPassword() const { return m_sshdPassword; }
|
||||||
@@ -120,6 +127,7 @@ public:
|
|||||||
|
|
||||||
/* users job */
|
/* users job */
|
||||||
QString cmdPasswd() const { return m_cmdPasswd; }
|
QString cmdPasswd() const { return m_cmdPasswd; }
|
||||||
|
QString cmdUsermod() const { return m_cmdUsermod; }
|
||||||
QString cmdSshdEnable() const { return m_cmdSshdEnable; }
|
QString cmdSshdEnable() const { return m_cmdSshdEnable; }
|
||||||
QString cmdSshdDisable() const { return m_cmdSshdDisable; }
|
QString cmdSshdDisable() const { return m_cmdSshdDisable; }
|
||||||
QString cmdSshdUseradd() const { return m_cmdSshdUseradd; }
|
QString cmdSshdUseradd() const { return m_cmdSshdUseradd; }
|
||||||
@@ -135,6 +143,9 @@ private:
|
|||||||
QString m_userInterface;
|
QString m_userInterface;
|
||||||
QString m_version;
|
QString m_version;
|
||||||
|
|
||||||
|
/* reserved usernames (user_pass, ssh_credentials) */
|
||||||
|
QStringList m_reservedUsernames;
|
||||||
|
|
||||||
/* default user */
|
/* default user */
|
||||||
QString m_username;
|
QString m_username;
|
||||||
QString m_userPassword;
|
QString m_userPassword;
|
||||||
@@ -172,6 +183,7 @@ private:
|
|||||||
|
|
||||||
/* users job */
|
/* users job */
|
||||||
QString m_cmdPasswd;
|
QString m_cmdPasswd;
|
||||||
|
QString m_cmdUsermod;
|
||||||
QString m_cmdSshdEnable;
|
QString m_cmdSshdEnable;
|
||||||
QString m_cmdSshdDisable;
|
QString m_cmdSshdDisable;
|
||||||
QString m_cmdSshdUseradd;
|
QString m_cmdSshdUseradd;
|
||||||
@@ -181,6 +193,7 @@ signals:
|
|||||||
|
|
||||||
/* default user */
|
/* default user */
|
||||||
void userPasswordChanged( QString userPassword );
|
void userPasswordChanged( QString userPassword );
|
||||||
|
void usernameChanged( QString username );
|
||||||
|
|
||||||
/* ssh server + credentials */
|
/* ssh server + credentials */
|
||||||
void sshdUsernameChanged( QString sshdUsername );
|
void sshdUsernameChanged( QString sshdUsername );
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "utils/CalamaresUtilsSystem.h"
|
#include "utils/System.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -75,7 +75,7 @@ Calamares::JobResult
|
|||||||
PartitionJob::exec()
|
PartitionJob::exec()
|
||||||
{
|
{
|
||||||
using namespace Calamares;
|
using namespace Calamares;
|
||||||
using namespace CalamaresUtils;
|
using namespace Calamares;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
const QString pathMount = "/mnt/install";
|
const QString pathMount = "/mnt/install";
|
||||||
@@ -118,7 +118,7 @@ PartitionJob::exec()
|
|||||||
const QString pathRoot = "/";
|
const QString pathRoot = "/";
|
||||||
|
|
||||||
ProcessResult res
|
ProcessResult res
|
||||||
= System::runCommand( System::RunLocation::RunInHost, args, pathRoot, stdInput, chrono::seconds( 120 ) );
|
= System::runCommand( System::RunLocation::RunInHost, args, pathRoot, stdInput, chrono::seconds( 600 ) );
|
||||||
if ( res.getExitCode() )
|
if ( res.getExitCode() )
|
||||||
{
|
{
|
||||||
return JobResult::error( "Command failed:<br><br>"
|
return JobResult::error( "Command failed:<br><br>"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include "GlobalStorage.h"
|
#include "GlobalStorage.h"
|
||||||
#include "JobQueue.h"
|
#include "JobQueue.h"
|
||||||
#include "Settings.h"
|
#include "Settings.h"
|
||||||
#include "utils/CalamaresUtilsSystem.h"
|
#include "utils/System.h"
|
||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
|
|
||||||
UsersJob::UsersJob( bool featureSshd,
|
UsersJob::UsersJob( bool featureSshd,
|
||||||
const QString& cmdPasswd,
|
const QString& cmdPasswd,
|
||||||
|
const QString& cmdUsermod,
|
||||||
const QString& cmdSshd,
|
const QString& cmdSshd,
|
||||||
const QString& cmdSshdUseradd,
|
const QString& cmdSshdUseradd,
|
||||||
bool isSshEnabled,
|
bool isSshEnabled,
|
||||||
@@ -24,6 +25,7 @@ UsersJob::UsersJob( bool featureSshd,
|
|||||||
: Calamares::Job()
|
: Calamares::Job()
|
||||||
, m_featureSshd( featureSshd )
|
, m_featureSshd( featureSshd )
|
||||||
, m_cmdPasswd( cmdPasswd )
|
, m_cmdPasswd( cmdPasswd )
|
||||||
|
, m_cmdUsermod( cmdUsermod )
|
||||||
, m_cmdSshd( cmdSshd )
|
, m_cmdSshd( cmdSshd )
|
||||||
, m_cmdSshdUseradd( cmdSshdUseradd )
|
, m_cmdSshdUseradd( cmdSshdUseradd )
|
||||||
, m_isSshEnabled( isSshEnabled )
|
, m_isSshEnabled( isSshEnabled )
|
||||||
@@ -45,13 +47,15 @@ Calamares::JobResult
|
|||||||
UsersJob::exec()
|
UsersJob::exec()
|
||||||
{
|
{
|
||||||
using namespace Calamares;
|
using namespace Calamares;
|
||||||
using namespace CalamaresUtils;
|
using namespace Calamares;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
QList< QPair< QStringList, QString > > commands = {
|
QList< QPair< QStringList, QString > > commands = {
|
||||||
{ { "sh", "-c", m_cmdPasswd + " " + m_username }, m_password + "\n" + m_password + "\n" },
|
{ { "sh", "-c", m_cmdUsermod }, m_username + "\n" }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
commands.append( { { "sh", "-c", m_cmdPasswd + " " + m_username }, m_password + "\n" + m_password + "\n" } );
|
||||||
|
|
||||||
if ( m_featureSshd )
|
if ( m_featureSshd )
|
||||||
{
|
{
|
||||||
commands.append( { { "sh", "-c", m_cmdSshd }, QString() } );
|
commands.append( { { "sh", "-c", m_cmdSshd }, QString() } );
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class UsersJob : public Calamares::Job
|
|||||||
public:
|
public:
|
||||||
UsersJob( bool featureSshd,
|
UsersJob( bool featureSshd,
|
||||||
const QString& cmdPasswd,
|
const QString& cmdPasswd,
|
||||||
|
const QString& cmdUsermod,
|
||||||
const QString& cmdSshd,
|
const QString& cmdSshd,
|
||||||
const QString& cmdSshdUseradd,
|
const QString& cmdSshdUseradd,
|
||||||
bool isSshEnabled,
|
bool isSshEnabled,
|
||||||
@@ -26,6 +27,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
bool m_featureSshd;
|
bool m_featureSshd;
|
||||||
QString m_cmdPasswd;
|
QString m_cmdPasswd;
|
||||||
|
QString m_cmdUsermod;
|
||||||
QString m_cmdSshd;
|
QString m_cmdSshd;
|
||||||
QString m_cmdSshdUseradd;
|
QString m_cmdSshdUseradd;
|
||||||
bool m_isSshEnabled;
|
bool m_isSshEnabled;
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Item {
|
|||||||
id: mainText
|
id: mainText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 30
|
anchors.topMargin: 10
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
text: "To protect your data in case your device gets stolen," +
|
text: "To protect your data in case your device gets stolen," +
|
||||||
@@ -33,15 +33,15 @@ Item {
|
|||||||
" boot your device or access any data on it. Make sure that" +
|
" boot your device or access any data on it. Make sure that" +
|
||||||
" you don't lose this password!"
|
" you don't lose this password!"
|
||||||
|
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: firstButton
|
id: firstButton
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: mainText.bottom
|
anchors.top: mainText.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Enable")
|
text: qsTr("Enable")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@@ -53,8 +53,8 @@ Item {
|
|||||||
Button {
|
Button {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: firstButton.bottom
|
anchors.top: firstButton.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Disable")
|
text: qsTr("Disable")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ Item {
|
|||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 50
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
@@ -49,8 +49,8 @@ Item {
|
|||||||
text: config.fdePassword
|
text: config.fdePassword
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
@@ -59,15 +59,15 @@ Item {
|
|||||||
visible: false
|
visible: false
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: errorText.bottom
|
anchors.top: errorText.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Continue")
|
text: qsTr("Continue")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -22,21 +22,21 @@ Item {
|
|||||||
id: mainText
|
id: mainText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 30
|
anchors.topMargin: 10
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
text: "Select the filesystem for root partition. If unsure, leave the default."
|
text: "Select the filesystem for root partition. If unsure, leave the default."
|
||||||
|
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
ComboBox {
|
ComboBox {
|
||||||
id: fsTypeCB
|
id: fsTypeCB
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: mainText.bottom
|
anchors.top: mainText.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 150
|
||||||
height: 60
|
height: 30
|
||||||
editable: false
|
editable: false
|
||||||
model: config.fsList
|
model: config.fsList
|
||||||
/* Save the current state on selection so it is there when the back button is pressed */
|
/* Save the current state on selection so it is there when the back button is pressed */
|
||||||
@@ -47,8 +47,8 @@ Item {
|
|||||||
Button {
|
Button {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: fsTypeCB.bottom
|
anchors.top: fsTypeCB.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Continue")
|
text: qsTr("Continue")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -22,13 +22,13 @@ Item {
|
|||||||
id: mainText
|
id: mainText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 30
|
anchors.topMargin: 10
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
text: (function() {
|
text: (function() {
|
||||||
var ret = "Once you hit 'install', the installation will begin." +
|
var ret = "Once you hit 'install', the installation will begin." +
|
||||||
" It will typically take a few minutes. Do not power off the" +
|
" It will typically take a few minutes. Do not power off the" +
|
||||||
" device until it is done.<br><br>";
|
" device until it is done.<br>";
|
||||||
|
|
||||||
if (config.installFromExternalToInternal) {
|
if (config.installFromExternalToInternal) {
|
||||||
ret += "<b>After the installation, your device will shutdown" +
|
ret += "<b>After the installation, your device will shutdown" +
|
||||||
@@ -44,15 +44,15 @@ Item {
|
|||||||
return ret;
|
return ret;
|
||||||
}())
|
}())
|
||||||
|
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: firstButton
|
id: firstButton
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: mainText.bottom
|
anchors.top: mainText.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Install")
|
text: qsTr("Install")
|
||||||
onClicked: navFinish()
|
onClicked: navFinish()
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ Item {
|
|||||||
id: mainText
|
id: mainText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 30
|
anchors.topMargin: 10
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
text: "The installation was started from an external storage medium." +
|
text: "The installation was started from an external storage medium." +
|
||||||
@@ -32,15 +32,15 @@ Item {
|
|||||||
"<br>" +
|
"<br>" +
|
||||||
"Where would you like to install " + config.osName + "?"
|
"Where would you like to install " + config.osName + "?"
|
||||||
|
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: firstButton
|
id: firstButton
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: mainText.bottom
|
anchors.top: mainText.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Internal (eMMC)")
|
text: qsTr("Internal (eMMC)")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@@ -52,8 +52,8 @@ Item {
|
|||||||
Button {
|
Button {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: firstButton.bottom
|
anchors.top: firstButton.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("External (SD card)")
|
text: qsTr("External (SD card)")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -22,21 +22,21 @@ Item {
|
|||||||
id: mainText
|
id: mainText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 30
|
anchors.topMargin: 10
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
text: "Are you sure that you want to overwrite the internal storage?" +
|
text: "Are you sure that you want to overwrite the internal storage?" +
|
||||||
"<br><br>" +
|
"<br><br>" +
|
||||||
"<b>All existing data on the device will be lost!</b>"
|
"<b>All existing data on the device will be lost!</b>"
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
id: firstButton
|
id: firstButton
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: mainText.bottom
|
anchors.top: mainText.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Yes")
|
text: qsTr("Yes")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@@ -47,8 +47,8 @@ Item {
|
|||||||
Button {
|
Button {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: firstButton.bottom
|
anchors.top: firstButton.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("No")
|
text: qsTr("No")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -26,8 +26,45 @@ bogus: true
|
|||||||
# version: "(unknown)"
|
# version: "(unknown)"
|
||||||
|
|
||||||
## Default username (for which the password will be set)
|
## Default username (for which the password will be set)
|
||||||
|
## Ensure also cmdUsermod command matches the default user, so it can be changed if desired.
|
||||||
# username: "user"
|
# username: "user"
|
||||||
|
|
||||||
|
## reserved usernames (for user_pass username prompt and ssh_credentials)
|
||||||
|
# reservedUsernames:
|
||||||
|
# - adm
|
||||||
|
# - at
|
||||||
|
# - bin
|
||||||
|
# - colord
|
||||||
|
# - cron
|
||||||
|
# - cyrus
|
||||||
|
# - daemon
|
||||||
|
# - ftp
|
||||||
|
# - games
|
||||||
|
# - geoclue
|
||||||
|
# - guest
|
||||||
|
# - halt
|
||||||
|
# - lightdm
|
||||||
|
# - lp
|
||||||
|
# - mail
|
||||||
|
# - man
|
||||||
|
# - messagebus
|
||||||
|
# - news
|
||||||
|
# - nobody
|
||||||
|
# - ntp
|
||||||
|
# - operator
|
||||||
|
# - polkitd
|
||||||
|
# - postmaster
|
||||||
|
# - pulse
|
||||||
|
# - root
|
||||||
|
# - shutdown
|
||||||
|
# - smmsp
|
||||||
|
# - squid
|
||||||
|
# - sshd
|
||||||
|
# - sync
|
||||||
|
# - uucp
|
||||||
|
# - vpopmail
|
||||||
|
# - xfs
|
||||||
|
|
||||||
#######
|
#######
|
||||||
### Target device information
|
### Target device information
|
||||||
#######
|
#######
|
||||||
@@ -118,6 +155,10 @@ bogus: true
|
|||||||
### Commands running in the target OS (chroot)
|
### Commands running in the target OS (chroot)
|
||||||
#######
|
#######
|
||||||
|
|
||||||
|
## Change the username for the default user
|
||||||
|
## Stdin: username with \n
|
||||||
|
# cmdUsermod: "xargs -I{} -n1 usermod -m -d /home/{} -l {} -c {} user"
|
||||||
|
|
||||||
## Set the password for default user and sshd user
|
## Set the password for default user and sshd user
|
||||||
## Arguments: <username>
|
## Arguments: <username>
|
||||||
## Stdin: password twice, each time with \n
|
## Stdin: password twice, each time with \n
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ Page
|
|||||||
Rectangle {
|
Rectangle {
|
||||||
id: mobileNavigation
|
id: mobileNavigation
|
||||||
width: parent.width
|
width: parent.width
|
||||||
height: 60
|
height: 30
|
||||||
color: "#e6e4e1"
|
color: "#e6e4e1"
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
@@ -98,8 +98,8 @@ Page
|
|||||||
text: "<"
|
text: "<"
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
implicitWidth: 32
|
implicitWidth: 10
|
||||||
implicitHeight: 30
|
implicitHeight: 7
|
||||||
border.color: "#c1bab5"
|
border.color: "#c1bab5"
|
||||||
border.width: 1
|
border.width: 1
|
||||||
radius: 4
|
radius: 4
|
||||||
@@ -109,7 +109,7 @@ Page
|
|||||||
onClicked: navBack()
|
onClicked: navBack()
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
implicitHeight: 30
|
implicitHeight: 10
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
color: "#e6e4e1"
|
color: "#e6e4e1"
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ Page
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Input validation: user-screens (user_pass, ssh_credentials) */
|
/* Input validation: user-screens (fde_pass, user_pass, ssh_credentials) */
|
||||||
function validatePin(userPin, userPinRepeat, errorText) {
|
function validatePin(userPin, userPinRepeat, errorText) {
|
||||||
var pin = userPin.text;
|
var pin = userPin.text;
|
||||||
var repeat = userPinRepeat.text;
|
var repeat = userPinRepeat.text;
|
||||||
@@ -278,47 +278,12 @@ Page
|
|||||||
|
|
||||||
return validationFailureClear(errorText);
|
return validationFailureClear(errorText);
|
||||||
}
|
}
|
||||||
function validateSshdUsername(username, errorText) {
|
function validateUsername(username, errorText, extraReservedUsernames = []) {
|
||||||
var name = username.text;
|
var name = username.text;
|
||||||
var reserved = [ /* FIXME: make configurable */
|
var reserved = config.reservedUsernames.concat(extraReservedUsernames);
|
||||||
config.username,
|
|
||||||
"adm",
|
|
||||||
"at ",
|
|
||||||
"bin",
|
|
||||||
"colord",
|
|
||||||
"cron",
|
|
||||||
"cyrus",
|
|
||||||
"daemon",
|
|
||||||
"ftp",
|
|
||||||
"games",
|
|
||||||
"geoclue",
|
|
||||||
"guest",
|
|
||||||
"halt",
|
|
||||||
"lightdm",
|
|
||||||
"lp",
|
|
||||||
"mail",
|
|
||||||
"man",
|
|
||||||
"messagebus",
|
|
||||||
"news",
|
|
||||||
"nobody",
|
|
||||||
"ntp",
|
|
||||||
"operator",
|
|
||||||
"polkitd",
|
|
||||||
"postmaster",
|
|
||||||
"pulse",
|
|
||||||
"root",
|
|
||||||
"shutdown",
|
|
||||||
"smmsp",
|
|
||||||
"squid",
|
|
||||||
"sshd",
|
|
||||||
"sync",
|
|
||||||
"uucp",
|
|
||||||
"vpopmail",
|
|
||||||
"xfs",
|
|
||||||
]
|
|
||||||
|
|
||||||
/* Validate characters */
|
/* Validate characters */
|
||||||
for (var i=0; i<name.length; i++) {
|
for (var i = 0; i < name.length; i++) {
|
||||||
if (i) {
|
if (i) {
|
||||||
if (!name[i].match(/^[a-z0-9_-]$/))
|
if (!name[i].match(/^[a-z0-9_-]$/))
|
||||||
return validationFailure(errorText,
|
return validationFailure(errorText,
|
||||||
@@ -335,16 +300,20 @@ Page
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Validate against reserved usernames */
|
/* Validate against reserved usernames */
|
||||||
for (var i=0;i<reserved.length;i++) {
|
for (var i = 0; i < reserved.length; i++) {
|
||||||
if (name == reserved[i])
|
if (name == reserved[i])
|
||||||
return validationFailure(errorText, "Username '" +
|
return validationFailure(errorText, "Username '" +
|
||||||
reserved[i] +
|
reserved[i] +
|
||||||
"' is reserved.")
|
"' is reserved.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Passed */
|
/* Passed */
|
||||||
return validationFailureClear(errorText);
|
return validationFailureClear(errorText);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function validateSshdUsername(username, errorText) {
|
||||||
|
return validateUsername(username, errorText, [config.username]);
|
||||||
|
}
|
||||||
function validateSshdPassword(password, passwordRepeat, errorText) {
|
function validateSshdPassword(password, passwordRepeat, errorText) {
|
||||||
var pass = password.text;
|
var pass = password.text;
|
||||||
var repeat = passwordRepeat.text;
|
var repeat = passwordRepeat.text;
|
||||||
@@ -352,10 +321,10 @@ Page
|
|||||||
if (pass == "")
|
if (pass == "")
|
||||||
return validationFailure(errorText);
|
return validationFailure(errorText);
|
||||||
|
|
||||||
if (pass.length < 8)
|
if (pass.length < 6)
|
||||||
return validationFailure(errorText,
|
return validationFailure(errorText,
|
||||||
"Too short: needs at least 8" +
|
"Too short: needs at least 6" +
|
||||||
" characters.");
|
" digits/characters.");
|
||||||
|
|
||||||
if (repeat == "")
|
if (repeat == "")
|
||||||
return validationFailure(errorText);
|
return validationFailure(errorText);
|
||||||
@@ -365,8 +334,6 @@ Page
|
|||||||
|
|
||||||
return validationFailureClear(errorText);
|
return validationFailureClear(errorText);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Input validation: fde_pass */
|
|
||||||
function check_chars(input) {
|
function check_chars(input) {
|
||||||
for (var i = 0; i < input.length; i++) {
|
for (var i = 0; i < input.length; i++) {
|
||||||
if (allowed_chars.indexOf(input[i]) == -1)
|
if (allowed_chars.indexOf(input[i]) == -1)
|
||||||
@@ -407,10 +374,10 @@ Page
|
|||||||
"\n" +
|
"\n" +
|
||||||
allowed_chars_multiline());
|
allowed_chars_multiline());
|
||||||
|
|
||||||
if (pass.length < 8)
|
if (pass.length < 6)
|
||||||
return validationFailure(errorText,
|
return validationFailure(errorText,
|
||||||
"Too short: needs at least 8" +
|
"Too short: needs at least 6" +
|
||||||
" characters.");
|
" digits/characters.");
|
||||||
|
|
||||||
if (repeat == "")
|
if (repeat == "")
|
||||||
return validationFailure(errorText);
|
return validationFailure(errorText);
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
<file>install_target.qml</file> <!-- install from external to internal? -->
|
<file>install_target.qml</file> <!-- install from external to internal? -->
|
||||||
<file>install_target_confirm.qml</file> <!-- overwrite internal storage? -->
|
<file>install_target_confirm.qml</file> <!-- overwrite internal storage? -->
|
||||||
|
|
||||||
<file>user_pass.qml</file> <!-- default user: password -->
|
<file>user_pass.qml</file> <!-- default user: username, password -->
|
||||||
<file>ssh_confirm.qml</file> <!-- sshd: enable or not? -->
|
<file>ssh_confirm.qml</file> <!-- sshd: enable or not? -->
|
||||||
<file>ssh_credentials.qml</file> <!-- sshd user: username, password -->
|
<file>ssh_credentials.qml</file> <!-- sshd user: username, password -->
|
||||||
<file>fs_selection.qml</file> <!-- filesystem selection -->
|
<file>fs_selection.qml</file> <!-- filesystem selection -->
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ Item {
|
|||||||
"More information:<br>" +
|
"More information:<br>" +
|
||||||
"https://postmarketos.org/ssh"
|
"https://postmarketos.org/ssh"
|
||||||
|
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
@@ -44,7 +44,7 @@ Item {
|
|||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: mainText.bottom
|
anchors.top: mainText.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 40
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Enable")
|
text: qsTr("Enable")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
@@ -57,7 +57,7 @@ Item {
|
|||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: firstButton.bottom
|
anchors.top: firstButton.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 40
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Disable")
|
text: qsTr("Disable")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ Item {
|
|||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 50
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
@@ -45,7 +45,7 @@ Item {
|
|||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 50
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
@@ -59,7 +59,7 @@ Item {
|
|||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 50
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
@@ -73,7 +73,7 @@ Item {
|
|||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 50
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
@@ -84,13 +84,13 @@ Item {
|
|||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 50
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
Button {
|
Button {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: errorTextPassword.bottom
|
anchors.top: errorTextPassword.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 40
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Continue")
|
text: qsTr("Continue")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|||||||
@@ -12,16 +12,18 @@ import QtQuick.Window 2.3
|
|||||||
import QtQuick.VirtualKeyboard 2.1
|
import QtQuick.VirtualKeyboard 2.1
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property var placeholder: (config.userPasswordNumeric
|
property var passPlaceholder: (config.userPasswordNumeric
|
||||||
? "PIN"
|
? "PIN"
|
||||||
: "Password")
|
: "Password")
|
||||||
property var hints: (config.userPasswordNumeric
|
property var hints: (config.userPasswordNumeric
|
||||||
? Qt.ImhDigitsOnly
|
? Qt.ImhDigitsOnly
|
||||||
: Qt.ImhPreferLowercase)
|
: Qt.ImhPreferLowercase)
|
||||||
property var validateFunc: (config.userPasswordNumeric
|
property var validatePassFunc: (config.userPasswordNumeric
|
||||||
? validatePin
|
? validatePin
|
||||||
: validatePassword);
|
: validatePassword);
|
||||||
|
|
||||||
|
property var validateNameFunc: validateUsername;
|
||||||
|
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
@@ -30,10 +32,36 @@ Item {
|
|||||||
height: parent.height
|
height: parent.height
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: description
|
id: usernameDescription
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 30
|
anchors.topMargin: 10
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
|
text: (function() {
|
||||||
|
return "Set the username of your user. The default" +
|
||||||
|
" username is \"" + config.username + "\".";
|
||||||
|
}())
|
||||||
|
|
||||||
|
width: 200
|
||||||
|
}
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: username
|
||||||
|
anchors.top: usernameDescription.bottom
|
||||||
|
placeholderText: qsTr("Username")
|
||||||
|
onTextChanged: validateNameFunc(username, errorText)
|
||||||
|
text: config.username
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.topMargin: 10
|
||||||
|
width: 200
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
id: userPassDescription
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.top: username.bottom
|
||||||
|
anchors.topMargin: 10
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
text: (function() {
|
text: (function() {
|
||||||
@@ -48,15 +76,15 @@ Item {
|
|||||||
}
|
}
|
||||||
}())
|
}())
|
||||||
|
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id: userPass
|
id: userPass
|
||||||
anchors.top: description.bottom
|
anchors.top: userPassDescription.bottom
|
||||||
placeholderText: qsTr(placeholder)
|
placeholderText: qsTr(passPlaceholder)
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
onTextChanged: validateFunc(userPass, userPassRepeat, errorText)
|
onTextChanged: validatePassFunc(userPass, userPassRepeat, errorText)
|
||||||
text: config.userPassword
|
text: config.userPassword
|
||||||
|
|
||||||
/* Let the virtual keyboard change to digits only */
|
/* Let the virtual keyboard change to digits only */
|
||||||
@@ -68,22 +96,22 @@ Item {
|
|||||||
}
|
}
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id: userPassRepeat
|
id: userPassRepeat
|
||||||
anchors.top: userPass.bottom
|
anchors.top: userPass.bottom
|
||||||
placeholderText: qsTr(placeholder + " (repeat)")
|
placeholderText: qsTr(passPlaceholder + " (repeat)")
|
||||||
inputMethodHints: hints
|
inputMethodHints: hints
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
onTextChanged: validateFunc(userPass, userPassRepeat, errorText)
|
onTextChanged: validatePassFunc(userPass, userPassRepeat, errorText)
|
||||||
text: config.userPassword
|
text: config.userPassword
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
@@ -93,20 +121,21 @@ Item {
|
|||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: errorText.bottom
|
anchors.top: errorText.bottom
|
||||||
anchors.topMargin: 40
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Continue")
|
text: qsTr("Continue")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (validateFunc(userPass, userPassRepeat, errorText)) {
|
if (validatePassFunc(userPass, userPassRepeat, errorText) && validateNameFunc(username, errorText)) {
|
||||||
config.userPassword = userPass.text;
|
config.userPassword = userPass.text;
|
||||||
|
config.username = username.text;
|
||||||
navNext();
|
navNext();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ Page
|
|||||||
id: logo
|
id: logo
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 10
|
||||||
height: 250
|
height: 50
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
source: "file:///usr/share/calamares/branding/default-mobile/logo.png"
|
source: "file:///usr/share/calamares/branding/default-mobile/logo.png"
|
||||||
}
|
}
|
||||||
@@ -35,11 +35,11 @@ Page
|
|||||||
id: waitText
|
id: waitText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: logo.bottom
|
anchors.top: logo.bottom
|
||||||
anchors.topMargin: 150
|
anchors.topMargin: 50
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
text: "Formatting and mounting target partition. This may" +
|
text: "Formatting and mounting target partition. This may" +
|
||||||
" take up to two minutes, please be patient."
|
" take up to ten minutes, please be patient."
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,8 +28,8 @@ Page
|
|||||||
id: logo
|
id: logo
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 10
|
||||||
height: 250
|
height: 50
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
source: "file:///usr/share/calamares/branding/default-mobile/logo.png"
|
source: "file:///usr/share/calamares/branding/default-mobile/logo.png"
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ Page
|
|||||||
id: mainText
|
id: mainText
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: logo.bottom
|
anchors.top: logo.bottom
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 10
|
||||||
horizontalAlignment: Text.AlignRight
|
horizontalAlignment: Text.AlignRight
|
||||||
text: "You are about to install<br>" +
|
text: "You are about to install<br>" +
|
||||||
"<b>" + config.osName +
|
"<b>" + config.osName +
|
||||||
@@ -46,16 +46,16 @@ Page
|
|||||||
"<b>" + config.userInterface + "</b><br>" +
|
"<b>" + config.userInterface + "</b><br>" +
|
||||||
"architecture " +
|
"architecture " +
|
||||||
"<b>" + config.arch + "</b><br>" +
|
"<b>" + config.arch + "</b><br>" +
|
||||||
"on your " +
|
"on your <br>" +
|
||||||
"<b>" + config.device + "</b><br>"
|
"<b>" + config.device + "</b><br>"
|
||||||
width: 500
|
width: 200
|
||||||
}
|
}
|
||||||
|
|
||||||
Button {
|
Button {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
anchors.top: mainText.bottom
|
anchors.top: mainText.bottom
|
||||||
anchors.topMargin: 50
|
anchors.topMargin: 10
|
||||||
width: 500
|
width: 200
|
||||||
|
|
||||||
text: qsTr("Continue")
|
text: qsTr("Continue")
|
||||||
onClicked: navNext()
|
onClicked: navNext()
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
# SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
|
|
||||||
calamares_add_plugin( unpackfsc
|
|
||||||
TYPE job
|
|
||||||
EXPORT_MACRO PLUGINDLLEXPORT_PRO
|
|
||||||
SOURCES
|
|
||||||
UnpackFSCJob.cpp
|
|
||||||
# The workers for differently-packed filesystems
|
|
||||||
Runners.cpp
|
|
||||||
FSArchiverRunner.cpp
|
|
||||||
UnsquashRunner.cpp
|
|
||||||
SHARED_LIB
|
|
||||||
)
|
|
||||||
@@ -1,74 +0,0 @@
|
|||||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
||||||
*
|
|
||||||
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*
|
|
||||||
* Calamares is Free Software: see the License-Identifier above.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "FSArchiverRunner.h"
|
|
||||||
|
|
||||||
#include <utils/Logger.h>
|
|
||||||
#include <utils/Runner.h>
|
|
||||||
|
|
||||||
#include <QProcess>
|
|
||||||
|
|
||||||
static constexpr const int chunk_size = 137;
|
|
||||||
|
|
||||||
Calamares::JobResult
|
|
||||||
FSArchiverRunner::run()
|
|
||||||
{
|
|
||||||
const QString toolName = QStringLiteral( "fsarchiver" );
|
|
||||||
|
|
||||||
if ( !checkSourceExists() )
|
|
||||||
{
|
|
||||||
return Calamares::JobResult::internalError(
|
|
||||||
tr( "Invalid fsarchiver configuration" ),
|
|
||||||
tr( "The source archive <i>%1</i> does not exist." ).arg( m_source ),
|
|
||||||
Calamares::JobResult::InvalidConfiguration );
|
|
||||||
}
|
|
||||||
|
|
||||||
QString fsarchiverExecutable;
|
|
||||||
if ( !checkToolExists( toolName, fsarchiverExecutable ) )
|
|
||||||
{
|
|
||||||
return Calamares::JobResult::internalError(
|
|
||||||
tr( "Missing tools" ),
|
|
||||||
tr( "The <i>%1</i> tool is not installed on the system." ).arg( toolName ),
|
|
||||||
Calamares::JobResult::MissingRequirements );
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination );
|
|
||||||
if ( destinationPath.isEmpty() )
|
|
||||||
{
|
|
||||||
return Calamares::JobResult::internalError(
|
|
||||||
tr( "Invalid fsarchiver configuration" ),
|
|
||||||
tr( "No destination could be found for <i>%1</i>." ).arg( m_destination ),
|
|
||||||
Calamares::JobResult::InvalidConfiguration );
|
|
||||||
}
|
|
||||||
|
|
||||||
Calamares::Utils::Runner r( { fsarchiverExecutable,
|
|
||||||
QStringLiteral( "-v" ),
|
|
||||||
QStringLiteral( "restdir" ),
|
|
||||||
m_source,
|
|
||||||
destinationPath } );
|
|
||||||
r.setLocation( Calamares::Utils::RunLocation::RunInHost ).enableOutputProcessing();
|
|
||||||
connect( &r, &decltype( r )::output, this, &FSArchiverRunner::fsarchiverProgress );
|
|
||||||
return r.run().explainProcess( toolName, std::chrono::seconds( 0 ) );
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
FSArchiverRunner::fsarchiverProgress( QString line )
|
|
||||||
{
|
|
||||||
m_since++;
|
|
||||||
// Typical line of output is this:
|
|
||||||
// -[00][ 99%][REGFILEM] /boot/thing
|
|
||||||
// 5 9 ^21
|
|
||||||
if (m_since >= chunk_size && line.length() > 21 && line[5] == '[' && line[9] == '%')
|
|
||||||
{
|
|
||||||
m_since = 0;
|
|
||||||
double p = double(line.mid(6,3).toInt()) / 100.0;
|
|
||||||
const QString filename = line.mid(22);
|
|
||||||
Q_EMIT progress(p, filename);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
||||||
*
|
|
||||||
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*
|
|
||||||
* Calamares is Free Software: see the License-Identifier above.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef UNPACKFSC_FSARCHIVERRUNNER_H
|
|
||||||
#define UNPACKFSC_FSARCHIVERRUNNER_H
|
|
||||||
|
|
||||||
#include "Runners.h"
|
|
||||||
|
|
||||||
class FSArchiverRunner : public Runner
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
using Runner::Runner;
|
|
||||||
|
|
||||||
Calamares::JobResult run() override;
|
|
||||||
|
|
||||||
protected Q_SLOTS:
|
|
||||||
void fsarchiverProgress( QString line );
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_since = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
||||||
*
|
|
||||||
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*
|
|
||||||
* Calamares is Free Software: see the License-Identifier above.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "Runners.h"
|
|
||||||
|
|
||||||
#include <utils/CalamaresUtilsSystem.h>
|
|
||||||
#include <utils/Logger.h>
|
|
||||||
|
|
||||||
#include <QFileInfo>
|
|
||||||
#include <QStandardPaths>
|
|
||||||
|
|
||||||
Runner::Runner( const QString& source, const QString& destination )
|
|
||||||
: m_source( source )
|
|
||||||
, m_destination( destination )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Runner::~Runner() {}
|
|
||||||
|
|
||||||
bool
|
|
||||||
Runner::checkSourceExists() const
|
|
||||||
{
|
|
||||||
QFileInfo fi( m_source );
|
|
||||||
return fi.exists() && fi.isReadable();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool
|
|
||||||
Runner::checkToolExists( const QString& toolName, QString& fullPath )
|
|
||||||
{
|
|
||||||
fullPath = QStandardPaths::findExecutable( toolName );
|
|
||||||
return !fullPath.isEmpty();
|
|
||||||
}
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
||||||
*
|
|
||||||
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*
|
|
||||||
* Calamares is Free Software: see the License-Identifier above.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef UNPACKFSC_RUNNERS_H
|
|
||||||
#define UNPACKFSC_RUNNERS_H
|
|
||||||
|
|
||||||
#include <Job.h>
|
|
||||||
|
|
||||||
class Runner : public QObject
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
Runner( const QString& source, const QString& destination );
|
|
||||||
~Runner() override;
|
|
||||||
|
|
||||||
virtual Calamares::JobResult run() = 0;
|
|
||||||
|
|
||||||
/** @brief Check that the (configured) source file exists.
|
|
||||||
*
|
|
||||||
* Returns @c true if it's a file and readable.
|
|
||||||
*/
|
|
||||||
bool checkSourceExists() const;
|
|
||||||
|
|
||||||
/** @brief Check that a named tool (executable) exists in the search path.
|
|
||||||
*
|
|
||||||
* Returns @c true if the tool is found and sets @p fullPath
|
|
||||||
* to the full path of that tool; returns @c false and clears
|
|
||||||
* @p fullPath otherwise.
|
|
||||||
*/
|
|
||||||
static bool checkToolExists( const QString& toolName, QString& fullPath );
|
|
||||||
|
|
||||||
Q_SIGNALS:
|
|
||||||
// See Calamares Job::progress
|
|
||||||
void progress( qreal percent, const QString& message );
|
|
||||||
|
|
||||||
protected:
|
|
||||||
QString m_source;
|
|
||||||
QString m_destination;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,116 +0,0 @@
|
|||||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
||||||
*
|
|
||||||
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*
|
|
||||||
* Calamares is Free Software: see the License-Identifier above.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "UnpackFSCJob.h"
|
|
||||||
|
|
||||||
#include "FSArchiverRunner.h"
|
|
||||||
#include "UnsquashRunner.h"
|
|
||||||
|
|
||||||
#include <utils/Logger.h>
|
|
||||||
#include <utils/NamedEnum.h>
|
|
||||||
#include <utils/RAII.h>
|
|
||||||
#include <utils/Variant.h>
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
static const NamedEnumTable< UnpackFSCJob::Type >
|
|
||||||
typeNames()
|
|
||||||
{
|
|
||||||
using T = UnpackFSCJob::Type;
|
|
||||||
// clang-format off
|
|
||||||
static const NamedEnumTable< T > names
|
|
||||||
{
|
|
||||||
{ "none", T::None },
|
|
||||||
{ "fsarchiver", T::FSArchive },
|
|
||||||
{ "fsarchive", T::FSArchive },
|
|
||||||
{ "fsa", T::FSArchive },
|
|
||||||
{ "fsa-dir", T::FSArchive },
|
|
||||||
// TODO: support fsa-block, savefs/restfs format
|
|
||||||
{ "squashfs", T::Squashfs },
|
|
||||||
{ "squash", T::Squashfs },
|
|
||||||
{ "unsquash", T::Squashfs },
|
|
||||||
};
|
|
||||||
// clang-format on
|
|
||||||
return names;
|
|
||||||
}
|
|
||||||
|
|
||||||
UnpackFSCJob::UnpackFSCJob( QObject* parent )
|
|
||||||
: Calamares::CppJob( parent )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
UnpackFSCJob::~UnpackFSCJob() {}
|
|
||||||
|
|
||||||
QString
|
|
||||||
UnpackFSCJob::prettyName() const
|
|
||||||
{
|
|
||||||
return tr( "Unpack filesystems" );
|
|
||||||
}
|
|
||||||
|
|
||||||
QString
|
|
||||||
UnpackFSCJob::prettyStatusMessage() const
|
|
||||||
{
|
|
||||||
return m_progressMessage;
|
|
||||||
}
|
|
||||||
Calamares::JobResult
|
|
||||||
UnpackFSCJob::exec()
|
|
||||||
{
|
|
||||||
cScopedAssignment messageClearer( &m_progressMessage, QString() );
|
|
||||||
std::unique_ptr< Runner > r;
|
|
||||||
switch ( m_type )
|
|
||||||
{
|
|
||||||
case Type::FSArchive:
|
|
||||||
r = std::make_unique< FSArchiverRunner >( m_source, m_destination );
|
|
||||||
break;
|
|
||||||
case Type::Squashfs:
|
|
||||||
r = std::make_unique< UnsquashRunner >( m_source, m_destination );
|
|
||||||
break;
|
|
||||||
case Type::None:
|
|
||||||
default:
|
|
||||||
cDebug() << "Nothing to do.";
|
|
||||||
return Calamares::JobResult::ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
connect( r.get(), &Runner::progress, [=]( qreal percent, const QString& message ) {
|
|
||||||
m_progressMessage = message;
|
|
||||||
Q_EMIT progress( percent );
|
|
||||||
} );
|
|
||||||
return r->run();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
UnpackFSCJob::setConfigurationMap( const QVariantMap& map )
|
|
||||||
{
|
|
||||||
QString source = CalamaresUtils::getString( map, "source" );
|
|
||||||
QString sourceTypeName = CalamaresUtils::getString( map, "sourcefs" );
|
|
||||||
if ( source.isEmpty() || sourceTypeName.isEmpty() )
|
|
||||||
{
|
|
||||||
cWarning() << "Skipping item with bad source data:" << map;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
bool bogus = false;
|
|
||||||
Type sourceType = typeNames().find( sourceTypeName, bogus );
|
|
||||||
if ( sourceType == Type::None )
|
|
||||||
{
|
|
||||||
cWarning() << "Skipping item with source type None";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
QString destination = CalamaresUtils::getString( map, "destination" );
|
|
||||||
if ( destination.isEmpty() )
|
|
||||||
{
|
|
||||||
cWarning() << "Skipping item with empty destination";
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_source = source;
|
|
||||||
m_destination = destination;
|
|
||||||
m_type = sourceType;
|
|
||||||
}
|
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DEFINITION( UnpackFSCFactory, registerPlugin< UnpackFSCJob >(); )
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
||||||
*
|
|
||||||
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*
|
|
||||||
* Calamares is Free Software: see the License-Identifier above.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef UNPACKFSC_UNPACKFSCJOB_H
|
|
||||||
#define UNPACKFSC_UNPACKFSCJOB_H
|
|
||||||
|
|
||||||
#include <CppJob.h>
|
|
||||||
#include <DllMacro.h>
|
|
||||||
#include <utils/PluginFactory.h>
|
|
||||||
|
|
||||||
class PLUGINDLLEXPORT UnpackFSCJob : public Calamares::CppJob
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
enum class Type
|
|
||||||
{
|
|
||||||
None, /// << Invalid
|
|
||||||
FSArchive,
|
|
||||||
Squashfs,
|
|
||||||
};
|
|
||||||
|
|
||||||
explicit UnpackFSCJob( QObject* parent = nullptr );
|
|
||||||
~UnpackFSCJob() override;
|
|
||||||
|
|
||||||
QString prettyName() const override;
|
|
||||||
QString prettyStatusMessage() const override;
|
|
||||||
|
|
||||||
Calamares::JobResult exec() override;
|
|
||||||
|
|
||||||
void setConfigurationMap( const QVariantMap& configurationMap ) override;
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString m_source;
|
|
||||||
QString m_destination;
|
|
||||||
Type m_type = Type::None;
|
|
||||||
QString m_progressMessage;
|
|
||||||
};
|
|
||||||
|
|
||||||
CALAMARES_PLUGIN_FACTORY_DECLARATION( UnpackFSCFactory )
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,98 +0,0 @@
|
|||||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
||||||
*
|
|
||||||
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*
|
|
||||||
* Calamares is Free Software: see the License-Identifier above.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "UnsquashRunner.h"
|
|
||||||
|
|
||||||
#include <utils/Logger.h>
|
|
||||||
#include <utils/Runner.h>
|
|
||||||
#include <utils/String.h>
|
|
||||||
|
|
||||||
#include <QString>
|
|
||||||
|
|
||||||
static constexpr const int chunk_size = 107;
|
|
||||||
|
|
||||||
Calamares::JobResult
|
|
||||||
UnsquashRunner::run()
|
|
||||||
{
|
|
||||||
if ( !checkSourceExists() )
|
|
||||||
{
|
|
||||||
return Calamares::JobResult::internalError(
|
|
||||||
tr( "Invalid unsquash configuration" ),
|
|
||||||
tr( "The source archive <i>%1</i> does not exist." ).arg( m_source ),
|
|
||||||
Calamares::JobResult::InvalidConfiguration );
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString toolName = QStringLiteral( "unsquashfs" );
|
|
||||||
QString unsquashExecutable;
|
|
||||||
if ( !checkToolExists( toolName, unsquashExecutable ) )
|
|
||||||
{
|
|
||||||
return Calamares::JobResult::internalError(
|
|
||||||
tr( "Missing tools" ),
|
|
||||||
tr( "The <i>%1</i> tool is not installed on the system." ).arg( toolName ),
|
|
||||||
Calamares::JobResult::MissingRequirements );
|
|
||||||
}
|
|
||||||
|
|
||||||
const QString destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination );
|
|
||||||
if ( destinationPath.isEmpty() )
|
|
||||||
{
|
|
||||||
return Calamares::JobResult::internalError(
|
|
||||||
tr( "Invalid unsquash configuration" ),
|
|
||||||
tr( "No destination could be found for <i>%1</i>." ).arg( m_destination ),
|
|
||||||
Calamares::JobResult::InvalidConfiguration );
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get the stats (number of inodes) from the FS
|
|
||||||
{
|
|
||||||
m_inodes = -1;
|
|
||||||
Calamares::Utils::Runner r( { unsquashExecutable, QStringLiteral( "-s" ), m_source } );
|
|
||||||
r.setLocation( Calamares::Utils::RunLocation::RunInHost ).enableOutputProcessing();
|
|
||||||
QObject::connect( &r, &decltype( r )::output, [&]( QString line ) {
|
|
||||||
if ( line.startsWith( "Number of inodes " ) )
|
|
||||||
{
|
|
||||||
m_inodes = line.split( ' ', SplitSkipEmptyParts ).last().toInt();
|
|
||||||
}
|
|
||||||
} );
|
|
||||||
/* ignored */ r.run();
|
|
||||||
}
|
|
||||||
if ( m_inodes <= 0 )
|
|
||||||
{
|
|
||||||
cWarning() << "No stats could be obtained from" << unsquashExecutable << "-s";
|
|
||||||
}
|
|
||||||
|
|
||||||
// Now do the actual unpack
|
|
||||||
{
|
|
||||||
m_processed = 0;
|
|
||||||
Calamares::Utils::Runner r( { unsquashExecutable,
|
|
||||||
QStringLiteral( "-i" ), // List files
|
|
||||||
QStringLiteral( "-f" ), // Force-overwrite
|
|
||||||
QStringLiteral( "-d" ),
|
|
||||||
destinationPath,
|
|
||||||
m_source } );
|
|
||||||
r.setLocation( Calamares::Utils::RunLocation::RunInHost ).enableOutputProcessing();
|
|
||||||
connect( &r, &decltype( r )::output, this, &UnsquashRunner::unsquashProgress );
|
|
||||||
return r.run().explainProcess( toolName, std::chrono::seconds( 0 ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
UnsquashRunner::unsquashProgress( QString line )
|
|
||||||
{
|
|
||||||
m_processed++;
|
|
||||||
m_since++;
|
|
||||||
if ( m_since > chunk_size && line.contains( '/' ) )
|
|
||||||
{
|
|
||||||
const QString filename = line.split( '/', SplitSkipEmptyParts ).last().trimmed();
|
|
||||||
if ( !filename.isEmpty() )
|
|
||||||
{
|
|
||||||
m_since = 0;
|
|
||||||
double p = m_inodes > 0 ? ( double( m_processed ) / double( m_inodes ) ) : 0.5;
|
|
||||||
Q_EMIT progress( p, tr( "Unsquash file %1" ).arg( filename ) );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
/* === This file is part of Calamares - <https://calamares.io> ===
|
|
||||||
*
|
|
||||||
* SPDX-FileCopyrightText: 2021 Adriaan de Groot <groot@kde.org>
|
|
||||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
*
|
|
||||||
* Calamares is Free Software: see the License-Identifier above.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef UNPACKFSC_UNSQUASHRUNNER_H
|
|
||||||
#define UNPACKFSC_UNSQUASHRUNNER_H
|
|
||||||
|
|
||||||
#include "Runners.h"
|
|
||||||
|
|
||||||
/** @brief Use Unsquash for extracting a filesystem
|
|
||||||
*
|
|
||||||
* NOTE: not implemented
|
|
||||||
*/
|
|
||||||
class UnsquashRunner : public Runner
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
using Runner::Runner;
|
|
||||||
|
|
||||||
Calamares::JobResult run() override;
|
|
||||||
|
|
||||||
protected Q_SLOTS:
|
|
||||||
void unsquashProgress( QString line );
|
|
||||||
|
|
||||||
private:
|
|
||||||
int m_inodes = 0; // Total in the FS
|
|
||||||
|
|
||||||
// Progress reporting
|
|
||||||
int m_processed = 0;
|
|
||||||
int m_since = 0;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
---
|
|
||||||
rootMountPoint: /tmp/fstest
|
|
||||||
@@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
source: /tmp/src.fsa
|
|
||||||
sourcefs: fsarchive
|
|
||||||
destination: "/calasrc"
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
# SPDX-FileCopyrightText: no
|
|
||||||
# SPDX-License-Identifier: CC0-1.0
|
|
||||||
#
|
|
||||||
# Unpack a filesystem. Supported ways to "pack" the filesystem are:
|
|
||||||
# - fsarchiver in *savedir/restdir* mode (directories, not block devices)
|
|
||||||
# - squashfs
|
|
||||||
#
|
|
||||||
# Configuration:
|
|
||||||
#
|
|
||||||
# from globalstorage: rootMountPoint
|
|
||||||
# from job configuration: the item to unpack
|
|
||||||
#
|
|
||||||
|
|
||||||
---
|
|
||||||
# This module is configured a lot like the items in the *unpackfs*
|
|
||||||
# module, but with only **one** item. Use multiple instances for
|
|
||||||
# unpacking more than one filesystem.
|
|
||||||
#
|
|
||||||
# There are the following **mandatory** keys:
|
|
||||||
# - *source* path relative to the live / intstalling system to the image
|
|
||||||
# - *sourcefs* the type of the source files; valid entries are
|
|
||||||
# - `none` (this entry is ignored; kind of useless)
|
|
||||||
# - `fsarchiver`
|
|
||||||
# Aliases of this are `fsarchive`, `fsa` and `fsa-dir`.
|
|
||||||
# - `squashfs`
|
|
||||||
# Aliases of this are `squash` and `unsquash`.
|
|
||||||
# - *destination* path relative to rootMountPoint (so in the target
|
|
||||||
# system) where this filesystem is unpacked. It may be an
|
|
||||||
# empty string, which effectively is / (the root) of the target
|
|
||||||
# system.
|
|
||||||
#
|
|
||||||
# TODO: add `fsa-block` and support for *savefs/restfs* mode.
|
|
||||||
source: /data/rootfs.fsa
|
|
||||||
sourcefs: fsarchiver
|
|
||||||
destination: "/"
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
# SPDX-FileCopyrightText: 2020 Adriaan de Groot <groot@kde.org>
|
|
||||||
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
||||||
---
|
|
||||||
$schema: https://json-schema.org/schema#
|
|
||||||
$id: https://calamares.io/schemas/unpackfsc
|
|
||||||
additionalProperties: false
|
|
||||||
type: object
|
|
||||||
properties:
|
|
||||||
unpack:
|
|
||||||
type: array
|
|
||||||
items:
|
|
||||||
type: object
|
|
||||||
additionalProperties: false
|
|
||||||
properties:
|
|
||||||
source: { type: string }
|
|
||||||
sourcefs: { type: string }
|
|
||||||
destination: { type: string }
|
|
||||||
weight: { type: integer, exclusiveMinimum: 0 }
|
|
||||||
required: [ source , sourcefs, destination ]
|
|
||||||
Reference in New Issue
Block a user