Compare commits
1 Commits
appstream-
...
postcfg
| Author | SHA1 | Date | |
|---|---|---|---|
| 041dcd2983 |
@@ -25,9 +25,9 @@ endif()
|
|||||||
#
|
#
|
||||||
option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON)
|
option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON)
|
||||||
if(BUILD_APPSTREAM)
|
if(BUILD_APPSTREAM)
|
||||||
find_package(AppStreamQt5)
|
find_package(AppStreamQt)
|
||||||
set_package_properties(
|
set_package_properties(
|
||||||
AppStreamQt5
|
AppStreamQt
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
DESCRIPTION "Support for AppStream (cache) data"
|
DESCRIPTION "Support for AppStream (cache) data"
|
||||||
URL "https://github.com/ximion/appstream"
|
URL "https://github.com/ximion/appstream"
|
||||||
@@ -35,8 +35,8 @@ if(BUILD_APPSTREAM)
|
|||||||
TYPE OPTIONAL
|
TYPE OPTIONAL
|
||||||
)
|
)
|
||||||
if(AppStreamQt_FOUND)
|
if(AppStreamQt_FOUND)
|
||||||
add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt5_VERSION_MAJOR})
|
add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt_VERSION_MAJOR})
|
||||||
list(APPEND _extra_libraries AppStreamQt5)
|
list(APPEND _extra_libraries AppStreamQt)
|
||||||
list(APPEND _extra_src ItemAppStream.cpp)
|
list(APPEND _extra_src ItemAppStream.cpp)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#ifdef HAVE_APPSTREAM_VERSION
|
#ifdef HAVE_APPSTREAM_VERSION
|
||||||
#include "ItemAppStream.h"
|
#include "ItemAppStream.h"
|
||||||
#include <AppStreamQt5/pool.h>
|
#include <AppStreamQt/pool.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -17,9 +17,9 @@
|
|||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
#include "utils/Variant.h"
|
#include "utils/Variant.h"
|
||||||
|
|
||||||
#include <AppStreamQt5/image.h>
|
#include <AppStreamQt/image.h>
|
||||||
#include <AppStreamQt5/pool.h>
|
#include <AppStreamQt/pool.h>
|
||||||
#include <AppStreamQt5/screenshot.h>
|
#include <AppStreamQt/screenshot.h>
|
||||||
|
|
||||||
/// @brief Return number of pixels in a size, for < ordering purposes
|
/// @brief Return number of pixels in a size, for < ordering purposes
|
||||||
static inline quint64
|
static inline quint64
|
||||||
|
|||||||
@@ -36,9 +36,9 @@ endif()
|
|||||||
#
|
#
|
||||||
option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON)
|
option(BUILD_APPSTREAM "Support appstream: items in PackageChooser (requires libappstream-qt)" ON)
|
||||||
if(BUILD_APPSTREAM)
|
if(BUILD_APPSTREAM)
|
||||||
find_package(AppStreamQt5)
|
find_package(AppStreamQt)
|
||||||
set_package_properties(
|
set_package_properties(
|
||||||
AppStreamQt5
|
AppStreamQt
|
||||||
PROPERTIES
|
PROPERTIES
|
||||||
DESCRIPTION "Support for AppStream (cache) data"
|
DESCRIPTION "Support for AppStream (cache) data"
|
||||||
URL "https://github.com/ximion/appstream"
|
URL "https://github.com/ximion/appstream"
|
||||||
@@ -46,8 +46,8 @@ if(BUILD_APPSTREAM)
|
|||||||
TYPE OPTIONAL
|
TYPE OPTIONAL
|
||||||
)
|
)
|
||||||
if(AppStreamQt_FOUND)
|
if(AppStreamQt_FOUND)
|
||||||
add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt5_VERSION_MAJOR})
|
add_definitions(-DHAVE_APPSTREAM_VERSION=${AppStreamQt_VERSION_MAJOR})
|
||||||
list(APPEND _extra_libraries AppStreamQt5)
|
list(APPEND _extra_libraries AppStreamQt)
|
||||||
list(APPEND _extra_src ${_packagechooser}/ItemAppStream.cpp)
|
list(APPEND _extra_src ${_packagechooser}/ItemAppStream.cpp)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|||||||
80
src/modules/postcfg/main.py
Normal file
80
src/modules/postcfg/main.py
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
#
|
||||||
|
# === This file is part of Calamares - <http://github.com/calamares> ===
|
||||||
|
#
|
||||||
|
# Copyright 2014 - 2016, Philip Müller <philm@manjaro.org>
|
||||||
|
# Copyright 2016, Artoo <artoo@manjaro.org>
|
||||||
|
# Copyright 2018, Artoo <artoo@artixlinux.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/>.
|
||||||
|
|
||||||
|
|
||||||
|
from os.path import join, exists
|
||||||
|
|
||||||
|
import libcalamares
|
||||||
|
from libcalamares.utils import target_env_call
|
||||||
|
|
||||||
|
|
||||||
|
class ConfigController:
|
||||||
|
"""Configuration controller
|
||||||
|
"""
|
||||||
|
|
||||||
|
def __init__(self):
|
||||||
|
self.root = libcalamares.globalstorage.value("rootMountPoint")
|
||||||
|
|
||||||
|
def terminate(self, proc):
|
||||||
|
"""Send SIGKILL to the given proccess
|
||||||
|
"""
|
||||||
|
target_env_call(['killall', '-9', proc])
|
||||||
|
|
||||||
|
def sedFile(self, pattern, file):
|
||||||
|
"""Sed the given file with the given pattern
|
||||||
|
"""
|
||||||
|
target_env_call(["sed", "-e", pattern, "-i", file])
|
||||||
|
|
||||||
|
def configure(self):
|
||||||
|
"""Configure the services
|
||||||
|
"""
|
||||||
|
if exists(join(self.root, "/etc/conf.d/keymaps")):
|
||||||
|
exp = 's|^.*keymap=.*|keymap="{}"|'.format(
|
||||||
|
libcalamares.globalstorage.value("keyboardLayout")
|
||||||
|
)
|
||||||
|
self.sedFile(exp, "/etc/conf.d/keymaps")
|
||||||
|
|
||||||
|
if exists(join(self.root, "/etc/conf.d/xdm")):
|
||||||
|
for dm in libcalamares.globalstorage.value("displayManagers"):
|
||||||
|
exp = 's|^.*DISPLAYMANAGER=.*|DISPLAYMANAGER="{}"|'.format(dm)
|
||||||
|
self.sedFile(exp, "/etc/conf.d/xdm")
|
||||||
|
|
||||||
|
|
||||||
|
def run(self):
|
||||||
|
"""Run the controller
|
||||||
|
|
||||||
|
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.configure()
|
||||||
|
self.terminate('gpg-agent')
|
||||||
|
|
||||||
|
|
||||||
|
def run():
|
||||||
|
""" Misc postinstall configurations """
|
||||||
|
|
||||||
|
config = ConfigController()
|
||||||
|
|
||||||
|
return config.run()
|
||||||
7
src/modules/postcfg/module.desc
Normal file
7
src/modules/postcfg/module.desc
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Syntax is YAML 1.2
|
||||||
|
---
|
||||||
|
type: "job"
|
||||||
|
name: "postcfg"
|
||||||
|
interface: "python"
|
||||||
|
script: "main.py" #assumed relative to the current directory
|
||||||
|
noconfig: true
|
||||||
Reference in New Issue
Block a user