19 Commits

Author SHA1 Message Date
Adriaan de Groot
51e89e58dd CMake: bump version and requirements
Builds cleanly with Calamares 3.3.1
2024-01-12 23:15:55 +01:00
Adriaan de Groot
d8d5a1fb26 CMake: find Calamares first, then other bits 2024-01-09 23:10:38 +01:00
Adriaan de Groot
85f05e8121 Merge pull request #31 from Undef-a/wip/undef/fix-ftbfs
Fix failure to configure/build with newer CMake and Calamares 3.3.0
2024-01-09 23:06:45 +01:00
undef
c28c9b8114 Port modules to Calamares 3.3.0
Calamares 3.3.0 changed the import name and namespace of
CalamaresUtilsSystem and CalamaresUtilsGui.
2023-12-17 03:40:44 +00:00
undef
935f21ace5 CMakeLists: Copy KF CoreAddons and FeatureSummary imports from Calamares
Without these the package no-longer compiles with recent versions of
cmake.
2023-12-17 03:40:40 +00:00
demmm
6bd75570de Merge pull request #30 from Undef-a/wip/undef/librem5-screen
mobile: Ensure welcome screen fits on Librem5
2023-09-29 14:19:05 +02:00
undef
acdcdea668 mobile: Ensure welcome screen fits on Librem5
Now that the sizing has changed this line overhangs the screen.
2023-09-29 11:36:34 +00:00
Adriaan de Groot
edb405a4d1 Merge pull request #29 from Undef-a/wip/undef/fix-sizing-with-3.3.x
mobile: Adjust all sizes for Calamares 3.3.x
2023-09-28 23:03:26 +02:00
undef
3ad9c221d4 mobile: Adjust all sizes for Calamares 3.3.x
Element sizing in Calamares 3.3.x seems to have dramatically changed,
with for example a button that was previously fine at width 500 now
being huge to the point of causing the installer to overhang the screen.

This reduces the size of most elements such that they fit on a mobile
screen again.

Fixes: https://github.com/calamares/calamares/issues/2192
2023-09-28 08:56:44 +00:00
Adriaan de Groot
dc3550eccd CMake: post-release housekeeping
- Update CMake requirements to shut KF5 up
- Require the next Calamares main branch
- Bump to 1.4.0 version
2023-08-28 23:52:02 +02:00
Adriaan de Groot
fac16ac6a7 CMake: be more chatty about Calamares version used 2023-08-28 21:04:36 +02:00
Adriaan de Groot
a442ed8c12 CI: remove Linuxisms from release script 2023-08-28 20:34:32 +02:00
Adriaan de Groot
e08d687061 CI: update signing key 2023-08-28 00:33:12 +02:00
Adriaan de Groot
15f6369537 Changes: pre-release housekeeping 2023-08-28 00:31:50 +02:00
Adriaan de Groot
f01b4ed2f8 docs: drop mention of IRC, prefer Matrix for communication 2023-08-27 22:47:08 +02:00
Adriaan de Groot
ea762b0945 Merge pull request #26 from nmschulte/nms/fix-username-prompt
add usermod command about default username
2023-08-06 15:24:10 +02:00
Nathan Schulte
cae8acb4a4 custom username also changes the fullname/comment 2023-08-03 14:52:59 -05:00
Nathan Schulte
ae204d0108 change username before password 2023-07-19 20:49:48 -05:00
Nathan Schulte
a2fae600c4 add usermod command about default username
cmdUsermod supports changing the default username

in case any extra initial state needs updated, cmdUsermod can be amended to run additional commands
2023-07-11 01:29:32 -05:00
29 changed files with 184 additions and 111 deletions

18
CHANGES
View File

@@ -6,6 +6,24 @@ 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.
# 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

View File

@@ -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.1 )
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,42 @@ 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.1 )
find_package(Calamares ${CALAMARES_VERSION_REQUIRED} NO_CMAKE_PACKAGE_REGISTRY) find_package(Calamares ${CALAMARES_VERSION_REQUIRED} 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) find_package(Calamares ${CALAMARES_VERSION_REQUIRED} 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(WITH_QT6)
set(kfname "KF6")
set(KF_VERSION 5.240) # KDE Neon weirdness
else()
message(STATUS "Building Calamares 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
@@ -119,6 +152,8 @@ 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 ) 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.
calamares_explain_skipped_modules( ${LIST_SKIPPED_MODULES} ) calamares_explain_skipped_modules( ${LIST_SKIPPED_MODULES} )

View File

@@ -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.
* [![Join us on Matrix](https://img.shields.io/badge/Matrix-%23calamares:kde.org-blue)](https://webchat.kde.org/#/room/%23calamares:kde.org) * [![Join us on Matrix](https://img.shields.io/badge/Matrix-%23calamares:kde.org-blue)](https://webchat.kde.org/#/room/%23calamares:kde.org)
* [![Chat on IRC](https://img.shields.io/badge/IRC-Libera.Chat%20%23calamares-green)](https://kiwiirc.com/client/irc.libera.chat/#calamares)

View File

@@ -220,15 +220,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.
* [![Join us on Matrix](https://img.shields.io/badge/Matrix-%23calamares:kde.org-blue)](https://webchat.kde.org/#/room/%23calamares:kde.org) * [![Join us on Matrix](https://img.shields.io/badge/Matrix-%23calamares:kde.org-blue)](https://webchat.kde.org/#/room/%23calamares:kde.org)
* [![Chat on IRC](https://img.shields.io/badge/IRC-Libera.Chat%20%23calamares-green)](https://kiwiirc.com/client/irc.libera.chat/#calamares)

View File

@@ -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 build.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 ; }

View File

@@ -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 ) )
{ {
@@ -36,6 +36,7 @@ Config::setConfigurationMap( const QVariantMap& cfgMap )
"messagebus", "news", "nobody", "ntp", "operator", "polkitd", "postmaster", "pulse", "root", "shutdown", "messagebus", "news", "nobody", "ntp", "operator", "polkitd", "postmaster", "pulse", "root", "shutdown",
"smmsp", "squid", "sshd", "sync", "uucp", "vpopmail", "xfs" } ); "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 );
@@ -60,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" );
@@ -74,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,
@@ -138,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 )
{ {

View File

@@ -24,7 +24,7 @@ class Config : public QObject
Q_PROPERTY( QStringList reservedUsernames READ reservedUsernames CONSTANT FINAL ) 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 )
@@ -78,9 +78,10 @@ public:
/* reserved usernames (user_pass, ssh_credentials) */ /* reserved usernames (user_pass, ssh_credentials) */
QStringList reservedUsernames() const { return m_reservedUsernames; }; QStringList reservedUsernames() const { return m_reservedUsernames; };
/* default user */ /* 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; }
@@ -126,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; }
@@ -181,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;
@@ -190,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 );

View File

@@ -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";

View File

@@ -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() } );

View File

@@ -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;

View File

@@ -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: {

View File

@@ -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: {

View File

@@ -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: {

View File

@@ -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: 25 anchors.topMargin: 10
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: (function() { text: (function() {
@@ -44,15 +44,15 @@ Item {
return ret; return ret;
}()) }())
width: 550 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: 20 anchors.topMargin: 10
width: 500 width: 200
text: qsTr("Install") text: qsTr("Install")
onClicked: navFinish() onClicked: navFinish()

View File

@@ -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: {

View File

@@ -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: {

View File

@@ -26,6 +26,7 @@ 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) ## reserved usernames (for user_pass username prompt and ssh_credentials)
@@ -154,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

View File

@@ -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"

View File

@@ -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 -->

View File

@@ -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: {

View File

@@ -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: {

View File

@@ -35,7 +35,7 @@ Item {
id: usernameDescription 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 wrapMode: Text.WordWrap
text: (function() { text: (function() {
@@ -43,7 +43,7 @@ Item {
" username is \"" + config.username + "\"."; " username is \"" + config.username + "\".";
}()) }())
width: 500 width: 200
} }
TextField { TextField {
@@ -53,15 +53,15 @@ Item {
onTextChanged: validateNameFunc(username, errorText) onTextChanged: validateNameFunc(username, errorText)
text: config.username text: config.username
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 50 anchors.topMargin: 10
width: 500 width: 200
} }
Text { Text {
id: userPassDescription id: userPassDescription
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.top: username.bottom anchors.top: username.bottom
anchors.topMargin: 30 anchors.topMargin: 10
wrapMode: Text.WordWrap wrapMode: Text.WordWrap
text: (function() { text: (function() {
@@ -76,7 +76,7 @@ Item {
} }
}()) }())
width: 500 width: 200
} }
TextField { TextField {
@@ -96,8 +96,8 @@ Item {
} }
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 50 anchors.topMargin: 10
width: 500 width: 200
} }
TextField { TextField {
@@ -110,8 +110,8 @@ Item {
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 {
@@ -121,15 +121,15 @@ 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: {

View File

@@ -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 ten minutes, please be patient." " take up to ten minutes, please be patient."
width: 500 width: 200
} }
} }
} }

View File

@@ -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()

View File

@@ -62,7 +62,7 @@ FSArchiverRunner::checkPrerequisites( QString& fsarchiverExecutable ) const
Calamares::JobResult Calamares::JobResult
FSArchiverRunner::checkDestination( QString& destinationPath ) const FSArchiverRunner::checkDestination( QString& destinationPath ) const
{ {
destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination ); destinationPath = Calamares::System::instance()->targetPath( m_destination );
if ( destinationPath.isEmpty() ) if ( destinationPath.isEmpty() )
{ {
return Calamares::JobResult::internalError( return Calamares::JobResult::internalError(

View File

@@ -9,7 +9,7 @@
#include "Runners.h" #include "Runners.h"
#include <utils/CalamaresUtilsSystem.h> #include <utils/System.h>
#include <utils/Logger.h> #include <utils/Logger.h>
#include <QFileInfo> #include <QFileInfo>

View File

@@ -38,7 +38,7 @@ TarballRunner::run()
Calamares::JobResult::MissingRequirements ); Calamares::JobResult::MissingRequirements );
} }
const QString destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination ); const QString destinationPath = Calamares::System::instance()->targetPath( m_destination );
if ( destinationPath.isEmpty() ) if ( destinationPath.isEmpty() )
{ {
return Calamares::JobResult::internalError( return Calamares::JobResult::internalError(

View File

@@ -101,8 +101,8 @@ UnpackFSCJob::exec()
void void
UnpackFSCJob::setConfigurationMap( const QVariantMap& map ) UnpackFSCJob::setConfigurationMap( const QVariantMap& map )
{ {
QString source = CalamaresUtils::getString( map, "source" ); QString source = Calamares::getString( map, "source" );
QString sourceTypeName = CalamaresUtils::getString( map, "sourcefs" ); QString sourceTypeName = Calamares::getString( map, "sourcefs" );
if ( source.isEmpty() || sourceTypeName.isEmpty() ) if ( source.isEmpty() || sourceTypeName.isEmpty() )
{ {
cWarning() << "Skipping item with bad source data:" << map; cWarning() << "Skipping item with bad source data:" << map;
@@ -115,7 +115,7 @@ UnpackFSCJob::setConfigurationMap( const QVariantMap& map )
cWarning() << "Skipping item with source type None"; cWarning() << "Skipping item with source type None";
return; return;
} }
QString destination = CalamaresUtils::getString( map, "destination" ); QString destination = Calamares::getString( map, "destination" );
if ( destination.isEmpty() ) if ( destination.isEmpty() )
{ {
cWarning() << "Skipping item with empty destination"; cWarning() << "Skipping item with empty destination";

View File

@@ -38,7 +38,7 @@ UnsquashRunner::run()
Calamares::JobResult::MissingRequirements ); Calamares::JobResult::MissingRequirements );
} }
const QString destinationPath = CalamaresUtils::System::instance()->targetPath( m_destination ); const QString destinationPath = Calamares::System::instance()->targetPath( m_destination );
if ( destinationPath.isEmpty() ) if ( destinationPath.isEmpty() )
{ {
return Calamares::JobResult::internalError( return Calamares::JobResult::internalError(