...
 
Commits (237)
......@@ -12,7 +12,7 @@ services:
notifications:
irc:
- "chat.freenode.net#calamares"
- "chat.freenode.net#manjaro"
install:
- docker build -t calamares .
......
......@@ -176,7 +176,7 @@ set( CALAMARES_TRANSLATION_LANGUAGES ar ast bg ca cs_CZ da de el en en_GB es_MX
### Bump version here
set( CALAMARES_VERSION_MAJOR 3 )
set( CALAMARES_VERSION_MINOR 1 )
set( CALAMARES_VERSION_PATCH 12 )
set( CALAMARES_VERSION_PATCH 13 )
set( CALAMARES_VERSION_RC 0 )
set( CALAMARES_VERSION ${CALAMARES_VERSION_MAJOR}.${CALAMARES_VERSION_MINOR}.${CALAMARES_VERSION_PATCH} )
......
......@@ -12,6 +12,6 @@ set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_MODULE_PATH})
include(KDEInstallDirs)
include(GenerateExportHeader)
find_package( KF5 REQUIRED CoreAddons )
find_package( KF5 REQUIRED Config I18n IconThemes KIO Service )
find_package( KF5 REQUIRED Config I18n Service WidgetsAddons )
find_package( KPMcore 3.0.3 REQUIRED )
find_package( KPMcore 3.2 REQUIRED )
FROM kdeneon/all:dev-stable
RUN sudo apt-get update && sudo apt-get -y install build-essential cmake extra-cmake-modules gettext kio-dev libatasmart-dev libboost-python-dev libkf5config-dev libkf5coreaddons-dev libkf5i18n-dev libkf5iconthemes-dev libkf5parts-dev libkf5service-dev libkf5solid-dev libkpmcore-dev libparted-dev libpolkit-qt5-1-dev libqt5svg5-dev libqt5webkit5-dev libyaml-cpp-dev os-prober pkg-config python3-dev qtbase5-dev qtdeclarative5-dev qttools5-dev qttools5-dev-tools
FROM kdeneon/all:user
RUN sudo apt-get update && sudo apt-get -y install build-essential cmake extra-cmake-modules gettext kio-dev libatasmart-dev libboost-python-dev libkf5config-dev libkf5coreaddons-dev libkf5i18n-dev libkf5iconthemes-dev libkf5parts-dev libkf5service-dev libkf5solid-dev libkpmcore-dev libparted-dev libpolkit-qt5-1-dev libqt5svg5-dev libqt5webkit5-dev libyaml-cpp-dev os-prober pkg-config python3-dev qtbase5-dev qtdeclarative5-dev qttools5-dev qttools5-dev-tools
The Breeze Icon Theme in icons/
Copyright (C) 2014 Uri Herrera <uri_herrera@nitrux.in> and others
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 3 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library. If not, see <http://www.gnu.org/licenses/>.
Clarification:
The GNU Lesser General Public License or LGPL is written for
software libraries in the first place. We expressly want the LGPL to
be valid for this artwork library too.
KDE Breeze theme icons is a special kind of software library, it is an
artwork library, it's elements can be used in a Graphical User Interface, or
GUI.
Source code, for this library means:
- where they exist, SVG;
- otherwise, if applicable, the multi-layered formats xcf or psd, or
otherwise png.
The LGPL in some sections obliges you to make the files carry
notices. With images this is in some cases impossible or hardly useful.
With this library a notice is placed at a prominent place in the directory
containing the elements. You may follow this practice.
The exception in section 5 of the GNU Lesser General Public License covers
the use of elements of this art library in a GUI.
https://vdesign.kde.org/
-----
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
/* Allow Calamares to be started without password authentication
*/
polkit.addRule(function(action, subject) {
if ((action.id == "com.github.calamares.calamares.pkexec.run"))
{
return polkit.Result.YES;
}
});
[Desktop Entry]
Type=Application
Version=1.0
Name=Install Manjaro Linux
GenericName=Live Installer
Comment=Install the operating system to disk
Comment[de]=Manjaro Linux installieren
Exec=/usr/bin/calamares_polkit %f
Icon=calamares
Terminal=false
StartupNotify=true
Type=Application
Categories=Qt;System;
#!/bin/bash
if [ $(which pkexec) ]; then
pkexec --disable-internal-agent "/usr/bin/calamares" "$@"
else
/usr/bin/calamares "$@"
fi
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-NegativeText {
color:#da4453;
}
</style>
</defs>
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
class="ColorScheme-NegativeText"
d="M 1 0 C 0.4459807 0 0 0.446 0 1 L 0 7 C 0 7.5541 0.4459807 8 1 8 L 7 8 C 7.554019 8 8 7.5541 8 7 L 8 1 C 8 0.446 7.554019 0 7 0 L 1 0 z "
/>
<path
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="M 2 1 L 1 2 L 3 4 L 1 6 L 2 7 L 4 5 L 6 7 L 7 6 L 5 4 L 7 2 L 6 1 L 4 3 L 2 1 z "
/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-PositiveText {
color:#27ae60;
}
</style>
</defs>
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
class="ColorScheme-PositiveText"
d="M 4 0 C 1.784 0 0 1.784 0 4 C 0 6.216 1.784 8 4 8 C 6.216 8 8 6.216 8 4 C 8 1.784 6.216 0 4 0 z "
/>
<path
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="M 6 2 L 3 5 L 2 4 L 1 5 L 2 6 L 3 7 L 7 3 L 6 2 z "
/>
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 8 8">
<defs id="defs3051">
<style type="text/css" id="current-color-scheme">
.ColorScheme-NeutralText {
color:#f67400;
}
</style>
</defs>
<path
style="fill:currentColor;fill-opacity:1;stroke:none"
class="ColorScheme-NeutralText"
d="M 4 0 C 3.7964835 0.00025315917 3.644678 0.09649124 3.5371094 0.3125 C 3.5371094 0.3125 0.077246535 7.200596 0.080078125 7.2285156 C 0.043417505 7.3055016 -1.2456632e-05 7.403681 0 7.5 C 0 7.7761424 0.22385763 8 0.5 8 L 7.5 8 C 7.7761424 8 8 7.7761424 8 7.5 C 8.0002021 7.3873383 7.9818808 7.3677538 7.8925781 7.1894531 L 4.4550781 0.29101562 C 4.346001 0.097741395 4.1955491 -0.00033128801 4 0 z "
/>
<path
style="fill:#ffffff;fill-opacity:1;stroke:none"
d="M 3.5 2 L 3.5 5 L 4.5 5 L 4.5 2 L 3.5 2 z M 3.5 6 L 3.5 7 L 4.5 7 L 4.5 6 L 3.5 6 z "
/>
</svg>
This diff is collapsed.
......@@ -30,7 +30,6 @@ modules-search: [ local ]
# For more information on running module instances, run Calamares in debug mode
# and check the Modules page in the Debug information interface.
# YAML: list of maps of string:string key-value pairs.
#instances:
#- id: owncloud
# module: webview
......@@ -59,46 +58,39 @@ modules-search: [ local ]
# instances are lifted.
# YAML: list of lists of strings.
sequence:
- show:
- welcome
# - dummypythonqt
- locale
- keyboard
- partition
- users
- summary
- exec:
# - dummycpp
# - dummyprocess
# - dummypython
# - dummypythonqt
- partition
- mount
- unpackfs
- machineid
- fstab
- locale
- keyboard
- localecfg
# - luksbootkeyfile
# - luksopenswaphookcfg
# - dracutlukscfg
# - plymouthcfg
- initcpiocfg
- initcpio
- users
- displaymanager
- networkcfg
- hwclock
- services
# - dracut
- initramfs
# - grubcfg
- bootloader
- umount
- show:
# - webview@owncloud
- finished
- show:
- welcome
- locale
- keyboard
- partition
- users
- summary
- exec:
- partition
- mount
- unpackfs
- machineid
- fstab
- locale
- keyboard
- localecfg
- luksopenswaphookcfg
- luksbootkeyfile
- plymouthcfg
- initcpiocfg
- initcpio
- users
- displaymanager
- mhwdcfg
- networkcfg
- hwclock
- services
- grubcfg
- bootloader
- postcfg
- umount
- show:
- finished
# A branding component is a directory, either in SHARE/calamares/branding or in
# /etc/calamares/branding (the latter takes precedence). The directory must contain a
......@@ -109,7 +101,7 @@ sequence:
# Only the name of the branding component (directory) should be specified here, Calamares
# then takes care of finding it and loading the contents.
# YAML: string.
branding: default
branding: manjaro
# If this is set to true, Calamares will show an "Are you sure?" prompt right before
# each execution phase, i.e. at points of no return. If this is set to false, no prompt
......
---
componentName: manjaro
strings:
productName: Manjaro Linux
shortProductName: Manjaro
version: 17.1
shortVersion: 17.1
versionedName: Manjaro Linux 17.1 "Hakoila"
shortVersionedName: Manjaro 17.1
bootloaderEntryName: Manjaro
images:
productLogo: "logo.png"
productIcon: "logo.png"
productWelcome: "languages.png"
slideshow: "show.qml"
style:
sidebarBackground: "#454948"
sidebarText: "#efefef"
sidebarTextSelect: "#9E4F5D"
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2015, Teo Mrnjavac <teo@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Calamares is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Calamares. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Slides images dimensions are 800x440px.
*/
import QtQuick 2.0;
import calamares.slideshow 1.0;
Presentation
{
id: presentation
Timer {
interval: 20000
running: true
repeat: true
onTriggered: presentation.goToNextSlide()
}
Slide {
Image {
id: background1
source: "slide1.png"
width: 800; height: 440
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
}
Text {
anchors.horizontalCenter: background1.horizontalCenter
anchors.top: background1.bottom
text: ""
wrapMode: Text.WordWrap
width: 800
horizontalAlignment: Text.Center
}
}
Slide {
Image {
id: background2
source: "slide2.png"
width: 800; height: 440
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
}
Text {
anchors.horizontalCenter: background2.horizontalCenter
anchors.top: background2.bottom
text: ""
wrapMode: Text.WordWrap
width: 800
horizontalAlignment: Text.Center
}
}
Slide {
Image {
id: background3
source: "slide3.png"
width: 800; height: 440
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
}
Text {
anchors.horizontalCenter: background3.horizontalCenter
anchors.top: background3.bottom
text: ""
wrapMode: Text.WordWrap
width: 800
horizontalAlignment: Text.Center
}
}
Slide {
Image {
id: background4
source: "slide4.png"
width: 800; height: 440
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
}
Text {
anchors.horizontalCenter: background4.horizontalCenter
anchors.top: background4.bottom
text: ""
wrapMode: Text.WordWrap
width: 800
horizontalAlignment: Text.Center
}
}
Slide {
Image {
id: background5
source: "slide5.png"
width: 800; height: 440
fillMode: Image.PreserveAspectFit
anchors.centerIn: parent
}
Text {
anchors.horizontalCenter: background5.horizontalCenter
anchors.top: background5.bottom
text: ""
wrapMode: Text.WordWrap
width: 800
horizontalAlignment: Text.Center
}
}
}
......@@ -16,5 +16,8 @@
<file alias="images/boot-environment.svg">../../data/images/boot-environment.svg</file>
<file alias="images/partition-table.svg">../../data/images/partition-table.svg</file>
<file alias="images/squid.svg">../../data/images/squid.svg</file>
<file alias="images/state-ok.svg">../../data/images/state-ok.svg</file>
<file alias="images/state-warning.svg">../../data/images/state-warning.svg</file>
<file alias="images/state-error.svg">../../data/images/state-error.svg</file>
</qresource>
</RCC>
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2015, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -107,6 +108,18 @@ defaultPixmap( ImageType type, ImageMode mode, const QSize& size )
case Squid:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/squid.svg", size );
break;
case StatusOk:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/state-ok.svg", size );
break;
case StatusWarning:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/state-warning.svg", size );
break;
case StatusError:
pixmap = ImageRegistry::instance()->pixmap( RESPATH "images/state-error.svg", size );
break;
}
if ( pixmap.isNull() )
......
......@@ -55,7 +55,10 @@ enum ImageType : int
PartitionReplaceOs,
PartitionTable,
BootEnvironment,
Squid
Squid,
StatusOk, // Icons for the requirements checker
StatusWarning,
StatusError
};
/**
......
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2018, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -19,8 +20,9 @@
#ifndef PYTHONQTGLOBALSTORAGEWRAPPER_H
#define PYTHONQTGLOBALSTORAGEWRAPPER_H
#include <QObject>
#include <QStringList>
#include <QVariant>
namespace Calamares
{
......
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* SPDX-License-Identifier: MIT
* License-Filename: LICENSES/MIT-QtWaitingSpinner
*/
/* Original Work Copyright (c) 2012-2014 Alexander Turkin
Modified 2014 by William Hallatt
Modified 2015 by Jacob Dawid
......
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* SPDX-License-Identifier: MIT
* License-Filename: LICENSES/MIT-QtWaitingSpinner
*/
/* Original Work Copyright (c) 2012-2014 Alexander Turkin
Modified 2014 by William Hallatt
Modified 2015 by Jacob Dawid
......
......@@ -20,8 +20,16 @@ timeout: "10"
grubInstall: "grub-install"
grubMkconfig: "grub-mkconfig"
grubCfg: "/boot/grub/grub.cfg"
# Optionally set the --bootloader-id to use for EFI. If not set, this defaults
# to the bootloaderEntryName from branding.desc with problematic characters
# replaced. If an efiBootloaderId is specified here, it is taken to already be a
# valid directory name, so no such postprocessing is done in this case.
# Optionally set the bootloader ID to use for EFI. This is passed to
# grub-install --bootloader-id.
#
# If not set here, the value from bootloaderEntryName from branding.desc
# is used, with problematic characters (space and slash) replaced.
#
# The ID is also used as a directory name within the EFI environment,
# and the bootloader is copied from /boot/efi/EFI/<dirname>/ . When
# setting the option here, take care to use only valid directory
# names since no sanitizing is done.
#
# efiBootloaderId: "dirname"
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <http://github.com/calamares> ===
# === This file is part of Calamares - <https://github.com/calamares> ===
#
# Copyright 2014, Aurélien Gâteau <agateau@kde.org>
# Copyright 2014, Anke Boersma <demm@kaosx.us>
......@@ -13,6 +13,7 @@
# Copyright 2017, Alf Gaida <agaida@siduction.org>
# Copyright 2017, Adriaan de Groot <groot@kde.org>
# Copyright 2017, Gabriel Craciunescu <crazy@frugalware.org>
# Copyright 2017, Ben Green <Bezzy1999@hotmail.com>
#
# Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -235,10 +236,18 @@ def install_grub(efi_directory, fw_type):
# if the kernel is older than 4.0, the UEFI bitness likely isn't
# exposed to the userspace so we assume a 64 bit UEFI here
efi_bitness = "64"
bitness_translate = {"32": "--target=i386-efi",
"64": "--target=x86_64-efi"}
if efi_bitness == "32":
efi_target = "i386-efi"
efi_grub_file = "grubia32.efi"
efi_boot_file = "bootia32.efi"
elif efi_bitness == "64":
efi_target = "x86_64-efi"
efi_grub_file = "grubx64.efi"
efi_boot_file = "bootx64.efi"
check_target_env_call([libcalamares.job.configuration["grubInstall"],
bitness_translate[efi_bitness],
"--target=" + efi_target,
"--efi-directory=" + efi_directory,
"--bootloader-id=" + efi_bootloader_id,
"--force"])
......@@ -260,19 +269,13 @@ def install_grub(efi_directory, fw_type):
os.makedirs(install_efi_boot_directory)
# Workaround for some UEFI firmwares
efi_file_source = {"32": os.path.join(install_efi_directory_firmware,
efi_bootloader_id,
"grubia32.efi"),
"64": os.path.join(install_efi_directory_firmware,
efi_bootloader_id,
"grubx64.efi")}
efi_file_target = {"32": os.path.join(install_efi_boot_directory,
"bootia32.efi"),
"64": os.path.join(install_efi_boot_directory,
"bootx64.efi")}
shutil.copy2(efi_file_source[efi_bitness], efi_file_target[efi_bitness])
efi_file_source = os.path.join(install_efi_directory_firmware,
efi_bootloader_id,
efi_grub_file)
efi_file_target = os.path.join(install_efi_boot_directory,
efi_boot_file)
shutil.copy2(efi_file_source, efi_file_target)
else:
print("Bootloader: grub (bios)")
if libcalamares.globalstorage.value("bootLoader") is None:
......
---
requirements:
- name: /etc
mode: "0o755"
- name: /var/cache/pacman/pkg
mode: "0o755"
- name: /var/lib/pacman
mode: "0o755"
isRank: true
keyrings:
- archlinux
- manjaro
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <http://github.com/calamares> ===
#
# Copyright 2016, Artoo <artoo@manjaro.org>
# Copyright 2017, Philip Müller <philm@manjaro.org>
#
# Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Calamares is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Calamares. If not, see <http://www.gnu.org/licenses/>.
import os
import shutil
import subprocess
import sys
import re
import libcalamares
from libcalamares.utils import check_target_env_call, target_env_call, debug
from os.path import join
from subprocess import call
class OperationTracker:
def __init__(self):
self._downloaded = 0
self._installed = 0
self._total = 0
self._progress = float(0)
@property
def downloaded(self):
return self._downloaded
@downloaded.setter
def downloaded(self, value):
self._downloaded = value
@property
def installed(self):
return self._installed
@installed.setter
def installed(self, value):
self._installed = value
@property
def total(self):
return self._total
@total.setter
def total(self, value):
self._total = value
@property
def progress(self):
return self._progress
@progress.setter
def progress(self, value):
self._progress = value
def send_progress(self, counter, phase):
for p in range(phase):
if self.total == 0:
continue
step = 0.05
step += 0.95 * (counter / float(self.total))
self.progress += step / self.total
debug("Progress: {}".format(self.progress))
libcalamares.job.setprogress(self.progress)
ON_POSIX = 'posix' in sys.builtin_module_names
class PacmanController:
def __init__(self, root):
self.__root = root
self.__operations = libcalamares.globalstorage.value(
"packageOperations"
)
self.__tracker = OperationTracker()
self.__keyrings = libcalamares.job.configuration.get(
'keyrings',
[]
)
@property
def tracker(self):
return self.__tracker
@property
def root(self):
return self.__root
@property
def operations(self):
return self.__operations
@property
def keyrings(self):
return self.__keyrings
def init_keyring(self):
target_env_call(["pacman-key", "--init"])
def populate_keyring(self):
target_env_call(["pacman-key", "--populate"] + self.keyrings)
def parse_output(self, cmd):
cal_env = os.environ
cal_env["LC_ALL"] = "C"
last = []
phase = 0
process = subprocess.Popen(
cmd,
env=cal_env,
bufsize=1,
stdout=subprocess.PIPE,
close_fds=ON_POSIX
)
for line in iter(process.stdout.readline, b''):
pkgs = re.findall(r'\((\d+)\)', line.decode())
dl = re.findall(r'downloading\s+(.*).pkg.tar.xz', line.decode())
inst = re.findall(r'installing(.*)\.\.\.', line.decode())
if pkgs:
self.tracker.total = (int(pkgs[0]))
debug("Number of packages: {}".format(self.tracker.total))
if dl:
if dl != last:
self.tracker.downloaded += 1
phase = 1
debug("Downloading: {}".format(dl[0]))
debug("Downloaded packages: {}".format(
self.tracker.downloaded
))
self.tracker.send_progress(
self.tracker.downloaded,
phase
)
last = dl
elif inst:
self.tracker.installed += 1
phase = 2
debug("Installing: {}".format(inst[0]))
debug("Installed packages: {}".format(self.tracker.installed))
self.tracker.send_progress(self.tracker.installed, phase)
if process.returncode != 0:
return process.kill()
return None
def install(self, pkglist, local=False):
cachedir = join(self.root, "var/cache/pacman/pkg")
dbdir = join(self.root, "var/lib/pacman")
args = ["pacman", "--noconfirm"]
if local:
args.extend(["-U"])
else:
args.extend(["-Sy"])
args.extend([
"--cachedir",
cachedir,
"--root",
self.root,
"--dbpath",
dbdir
])
cmd = args + pkglist
self.parse_output(cmd)
def remove(self, pkglist):
args = ["chroot", self.root, "pacman", "-Rs", "--noconfirm"]
cmd = args + pkglist
check_target_env_call(cmd)
def run(self):
pkgs = []
for key in self.operations.keys():
if key == "install":
for pkg in self.operations[key]:
pkgs.extend([pkg["package"]])
self.install(pkgs)
elif key == "localInstall":
for pkg in self.operations[key]:
pkgs.extend([pkg["package"]])
self.install(pkgs, local=True)
elif key == "remove":
for pkg in self.operations[key]:
pkgs.extend([pkg["package"]])
self.tracker.total(len(pkgs))
self.remove(pkgs)
elif key == "try_install":
for pkg in self.operations[key]:
pkgs.extend([pkg["package"]])
self.install(pkgs)
elif key == "try_remove":
for pkg in self.operations[key]:
pkgs.extend([pkg["package"]])
self.remove(pkgs)
self.init_keyring()
self.populate_keyring()
return None
class ChrootController:
def __init__(self):
self.__root = libcalamares.globalstorage.value('rootMountPoint')
self.__requirements = libcalamares.job.configuration.get(
'requirements',
[]
)
self.__isRank = libcalamares.job.configuration['isRank']
@property
def root(self):
return self.__root
@property
def isRank(self):
return self.__isRank
@property
def requirements(self):
return self.__requirements
def make_dirs(self):
for target in self.requirements:
dest = self.root + target["name"]
if not os.path.exists(dest):
debug("Create: {}".format(dest))
mod = int(target["mode"], 8)
debug("Mode: {}".format(oct(mod)))
os.makedirs(dest, mode=mod)
def rank_mirrors(self):
call(["pacman-mirrors", "-f", "5"])
def copy_file(self, file):
if os.path.exists(os.path.join("/", file)):
shutil.copy2(
os.path.join("/", file),
os.path.join(self.root, file)
)
def prepare(self):
cal_umask = os.umask(0)
self.make_dirs()
path = join(self.root, "run")
os.chmod(path, 0o755)
os.umask(cal_umask)
self.copy_file('etc/pacman-mirrors.conf')
self.copy_file('etc/resolv.conf')
def run(self):
if self.isRank:
self.rank_mirrors()
self.prepare()
pacman = PacmanController(self.root)
return pacman.run()
def run():
"""
Create chroot dirs and install pacman,
kernel and netinstall selection
"""
targetRoot = ChrootController()
return targetRoot.run()
# Syntax is YAML 1.2
---
type: "job"
name: "chrootcfg"
interface: "python"
script: "main.py" #assumed relative to the current directory
......@@ -37,6 +37,12 @@ DesktopEnvironment = collections.namedtuple(
desktop_environments = [
DesktopEnvironment('/usr/bin/startkde', 'plasma'), # KDE Plasma 5
DesktopEnvironment('/usr/bin/startkde', 'kde-plasma'), # KDE Plasma 4
DesktopEnvironment(
'/usr/bin/budgie-desktop', 'budgie-desktop' # Budgie v10
),
DesktopEnvironment(
'/usr/bin/budgie-session', 'budgie-desktop' # Budgie v8
),
DesktopEnvironment('/usr/bin/gnome-session', 'gnome'),
DesktopEnvironment('/usr/bin/startxfce4', 'xfce'),
DesktopEnvironment('/usr/bin/cinnamon-session-cinnamon', 'cinnamon'),
......@@ -47,8 +53,6 @@ desktop_environments = [
DesktopEnvironment('/usr/bin/lxqt-session', 'lxqt'),
DesktopEnvironment('/usr/bin/pekwm', 'pekwm'),
DesktopEnvironment('/usr/bin/pantheon-session', 'pantheon'),
DesktopEnvironment('/usr/bin/budgie-session', 'budgie-session'),
DesktopEnvironment('/usr/bin/budgie-desktop', 'budgie-desktop'),
DesktopEnvironment('/usr/bin/i3', 'i3'),
DesktopEnvironment('/usr/bin/startdde', 'deepin'),
DesktopEnvironment('/usr/bin/openbox-session', 'openbox')
......
......@@ -6,6 +6,7 @@
# Copyright 2014, Aurélien Gâteau <agateau@kde.org>
# Copyright 2016, Teo Mrnjavac <teo@kde.org>
# Copyright 2017, Alf Gaida <agaida@siduction.org>
# Copyright 2017, Philip Müller <philm@manjaro.org>
#
# Calamares is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -184,7 +185,7 @@ class FstabGenerator(object):
for partition in self.partitions:
# Special treatment for a btrfs root with @ and @home
# subvolumes
if (partition["fs"] == "btrfs"
if (partition["fs"].lower() == "btrfs"
and partition["mountPoint"] == "/"):
output = subprocess.check_output(['btrfs',
'subvolume',
......@@ -255,10 +256,34 @@ class FstabGenerator(object):
self.root_is_ssd = is_ssd
if filesystem == "btrfs" and "subvol" in partition:
options="subvol={},".format(partition["subvol"]) + options
if has_luks:
return dict(
device="/dev/mapper/" + partition["luksMapperName"],
mount_point=mount_point,
fs=filesystem,
options=",".join(
["subvol={}".format(partition["subvol"]), options]
),
check=check,
)
else:
return dict(
device="UUID=" + partition["uuid"],
mount_point=mount_point,
fs=filesystem,
options=",".join(
["subvol={}".format(partition["subvol"]), options]
),
check=check,
)
if has_luks:
device="/dev/mapper/" + partition["luksMapperName"]
return dict(device="/dev/mapper/" + partition["luksMapperName"],
mount_point=mount_point or "swap",
fs=filesystem,
options=options,
check=check,
)
else:
device="UUID=" + partition["uuid"]
......
......@@ -3,7 +3,7 @@
#
# === This file is part of Calamares - <http://github.com/calamares> ===
#
# Copyright 2014-2015, Philip Müller <philm@manjaro.org>
# Copyright 2014-2017, Philip Müller <philm@manjaro.org>
# Copyright 2015-2017, Teo Mrnjavac <teo@kde.org>
# Copyright 2017, Alf Gaida <agaida@siduction.org>
# Copyright 2017, Adriaan de Groot <groot@kde.org>
......@@ -60,10 +60,10 @@ def modify_grub_default(partitions, root_mount_point, distributor):
if have_dracut:
for partition in partitions:
has_luks = "luksMapperName" in partition
if partition["fs"] == "linuxswap" and not has_luks:
if partition["fs"].lower() == "linuxswap" and not has_luks:
swap_uuid = partition["uuid"]
if (partition["fs"] == "linuxswap" and has_luks):
if (partition["fs"].lower() == "linuxswap" and has_luks):
swap_outer_uuid = partition["luksUuid"]
swap_outer_mappername = partition["luksMapperName"]
......@@ -74,7 +74,7 @@ def modify_grub_default(partitions, root_mount_point, distributor):
else:
for partition in partitions:
has_luks = "luksMapperName" in partition
if partition["fs"] == "linuxswap" and not has_luks:
if partition["fs"].lower() == "linuxswap" and not has_luks:
swap_uuid = partition["uuid"]
if (partition["mountPoint"] == "/" and has_luks):
......
---
kernel: linux312
kernel: _kernel_
......@@ -100,6 +100,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
cpu = cpuinfo()
swap_uuid = ""
btrfs = ""
lvm2 = ""
hooks = ["base", "udev", "autodetect", "modconf", "block", "keyboard",
"keymap"]
modules = []
......@@ -114,14 +115,17 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
hooks.append("plymouth")
for partition in partitions:
if partition["fs"] == "linuxswap":
if partition["fs"].lower() == "linuxswap":
swap_uuid = partition["uuid"]
if "luksMapperName" in partition:
openswap_hook = True
if partition["fs"] == "btrfs":
if partition["fs"].lower() == "btrfs":
btrfs = "yes"
if "lvm2" in partition["fs"]:
lvm2 = "yes"
if partition["mountPoint"] == "/" and "luksMapperName" in partition:
encrypt_hook = True
......@@ -137,6 +141,9 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
):
files.append("/crypto_keyfile.bin")
if lvm2:
hooks.append("lvm2")
if swap_uuid != "":
if encrypt_hook and openswap_hook:
hooks.extend(["openswap"])
......
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -59,9 +60,9 @@ KeyboardLayoutModel::data( const QModelIndex& index, int role ) const
void
KeyboardLayoutModel::init()
{
QMap< QString, KeyboardGlobal::KeyboardInfo > layouts =
KeyboardGlobal::LayoutsMap layouts =
KeyboardGlobal::getKeyboardLayouts();
for ( QMap< QString, KeyboardGlobal::KeyboardInfo >::const_iterator it = layouts.constBegin();
for ( KeyboardGlobal::LayoutsMap::const_iterator it = layouts.constBegin();
it != layouts.constEnd(); ++it )
{
m_layouts.append( qMakePair( it.key(), it.value() ) );
......
......@@ -248,10 +248,58 @@ KeyboardPage::createJobs( const QString& xOrgConfFileName,
}
void
KeyboardPage::guessLayout( const QStringList& langParts )
{
const KeyboardLayoutModel* klm = dynamic_cast< KeyboardLayoutModel* >( ui->listLayout->model() );
bool foundCountryPart = false;
for ( auto countryPart = langParts.rbegin(); !foundCountryPart && countryPart != langParts.rend(); ++countryPart)
{
cDebug() << " .. looking for locale part" << *countryPart;
for ( int i = 0; i < klm->rowCount(); ++i )
{
QModelIndex idx = klm->index( i );
if ( idx.isValid() &&
( idx.data( KeyboardLayoutModel::KeyboardLayoutKeyRole ).toString().compare( *countryPart, Qt::CaseInsensitive ) == 0 ) )
{
cDebug() << " .. matched" << idx.data( KeyboardLayoutModel::KeyboardLayoutKeyRole ).toString();
ui->listLayout->setCurrentIndex( idx );
foundCountryPart = true;
break;
}
}
}
}
void
KeyboardPage::onActivate()
{
ui->listLayout->setFocus();
// Try to preselect a layout, depending on language and locale
Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
QString lang = gs->value( "localeConf" ).toMap().value( "LANG" ).toString();
cDebug() << "Got locale language" << lang;
if ( !lang.isEmpty() )
{
// Chop off .codeset and @modifier
int index = lang.indexOf('.');
if ( index >= 0 )
lang.truncate( index );
index = lang.indexOf('@');
if ( index >= 0 )
lang.truncate( index );
lang.replace( '-', '_' ); // Normalize separators
const auto langParts = lang.split( '_' , QString::SkipEmptyParts );
QString country = QLocale::countryToString( QLocale( lang ).country() );
cDebug() << " .. extracted country" << country << "::" << langParts;
guessLayout( langParts );
}
}
......
/* === This file is part of Calamares - <http://github.com/calamares> ===
*
* Copyright 2014-2016, Teo Mrnjavac <teo@kde.org>
* Copyright 2017, Adriaan de Groot <groot@kde.org>
*
* Portions from the Manjaro Installation Framework
* by Roland Singer <roland@manjaro.org>
......@@ -63,6 +64,15 @@ protected slots:
QListWidgetItem* previous );
private:
class LayoutItem : public QListWidgetItem
{
public:
QString data;
KeyboardGlobal::KeyboardInfo info;
};
/// Guess a layout based on the split-apart locale
void guessLayout( const QStringList& langParts );
void updateVariants( const QPersistentModelIndex& currentItem,
QString currentVariant = QString() );
......