Git-Url: http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=e49d0fa9ae1fb044c2c1446ff8668f0bf2bdf23d
commit e49d0fa9ae1fb044c2c1446ff8668f0bf2bdf23d Author: crazy <[email protected]> Date: Sun Oct 22 06:32:49 2017 +0200 calamares-frugalware-3.1.6-2-x86_64 * import work from my frugalware-dev branch * remane guest to live diff --git a/source/kde5-extra/calamares-frugalware/0001-import-chrootcfg-from-artix-with-some-changes.patch b/source/kde5-extra/calamares-frugalware/0001-import-chrootcfg-from-artix-with-some-changes.patch new file mode 100644 index 0000000..d737b19 --- /dev/null +++ b/source/kde5-extra/calamares-frugalware/0001-import-chrootcfg-from-artix-with-some-changes.patch @@ -0,0 +1,288 @@ +From 0d7c23eff012d57a238275e3b3fe9392f07f6e5c Mon Sep 17 00:00:00 2001 +From: Gabriel Craciunescu <[email protected]> +Date: Sun, 22 Oct 2017 02:13:51 +0200 +Subject: [PATCH 1/6] import chrootcfg from artix ( with some changes ) + +- netinstall upstream is broken wth 3.x and packages module +- this one still need some changes .. however it may work better +--- + src/modules/chrootcfg/chrootcfg.conf | 14 +++ + src/modules/chrootcfg/main.py | 231 +++++++++++++++++++++++++++++++++++ + src/modules/chrootcfg/module.desc | 6 + + 3 files changed, 251 insertions(+) + create mode 100644 src/modules/chrootcfg/chrootcfg.conf + create mode 100644 src/modules/chrootcfg/main.py + create mode 100644 src/modules/chrootcfg/module.desc + +diff --git a/src/modules/chrootcfg/chrootcfg.conf b/src/modules/chrootcfg/chrootcfg.conf +new file mode 100644 +index 000000000..5ed526f93 +--- /dev/null ++++ b/src/modules/chrootcfg/chrootcfg.conf +@@ -0,0 +1,14 @@ ++--- ++requirements: ++ - name: /etc ++ mode: "0o755" ++ - name: /var/cache/pacman-g2/pkg ++ mode: "0o755" ++ - name: /var/lib/pacman-g2 ++ mode: "0o755" ++ ++# these only work once we merge with upstream pacman ++# DO NOT enable ++#keyrings: ++# - archlinux ++# - artix +diff --git a/src/modules/chrootcfg/main.py b/src/modules/chrootcfg/main.py +new file mode 100644 +index 000000000..459cb7158 +--- /dev/null ++++ b/src/modules/chrootcfg/main.py +@@ -0,0 +1,231 @@ ++#!/usr/bin/env python3 ++# -*- coding: utf-8 -*- ++# ++# === This file is part of Calamares - <http://github.com/calamares> === ++# ++# Copyright 2016, Artoo <[email protected]> ++# Copyright 2017, Philip Müller <[email protected]> ++# Copyright 2016, Artoo <[email protected]> ++# ++# 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 re ++import shutil ++import subprocess ++import libcalamares ++from os.path import join ++ ++from libcalamares.utils import check_target_env_call, target_env_call, debug ++ ++ON_POSIX = os.name == 'posix' ++ ++ ++class OperationTracker: ++ """Tracks the overall operation process ++ """ ++ ++ def __init__(self): ++ self.downloaded = 0 ++ self.installed = 0 ++ self.total = 0 ++ self.progress = 0.00 ++ ++ def send_progress(self, counter, phase): ++ """Send progress to calamares ++ """ ++ ++ for _ in range(phase): ++ if self.total == 0: ++ continue ++ ++ self.progress += ( ++ 0.05 + (0.95 * (counter / self.total)) ++ ) / self.total ++ debug("Progress: {}".format(self.progress)) ++ ++ libcalamares.job.setprogress(self.progress) ++ ++ ++class PacmanController: ++ """Wrapper around pacman ++ """ ++ ++ def __init__(self, root): ++ self.root = root ++ self.operations = libcalamares.globalstorage.value( ++ 'packageOperations' ++ ) ++ self.tracker = OperationTracker() ++ #self.keyrings = libcalamares.job.configuration.get('keyrings', []) ++ ++ def init_keyring(self): ++ """Initializes pacman keyring ++ """ ++ ++ #target_env_call(["pacman-key", "--init"]) ++ ++ def populate_keyring(self): ++ """Populates pacman keyring ++ """ ++ ++ #target_env_call(["pacman-key", "--populate"] + self.keyrings) ++ ++ def parse_output(self, cmd): ++ """Parses installation output ++ """ ++ ++ cal_env = os.environ.copy() ++ 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 process.stdout.readlines(): ++ pkgs = re.findall(r'\((\d+)\)', line.decode()) ++ dl = re.findall(r'downloading\s+(.*).fpm', 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): ++ """Install the given packagelist ++ """ ++ ++ cachedir = join(self.root, "var/cache/pacman-g2/pkg") ++ dbdir = join(self.root, "var/lib/pacman-g2") ++ ++ args = 'pacman --noconfirm {} --root {} --dbpath {} {}' ++ cmd = args.format( ++ '-U' if local else '-Sy', cachedir, self.root, dbdir, ++ ' '.join(pkglist) ++ ) ++ ++ self.parse_output(cmd.split()) ++ ++ def remove(self, pkglist): ++ """Remove the given packagelist ++ """ ++ ++ check_target_env_call( ++ 'chroot {} pacman -Rs --noconfirm {}'.format(self.root, pkglist) ++ ) ++ ++ def run(self): ++ """Run operations ++ """ ++ ++ pkgs = [] ++ for key in self.operations.keys(): ++ # append package to pkgs ++ [pkgs.append(p['package']) for p in self.operations[key]] ++ ++ if key in ["install", "localinstall"]: ++ self.install(pkgs, local=False if key == 'install' else True) ++ elif key == "remove": ++ self.tracker.total(len(pkgs)) ++ self.remove(pkgs) ++ elif key == "try_install": ++ self.install(pkgs) ++ elif key == "try_remove": ++ self.remove(pkgs) ++ ++ #self.init_keyring() ++ #self.populate_keyring() ++ ++ ++class ChrootController: ++ """Chroot controller ++ """ ++ ++ def __init__(self): ++ self.root = libcalamares.globalstorage.value('rootMountPoint') ++ self.requirements = libcalamares.job.configuration.get( ++ 'requirements', [] ++ ) ++ ++ def make_dirs(self): ++ """Create needed directories ++ """ ++ ++ for target in self.requirements: ++ dest = '{}{}'.format(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 copy_file(self, file): ++ """Copy the given file into root ++ """ ++ ++ orig = os.path.join("/", file) ++ if os.path.exists(orig): ++ shutil.copy2(orig, os.path.join(self.root, file)) ++ ++ def prepare(self): ++ """Prepare root environment ++ """ ++ ++ cal_umask = os.umask(0) ++ self.make_dirs() ++ os.umask(cal_umask) ++ self.copy_file('etc/resolv.conf') ++ ++ def run(self): ++ """Execute the controller ++ """ ++ ++ self.prepare() ++ return PacmanController(self.root).run() ++ ++ ++def run(): ++ """Download and install package selection ++ """ ++ ++ return ChrootController().run() +diff --git a/src/modules/chrootcfg/module.desc b/src/modules/chrootcfg/module.desc +new file mode 100644 +index 000000000..6020a9583 +--- /dev/null ++++ b/src/modules/chrootcfg/module.desc +@@ -0,0 +1,6 @@ ++# Syntax is YAML 1.2 ++--- ++type: "job" ++name: "chrootcfg" ++interface: "python" ++script: "main.py" #assumed relative to the current directory +-- +2.14.2 + diff --git a/source/kde5-extra/calamares-frugalware/0002-chrootcfg-our-pacman-doesn-t-have-cachedir-args.patch b/source/kde5-extra/calamares-frugalware/0002-chrootcfg-our-pacman-doesn-t-have-cachedir-args.patch new file mode 100644 index 0000000..f2c49b4 --- /dev/null +++ b/source/kde5-extra/calamares-frugalware/0002-chrootcfg-our-pacman-doesn-t-have-cachedir-args.patch @@ -0,0 +1,28 @@ +From 8ffab7ec8e4a2fcb3e9650f5676ca6e0098f4d86 Mon Sep 17 00:00:00 2001 +From: Gabriel Craciunescu <[email protected]> +Date: Sun, 22 Oct 2017 02:20:29 +0200 +Subject: [PATCH 2/6] chrootcfg: our pacman doesn't have cachedir args + +--- + src/modules/chrootcfg/main.py | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/modules/chrootcfg/main.py b/src/modules/chrootcfg/main.py +index 459cb7158..1bb315de8 100644 +--- a/src/modules/chrootcfg/main.py ++++ b/src/modules/chrootcfg/main.py +@@ -138,9 +138,9 @@ class PacmanController: + cachedir = join(self.root, "var/cache/pacman-g2/pkg") + dbdir = join(self.root, "var/lib/pacman-g2") + +- args = 'pacman --noconfirm {} --root {} --dbpath {} {}' ++ args = 'pacman --noconfirm {} --root {} --dbpath {} {}' + cmd = args.format( +- '-U' if local else '-Sy', cachedir, self.root, dbdir, ++ '-U' if local else '-Sy', self.root, dbdir, + ' '.join(pkglist) + ) + +-- +2.14.2 + diff --git a/source/kde5-extra/calamares-frugalware/0003-chrootcfg-remove-dbpatch-too.patch b/source/kde5-extra/calamares-frugalware/0003-chrootcfg-remove-dbpatch-too.patch new file mode 100644 index 0000000..03b596f --- /dev/null +++ b/source/kde5-extra/calamares-frugalware/0003-chrootcfg-remove-dbpatch-too.patch @@ -0,0 +1,33 @@ +From faea845162cfc8b7e2c9c6b7b1e03c595d48a608 Mon Sep 17 00:00:00 2001 +From: Gabriel Craciunescu <[email protected]> +Date: Sun, 22 Oct 2017 03:29:09 +0200 +Subject: [PATCH 3/6] chrootcfg: remove dbpatch too + +--- + src/modules/chrootcfg/main.py | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/modules/chrootcfg/main.py b/src/modules/chrootcfg/main.py +index 1bb315de8..b0bc09d98 100644 +--- a/src/modules/chrootcfg/main.py ++++ b/src/modules/chrootcfg/main.py +@@ -134,13 +134,13 @@ class PacmanController: + def install(self, pkglist, local=False): + """Install the given packagelist + """ +- ++ # not used + cachedir = join(self.root, "var/cache/pacman-g2/pkg") + dbdir = join(self.root, "var/lib/pacman-g2") + +- args = 'pacman --noconfirm {} --root {} --dbpath {} {}' ++ args = 'pacman --noconfirm {} --root {} {}' + cmd = args.format( +- '-U' if local else '-Sy', self.root, dbdir, ++ '-U' if local else '-Sy', self.root, + ' '.join(pkglist) + ) + +-- +2.14.2 + diff --git a/source/kde5-extra/calamares-frugalware/0004-chrootcfg-added-noarch-noprogressbar-to-install.patch b/source/kde5-extra/calamares-frugalware/0004-chrootcfg-added-noarch-noprogressbar-to-install.patch new file mode 100644 index 0000000..f3abce2 --- /dev/null +++ b/source/kde5-extra/calamares-frugalware/0004-chrootcfg-added-noarch-noprogressbar-to-install.patch @@ -0,0 +1,25 @@ +From 00e5013768ae999e3dd4ba569d300bbabf593043 Mon Sep 17 00:00:00 2001 +From: Gabriel Craciunescu <[email protected]> +Date: Sun, 22 Oct 2017 03:41:10 +0200 +Subject: [PATCH 4/6] chrootcfg: added --noarch --noprogressbar to install + +--- + src/modules/chrootcfg/main.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/modules/chrootcfg/main.py b/src/modules/chrootcfg/main.py +index b0bc09d98..3d5f06e82 100644 +--- a/src/modules/chrootcfg/main.py ++++ b/src/modules/chrootcfg/main.py +@@ -138,7 +138,7 @@ class PacmanController: + cachedir = join(self.root, "var/cache/pacman-g2/pkg") + dbdir = join(self.root, "var/lib/pacman-g2") + +- args = 'pacman --noconfirm {} --root {} {}' ++ args = 'pacman --noconfirm --noarch --noprogressbar {} --root {} {}' + cmd = args.format( + '-U' if local else '-Sy', self.root, + ' '.join(pkglist) +-- +2.14.2 + diff --git a/source/kde5-extra/calamares-frugalware/0005-chrootcfg-remove-stuff-we-cannot-yet-use.patch b/source/kde5-extra/calamares-frugalware/0005-chrootcfg-remove-stuff-we-cannot-yet-use.patch new file mode 100644 index 0000000..c59e54f --- /dev/null +++ b/source/kde5-extra/calamares-frugalware/0005-chrootcfg-remove-stuff-we-cannot-yet-use.patch @@ -0,0 +1,85 @@ +From 6273d375dcc9dfdbc98159b635f740668730efca Mon Sep 17 00:00:00 2001 +From: Gabriel Craciunescu <[email protected]> +Date: Sun, 22 Oct 2017 03:45:22 +0200 +Subject: [PATCH 5/6] chrootcfg: remove stuff we cannot yet use + +--- + src/modules/chrootcfg/chrootcfg.conf | 9 --------- + src/modules/chrootcfg/main.py | 22 +--------------------- + 2 files changed, 1 insertion(+), 30 deletions(-) + +diff --git a/src/modules/chrootcfg/chrootcfg.conf b/src/modules/chrootcfg/chrootcfg.conf +index 5ed526f93..c18e2d5e4 100644 +--- a/src/modules/chrootcfg/chrootcfg.conf ++++ b/src/modules/chrootcfg/chrootcfg.conf +@@ -2,13 +2,4 @@ + requirements: + - name: /etc + mode: "0o755" +- - name: /var/cache/pacman-g2/pkg +- mode: "0o755" +- - name: /var/lib/pacman-g2 +- mode: "0o755" + +-# these only work once we merge with upstream pacman +-# DO NOT enable +-#keyrings: +-# - archlinux +-# - artix +diff --git a/src/modules/chrootcfg/main.py b/src/modules/chrootcfg/main.py +index 3d5f06e82..5786d8af4 100644 +--- a/src/modules/chrootcfg/main.py ++++ b/src/modules/chrootcfg/main.py +@@ -68,19 +68,6 @@ class PacmanController: + 'packageOperations' + ) + self.tracker = OperationTracker() +- #self.keyrings = libcalamares.job.configuration.get('keyrings', []) +- +- def init_keyring(self): +- """Initializes pacman keyring +- """ +- +- #target_env_call(["pacman-key", "--init"]) +- +- def populate_keyring(self): +- """Populates pacman keyring +- """ +- +- #target_env_call(["pacman-key", "--populate"] + self.keyrings) + + def parse_output(self, cmd): + """Parses installation output +@@ -134,10 +121,6 @@ class PacmanController: + def install(self, pkglist, local=False): + """Install the given packagelist + """ +- # not used +- cachedir = join(self.root, "var/cache/pacman-g2/pkg") +- dbdir = join(self.root, "var/lib/pacman-g2") +- + args = 'pacman --noconfirm --noarch --noprogressbar {} --root {} {}' + cmd = args.format( + '-U' if local else '-Sy', self.root, +@@ -162,7 +145,7 @@ class PacmanController: + for key in self.operations.keys(): + # append package to pkgs + [pkgs.append(p['package']) for p in self.operations[key]] +- ++ ## ?!? + if key in ["install", "localinstall"]: + self.install(pkgs, local=False if key == 'install' else True) + elif key == "remove": +@@ -173,9 +156,6 @@ class PacmanController: + elif key == "try_remove": + self.remove(pkgs) + +- #self.init_keyring() +- #self.populate_keyring() +- + + class ChrootController: + """Chroot controller +-- +2.14.2 + diff --git a/source/kde5-extra/calamares-frugalware/0006-chrootcfg-move-Vbox-hack-over-from-packages.patch b/source/kde5-extra/calamares-frugalware/0006-chrootcfg-move-Vbox-hack-over-from-packages.patch new file mode 100644 index 0000000..fc0537d --- /dev/null +++ b/source/kde5-extra/calamares-frugalware/0006-chrootcfg-move-Vbox-hack-over-from-packages.patch @@ -0,0 +1,29 @@ +From a2c191de8f00d79e3cff030411062356775ddeb9 Mon Sep 17 00:00:00 2001 +From: Gabriel Craciunescu <[email protected]> +Date: Sun, 22 Oct 2017 04:26:05 +0200 +Subject: [PATCH 6/6] chrootcfg: move Vbox hack over from packages + +--- + src/modules/chrootcfg/main.py | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/src/modules/chrootcfg/main.py b/src/modules/chrootcfg/main.py +index 5786d8af4..853bd663c 100644 +--- a/src/modules/chrootcfg/main.py ++++ b/src/modules/chrootcfg/main.py +@@ -129,6 +129,12 @@ class PacmanController: + + self.parse_output(cmd.split()) + ++ vbox_sysfile = open("/sys/devices/virtual/dmi/id/bios_version", "r") ++ vbox_out = vbox_sysfile.read(10) ++ if 'VirtualBox' in vbox_out: ++ check_target_env_call(["pacman", "-Sy", "--noconfirm", "virtualbox-guest-additions"]) ++ check_target_env_call(["pacman", "-Scc", "--noconfirm"]) ++ + def remove(self, pkglist): + """Remove the given packagelist + """ +-- +2.14.2 + diff --git a/source/kde5-extra/calamares-frugalware/49-nopasswd_calamares.rules b/source/kde5-extra/calamares-frugalware/49-nopasswd_calamares.rules index cb5a56b..ddfae73 100644 --- a/source/kde5-extra/calamares-frugalware/49-nopasswd_calamares.rules +++ b/source/kde5-extra/calamares-frugalware/49-nopasswd_calamares.rules @@ -2,7 +2,7 @@ * without password authentication, similar to "sudo NOPASSWD:" */ polkit.addRule(function(action, subject) { - if (action.id == "com.github.calamares.calamares.pkexec.run" && subject.user == "guest") + if (action.id == "com.github.calamares.calamares.pkexec.run" && subject.user == "live") { return polkit.Result.YES; } diff --git a/source/kde5-extra/calamares-frugalware/FrugalBuild b/source/kde5-extra/calamares-frugalware/FrugalBuild index c442b9a..f97a8e2 100644 --- a/source/kde5-extra/calamares-frugalware/FrugalBuild +++ b/source/kde5-extra/calamares-frugalware/FrugalBuild @@ -3,7 +3,7 @@ pkgname=calamares-frugalware pkgver=3.1.6 -pkgrel=1 +pkgrel=2 pkgdesc="Distribution-independent installer framework" archs=("x86_64") groups=('kde5-extra') @@ -16,7 +16,15 @@ source+=(calamares-locale.service \ calamares-frugalware.svg \ 49-nopasswd_calamares.rules \ 0001-packages-virtualbox-and-pacman-flags-workarounds.patch \ - 0002-workaround-vbox-with-efi.patch) + 0002-workaround-vbox-with-efi.patch \ + https://github.com/abucodonosor/calamares/commit/85ceb5d150a72bc12316a2d7e8884b6a6c5d135d.patch \ + https://github.com/abucodonosor/calamares/commit/cd38084fecc0603170f639c17f04c5fd90d61158.patch \ + 0001-import-chrootcfg-from-artix-with-some-changes.patch \ + 0002-chrootcfg-our-pacman-doesn-t-have-cachedir-args.patch \ + 0003-chrootcfg-remove-dbpatch-too.patch \ + 0004-chrootcfg-added-noarch-noprogressbar-to-install.patch \ + 0005-chrootcfg-remove-stuff-we-cannot-yet-use.patch \ + 0006-chrootcfg-move-Vbox-hack-over-from-packages.patch) depends=('kpmcore>=3.1.2' 'qt5-webengine>=5.9.1' 'pyqt5-python3>=5.9' 'libboost' \ "kcoreaddons>=$_F_kf5_full" "kconfig>=$_F_kf5_full" \ "ki18n>=$_F_kf5_full" "kiconthemes>=$_F_kf5_full" \ @@ -28,9 +36,17 @@ sha1sums=('45c3078cfe04f1c6e6b041687c16709a587b5f5f' \ 'a496ee65a14fad4c96fe2a51d59f5769a9286411' \ 'abd9098e0b3f988182a4b0f3173bffb9f0f7c215' \ '134ca1a53f3b628ba459ec450e84ea0b4f0c11f2' \ - '02e4c49a4ff57712ffa94dbb79abc1dd701692c7' \ + 'ac15c2fdb3c1bd2116b72f21e9ac2fd5828d1290' \ '67fead29419ba303c096a0473d23b701e321e760' \ - '8ea80c581ca29a49e685c4809bac03e8c607e555') + '8ea80c581ca29a49e685c4809bac03e8c607e555' \ + '8b11b503288d4c947cf2042fb2c4278a215b88aa' \ + '37b9dee3185a49709aa2660dcabf115e341f983a' \ + '9896ed56fecd29ec603359e175b04c550193a4ef' \ + '3e44e12215cc8fd4bf60797574fa713307f519ad' \ + 'da189d57e1a4ed6608b8b6c3b80730fb2187910c' \ + '299b99bd9f449aa33f619d471c774d575863e051' \ + 'ee910ad3a82ff3d63e9f099fbddbb0199fcf34c7' \ + '145eca3d6b7e49bf88cb45bafdc186b25584eb82') ## don't install stuff we never need.. ## - dummy* -- no need to be installed @@ -59,8 +75,8 @@ build() { ## sudo to exec cala Fmkdir /etc/sudoers.d - Fexec echo "guest ALL=(ALL) NOPASSWD: ALL" > $pkgname-guest - Finstallrel 440 /etc/sudoers.d/$pkgname-guest + Fexec echo "live ALL=(ALL) NOPASSWD: ALL" > $pkgname-live + Finstallrel 440 /etc/sudoers.d/$pkgname-live } # optimization OK
_______________________________________________ Frugalware-git mailing list [email protected] http://frugalware.org/mailman/listinfo/frugalware-git
