...
 
Commits (104)
......@@ -10,7 +10,7 @@ services:
notifications:
irc:
- "chat.freenode.net#calamares"
- "chat.freenode.net#manjaro"
install:
- docker build -t calamares .
......
......@@ -40,10 +40,10 @@
cmake_minimum_required( VERSION 3.3 FATAL_ERROR )
project( CALAMARES
VERSION 3.2.25
VERSION 3.2.24
LANGUAGES C CXX )
set( CALAMARES_VERSION_RC 1 ) # Set to 0 during release cycle, 1 during development
set( CALAMARES_VERSION_RC 0 ) # Set to 0 during release cycle, 1 during development
### OPTIONS
#
......
/* 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
Name[da]=Installer Manjaro Linux
GenericName=Live Installer
GenericName[da]=Live-installationsprogram
Comment=Install the operating system to disk
Comment[da]=Installer styresystemet på 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
This diff is collapsed.
......@@ -87,17 +87,12 @@ modules-search: [ local ]
sequence:
- show:
- welcome
# - notesqml
- locale
- keyboard
- partition
- users
# - tracking
- summary
- exec:
# - dummycpp
# - dummyprocess
# - dummypython
- partition
- mount
- unpackfs
......@@ -106,24 +101,22 @@ sequence:
- locale
- keyboard
- localecfg
# - luksbootkeyfile
# - luksopenswaphookcfg
# - dracutlukscfg
# - plymouthcfg
- luksopenswaphookcfg
- luksbootkeyfile
- plymouthcfg
- initcpiocfg
- initcpio
- users
- displaymanager
- mhwdcfg
- networkcfg
- hwclock
- services-systemd
# - dracut
- initramfs
# - grubcfg
- grubcfg
- bootloader
- postcfg
- umount
- show:
# - webview@owncloud
- finished
# A branding component is a directory, either in SHARE/calamares/branding or
......@@ -138,7 +131,7 @@ sequence:
# 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
......
---
componentName: manjaro
# This selects between different welcome texts. When false, uses
# the traditional "Welcome to the %1 installer.", and when true,
# uses "Welcome to the Calamares installer for %1." This allows
# to distinguish this installer from other installers for the
# same distribution.
welcomeStyleCalamares: false
# Should the welcome image (productWelcome, below) be scaled
# up beyond its natural size? If false, the image does not grow
# with the window but remains the same size throughout (this
# may have surprising effects on HiDPI monitors).
welcomeExpandingLogo: true
# Size and expansion policy for Calamares.
# - "normal" or unset, expand as needed, use *windowSize*
# - "fullscreen", start as large as possible, ignore *windowSize*
# - "noexpand", never expand, use *windowSize*
windowExpanding: noexpand
# Size of Calamares window, expressed as w,h. Both w and h
# may be either pixels (suffix px) or font-units (suffix em).
# e.g. "800px,600px"
# "60em,480px"
# This setting is ignored if "fullscreen" is selected for
# *windowExpanding*, above. If not set, use constants defined
# in CalamaresUtilsGui, 800x520.
windowSize: 820px,540px
# Placement of Calamares window. Either "center" or "free".
# Whether "center" actually works does depend on the window
# manager in use (and only makes sense if you're not using
# *windowExpanding* set to "fullscreen").
windowPlacement: center
# These are strings shown to the user in the user interface.
# There is no provision for translating them -- since they
# are names, the string is included as-is.
#
# The four Url strings are the Urls used by the buttons in
# the welcome screen, and are not shown to the user. Clicking
# on the "Support" button, for instance, opens the link supportUrl.
# If a Url is empty, the corresponding button is not shown.
#
# bootloaderEntryName is how this installation / distro is named
# in the boot loader (e.g. in the GRUB menu).
strings:
productName: Manjaro Linux
shortProductName: Manjaro
version: 20.0
shortVersion: 20.0
versionedName: Manjaro Linux 20.0 "Lysia"
shortVersionedName: Manjaro 20.0
bootloaderEntryName: Manjaro
# These images are loaded from the branding module directory.
#
# productIcon is used as the window icon, and will (usually) be used
# by the window manager to represent the application. This image
# should be square, and may be displayed by the window manager
# as small as 16x16 (but possibly larger).
# productLogo is used as the logo at the top of the left-hand column
# which shows the steps to be taken. The image should be square,
# and is displayed at 80x80 pixels (also on HiDPI).
# productWelcome is shown on the welcome page of the application in
# the middle of the window, below the welcome text. It can be
# any size and proportion, and will be scaled to fit inside
# the window. Use `welcomeExpandingLogo` to make it non-scaled.
# Recommended size is 320x150.
images:
productLogo: "logo.png"
productIcon: "logo.png"
productWelcome: "languages.png"
# The slideshow is displayed during execution steps (e.g. when the
# installer is actually writing to disk and doing other slow things).
slideshow: "show.qml"
# Colors for text and background components.
#
# - sidebarBackground is the background of the sidebar
# - sidebarText is the (foreground) text color
# - sidebarTextHighlight sets the background of the selected (current) step.
# Optional, and defaults to the application palette.
# - sidebarSelect is the text color of the selected step.
#
style:
sidebarBackground: "#454948"
sidebarText: "#efefef"
sidebarTextSelect: "#4d915e"
sidebarTextHighlight: "#1a1c1b"
/* === 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
}
}
}
......@@ -8,17 +8,17 @@ efiBootLoader: "grub"
# systemd-boot configuration files settings, set kernel and initramfs file names
# and amount of time before default selection boots
kernel: "/vmlinuz-linux"
img: "/initramfs-linux.img"
fallback: "/initramfs-linux-fallback.img"
kernel: "_ALL_kver_"
img: "_default_image_"
fallback: "_fallback_image_"
timeout: "10"
# Optionally set the menu entry name and kernel name to use in systemd-boot.
# If not specified here, these settings will be taken from branding.desc.
#
# bootloaderEntryName: "Generic GNU/Linux"
# kernelLine: ", with Stable-Kernel"
# fallbackKernelLine: ", with Stable-Kernel (fallback initramfs)"
# bootloaderEntryName: "Manjaro"
kernelLine: ", with _manjaro_kernel_"
fallbackKernelLine: ", with _manjaro_kernel_ (fallback initramfs)"
# GRUB 2 binary names and boot directory
# Some distributions (e.g. Fedora) use grub2-* (resp. /boot/grub2/) names.
......
---
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
......@@ -10,7 +10,7 @@
# options from this mapping.
mountOptions:
default: defaults,noatime
btrfs: defaults,noatime,space_cache,autodefrag
btrfs: defaults,noatime,space_cache
# Mount options to use for the EFI System Partition. If not defined, the
# *mountOptions* for *vfat* are used, or if that is not set either,
......@@ -38,7 +38,7 @@ efiMountOptions: umask=0077
# The standard configuration applies only lzo compression to btrfs
# and does nothing for other filesystems.
ssdExtraMountOptions:
btrfs: compress=lzo
btrfs: ssd,compress=zstd,commit=120
# Additional options added to each line in /etc/crypttab
crypttabOptions: luks
......
......@@ -3,7 +3,7 @@
#
# === This file is part of Calamares - <https://github.com/calamares> ===
#
# Copyright 2014-2015, Philip Müller <philm@manjaro.org>
# Copyright 2014-2019, Philip Müller <philm@manjaro.org>
# Copyright 2015-2017, Teo Mrnjavac <teo@kde.org>
# Copyright 2017, Alf Gaida <agaida@siduction.org>
# Copyright 2017, 2019, Adriaan de Groot <groot@kde.org>
......@@ -68,6 +68,8 @@ def modify_grub_default(partitions, root_mount_point, distributor):
have_plymouth = plymouth_bin == 0
have_dracut = dracut_bin == 0
enable_apparmor = "apparmor=1"
set_security = ""
use_splash = ""
swap_uuid = ""
swap_outer_uuid = ""
......@@ -128,9 +130,14 @@ def modify_grub_default(partitions, root_mount_point, distributor):
if cryptdevice_params:
kernel_params.extend(cryptdevice_params)
if use_splash:
if use_splash and not os.path.exists(os.path.join(root_mount_point, "usr/bin/grub-set-bootflag")):
kernel_params.append(use_splash)
if os.path.exists(os.path.join(root_mount_point, "usr/lib/libapparmor.so")):
set_security = "security=apparmor"
kernel_params.append(enable_apparmor)
kernel_params.append(set_security)
if swap_uuid:
kernel_params.append("resume=UUID={!s}".format(swap_uuid))
......
......@@ -4,7 +4,7 @@
# === This file is part of Calamares - <https://github.com/calamares> ===
#
# Copyright 2014, Rohan Garg <rohan@kde.org>
# Copyright 2015,2019-2020, Philip Müller <philm@manjaro.org>
# Copyright 2015,2019,2020, Philip Müller <philm@manjaro.org>
# Copyright 2017, Alf Gaida <agaida@sidution.org>
# Copyright 2019, Adriaan de Groot <groot@kde.org>
#
......@@ -136,6 +136,13 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
if detect_plymouth():
hooks.append("plymouth")
# Detect bootsplash theme and enable hook
bootsplash_folder = os.path.join(root_mount_point, "usr/lib/firmware/bootsplash-themes")
if os.path.exists(bootsplash_folder):
bootsplash_themes = os.listdir(bootsplash_folder)
for bootsplash_theme in bootsplash_themes:
hooks.append("bootsplash-{!s}".format(bootsplash_theme))
for partition in partitions:
if partition["fs"] == "linuxswap" and not partition.get("claimed", None):
# Skip foreign swap
......@@ -185,7 +192,7 @@ def modify_mkinitcpio_conf(partitions, root_mount_point):
elif (btrfs == "yes"
and cpu['proc0']['vendor_id'].lower() == "genuineintel"):
modules.append("crc32c-intel")
else:
elif not os.path.exists(os.path.join(root_mount_point, "usr/bin/grub-set-bootflag")):
hooks.append("fsck")
write_mkinitcpio_lines(hooks, modules, files, root_mount_point)
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <http://github.com/calamares> ===
#
# Copyright 2016, Artoo <artoo@manjaro.org>
# Copyright 2016-2019, 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 libcalamares
from libcalamares.utils import target_env_call, debug
from os.path import join
from subprocess import call
class MhwdController:
def __init__(self):
self.__root = libcalamares.globalstorage.value("rootMountPoint")
self.__bus = libcalamares.job.configuration.get('bus', [])
self.__identifier = libcalamares.job.configuration.get(
'identifier',
[]
)
self.__local = libcalamares.job.configuration['local']
self.__repo = libcalamares.job.configuration['repo']
self._driver = libcalamares.job.configuration['driver']
@property
def driver(self):
return self._driver
@driver.setter
def driver(self, value):
self._driver = value
@property
def root(self):
return self.__root
@property
def local(self):
return self.__local
@property
def repo(self):
return self.__repo
@property
def identifier(self):
return self.__identifier
@property
def bus(self):
return self.__bus
def umount(self, mp):
call(["umount", "-l", join(self.root, mp)])
def mount(self, mp):
call(["mount", "-B", "/" + mp, join(self.root, mp)])
def rmdir(self, dir):
call(["rm", "-Rf", join(self.root, dir)])
def mkdir(self, dir):
call(["mkdir", "-p", join(self.root, dir)])
def configure(self, name, id):
cmd = ["mhwd", "-a", str(name), str(self.driver), str(id).zfill(4)]
if self.local:
self.mkdir("opt/mhwd")
self.mount("opt/mhwd")
self.mount("var/lib/mhwd/db")
cmd.extend(["--pmconfig", self.repo])
self.mount("etc/resolv.conf")
target_env_call(cmd)
if self.local:
self.umount("opt/mhwd")
self.rmdir("opt/mhwd")
self.umount("var/lib/mhwd/db")
self.umount("etc/resolv.conf")
def run(self):
for b in self.bus:
for id in self.identifier['net']:
self.configure(b, id)
for id in self.identifier['video']:
self.configure(b, id)
return None
def run():
""" Configure the hardware """
mhwd = MhwdController()
return mhwd.run()
---
bus:
- pci
# - usb
identifier:
net:
- 200
- 280
video:
- 300
- 302
- 380
driver: free
local: true
repo: /opt/mhwd/pacman-mhwd.conf
# Syntax is YAML 1.2
---
type: "job"
name: "mhwdcfg"
interface: "python"
script: "main.py" #assumed relative to the current directory
......@@ -85,3 +85,4 @@ def run():
dmcrypt_conf_path = dmcrypt_conf_path.lstrip('/')
return write_dmcrypt_conf(partitions, root_mount_point, dmcrypt_conf_path)
......@@ -30,8 +30,8 @@ mode: required
# with the explicit id "".
#
labels:
step: "Packages"
step[nl]: "Pakketten"
step: "Office Suite"
step[de]: "Office-Paket"
# (Optional) 'id' of pre-selected list-view item.
# Pre-selects one of the items below.
......@@ -91,23 +91,22 @@ labels:
items:
- id: ""
package: ""
name: "No Desktop"
name[nl]: "Geen desktop"
description: "Please pick a desktop environment from the list. If you don't want to install a desktop, that's fine, your system will start up in text-only mode and you can install a desktop environment later."
description[nl]: "Kies eventueel een desktop-omgeving uit deze lijst. Als u geen desktop-omgeving wenst te gebruiken, kies er dan geen. In dat geval start het systeem straks op in tekst-modus en kunt u later alsnog een desktop-omgeving installeren."
screenshot: ":/images/no-selection.png"
- id: kde
package: kde
name: Plasma Desktop
description: "KDE Plasma Desktop, simple by default, a clean work area for real-world usage which intends to stay out of your way. Plasma is powerful when needed, enabling the user to create the workflow that makes them more effective to complete their tasks."
screenshot: ":/images/kde.png"
- id: gnome
package: gnome
name: GNOME
description: GNU Networked Object Modeling Environment Desktop
screenshot: ":/images/gnome.png"
- id: calamares
appdata: ../io.calamares.calamares.appdata.xml
screenshot: ":/images/calamares.png"
- id: kate
appstream: org.kde.kwrite.desktop
name: "No Office Suite"
name[de]: "Kein Office Paket"
description: "Please pick an office suite from the list. If you don't want to install an office suite, that's fine, you can install one later as needed."
description[de]: "Bitte wählen Sie ein Office-Paket von der Liste. Wenn Sie kein Office installieren wollen, kann dies auch zu einer späteren Zeitpunkt erfolgen."
screenshot: ":/images/choose-office.jpg"
- id: "libreoffice-still"
package: "libreoffice-still"
name: "LibreOffice"
name[de]: "LibreOffice"
description: "LibreOffice is a powerful and free office suite, used by millions of people around the world. Its clean interface and feature-rich tools help you unleash your creativity and enhance your productivity."
description[de]: "LibreOffice ist ein leistungsstarkes Office-Paket. Die klare Oberfläche und mächtigen Werkzeuge lassen Sie Ihre Kreativität entfalten und Ihre Produktivität steigern."
screenshot: ":/images/LibreOffice.jpg"
- id: "freeoffice"
package: "freeoffice"
name: "FreeOffice"
name[de]: "FreeOffice"
description: "FreeOffice is a powerful Office suite with word processing, spreadsheet and presentation software. It is seamlessly compatible with Microsoft Office and can be used free of charge. For long-term use, request a free product key directly in the application."
description[de]: "FreeOffice ist ein leistungsstarkes Office-Paket mit Textverarbeitung, Tabellenkalkulation und Präsentationssoftware. Es ist nahtlos kompatible zu Microsoft Office und kann frei genutzt werden. Für eine Langzeitnutzung kann ein Produktkey im Programm angefordert werden."
screenshot: ":/images/FreeOffice.jpg"
<RCC>
<qresource prefix="/">
<file>images/no-selection.png</file>
<file>images/calamares.png</file>
<file>images/choose-office.jpg</file>
<file>images/FreeOffice.jpg</file>
<file>images/LibreOffice.jpg</file>
</qresource>
</RCC>
/* === This file is part of Calamares - <https://github.com/calamares> ===
*
* Copyright 2014, Aurélien Gâteau <agateau@kde.org>
* Copyright 2018, Philip Müller <philm@manjaro.org>
* Copyright 2017, 2019 Adriaan de Groot <groot@kde.org>
*
* Calamares is free software: you can redistribute it and/or modify
......
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <http://github.com/calamares> ===
#
# Copyright 2014 - 2019, Philip Müller <philm@manjaro.org>
# Copyright 2016, Artoo <artoo@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 libcalamares
import subprocess
from shutil import copy2
from distutils.dir_util import copy_tree
from os.path import join, exists
from libcalamares.utils import target_env_call
class ConfigController:
def __init__(self):
self.__root = libcalamares.globalstorage.value("rootMountPoint")
self.__keyrings = libcalamares.job.configuration.get('keyrings', [])
@property
def root(self):
return self.__root
@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 terminate(self, proc):
target_env_call(['killall', '-9', proc])
def copy_file(self, file):
if exists("/" + file):
copy2("/" + file, join(self.root, file))
def copy_folder(self, source, target):
if exists("/" + source):
copy_tree("/" + source, join(self.root, target))
def remove_pkg(self, pkg, path):
if exists(join(self.root, path)):
target_env_call(['pacman', '-R', '--noconfirm', pkg])
def umount(self, mp):
subprocess.call(["umount", "-l", join(self.root, mp)])
def mount(self, mp):
subprocess.call(["mount", "-B", "/" + mp, join(self.root, mp)])
def rmdir(self, dir):
subprocess.call(["rm", "-Rf", join(self.root, dir)])
def mkdir(self, dir):
subprocess.call(["mkdir", "-p", join(self.root, dir)])
def run(self):
self.init_keyring()
self.populate_keyring()
# Generate mirror list
if exists(join(self.root, "usr/bin/pacman-mirrors")):
if libcalamares.globalstorage.value("hasInternet"):
target_env_call(["pacman-mirrors", "-f3"])
else:
self.copy_file('etc/pacman.d/mirrorlist')
# Initialize package manager databases
if libcalamares.globalstorage.value("hasInternet"):
target_env_call(["pacman", "-Syy"])
# Remove unneeded ucode
cpu_ucode = subprocess.getoutput("hwinfo --cpu | grep Vendor: -m1 | cut -d\'\"\' -f2")
if cpu_ucode == "AuthenticAMD":
self.remove_pkg("intel-ucode", "boot/intel-ucode.img")
elif cpu_ucode == "GenuineIntel":
self.remove_pkg("amd-ucode", "boot/amd-ucode.img")
# Remove calamares
self.remove_pkg("calamares", "usr/bin/calamares")
# Copy skel to root
self.copy_folder('etc/skel', 'root')
# Workaround for pacman-key bug
# FS#45351 https://bugs.archlinux.org/task/45351
# We have to kill gpg-agent because if it stays
# around we can't reliably unmount
# the target partition.
self.terminate('gpg-agent')
# Update grub.cfg
if exists(join(self.root, "usr/bin/update-grub")):
target_env_call(["update-grub"])
# Enable 'menu_auto_hide' when supported in grubenv
if exists(join(self.root, "usr/bin/grub-set-bootflag")):
target_env_call(["grub-editenv", "-", "set", "menu_auto_hide=1", "boot_success=1"])
# Install Office Suite if selected (WIP)
office_package = libcalamares.globalstorage.value("packagechooser_packagechooser")
if not office_package:
libcalamares.utils.warning("no office suite selected, {!s}".format(office_package))
else:
# For PoC we added the Office Packages to mhwd-live overlay in 18.1.0
cmd = ["pacman", "-S", office_package, "--noconfirm", "--config", "/opt/mhwd/pacman-mhwd.conf" ]
self.mkdir("opt/mhwd")
self.mount("opt/mhwd")
self.mount("etc/resolv.conf")
target_env_call(cmd)
self.umount("opt/mhwd")
self.rmdir("opt/mhwd")
self.umount("etc/resolv.conf")
return None
def run():
""" Misc postinstall configurations """
config = ConfigController()
return config.run()
# Syntax is YAML 1.2
---
type: "job"
name: "postcfg"
interface: "python"
script: "main.py" #assumed relative to the current directory
---
keyrings:
- archlinux
- manjaro
......@@ -63,8 +63,25 @@
# - mandatory: true
# By default, no changes are made.
services: []
targets: []
disable: []
#services: []
#targets: []
#disable: []
disable-targets: []
mask: []
# Manjaro settings
services:
- name: "NetworkManager"
mandatory: false
- name: "org.cups.cupsd"
mandatory: false
targets:
- name: "graphical"
mandatory: true
disable:
- name: "pacman-init"
mandatory: false
#!/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 libcalamares
from libcalamares.utils import target_env_call
from os.path import exists, join
class ServicesController:
def __init__(self):
self.__root = libcalamares.globalstorage.value('rootMountPoint')
self.__services = libcalamares.job.configuration.get('services', [])
@property
def root(self):
return self.__root
@property
def services(self):
return self.__services
def setExpression(self, pattern, file):
target_env_call(["sed", "-e", pattern, "-i", file])
def configure(self):
self.setExpression(
's|^.*rc_shell=.*|rc_shell="/usr/bin/sulogin"|',
"/etc/rc.conf"
)
self.setExpression(
's|^.*rc_controller_cgroups=.*|rc_controller_cgroups="YES"|',
"/etc/rc.conf"
)
exp = 's|^.*keymap=.*|keymap="' \
+ libcalamares.globalstorage.value("keyboardLayout") \
+ '"|'
self.setExpression(exp, "/etc/conf.d/keymaps")
self.setExpression(
's|pam_systemd.so|pam_ck_connector.so nox11|',
"/etc/pam.d/system-login"
)
for dm in libcalamares.globalstorage.value("displayManagers"):
exp = 's|^.*DISPLAYMANAGER=.*|DISPLAYMANAGER="' + dm + '"|'
self.setExpression(exp, "/etc/conf.d/xdm")
if dm == "lightdm":
self.setExpression(
's|^.*minimum-vt=.*|minimum-vt=7|',
"/etc/lightdm/lightdm.conf"
)
self.setExpression(
's|pam_systemd.so|pam_ck_connector.so nox11|',
"/etc/pam.d/lightdm-greeter"
)
if exists(join(self.root, "etc/pulse/client.conf")):
self.setExpression(
's|autospawn = no|autospawn = yes|',
"/etc/pulse/client.conf"
)
def update(self, action, state):
for svc in self.services[state]:
if exists(self.root + "/etc/init.d/" + svc["name"]):
target_env_call([
"rc-update",
action,
svc["name"],
svc["runlevel"]
])
def run(self):
self.configure()
for state in self.services.keys():
if state == "enabled":
self.update("add", "enabled")
elif state == "disabled":
self.update("del", "disabled")
return None
def run():
""" Setup openrc services """
sc = ServicesController()
return sc.run()
---
type: "job"
name: "servicescfg"
interface: "python"
requires: []
script: "main.py"
---
services:
enabled:
- name: "NetworkManager"
runlevel: "default"
- name: "cups"
runlevel: "default"
# disabled:
# - name: "hwclock"
# runlevel: "boot"