From ff9483c2bd78a1b7857960f73ce5dfab61b93313 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Mon, 2 Sep 2019 11:38:25 -0400 Subject: [PATCH 1/7] [cleanup] remove unneeded conf --- src/modules/packagechooser/officechooser.conf | 79 ------------------- 1 file changed, 79 deletions(-) delete mode 100644 src/modules/packagechooser/officechooser.conf diff --git a/src/modules/packagechooser/officechooser.conf b/src/modules/packagechooser/officechooser.conf deleted file mode 100644 index 5c4b99329..000000000 --- a/src/modules/packagechooser/officechooser.conf +++ /dev/null @@ -1,79 +0,0 @@ -# Configuration for the low-density software chooser ---- -# The packagechooser writes a GlobalStorage value for the choice that -# has been made. The key is *packagechooser_*. If *id* is set here, -# it is substituted into the key name. If it is not set, the module's -# instance name is used; see the *instances* section of `settings.conf`. -# If there is just one packagechooser module, and no *id* is set, -# resulting GS key is probably *packagechooser_packagechooser*. -# -# The GS value is a comma-separated list of the IDs of the selected -# packages, or an empty string if none is selected. -# -# id: "" - -# Software selection mode, to set whether the software packages -# can be chosen singly, or multiply. -# -# Possible modes are "optional", "required" (for zero or one) -# or "optionalmultiple", "requiredmultiple" (for zero-or-more -# or one-or-more). -mode: required - -# Items to display in the chooser. In general, this should be a -# pretty short list to avoid overwhelming the UI. This is a list -# of objects, and the items are displayed in list order. -# -# Either provide the data for an item in the list (using the keys -# below), or use existing AppData XML files as a source for the data. -# -# For data provided by the list: the item has an id, which is used in -# setting the value of *packagechooser_*). The following fields -# are mandatory: -# -# - *id* ID for the product. The ID "" is special, and is used for -# "no package selected". Only include this if the mode allows -# selecting none. -# - *package* Package name for the product. While mandatory, this is -# not actually used anywhere. -# - *name* Human-readable name of the product. To provide translations, -# add a *[lang]* decoration as part of the key name, e.g. `name[nl]` -# for Dutch. The list of usable languages can be found in -# `CMakeLists.txt` or as part of the debug output of Calamares. -# - *description* Human-readable description. These can be translated -# as well. -# - *screenshot* Path to a single screenshot of the product. May be -# a filesystem path or a QRC path (e.g. ":/images/no-selection.png"). -# -# Use the empty string "" as ID / key for the "no selection" item if -# you want to customize the display of that item as well. -# -# For data provided by AppData XML: the item has an *appdata* -# key which points to an AppData XML file in the local filesystem. -# This file is parsed to provide the id (from AppData id), name -# (from AppData name), description (from AppData description paragraphs -# or the summary entries), and a screenshot (the defautl screenshot -# from AppData). No package is set (but that is unused anyway). -# -# AppData may contain IDs that are not useful inside Calamares, -# and the screenshot URL may be remote -- a remote URL will not -# be loaded and the screenshot will be missing. An item with *appdata* -# **may** specify an ID or screenshot path, as above. This will override -# the settings from AppData. -items: - - id: "" - package: "" - name: "No Office Suite" - 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." - screenshot: ":/images/choose-office.jpg" - - id: "libreoffice-still" - package: "libreoffice-still" - name: "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." - screenshot: ":/images/LibreOffice.jpg" - - id: "freeoffice" - package: "freeoffice" - name: "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 directly in the application." - screenshot: ":/images/FreeOffice.jpg" - From 703640f7c2a219e6ac57246fe6ddf0426f77a4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Mon, 2 Sep 2019 11:46:10 -0400 Subject: [PATCH 2/7] [packagechooser] use our images --- src/modules/packagechooser/packagechooser.qrc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/packagechooser/packagechooser.qrc b/src/modules/packagechooser/packagechooser.qrc index 3b9c96a5b..954a2df08 100644 --- a/src/modules/packagechooser/packagechooser.qrc +++ b/src/modules/packagechooser/packagechooser.qrc @@ -1,6 +1,7 @@ - images/no-selection.png - images/calamares.png + images/choose-office.jpg + images/FreeOffice.jpg + images/LibreOffice.jpg From 250093d9f0c4e55e245af5d21dcc7749ae3900ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Mon, 2 Sep 2019 14:18:17 -0400 Subject: [PATCH 3/7] [postcfg] update value --- src/modules/packagechooser/packagechooser.conf | 2 +- src/modules/postcfg/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/packagechooser/packagechooser.conf b/src/modules/packagechooser/packagechooser.conf index 1c478d888..28f06f32b 100644 --- a/src/modules/packagechooser/packagechooser.conf +++ b/src/modules/packagechooser/packagechooser.conf @@ -95,7 +95,7 @@ items: 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. + 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" diff --git a/src/modules/postcfg/main.py b/src/modules/postcfg/main.py index 89182b927..80b030165 100644 --- a/src/modules/postcfg/main.py +++ b/src/modules/postcfg/main.py @@ -112,7 +112,7 @@ class ConfigController: 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_officechooser") + office_package = libcalamares.globalstorage.value("packagechooser_packagechooser") if not office_package: libcalamares.utils.warning("no office suite selected, {!s}".format(office_package)) else: From e797bb0dc5d35d1663d3547507dfa092f9af1412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Mon, 2 Sep 2019 14:18:17 -0400 Subject: [PATCH 4/7] [modules] add mkdir and rmdir for 'opt/mhwd' --- src/modules/mhwdcfg/main.py | 8 ++++++++ src/modules/postcfg/main.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/src/modules/mhwdcfg/main.py b/src/modules/mhwdcfg/main.py index 717596c57..5335e3e87 100644 --- a/src/modules/mhwdcfg/main.py +++ b/src/modules/mhwdcfg/main.py @@ -72,9 +72,16 @@ class MhwdController: def mount(self, mp): 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", "/" + mp, 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") cmd.extend(["--pmconfig", self.repo]) @@ -84,6 +91,7 @@ class MhwdController: if self.local: self.umount("opt/mhwd") + self.rmdir("opt/mhwd") self.umount("var/lib/mhwd") self.umount("etc/resolv.conf") diff --git a/src/modules/postcfg/main.py b/src/modules/postcfg/main.py index 80b030165..90b454e16 100644 --- a/src/modules/postcfg/main.py +++ b/src/modules/postcfg/main.py @@ -68,6 +68,12 @@ class ConfigController: 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", "/" + mp, join(self.root, dir)]) + def run(self): self.init_keyring() self.populate_keyring() @@ -118,10 +124,12 @@ class ConfigController: 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 From bba3ce09cd581db200f5ed8040a2093ca0f57940 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Mon, 2 Sep 2019 16:42:19 -0400 Subject: [PATCH 5/7] [modules] fix mkdir for 'opt/mhwd' --- src/modules/mhwdcfg/main.py | 2 +- src/modules/postcfg/main.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/mhwdcfg/main.py b/src/modules/mhwdcfg/main.py index 5335e3e87..da385ceee 100644 --- a/src/modules/mhwdcfg/main.py +++ b/src/modules/mhwdcfg/main.py @@ -76,7 +76,7 @@ class MhwdController: subprocess.call(["rm", "-Rf", join(self.root, dir)]) def mkdir(self, dir): - subprocess.call(["mkdir", "-p", "/" + mp, join(self.root, dir)]) + subprocess.call(["mkdir", "-p", join(self.root, dir)]) def configure(self, name, id): cmd = ["mhwd", "-a", str(name), str(self.driver), str(id).zfill(4)] diff --git a/src/modules/postcfg/main.py b/src/modules/postcfg/main.py index 90b454e16..9fec42289 100644 --- a/src/modules/postcfg/main.py +++ b/src/modules/postcfg/main.py @@ -72,7 +72,7 @@ class ConfigController: subprocess.call(["rm", "-Rf", join(self.root, dir)]) def mkdir(self, dir): - subprocess.call(["mkdir", "-p", "/" + mp, join(self.root, dir)]) + subprocess.call(["mkdir", "-p", join(self.root, dir)]) def run(self): self.init_keyring() From a2a47826d40f19fe4f2b6f354c5a53513bb36f25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Mon, 2 Sep 2019 17:23:09 -0400 Subject: [PATCH 6/7] [mhwdcfg] fix call cmd --- src/modules/mhwdcfg/main.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/mhwdcfg/main.py b/src/modules/mhwdcfg/main.py index da385ceee..8944c9945 100644 --- a/src/modules/mhwdcfg/main.py +++ b/src/modules/mhwdcfg/main.py @@ -4,7 +4,7 @@ # === This file is part of Calamares - === # # Copyright 2016, Artoo -# Copyright 2016-2017, Philip Müller +# Copyright 2016-2019, Philip Müller # # Calamares is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -73,10 +73,10 @@ class MhwdController: call(["mount", "-B", "/" + mp, join(self.root, mp)]) def rmdir(self, dir): - subprocess.call(["rm", "-Rf", join(self.root, dir)]) + call(["rm", "-Rf", join(self.root, dir)]) def mkdir(self, dir): - subprocess.call(["mkdir", "-p", join(self.root, 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)] From 71d26e85e1c577a356ab2101caf1bf0265ca6b2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20M=C3=BCller?= Date: Mon, 2 Sep 2019 18:15:25 -0400 Subject: [PATCH 7/7] [mhwdcfg] fix mounting mhwd/db blacklists --- src/modules/mhwdcfg/main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/mhwdcfg/main.py b/src/modules/mhwdcfg/main.py index 8944c9945..f1bb07d91 100644 --- a/src/modules/mhwdcfg/main.py +++ b/src/modules/mhwdcfg/main.py @@ -83,7 +83,7 @@ class MhwdController: if self.local: self.mkdir("opt/mhwd") self.mount("opt/mhwd") - self.mount("var/lib/mhwd") + self.mount("var/lib/mhwd/db") cmd.extend(["--pmconfig", self.repo]) self.mount("etc/resolv.conf") @@ -92,7 +92,7 @@ class MhwdController: if self.local: self.umount("opt/mhwd") self.rmdir("opt/mhwd") - self.umount("var/lib/mhwd") + self.umount("var/lib/mhwd/db") self.umount("etc/resolv.conf") def run(self):