Skip to content

Commit b671cf5

Browse files
authored
Merge pull request #18 from calamares/master
Update #3
2 parents f55b4b0 + fba38b9 commit b671cf5

File tree

9 files changed

+36
-12
lines changed

9 files changed

+36
-12
lines changed

CHANGES

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ website will have to do for older versions.
66
# 3.2.21 (unreleased) #
77

88
This release contains contributions from (alphabetically by first name):
9-
- No external contributors yet
9+
- Camilo Higuita
10+
- Gabriel Craciunescu
1011

1112
## Core ##
1213
- Python job modules (such as *unpackfs* or *packages*) can now provide

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,11 @@ set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeModules" )
135135
if( POLICY CMP0057 )
136136
cmake_policy( SET CMP0057 NEW )
137137
endif()
138-
# CMake 3.9, 3.10 compatibility
138+
# Let ``AUTOMOC`` and ``AUTOUIC`` process ``GENERATED`` files.
139139
if( POLICY CMP0071 )
140140
cmake_policy( SET CMP0071 NEW )
141141
endif()
142+
# Recognize more macros to trigger automoc
142143
if(NOT CMAKE_VERSION VERSION_LESS "3.10.0")
143144
list(APPEND CMAKE_AUTOMOC_MACRO_NAMES
144145
"K_PLUGIN_FACTORY_WITH_JSON"

src/calamares/CalamaresWindow.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ CalamaresWindow::getQmlSidebar( int desiredWidth )
136136
{
137137
CalamaresUtils::registerCalamaresModels();
138138
QQuickWidget* w = new QQuickWidget( this );
139+
w->setFixedWidth( desiredWidth );
140+
w->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding );
139141
w->setSource( QUrl(
140142
CalamaresUtils::searchQmlFile( CalamaresUtils::QmlSearch::Both, QStringLiteral( "calamares-sidebar" ) ) ) );
141143
return w;
@@ -197,7 +199,7 @@ CalamaresWindow::CalamaresWindow( QWidget* parent )
197199
sideBox = getQmlSidebar(
198200
qBound( 100, CalamaresUtils::defaultFontHeight() * 12, w < windowPreferredWidth ? 100 : 190 ) );
199201
break;
200-
default:
202+
case Calamares::Branding::SidebarFlavor::None:
201203
sideBox = nullptr;
202204
}
203205
if ( sideBox )

src/libcalamaresui/viewpages/QmlViewStep.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ QmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
232232
QObject* config = this->getConfig();
233233
if ( config )
234234
{
235-
m_qmlWidget->engine()->rootContext()->setContextProperty( "config", config );
235+
setContextProperty( "config", config );
236236
}
237237

238238
cDebug() << "QmlViewStep" << moduleInstanceKey() << "loading" << m_qmlFileName;
@@ -267,4 +267,10 @@ QmlViewStep::getConfig()
267267
return nullptr;
268268
}
269269

270+
void
271+
QmlViewStep::setContextProperty( const char* name, QObject* property )
272+
{
273+
m_qmlWidget->engine()->rootContext()->setContextProperty( name, property );
274+
}
275+
270276
} // namespace Calamares

src/libcalamaresui/viewpages/QmlViewStep.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,12 @@ class QmlViewStep : public Calamares::ViewStep
8585
*/
8686
virtual QObject* getConfig();
8787

88+
/** @brief Adds a context property for this QML file
89+
*
90+
* Does not take ownership.
91+
*/
92+
void setContextProperty( const char* name, QObject* property );
93+
8894
private Q_SLOTS:
8995
void loadComplete();
9096

src/modules/bootloader/main.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,25 +117,29 @@ def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, ker
117117

118118
partitions = libcalamares.globalstorage.value("partitions")
119119
swap_uuid = ""
120+
swap_outer_mappername = None
120121

121122
cryptdevice_params = []
122123

123124
# Take over swap settings:
124125
# - unencrypted swap partition sets swap_uuid
125126
# - encrypted root sets cryptdevice_params
126127
for partition in partitions:
128+
if partition["fs"] == "linuxswap" and not partition.get("claimed", None):
129+
continue
127130
has_luks = "luksMapperName" in partition
128131
if partition["fs"] == "linuxswap" and not has_luks:
129132
swap_uuid = partition["uuid"]
130133

134+
if (partition["fs"] == "linuxswap" and has_luks):
135+
swap_outer_mappername = partition["luksMapperName"]
136+
131137
if partition["mountPoint"] == "/" and has_luks:
132138
cryptdevice_params = ["cryptdevice=UUID="
133139
+ partition["luksUuid"]
134140
+ ":"
135141
+ partition["luksMapperName"],
136142
"root=/dev/mapper/"
137-
+ partition["luksMapperName"],
138-
"resume=/dev/mapper/"
139143
+ partition["luksMapperName"]]
140144

141145
if cryptdevice_params:
@@ -146,6 +150,10 @@ def create_systemd_boot_conf(install_path, efi_dir, uuid, entry, entry_name, ker
146150
if swap_uuid:
147151
kernel_params.append("resume=UUID={!s}".format(swap_uuid))
148152

153+
if swap_outer_mappername:
154+
kernel_params.append("resume=/dev/mapper/{!s}".format(
155+
swap_outer_mappername))
156+
149157
kernel_line = get_kernel_line(kernel_type)
150158
libcalamares.utils.debug("Configure: \"{!s}\"".format(kernel_line))
151159

src/modules/grubcfg/main.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,15 @@ def modify_grub_default(partitions, root_mount_point, distributor):
110110
if partition["fs"] == "linuxswap" and not has_luks:
111111
swap_uuid = partition["uuid"]
112112

113+
if (partition["fs"] == "linuxswap" and has_luks):
114+
swap_outer_mappername = partition["luksMapperName"]
115+
113116
if (partition["mountPoint"] == "/" and has_luks):
114117
cryptdevice_params = [
115118
"cryptdevice=UUID={!s}:{!s}".format(
116119
partition["luksUuid"], partition["luksMapperName"]
117120
),
118121
"root=/dev/mapper/{!s}".format(
119-
partition["luksMapperName"]
120-
),
121-
"resume=/dev/mapper/{!s}".format(
122122
partition["luksMapperName"]
123123
)
124124
]
@@ -136,7 +136,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
136136

137137
if have_dracut and swap_outer_uuid:
138138
kernel_params.append("rd.luks.uuid={!s}".format(swap_outer_uuid))
139-
if have_dracut and swap_outer_mappername:
139+
if swap_outer_mappername:
140140
kernel_params.append("resume=/dev/mapper/{!s}".format(
141141
swap_outer_mappername))
142142

src/modules/welcomeq/WelcomeQmlViewStep.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ WelcomeQmlViewStep::WelcomeQmlViewStep( QObject* parent )
5151
// this,
5252
// &WelcomeQmlViewStep::nextStatusChanged );
5353
// emit nextStatusChanged(true);
54-
qmlRegisterSingletonType< Config >( "io.calamares.module", 1, 0, "Welcome", [&](QQmlEngine*, QJSEngine*) -> QObject* { return m_config; } );
5554
}
5655

5756

@@ -158,6 +157,7 @@ WelcomeQmlViewStep::setConfigurationMap( const QVariantMap& configurationMap )
158157
}
159158

160159
Calamares::QmlViewStep::setConfigurationMap( configurationMap ); // call parent implementation last
160+
setContextProperty( "Welcome", m_config );
161161
}
162162

163163
Calamares::RequirementsList

src/modules/welcomeq/welcomeq.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* You should have received a copy of the GNU General Public License
1616
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
1717
*/
18-
import calamares.ui 1.0
18+
import io.calamares.ui 1.0
1919

2020
import QtQuick 2.10
2121
import QtQuick.Controls 2.10

0 commit comments

Comments
 (0)