chore(merge): bring fix/installer-wizard up to date with Main
Main replaced WinBoat with PacManager 1.6.2 (fetched from the public Gitea, installed under /opt and shipped in the live image) and added the install progress steps, the Vulkan-per-GPU fix and the default emoji font. This branch keeps everything that is specific to it: Intel RST/VMD handling (fws-intel-rst, --no-nvram in the kickstart and fws-grub-finalize, the ESP lookup fix), the Broadcom wl driver, fws-bugreport and the step-by-step wizard. Where the two sides disagreed on PacManager, Main wins: the vendored 1.4.3 tarball, the FWS launcher and the target-only install block (build.sh and kickstart) are dropped, since the package now ships in packages.x86_64 and the LiveOS payload copies it to the target. Launchers call PacManager, the binary Main's package exposes on PATH.
This commit is contained in:
commit
423dcc66dc
37 files changed
+1836
-258
No files matched your search
@@ -13,3 +13,25 @@ set -euo pipefail
|
||||
# sinon « locale.Error: unsupported locale setting » → le module Boss plante).
|
||||
# ~3 Mo générés, vs 222 Mo pour le paquet glibc-locales complet.
|
||||
locale-gen
|
||||
|
||||
# --- Overlays pyanaconda (écran de progression FWS) ---------------------------
|
||||
# mkarchiso copie l'airootfs AVANT le pacstrap (cf. fws/mkarchiso :
|
||||
# _make_custom_airootfs puis _make_packages) : un fichier de l'airootfs qui
|
||||
# remplace un fichier du paquet « anaconda » fait échouer pacman (« exists in
|
||||
# filesystem ») et donc tout le build. Ces deux fichiers vivent donc hors des
|
||||
# chemins du paquet, et on les pose ICI, après l'installation : c'est le seul
|
||||
# moment où écraser un fichier de paquet est légitime (et le script est
|
||||
# supprimé après exécution, il ne part pas dans l'ISO).
|
||||
if [ -d /usr/local/share/fws/anaconda-overlay/pyanaconda ]; then
|
||||
cp -a /usr/local/share/fws/anaconda-overlay/. /usr/lib/python3.14/site-packages/
|
||||
rm -rf /usr/local/share/fws/anaconda-overlay
|
||||
|
||||
# Le build doit s'arrêter net si l'overlay n'a pas atterri : sans lui, plus
|
||||
# d'écran de progression détaillé (mais l'installateur fonctionne quand même).
|
||||
for _f in modules/runtime/scripts/runtime.py modules/boss/installation.py; do
|
||||
if [ ! -f "/usr/lib/python3.14/site-packages/pyanaconda/${_f}" ]; then
|
||||
echo "[FWS] overlay pyanaconda manquant : ${_f}" >&2
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
+1
-1
@@ -211,7 +211,7 @@ def _build_summary():
|
||||
net = ("INDISPONIBLE ✖ — bureau, drivers et stack FWS ne\n"
|
||||
" s'installeront PAS (rattrapable au 1er boot)")
|
||||
|
||||
extras = ("Steam, Wine, VR (Monado/OpenXR), winboat-bin"
|
||||
extras = ("Steam, Wine, VR (Monado/OpenXR), PacManager"
|
||||
if desk != "cli" else "rien de plus (choix CLI)")
|
||||
|
||||
return f"""\
|
||||
|
||||
+906
@@ -0,0 +1,906 @@
|
||||
#
|
||||
# Copyright (C) 2021 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing to use,
|
||||
# modify, copy, or redistribute it subject to the terms and conditions of
|
||||
# the GNU General Public License v.2, or (at your option) any later version.
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY expressed or implied, including the implied warranties 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 this program; if not, write to the
|
||||
# Free Software Foundation, Inc., 31 Milk Street #960789 Boston, MA
|
||||
# 02196 USA. Any Red Hat trademarks that are incorporated in the
|
||||
# source code or documentation are not subject to the GNU General Public
|
||||
# License and may only be used or replicated with the express permission of
|
||||
# Red Hat, Inc.
|
||||
|
||||
import glob
|
||||
import os.path
|
||||
import shutil
|
||||
|
||||
from dasbus.error import DBusError
|
||||
from threading import Event
|
||||
|
||||
from pykickstart.constants import (
|
||||
KS_SCRIPT_POST,
|
||||
KS_SCRIPT_PREINSTALL,
|
||||
SNAPSHOT_WHEN_POST_INSTALL,
|
||||
)
|
||||
|
||||
from pyanaconda import flags, network
|
||||
from pyanaconda.anaconda_loggers import get_module_logger
|
||||
from pyanaconda.core import util
|
||||
from pyanaconda.core.configuration.anaconda import conf
|
||||
from pyanaconda.core.constants import (
|
||||
CATEGORY_BOOTLOADER,
|
||||
CATEGORY_ENVIRONMENT,
|
||||
CATEGORY_SOFTWARE,
|
||||
CATEGORY_STORAGE,
|
||||
CATEGORY_SYSTEM,
|
||||
PAYLOAD_LIVE_TYPES,
|
||||
PAYLOAD_TYPE_DNF,
|
||||
)
|
||||
from pyanaconda.core.i18n import _
|
||||
from pyanaconda.core.path import (
|
||||
join_paths,
|
||||
make_directories,
|
||||
open_with_perm,
|
||||
)
|
||||
from pyanaconda.core.service import is_service_installed
|
||||
from pyanaconda.core.signal import Signal
|
||||
from pyanaconda.core.util import execWithRedirect, restorecon
|
||||
from pyanaconda.installation_tasks import DBusTask, Task, TaskQueue
|
||||
from pyanaconda.kexec import setup_kexec
|
||||
from pyanaconda.modules.boss.install_manager.installation_category_interface import (
|
||||
CategoryReportTaskInterface,
|
||||
)
|
||||
from pyanaconda.modules.common.constants.installation import InstallationErrorDialogType
|
||||
from pyanaconda.modules.common.constants.objects import (
|
||||
BOOTLOADER,
|
||||
CERTIFICATES,
|
||||
FIREWALL,
|
||||
SCRIPTS,
|
||||
SNAPSHOT,
|
||||
)
|
||||
from pyanaconda.modules.common.constants.services import (
|
||||
BOSS,
|
||||
LOCALIZATION,
|
||||
NETWORK,
|
||||
PAYLOADS,
|
||||
RUNTIME,
|
||||
SECURITY,
|
||||
SERVICES,
|
||||
STORAGE,
|
||||
SUBSCRIPTION,
|
||||
TIMEZONE,
|
||||
USERS,
|
||||
)
|
||||
from pyanaconda.modules.common.task import Task as InstallationTask
|
||||
from pyanaconda.modules.common.task import sync_run_task
|
||||
from pyanaconda.modules.common.util import is_module_available
|
||||
|
||||
log = get_module_logger(__name__)
|
||||
|
||||
TARGET_LOG_DIR = "/var/log/anaconda/"
|
||||
|
||||
def _writeKS_via_boss():
|
||||
boss_proxy = BOSS.get_proxy()
|
||||
ks_string = boss_proxy.GenerateKickstart()
|
||||
path = conf.target.system_root + "/root/anaconda-ks.cfg"
|
||||
|
||||
with open_with_perm(path, "w", 0o600) as f:
|
||||
f.write("# Generated by Anaconda {}\n".format(util.get_anaconda_version_string()))
|
||||
f.write(ks_string)
|
||||
|
||||
|
||||
class CopyLogsTask(InstallationTask):
|
||||
"""Task to copy logs to target system."""
|
||||
def __init__(self, sysroot):
|
||||
"""Create a new task.
|
||||
|
||||
:param sysroot: a path to the root of installed system
|
||||
:type sysroot: str
|
||||
"""
|
||||
super().__init__()
|
||||
self._sysroot = sysroot
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return "Copy installation logs"
|
||||
|
||||
def run(self):
|
||||
"""Copy installation logs and other related files, and do necessary operations on them.
|
||||
|
||||
- Copy logs of all kinds, incl. ks scripts, journal dump, and lorax pkg list
|
||||
- Copy input kickstart file
|
||||
- SELinux contexts are left as is (fixed by SetContextsTask)
|
||||
"""
|
||||
self._copy_kickstart()
|
||||
self._copy_logs()
|
||||
|
||||
def _copy_logs(self):
|
||||
"""Copy installation logs to the target system"""
|
||||
if not conf.target.can_save_installation_logs:
|
||||
log.warning("Installation logs will not be saved to the installed system due to the "
|
||||
"nosave option.")
|
||||
return
|
||||
|
||||
log.info("Copying logs from the installation environment.")
|
||||
self._create_logs_directory()
|
||||
self._copy_tmp_logs()
|
||||
self._copy_lorax_packages()
|
||||
self._copy_pre_script_logs()
|
||||
self._copy_dnf_debugdata()
|
||||
self._copy_post_script_logs()
|
||||
self._dump_journal()
|
||||
|
||||
def _create_logs_directory(self):
|
||||
"""Create directory for Anaconda logs on the install target"""
|
||||
make_directories(join_paths(self._sysroot, TARGET_LOG_DIR))
|
||||
|
||||
def _copy_tmp_logs(self):
|
||||
"""Copy a number of log files from /tmp"""
|
||||
log_files_to_copy = [
|
||||
"anaconda.log",
|
||||
"syslog",
|
||||
"X.log",
|
||||
"program.log",
|
||||
"packaging.log",
|
||||
"storage.log",
|
||||
"ifcfg.log",
|
||||
"lvm.log",
|
||||
"dnf.librepo.log",
|
||||
"hawkey.log",
|
||||
"dbus.log",
|
||||
]
|
||||
for logfile in log_files_to_copy:
|
||||
self._copy_file_to_sysroot(
|
||||
join_paths("/tmp/", logfile),
|
||||
join_paths(TARGET_LOG_DIR, logfile)
|
||||
)
|
||||
|
||||
def _copy_lorax_packages(self):
|
||||
"""Copy list of packages used for creating the installation media"""
|
||||
self._copy_file_to_sysroot(
|
||||
"/root/lorax-packages.log",
|
||||
join_paths(TARGET_LOG_DIR, "lorax-packages.log")
|
||||
)
|
||||
|
||||
def _copy_pre_script_logs(self):
|
||||
"""Copy logs from %pre scripts"""
|
||||
self._copy_tree_to_sysroot(
|
||||
"/tmp/pre-anaconda-logs",
|
||||
TARGET_LOG_DIR
|
||||
)
|
||||
|
||||
def _copy_dnf_debugdata(self):
|
||||
"""Copy DNF debug data"""
|
||||
self._copy_tree_to_sysroot(
|
||||
"/root/debugdata",
|
||||
join_paths(TARGET_LOG_DIR, "dnf_debugdata/")
|
||||
)
|
||||
|
||||
def _copy_post_script_logs(self):
|
||||
"""Copy logs from %post scripts"""
|
||||
for logfile in glob.glob("/tmp/ks-script*.log"):
|
||||
self._copy_file_to_sysroot(
|
||||
logfile,
|
||||
join_paths(TARGET_LOG_DIR, os.path.basename(logfile))
|
||||
)
|
||||
|
||||
def _dump_journal(self):
|
||||
"""Dump journal from the installation environment"""
|
||||
tempfile = "/tmp/journal.log"
|
||||
with open_with_perm(tempfile, "w", perm=0o600) as logfile:
|
||||
execWithRedirect("journalctl", ["-b"], stdout=logfile, log_output=False)
|
||||
self._copy_file_to_sysroot(tempfile, join_paths(TARGET_LOG_DIR, "journal.log"))
|
||||
|
||||
def _copy_kickstart(self):
|
||||
"""Copy input kickstart file"""
|
||||
if conf.target.can_copy_input_kickstart:
|
||||
log.info("Copying input kickstart file.")
|
||||
self._copy_file_to_sysroot(
|
||||
"/run/install/ks.cfg",
|
||||
"/root/original-ks.cfg"
|
||||
)
|
||||
else:
|
||||
log.warning("Input kickstart will not be saved to the installed system due to the "
|
||||
"nosave option.")
|
||||
|
||||
def _copy_file_to_sysroot(self, src, dest):
|
||||
"""Copy a file, if it exists, and set its access bits.
|
||||
|
||||
:param str src: path to source file
|
||||
:param str dest: path to destination file within sysroot
|
||||
"""
|
||||
if os.path.exists(src):
|
||||
log.info("Copying file: %s -> %s", src, dest)
|
||||
full_dest_path = join_paths(self._sysroot, dest)
|
||||
shutil.copyfile(
|
||||
src,
|
||||
full_dest_path
|
||||
)
|
||||
os.chmod(full_dest_path, 0o0600)
|
||||
|
||||
def _copy_tree_to_sysroot(self, src, dest):
|
||||
"""Copy a directory tree, if it exists, and set its access bits.
|
||||
|
||||
:param str src: path to source directory
|
||||
:param str dest: path to destination directory within sysroot
|
||||
"""
|
||||
if os.path.exists(src):
|
||||
log.info("Copying directory tree: %s -> %s", src, dest)
|
||||
full_dest_path = join_paths(self._sysroot, dest)
|
||||
shutil.copytree(
|
||||
src,
|
||||
full_dest_path,
|
||||
dirs_exist_ok=True
|
||||
)
|
||||
os.chmod(full_dest_path, 0o0600)
|
||||
|
||||
|
||||
class SetContextsTask(InstallationTask):
|
||||
"""Task to set file contexts on target system.
|
||||
|
||||
We need to handle SELinux relabeling for a few reasons:
|
||||
|
||||
- %post scripts that write files into places in /etc, but don't do labeling correctly
|
||||
- Anaconda code that does the same (e.g. moving our log files into /var/log/anaconda)
|
||||
- ostree payloads, where all of the labeling of /var is the installer's responsibility
|
||||
(see https://github.com/ostreedev/ostree/pull/872 )
|
||||
- OSTree variants of the traditional mounts if present
|
||||
"""
|
||||
def __init__(self, sysroot):
|
||||
"""Create a new task.
|
||||
|
||||
:param sysroot: a path to the root of installed system
|
||||
:type sysroot: str
|
||||
"""
|
||||
super().__init__()
|
||||
self._sysroot = sysroot
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return "Set file contexts"
|
||||
|
||||
def run(self):
|
||||
"""Relabel files (set contexts).
|
||||
|
||||
Do not fail if the executable is not present.
|
||||
"""
|
||||
dirs_to_relabel = [
|
||||
"/boot",
|
||||
"/dev",
|
||||
"/etc",
|
||||
"/lib64",
|
||||
"/root",
|
||||
"/usr/lib",
|
||||
"/usr/lib64",
|
||||
"/var/cache/yum",
|
||||
"/var/home",
|
||||
"/var/lib",
|
||||
"/var/lock",
|
||||
"/var/log",
|
||||
"/var/media",
|
||||
"/var/mnt",
|
||||
"/var/opt",
|
||||
"/var/roothome",
|
||||
"/var/run",
|
||||
"/var/spool",
|
||||
"/var/srv"
|
||||
]
|
||||
|
||||
log.info("Restoring SELinux contexts.")
|
||||
if not restorecon(dirs_to_relabel, root=self._sysroot, skip_nonexistent=True):
|
||||
log.warning("Cannot restore contexts because restorecon was not installed.")
|
||||
|
||||
|
||||
# Module-private helper for RunInstallationTask.
|
||||
class _RemoteErrorUI:
|
||||
"""Error UI proxy that forwards dialog calls to the real UI over D-Bus.
|
||||
|
||||
This is used in the Boss process where errorHandler.ui is not set.
|
||||
It forwards showYesNoQuestion, showDetailedError, and showError
|
||||
calls via the RunInstallationTask's error_raised_signal, blocking
|
||||
until the UI responds via respond_to_error.
|
||||
"""
|
||||
|
||||
def __init__(self, task):
|
||||
self._task = task
|
||||
|
||||
def showYesNoQuestion(self, message):
|
||||
return self._task._show_dialog(message, InstallationErrorDialogType.YES_NO)
|
||||
|
||||
def showDetailedError(self, message, details, buttons=None):
|
||||
full_message = message
|
||||
if details:
|
||||
full_message += "\n\n" + details
|
||||
self._task._show_dialog(full_message, InstallationErrorDialogType.FATAL_ERROR)
|
||||
return False
|
||||
|
||||
def showError(self, message):
|
||||
self._task._show_dialog(message, InstallationErrorDialogType.FATAL_ERROR)
|
||||
|
||||
|
||||
class RunInstallationTask(InstallationTask):
|
||||
"""Task to run the installation queue."""
|
||||
|
||||
def __init__(self, install_manager):
|
||||
"""Create a new task.
|
||||
"""
|
||||
super().__init__()
|
||||
self._total_steps = 0
|
||||
self._install_manager = install_manager
|
||||
self._error_raised_signal = Signal()
|
||||
self._error_response_event = Event()
|
||||
self._error_should_continue = False
|
||||
|
||||
# FWS: the post-install scripts task reports one step per phase instead
|
||||
# of taking a single step for the whole %post, so the progress bar
|
||||
# follows what the installer is actually doing. _fws_scripts_steps is
|
||||
# how many steps it occupies, _fws_scripts_base the absolute position
|
||||
# where the phase starts.
|
||||
self._fws_scripts_task = None
|
||||
self._fws_scripts_steps = 1
|
||||
self._fws_scripts_base = 0
|
||||
self._fws_scripts_active = False
|
||||
|
||||
@property
|
||||
def error_raised_signal(self):
|
||||
"""Signal emitted when an error needs user interaction.
|
||||
|
||||
Carries the error message string and InstallationErrorDialogType value.
|
||||
"""
|
||||
return self._error_raised_signal
|
||||
|
||||
def _show_dialog(self, message, dialog_type):
|
||||
"""Emit error signal and block until UI responds.
|
||||
|
||||
:param message: the error message to display
|
||||
:param dialog_type: the type of dialog to show
|
||||
"""
|
||||
self._error_response_event.clear()
|
||||
self._error_raised_signal.emit(message, dialog_type.value)
|
||||
self._error_response_event.wait()
|
||||
return self._error_should_continue
|
||||
|
||||
def respond_to_error(self, should_continue):
|
||||
"""Respond to a previously reported error.
|
||||
|
||||
:param should_continue: True to continue, False to abort.
|
||||
"""
|
||||
self._error_should_continue = should_continue
|
||||
self._error_response_event.set()
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""Name of the task"""
|
||||
return "Run the installation queue."
|
||||
|
||||
@property
|
||||
def steps(self):
|
||||
"""Total number of steps."""
|
||||
return self._total_steps
|
||||
|
||||
def run(self):
|
||||
"""Run the task."""
|
||||
self._run_installation()
|
||||
|
||||
def for_publication(self):
|
||||
"""Return a DBus representation."""
|
||||
return CategoryReportTaskInterface(self)
|
||||
|
||||
def _queue_started_cb(self, task):
|
||||
"""The installation queue was started."""
|
||||
self.report_category(task.task_category)
|
||||
self.report_progress(task.status_message)
|
||||
|
||||
# FWS: remember where the post-install scripts start, so the sub-steps
|
||||
# they report land inside the span reserved for them in _total_steps.
|
||||
if task.name == "Post installation scripts" and self._fws_scripts_steps > 1:
|
||||
self._fws_scripts_active = True
|
||||
self._fws_scripts_base = self.progress[0]
|
||||
|
||||
def _task_completed_cb(self, task):
|
||||
"""The installation task was completed."""
|
||||
if task is self._fws_scripts_task:
|
||||
# FWS: this task owned several steps, not just one.
|
||||
self._fws_scripts_active = False
|
||||
self.report_progress("", step_size=self._fws_scripts_steps)
|
||||
return
|
||||
|
||||
self.report_progress("", step_size=1)
|
||||
|
||||
def _progress_report_cb(self, step, message):
|
||||
"""Handle a progress report of a task."""
|
||||
if self._fws_scripts_active:
|
||||
# FWS: the scripts task reports its own step numbers; translate
|
||||
# them into absolute positions of the installation progress.
|
||||
self.report_progress(
|
||||
message,
|
||||
step_number=min(self._fws_scripts_base + step, self.steps)
|
||||
)
|
||||
return
|
||||
|
||||
self.report_progress(message)
|
||||
|
||||
def _prepare_configuration(self):
|
||||
"""Prepare queue with tasks configuring installed system."""
|
||||
payloads_proxy = PAYLOADS.get_proxy()
|
||||
payload_path = payloads_proxy.ActivePayload
|
||||
if not payload_path:
|
||||
log.error("No active payload found! Can't continue install.")
|
||||
raise RuntimeError("No active payload")
|
||||
|
||||
payload_proxy = PAYLOADS.get_proxy(payload_path)
|
||||
configuration_queue = TaskQueue("Configuration queue")
|
||||
|
||||
# connect progress reporting
|
||||
configuration_queue.queue_started.connect(self._queue_started_cb)
|
||||
configuration_queue.task_completed.connect(self._task_completed_cb)
|
||||
|
||||
# import certificates first
|
||||
# they may be required for subscription, initramfs regenerating, ... ?
|
||||
if is_module_available(SECURITY):
|
||||
certificates_import = TaskQueue(
|
||||
"Certificates import",
|
||||
_("Importing certificates"),
|
||||
CATEGORY_SYSTEM
|
||||
)
|
||||
certificates_proxy = SECURITY.get_proxy(CERTIFICATES)
|
||||
certificates_import.append_dbus_tasks(SECURITY, [
|
||||
certificates_proxy.InstallWithTask()
|
||||
])
|
||||
configuration_queue.append(certificates_import)
|
||||
|
||||
# schedule the execute methods of ksdata that require an installed system to be present
|
||||
os_config = TaskQueue(
|
||||
"Installed system configuration",
|
||||
_("Configuring installed system"),
|
||||
CATEGORY_SYSTEM
|
||||
)
|
||||
|
||||
# add installation tasks for the Security DBus module
|
||||
if is_module_available(SECURITY):
|
||||
security_proxy = SECURITY.get_proxy()
|
||||
security_dbus_tasks = security_proxy.InstallWithTasks()
|
||||
os_config.append_dbus_tasks(SECURITY, security_dbus_tasks)
|
||||
|
||||
# add installation tasks for the Timezone DBus module
|
||||
# run these tasks before tasks of the Services module
|
||||
if is_module_available(TIMEZONE):
|
||||
timezone_proxy = TIMEZONE.get_proxy()
|
||||
timezone_dbus_tasks = timezone_proxy.InstallWithTasks()
|
||||
os_config.append_dbus_tasks(TIMEZONE, timezone_dbus_tasks)
|
||||
|
||||
# add installation tasks for the Services DBus module
|
||||
if is_module_available(SERVICES):
|
||||
services_proxy = SERVICES.get_proxy()
|
||||
services_dbus_tasks = services_proxy.InstallWithTasks()
|
||||
os_config.append_dbus_tasks(SERVICES, services_dbus_tasks)
|
||||
|
||||
# add installation tasks for the Localization DBus module
|
||||
if is_module_available(LOCALIZATION):
|
||||
localization_proxy = LOCALIZATION.get_proxy()
|
||||
localization_dbus_tasks = localization_proxy.InstallWithTasks()
|
||||
os_config.append_dbus_tasks(LOCALIZATION, localization_dbus_tasks)
|
||||
|
||||
# add the Firewall configuration task
|
||||
if conf.target.can_configure_network:
|
||||
firewall_proxy = NETWORK.get_proxy(FIREWALL)
|
||||
firewall_dbus_task = firewall_proxy.InstallWithTask()
|
||||
os_config.append_dbus_tasks(NETWORK, [firewall_dbus_task])
|
||||
|
||||
configuration_queue.append(os_config)
|
||||
|
||||
# schedule network configuration (if required)
|
||||
if conf.target.can_configure_network and conf.system.provides_network_config:
|
||||
overwrite = payload_proxy.Type in PAYLOAD_LIVE_TYPES
|
||||
network_config = TaskQueue(
|
||||
"Network configuration",
|
||||
_("Writing network configuration"),
|
||||
CATEGORY_SYSTEM
|
||||
)
|
||||
network_config.append(Task(
|
||||
"Network configuration",
|
||||
network.write_configuration,
|
||||
(overwrite, )
|
||||
))
|
||||
configuration_queue.append(network_config)
|
||||
|
||||
# add installation tasks for the Subscription DBus module
|
||||
if is_module_available(SUBSCRIPTION):
|
||||
# we only run the tasks if the Subscription module is available
|
||||
subscription_config = TaskQueue(
|
||||
"Subscription configuration",
|
||||
_("Configuring Red Hat subscription"),
|
||||
CATEGORY_SYSTEM
|
||||
)
|
||||
subscription_proxy = SUBSCRIPTION.get_proxy()
|
||||
subscription_dbus_tasks = subscription_proxy.InstallWithTasks()
|
||||
subscription_config.append_dbus_tasks(SUBSCRIPTION, subscription_dbus_tasks)
|
||||
configuration_queue.append(subscription_config)
|
||||
|
||||
# add installation tasks for the Users DBus module
|
||||
if is_module_available(USERS):
|
||||
user_config = TaskQueue(
|
||||
"User creation",
|
||||
_("Creating users"),
|
||||
CATEGORY_SYSTEM
|
||||
)
|
||||
users_proxy = USERS.get_proxy()
|
||||
users_dbus_tasks = users_proxy.InstallWithTasks()
|
||||
user_config.append_dbus_tasks(USERS, users_dbus_tasks)
|
||||
configuration_queue.append(user_config)
|
||||
|
||||
# Anaconda addon configuration
|
||||
addon_config = TaskQueue(
|
||||
"Anaconda addon configuration",
|
||||
_("Configuring addons"),
|
||||
CATEGORY_SYSTEM
|
||||
)
|
||||
|
||||
tasks_list = self._install_manager.collect_install_system_tasks()
|
||||
for task_proxy in tasks_list:
|
||||
addon_config.append(DBusTask(task_proxy))
|
||||
|
||||
configuration_queue.append(addon_config)
|
||||
|
||||
# Initramfs generation
|
||||
generate_initramfs = TaskQueue(
|
||||
"Initramfs generation",
|
||||
_("Generating initramfs"),
|
||||
CATEGORY_BOOTLOADER
|
||||
)
|
||||
bootloader_proxy = STORAGE.get_proxy(BOOTLOADER)
|
||||
|
||||
def run_generate_initramfs():
|
||||
tasks = bootloader_proxy.GenerateInitramfsWithTasks(
|
||||
payload_proxy.Type,
|
||||
payloads_proxy.GetKernelVersionList()
|
||||
)
|
||||
|
||||
for task in tasks:
|
||||
sync_run_task(STORAGE.get_proxy(task))
|
||||
|
||||
generate_initramfs.append(Task(
|
||||
"Generate initramfs",
|
||||
run_generate_initramfs
|
||||
))
|
||||
configuration_queue.append(generate_initramfs)
|
||||
|
||||
if is_module_available(SECURITY):
|
||||
security_proxy = SECURITY.get_proxy()
|
||||
|
||||
# Configure FIPS.
|
||||
configuration_queue.append_dbus_tasks(SECURITY, [
|
||||
security_proxy.ConfigureFIPSWithTask()
|
||||
])
|
||||
|
||||
# Join a realm. This can run only after network
|
||||
# is configured in the target system chroot.
|
||||
configuration_queue.append_dbus_tasks(SECURITY, [
|
||||
security_proxy.JoinRealmWithTask()
|
||||
])
|
||||
|
||||
# Calling zipl should be the last task on s390
|
||||
configuration_queue.append_dbus_tasks(STORAGE, [
|
||||
bootloader_proxy.FixZIPLBootloaderWithTask()
|
||||
])
|
||||
|
||||
# setup kexec reboot if requested
|
||||
if flags.flags.kexec:
|
||||
kexec_setup = TaskQueue(
|
||||
"Kexec setup",
|
||||
_("Setting up kexec"),
|
||||
CATEGORY_BOOTLOADER
|
||||
)
|
||||
kexec_setup.append(Task(
|
||||
"Setup kexec",
|
||||
setup_kexec
|
||||
))
|
||||
configuration_queue.append(kexec_setup)
|
||||
|
||||
# write anaconda related configs & kickstarts
|
||||
write_configs = TaskQueue(
|
||||
"Write configs and kickstarts",
|
||||
_("Storing configuration files and kickstarts"),
|
||||
CATEGORY_SYSTEM
|
||||
)
|
||||
|
||||
# Write the kickstart file to the installed system (or, copy the input
|
||||
# kickstart file over if one exists).
|
||||
if conf.target.can_save_output_kickstart:
|
||||
# write anaconda related configs & kickstarts
|
||||
write_configs.append(Task("Store kickstarts", _writeKS_via_boss))
|
||||
else:
|
||||
# don't write the kickstart file to the installed system if this has
|
||||
# been disabled by the nosave option
|
||||
log.warning("Writing of the output kickstart to installed system has been disabled"
|
||||
" by the nosave option.")
|
||||
|
||||
# only add write_configs to the main queue if we actually store some kickstarts/configs
|
||||
if write_configs.task_count:
|
||||
configuration_queue.append(write_configs)
|
||||
|
||||
post_scripts = TaskQueue(
|
||||
"Post installation scripts",
|
||||
_("Running post-installation scripts"),
|
||||
CATEGORY_SYSTEM
|
||||
)
|
||||
scripts_proxy = RUNTIME.get_proxy(SCRIPTS)
|
||||
# FWS: keep a handle on this task and learn how many steps it declares
|
||||
# (one per installation phase), so the progress bar can track them.
|
||||
scripts_task_proxy = RUNTIME.get_proxy(
|
||||
scripts_proxy.RunScriptsWithTask(KS_SCRIPT_POST)
|
||||
)
|
||||
try:
|
||||
self._fws_scripts_steps = max(1, int(scripts_task_proxy.Steps))
|
||||
except DBusError:
|
||||
# Progress is cosmetic: never fail the installation over it.
|
||||
log.warning("FWS: cannot read the post-script steps, using one step")
|
||||
self._fws_scripts_steps = 1
|
||||
self._fws_scripts_task = DBusTask(scripts_task_proxy)
|
||||
post_scripts.append(self._fws_scripts_task)
|
||||
configuration_queue.append(post_scripts)
|
||||
|
||||
configuration_queue.append(Task(
|
||||
"Copy installation logs",
|
||||
CopyLogsTask(conf.target.system_root).run
|
||||
))
|
||||
configuration_queue.append(Task(
|
||||
"Set file contexts",
|
||||
SetContextsTask(conf.target.system_root).run
|
||||
))
|
||||
|
||||
return configuration_queue
|
||||
|
||||
def _prepare_installation(self):
|
||||
"""Prepare the installation task queue.
|
||||
|
||||
This method builds and returns a queue of tasks that perform the system installation.
|
||||
The queue includes tasks for setting up the environment, configuring storage,
|
||||
installing the software payload, running installation scripts, setting up the
|
||||
bootloader, and executing post-installation steps.
|
||||
"""
|
||||
payloads_proxy = PAYLOADS.get_proxy()
|
||||
payload_path = payloads_proxy.ActivePayload
|
||||
if not payload_path:
|
||||
log.error("No active payload found! Can't continue install.")
|
||||
raise RuntimeError("No active payload")
|
||||
|
||||
payload_proxy = PAYLOADS.get_proxy(payload_path)
|
||||
installation_queue = TaskQueue("Installation queue")
|
||||
|
||||
# connect progress reporting
|
||||
installation_queue.queue_started.connect(self._queue_started_cb)
|
||||
installation_queue.task_completed.connect(self._task_completed_cb)
|
||||
|
||||
# setup the installation environment
|
||||
setup_environment = TaskQueue(
|
||||
"Installation environment setup",
|
||||
_("Setting up the installation environment"),
|
||||
CATEGORY_ENVIRONMENT
|
||||
)
|
||||
|
||||
tasks_list = self._install_manager.collect_configure_runtime_tasks()
|
||||
for task_proxy in tasks_list:
|
||||
setup_environment.append(DBusTask(task_proxy))
|
||||
|
||||
# Add configuration tasks for the Localization DBus module.
|
||||
if is_module_available(LOCALIZATION):
|
||||
localization_proxy = LOCALIZATION.get_proxy()
|
||||
# Populate the missing keyboard values before the payload installation,
|
||||
# so the module requirements can be generated for the right configuration.
|
||||
# FIXME: Make sure that the module always returns right values.
|
||||
populate_task = localization_proxy.PopulateMissingKeyboardConfigurationWithTask()
|
||||
setup_environment.append_dbus_tasks(LOCALIZATION, [populate_task])
|
||||
|
||||
installation_queue.append(setup_environment)
|
||||
|
||||
# Do partitioning.
|
||||
# Depending on current payload the storage might be apparently configured
|
||||
# either before or after package/payload installation.
|
||||
# So let's have two task queues - early storage & late storage.
|
||||
storage_proxy = STORAGE.get_proxy()
|
||||
early_storage = TaskQueue(
|
||||
"Early storage configuration",
|
||||
_("Configuring storage"),
|
||||
CATEGORY_STORAGE
|
||||
)
|
||||
early_storage.append_dbus_tasks(STORAGE, storage_proxy.InstallWithTasks())
|
||||
|
||||
if payload_proxy.Type == PAYLOAD_TYPE_DNF:
|
||||
conf_task = storage_proxy.WriteConfigurationWithTask()
|
||||
early_storage.append_dbus_tasks(STORAGE, [conf_task])
|
||||
|
||||
installation_queue.append(early_storage)
|
||||
|
||||
# Run %pre-install scripts with the filesystem mounted and no packages
|
||||
pre_install_scripts = TaskQueue(
|
||||
"Pre-install scripts",
|
||||
_("Running pre-installation scripts"),
|
||||
CATEGORY_ENVIRONMENT
|
||||
)
|
||||
scripts_proxy = RUNTIME.get_proxy(SCRIPTS)
|
||||
pre_install_scripts.append_dbus_tasks(RUNTIME, [
|
||||
scripts_proxy.RunScriptsWithTask(KS_SCRIPT_PREINSTALL)
|
||||
])
|
||||
installation_queue.append(pre_install_scripts)
|
||||
|
||||
# Do various pre-installation tasks
|
||||
# - try to discover a realm (if any)
|
||||
# - check for possibly needed additional packages.
|
||||
pre_install = TaskQueue(
|
||||
"Pre install tasks",
|
||||
_("Running pre-installation tasks"),
|
||||
CATEGORY_SOFTWARE
|
||||
)
|
||||
|
||||
# Make name resolution work for rpm scripts in chroot.
|
||||
# Also make sure dns resolution works in %post scripts
|
||||
# when systemd-resolved is not available.
|
||||
if conf.system.provides_resolver_config and \
|
||||
not is_service_installed("systemd-resolved.service"):
|
||||
pre_install.append(Task(
|
||||
"Copy resolv.conf to sysroot",
|
||||
network.copy_resolv_conf_to_root,
|
||||
(conf.target.system_root, )
|
||||
))
|
||||
|
||||
if is_module_available(SECURITY):
|
||||
security_proxy = SECURITY.get_proxy()
|
||||
|
||||
# Discover a realm.
|
||||
pre_install.append_dbus_tasks(SECURITY, [
|
||||
security_proxy.DiscoverRealmWithTask()
|
||||
])
|
||||
|
||||
# Set up FIPS for the payload installation.
|
||||
fips_task = security_proxy.PreconfigureFIPSWithTask(payload_proxy.Type)
|
||||
pre_install.append_dbus_tasks(SECURITY, [fips_task])
|
||||
|
||||
# Import certificates so they are available for rpm scripts
|
||||
certificates_proxy = SECURITY.get_proxy(CERTIFICATES)
|
||||
certificates_task = certificates_proxy.PreInstallWithTask(payload_proxy.Type)
|
||||
pre_install.append_dbus_tasks(SECURITY, [certificates_task])
|
||||
|
||||
installation_queue.append(pre_install)
|
||||
|
||||
payload_install = TaskQueue(
|
||||
"Payload installation",
|
||||
_("Installing the software"),
|
||||
CATEGORY_SOFTWARE
|
||||
)
|
||||
|
||||
tasks = payloads_proxy.InstallWithTasks()
|
||||
payload_install.append_dbus_tasks(PAYLOADS, tasks)
|
||||
|
||||
installation_queue.append(payload_install)
|
||||
|
||||
# for some payloads storage is configured after the payload is installed
|
||||
if payload_proxy.Type != PAYLOAD_TYPE_DNF:
|
||||
late_storage = TaskQueue(
|
||||
"Late storage configuration",
|
||||
_("Configuring storage"),
|
||||
CATEGORY_STORAGE,
|
||||
)
|
||||
conf_task = storage_proxy.WriteConfigurationWithTask()
|
||||
late_storage.append_dbus_tasks(STORAGE, [conf_task])
|
||||
installation_queue.append(late_storage)
|
||||
|
||||
# Do bootloader.
|
||||
bootloader_proxy = STORAGE.get_proxy(BOOTLOADER)
|
||||
bootloader_install = TaskQueue(
|
||||
"Bootloader installation",
|
||||
_("Installing boot loader"),
|
||||
CATEGORY_BOOTLOADER
|
||||
)
|
||||
|
||||
def run_configure_bootloader():
|
||||
task_proxies = self._install_manager.collect_configure_bootloader_tasks(payloads_proxy.GetKernelVersionList())
|
||||
|
||||
for proxy in task_proxies:
|
||||
sync_run_task(proxy)
|
||||
|
||||
bootloader_install.append(Task(
|
||||
"Configure bootloader",
|
||||
run_configure_bootloader
|
||||
))
|
||||
|
||||
def run_install_bootloader():
|
||||
tasks = bootloader_proxy.InstallBootloaderWithTasks(
|
||||
payload_proxy.Type,
|
||||
payloads_proxy.GetKernelVersionList()
|
||||
)
|
||||
|
||||
for task in tasks:
|
||||
sync_run_task(STORAGE.get_proxy(task))
|
||||
|
||||
bootloader_install.append(Task(
|
||||
"Install bootloader",
|
||||
run_install_bootloader
|
||||
))
|
||||
installation_queue.append(bootloader_install)
|
||||
|
||||
post_install = TaskQueue(
|
||||
"Post-installation setup tasks",
|
||||
_("Performing post-installation setup tasks"),
|
||||
CATEGORY_SYSTEM
|
||||
)
|
||||
tasks = payloads_proxy.PostInstallWithTasks()
|
||||
post_install.append_dbus_tasks(PAYLOADS, tasks)
|
||||
installation_queue.append(post_install)
|
||||
|
||||
# Create snapshot
|
||||
snapshot_proxy = STORAGE.get_proxy(SNAPSHOT)
|
||||
|
||||
if snapshot_proxy.IsRequested(SNAPSHOT_WHEN_POST_INSTALL):
|
||||
snapshot_creation = TaskQueue(
|
||||
"Creating post installation snapshots",
|
||||
_("Creating snapshots"),
|
||||
CATEGORY_STORAGE
|
||||
)
|
||||
snapshot_task = snapshot_proxy.CreateWithTask(SNAPSHOT_WHEN_POST_INSTALL)
|
||||
snapshot_creation.append_dbus_tasks(STORAGE, [snapshot_task])
|
||||
installation_queue.append(snapshot_creation)
|
||||
|
||||
return installation_queue
|
||||
|
||||
def _run_installation(self):
|
||||
"""Run the complete installation."""
|
||||
from pyanaconda.errors import errorHandler
|
||||
|
||||
queue = TaskQueue("Complete installation queue")
|
||||
queue.append(self._prepare_installation())
|
||||
queue.append(self._prepare_configuration())
|
||||
|
||||
# notify progress tracking about the number of steps
|
||||
# FWS: the post-install scripts task reports its own sub-steps, so it
|
||||
# takes more than the single step counted for it by task_count.
|
||||
self._total_steps = queue.task_count + max(0, self._fws_scripts_steps - 1)
|
||||
|
||||
# Set the progress reporting callback of the DBus tasks.
|
||||
# FIXME: This is a temporary workaround.
|
||||
for item in queue.nested_items:
|
||||
if isinstance(item, DBusTask):
|
||||
item._progress_cb = self._progress_report_cb
|
||||
|
||||
# log contents of the main task queue
|
||||
log.info(queue.summary)
|
||||
|
||||
# log tasks and queues when they are started
|
||||
# - note that we are using generators to add the counter
|
||||
queue_counter = util.item_counter(queue.queue_count)
|
||||
task_started_counter = util.item_counter(queue.task_count)
|
||||
task_completed_counter = util.item_counter(queue.task_count)
|
||||
queue.queue_started.connect(
|
||||
lambda x: log.info("Queue started: %s (%s)", x.name, next(queue_counter))
|
||||
)
|
||||
queue.task_started.connect(
|
||||
lambda x: log.info("Task started: %s (%s)", x.name, next(task_started_counter))
|
||||
)
|
||||
queue.task_completed.connect(
|
||||
lambda x: log.debug("Task completed: %s (%s) (%1.1f s)", x.name,
|
||||
next(task_completed_counter), x.elapsed_time)
|
||||
)
|
||||
|
||||
# Boss has no UserInterface; during the installation queue, tasks may call
|
||||
# errorHandler.cb() for non-fatal errors. Temporarily install a D-Bus proxy
|
||||
# that forwards dialogs to the progress spoke in the UI process.
|
||||
previous_ui = errorHandler.ui
|
||||
errorHandler.ui = _RemoteErrorUI(self)
|
||||
try:
|
||||
queue.start()
|
||||
finally:
|
||||
errorHandler.ui = previous_ui
|
||||
|
||||
# done
|
||||
self.report_progress(_("Complete!"), step_number=self.steps)
|
||||
|
||||
# this message is automatically detected by QE tools, do not change it lightly
|
||||
log.info(
|
||||
"All tasks in the installation queue are done. "
|
||||
"Installation successfully finished."
|
||||
)
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
#
|
||||
# Copyright (C) 2024 Red Hat, Inc.
|
||||
#
|
||||
# This copyrighted material is made available to anyone wishing to use,
|
||||
# modify, copy, or redistribute it subject to the terms and conditions of
|
||||
# the GNU General Public License v.2, or (at your option) any later version.
|
||||
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
# ANY WARRANTY expressed or implied, including the implied warranties 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 this program; if not, write to the
|
||||
# Free Software Foundation, Inc., 31 Milk Street #960789 Boston, MA
|
||||
# 02196 USA. Any Red Hat trademarks that are incorporated in the
|
||||
# source code or documentation are not subject to the GNU General Public
|
||||
# License and may only be used or replicated with the express permission of
|
||||
# Red Hat, Inc.
|
||||
#
|
||||
# FWS: this file is an overlay of the upstream Anaconda module. Upstream runs
|
||||
# every kickstart script of a type in one task without reporting anything, so
|
||||
# the GUI could only say "Running post-installation scripts" and the progress
|
||||
# bar sat still until the whole %post was done. FWS scripts publish their own
|
||||
# progress (helper: /usr/local/bin/fws-install-step), so the task below turns
|
||||
# that into one step per installation phase and a message that says which
|
||||
# script is running and what it is doing.
|
||||
#
|
||||
import os
|
||||
import re
|
||||
import threading
|
||||
|
||||
from pykickstart.constants import KS_SCRIPT_POST
|
||||
|
||||
from pyanaconda.anaconda_loggers import get_module_logger
|
||||
from pyanaconda.core.configuration.anaconda import conf
|
||||
from pyanaconda.modules.common.errors.runtime import ScriptError
|
||||
from pyanaconda.modules.common.task import Task
|
||||
|
||||
log = get_module_logger(__name__)
|
||||
|
||||
# Progress file written by fws-install-step, relative to a root. The %post
|
||||
# running in the chroot writes it into the target, the --nochroot ones into
|
||||
# the live system; both are read so any script can publish progress.
|
||||
FWS_PROGRESS_FILE = "var/log/fws-install-progress"
|
||||
FWS_PROGRESS_POLL = 0.5
|
||||
|
||||
# Title of a script, declared as its first comment:
|
||||
# # FWS-TITLE: Configuration du système installé
|
||||
FWS_TITLE_PATTERN = re.compile(r"^#\s*FWS-TITLE:\s*(.+?)\s*$", re.MULTILINE)
|
||||
|
||||
|
||||
class _ProgressWatcher(threading.Thread):
|
||||
"""Follow the progress published by the running kickstart script.
|
||||
|
||||
The scripts cannot talk to the installer directly: they are plain shell
|
||||
processes, possibly inside a chroot. They write "<percent>|<label>" to a
|
||||
file instead and this thread reports every change to the task, which
|
||||
forwards it to the GUI label and progress bar.
|
||||
"""
|
||||
|
||||
def __init__(self, task):
|
||||
super().__init__(daemon=True, name="fws-install-progress")
|
||||
self._task = task
|
||||
self._stop_event = threading.Event()
|
||||
# Start from what the previous script already published: otherwise the
|
||||
# new script would immediately re-report the last phase of the old one.
|
||||
self._last_report = task.last_phase
|
||||
|
||||
def stop(self):
|
||||
self._stop_event.set()
|
||||
|
||||
def _read_report(self):
|
||||
"""Return the newest (percent, label) published, or None."""
|
||||
newest = None
|
||||
|
||||
for path in self._task.progress_files:
|
||||
try:
|
||||
mtime = os.path.getmtime(path)
|
||||
except OSError:
|
||||
continue
|
||||
# Strictly newer: on a tie the first candidate (the target) wins,
|
||||
# and the list order keeps us from flapping between two files.
|
||||
if newest is None or mtime > newest[0]:
|
||||
newest = (mtime, path)
|
||||
|
||||
if newest is None:
|
||||
return None
|
||||
|
||||
try:
|
||||
with open(newest[1], encoding="utf-8", errors="replace") as handle:
|
||||
line = handle.readline().strip()
|
||||
except OSError:
|
||||
return None
|
||||
|
||||
percent, separator, label = line.partition("|")
|
||||
if not separator or not percent.isdigit() or not label:
|
||||
return None
|
||||
|
||||
return min(100, int(percent)), label
|
||||
|
||||
def run(self):
|
||||
while not self._stop_event.is_set():
|
||||
report = self._read_report()
|
||||
if report and report != self._last_report:
|
||||
self._last_report = report
|
||||
self._task.report_phase(*report)
|
||||
self._stop_event.wait(FWS_PROGRESS_POLL)
|
||||
|
||||
|
||||
class RunScriptsTask(Task):
|
||||
"""Task for running scripts."""
|
||||
|
||||
# The scripts report percentages; the bar gets this many steps so it moves
|
||||
# every 5 % instead of once at the end. The installer reserves the same
|
||||
# number of steps for this task (see pyanaconda/modules/boss/installation.py).
|
||||
FWS_STEPS = 20
|
||||
|
||||
def __init__(self, script_type, scripts):
|
||||
"""Create a new task.
|
||||
|
||||
:param script_type: type of scripts to be run
|
||||
:type script_type: int
|
||||
:param scripts: list of scripts
|
||||
:type scripts: list(Script)
|
||||
"""
|
||||
super().__init__()
|
||||
self._script_type = script_type
|
||||
self._scripts = scripts
|
||||
self._current_script = (0, 1, "")
|
||||
self.last_phase = None
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
return "Run scripts"
|
||||
|
||||
@property
|
||||
def steps(self):
|
||||
count = len([s for s in self._scripts if s.type == self._script_type])
|
||||
return self.FWS_STEPS if count else 1
|
||||
|
||||
@property
|
||||
def progress_files(self):
|
||||
"""Where the scripts may publish their progress."""
|
||||
target = str(conf.target.system_root)
|
||||
return [os.path.join(target, FWS_PROGRESS_FILE), "/" + FWS_PROGRESS_FILE]
|
||||
|
||||
def report_phase(self, percent, label):
|
||||
"""Report one installation phase to the GUI.
|
||||
|
||||
:param percent: progress of the whole script sequence, 0-100
|
||||
:param label: what is being done, in the installer language
|
||||
"""
|
||||
index, total, title = self._current_script
|
||||
message = "%s — %s %%" % (label, percent)
|
||||
if total > 1:
|
||||
message = "Script %d/%d · %s" % (index, total, message)
|
||||
elif title:
|
||||
message = "%s · %s" % (title, message)
|
||||
|
||||
step = min(self.steps, int(percent * self.steps / 100))
|
||||
log.debug("FWS install progress: %s (step %s/%s)", message, step, self.steps)
|
||||
self.last_phase = (percent, label)
|
||||
self.report_progress(message, step_number=step)
|
||||
|
||||
@staticmethod
|
||||
def _title(script, index):
|
||||
"""Title of a script: its "# FWS-TITLE:" line, else a generic one."""
|
||||
match = FWS_TITLE_PATTERN.search(getattr(script, "script", "") or "")
|
||||
if match:
|
||||
return match.group(1)
|
||||
return "Script %d" % index
|
||||
|
||||
def run(self):
|
||||
"""Execute the task."""
|
||||
scripts = [s for s in self._scripts if s.type == self._script_type]
|
||||
total = max(1, len(scripts))
|
||||
|
||||
for index, script in enumerate(scripts, start=1):
|
||||
self._current_script = (index, total, self._title(script, index))
|
||||
# Only the message changes here: the bar is moved by the
|
||||
# percentages published by the script itself, so it never runs
|
||||
# ahead of what has actually been done.
|
||||
self.report_progress(
|
||||
"Script %d/%d · %s" % (index, total, self._current_script[2])
|
||||
)
|
||||
|
||||
watcher = _ProgressWatcher(self)
|
||||
watcher.start()
|
||||
try:
|
||||
if script.type == KS_SCRIPT_POST:
|
||||
result = script.run(conf.target.system_root)
|
||||
else:
|
||||
result = script.run("/")
|
||||
finally:
|
||||
watcher.stop()
|
||||
watcher.join()
|
||||
|
||||
if result:
|
||||
lineno, err = result
|
||||
error_message = f"{lineno}\n\n{err.strip()}"
|
||||
raise ScriptError(error_message)
|
||||
@@ -108,14 +108,17 @@ qemu-guest-agent
|
||||
virtualbox-guest-utils-nox
|
||||
open-vm-tools
|
||||
|
||||
# Conteneurs : requis par winboat-bin (applications Windows) et par la
|
||||
# stack matérielle. fws-setup-hardware l'installait APRÈS coup, donc
|
||||
# Conteneurs : moteur sans démon pour les applications isolées, utilisé par
|
||||
# la stack matérielle. fws-setup-hardware l'installait APRÈS coup, donc
|
||||
# seulement si le réseau tenait pendant l'installation — dans l'image,
|
||||
# il est là quoi qu'il arrive.
|
||||
podman
|
||||
|
||||
# --- FWS (fws-local) ---
|
||||
winboat-bin
|
||||
# Gestionnaire de paquets graphique PacManager (Qt6). Installé dans un
|
||||
# répertoire dédié /opt/fws-pacmanage : son self-update réécrit CE dossier
|
||||
# (binaire + fichier version + plugins) sans toucher à /usr.
|
||||
fws-pacmanage
|
||||
# Gestionnaire D&D 5e (dés, personnages, grimoire, sessions, combat).
|
||||
fws-dnd
|
||||
|
||||
|
||||
@@ -45,5 +45,7 @@ file_permissions=(
|
||||
["/usr/local/bin/fws-powermenu"]="0:0:755"
|
||||
["/usr/local/bin/fws-about"]="0:0:755"
|
||||
["/usr/local/bin/fws-bugreport"]="0:0:755"
|
||||
["/usr/local/bin/fws-wallpaper"]="0:0:755"
|
||||
["/usr/local/bin/fws-install-step"]="0:0:755"
|
||||
["/etc/grub.d/42_fws-recovery"]="0:0:755"
|
||||
)
|
||||
@@ -0,0 +1,66 @@
|
||||
// FWS — configuration fastfetch SYSTÈME (/etc/fastfetch/config.jsonc).
|
||||
//
|
||||
// Posée ici pour que le logo FWS apparaisse quel que soit le lancement :
|
||||
// shell de login (cf. etc/profile.d/fastfetch.sh), terminal d'un bureau,
|
||||
// TTY, root ou utilisateur, live ou système installé — fastfetch lit ce
|
||||
// fichier en dernier recours, pour tout compte sans config personnelle
|
||||
// (~/.config/fastfetch/config.jsonc d'un utilisateur reste prioritaire).
|
||||
//
|
||||
// Le logo est un fichier texte avec des marqueurs $1..$6 (4 carrés FWS + le
|
||||
// « W »), coloriés par « logo.color ». Chemin ABSOLU : le rendu ne dépend donc
|
||||
// pas du répertoire courant.
|
||||
//
|
||||
// « modules » reprend la structure par DÉFAUT de fastfetch : dès qu'un fichier
|
||||
// de config existe, fastfetch n'affiche plus sa liste par défaut (on n'obtenait
|
||||
// que le logo, sans aucune information). Les modules indisponibles sur la
|
||||
// machine (batterie d'un fixe, DE absent…) se masquent d'eux-mêmes.
|
||||
{
|
||||
"$schema": "https://github.com/fastfetch-cli/fastfetch/raw/dev/doc/json_schema.json",
|
||||
"logo": {
|
||||
"type": "file",
|
||||
"source": "/usr/local/share/fws/logo.txt",
|
||||
"padding": {
|
||||
"top": 1,
|
||||
"left": 2
|
||||
},
|
||||
"color": {
|
||||
"1": "#1ea064",
|
||||
"2": "#2d7dd2",
|
||||
"3": "#f0b428",
|
||||
"4": "#195591",
|
||||
"5": "#1c1c22",
|
||||
"6": "#f5a523"
|
||||
}
|
||||
},
|
||||
"modules": [
|
||||
"title",
|
||||
"separator",
|
||||
"os",
|
||||
"host",
|
||||
"kernel",
|
||||
"uptime",
|
||||
"packages",
|
||||
"shell",
|
||||
"display",
|
||||
"de",
|
||||
"wm",
|
||||
"wmtheme",
|
||||
"theme",
|
||||
"icons",
|
||||
"font",
|
||||
"cursor",
|
||||
"terminal",
|
||||
"terminalfont",
|
||||
"cpu",
|
||||
"gpu",
|
||||
"memory",
|
||||
"swap",
|
||||
"disk",
|
||||
"localip",
|
||||
"battery",
|
||||
"poweradapter",
|
||||
"locale",
|
||||
"break",
|
||||
"colors"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0"?>
|
||||
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
|
||||
<!-- FWS — emoji par défaut (Noto Color Emoji, paquet noto-fonts-emoji).
|
||||
|
||||
Sans cette configuration, l'emoji ne s'affiche que dans les applications
|
||||
qui font elles-mêmes du fallback glyphe par glyphe (Pango le fait, un
|
||||
renderer simple non), et une règle « no bitmap » (70-no-bitmaps.conf)
|
||||
suffirait à tout désactiver : Noto Color Emoji est une police bitmap
|
||||
(CBDT), pas une police vectorielle.
|
||||
|
||||
1) famille « emoji » : c'est le nom que demandent Qt/GTK/Electron.
|
||||
2) polices génériques : l'emoji est ajouté en DERNIER recours
|
||||
(mode="append", binding="weak") pour ne JAMAIS prendre la place de la
|
||||
police principale — un binding « strong » ferait basculer le texte
|
||||
latin dans la police emoji.
|
||||
3) embeddedbitmap forcé : les emoji restent affichés même si une règle
|
||||
système désactive les polices bitmap.
|
||||
|
||||
Numéroté 99- pour s'appliquer APRÈS les alias génériques (60-latin.conf)
|
||||
qu'il complète. -->
|
||||
<fontconfig>
|
||||
|
||||
<alias binding="same">
|
||||
<family>emoji</family>
|
||||
<prefer><family>Noto Color Emoji</family></prefer>
|
||||
</alias>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>sans-serif</string></test>
|
||||
<edit name="family" mode="append" binding="weak"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>serif</string></test>
|
||||
<edit name="family" mode="append" binding="weak"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="pattern">
|
||||
<test qual="any" name="family"><string>monospace</string></test>
|
||||
<edit name="family" mode="append" binding="weak"><string>Noto Color Emoji</string></edit>
|
||||
</match>
|
||||
|
||||
<match target="font">
|
||||
<test qual="any" name="family"><string>Noto Color Emoji</string></test>
|
||||
<edit name="embeddedbitmap" mode="assign" binding="strong"><bool>true</bool></edit>
|
||||
</match>
|
||||
|
||||
</fontconfig>
|
||||
@@ -5,14 +5,8 @@
|
||||
# On utilise donc un autre nom.
|
||||
_fastfetch_rc=$?
|
||||
if [ "${_fastfetch_rc}" -eq 0 ]; then
|
||||
# Logo FWS maison (4 carrés + Tux) au lieu du logo Arch détecté par défaut.
|
||||
fastfetch \
|
||||
--logo-type file \
|
||||
--logo /usr/local/share/fws/logo.txt \
|
||||
--logo-color-1 '38;2;30;160;100' \
|
||||
--logo-color-2 '38;2;45;125;210' \
|
||||
--logo-color-3 '38;2;240;180;40' \
|
||||
--logo-color-4 '38;2;25;85;145' \
|
||||
--logo-color-5 '38;2;28;28;34' \
|
||||
--logo-color-6 '38;2;245;165;35'
|
||||
# Le logo FWS vient de la config SYSTÈME (/etc/fastfetch/config.jsonc) :
|
||||
# aucun flag ici, pour que le rendu soit identique quand fastfetch est
|
||||
# lancé à la main (terminal d'un bureau, TTY, n'importe quel compte).
|
||||
fastfetch
|
||||
fi
|
||||
@@ -0,0 +1,10 @@
|
||||
[Desktop Entry]
|
||||
Type=Application
|
||||
Name=Fond d'écran FWS
|
||||
Comment=Applique le fond d'écran FWS au premier démarrage (le choix de l'utilisateur est conservé ensuite)
|
||||
Exec=fws-wallpaper --autostart
|
||||
Icon=preferences-desktop-wallpaper
|
||||
Terminal=false
|
||||
NoDisplay=true
|
||||
Categories=System;
|
||||
X-GNOME-Autostart-enabled=true
|
||||
@@ -126,7 +126,7 @@ def _project_tab(osr):
|
||||
feats.set_markup(
|
||||
"<b>Inclus :</b> installateur graphique · plusieurs bureaux "
|
||||
"(GNOME, KDE, Hyprland, i3, XFCE) · Steam & Proton-GE · "
|
||||
"réalité virtuelle (SteamVR) · winboat (applications Windows) · "
|
||||
"réalité virtuelle (SteamVR) · PacManager (paquets) · "
|
||||
"pare-feu · réparation système intégrée.")
|
||||
feats.set_line_wrap(True)
|
||||
feats.set_max_width_chars(52)
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# FWS — publie l'avancement de l'installation pour l'écran de progression
|
||||
# d'Anaconda (pyanaconda/modules/runtime/scripts/runtime.py lit ce fichier et
|
||||
# le transforme en « Script 2/3 · Installation du bureau — 62 % »).
|
||||
#
|
||||
# Usage : fws-install-step <pourcentage 0-100> "<ce qui est en cours>"
|
||||
#
|
||||
# Le fichier est toujours écrit dans le rootfs COURANT (/var/log/…) : dans le
|
||||
# %post chrooté c'est le système installé (que l'installeur lit via
|
||||
# /mnt/sysroot), dans les %post --nochroot c'est le live. Écriture atomique
|
||||
# (fichier temporaire + mv) pour que l'installeur ne lise jamais une ligne à
|
||||
# moitié écrite.
|
||||
#
|
||||
# Best-effort : le code retour est toujours 0 — un souci de progression ne doit
|
||||
# jamais faire échouer l'installation (les %post sont en `set -x`, pas en
|
||||
# `set -e`, mais autant ne pas tenter le diable).
|
||||
set -u
|
||||
|
||||
FILE=/var/log/fws-install-progress
|
||||
|
||||
[ "$#" -ge 2 ] || exit 0
|
||||
PERCENT="$1"
|
||||
shift
|
||||
case "$PERCENT" in
|
||||
''|*[!0-9]*) exit 0 ;;
|
||||
esac
|
||||
[ "$PERCENT" -le 100 ] || PERCENT=100
|
||||
|
||||
mkdir -p "${FILE%/*}" 2>/dev/null || exit 0
|
||||
if printf '%s|%s\n' "$PERCENT" "$*" > "$FILE.tmp" 2>/dev/null; then
|
||||
mv -f "$FILE.tmp" "$FILE" 2>/dev/null || rm -f "$FILE.tmp" 2>/dev/null
|
||||
fi
|
||||
exit 0
|
||||
@@ -126,8 +126,11 @@ if printf '%s' "$GPU" | grep -qiE 'NVIDIA|GeForce'; then
|
||||
# tout simplement inutilisable.
|
||||
if [ "$_NEWEST" -eq 0 ] || [ "$_NEWEST" -ge $((16#1E00)) ]; then
|
||||
GPU_NOTE="NVIDIA 0x$(printf '%04x' "$_NEWEST") → modules ouverts (Turing ou plus récent)"
|
||||
# libva-nvidia-driver : le pilote VA-API (décodage vidéo matériel) —
|
||||
# nvidia-utils ne fournit que le VDPAU historique ; sans ce paquet,
|
||||
# Firefox/Chrome et les lecteurs décodent en CPU et saccadent en 4K.
|
||||
GPU_PKGS="$GPU_PKGS nvidia-open-dkms nvidia-utils nvidia-settings \
|
||||
opencl-nvidia egl-wayland linux-headers dkms"
|
||||
opencl-nvidia egl-wayland libva-nvidia-driver linux-headers dkms"
|
||||
[ "$LIB32" = 1 ] && GPU_PKGS="$GPU_PKGS lib32-nvidia-utils lib32-opencl-nvidia"
|
||||
# Portable hybride : de quoi basculer entre iGPU et carte dédiée.
|
||||
# Délimiteurs de mot OBLIGATOIRES : sans eux « ATI » matche dans
|
||||
@@ -280,7 +283,7 @@ esac
|
||||
[ -n "$VM_PKGS" ] && group vm "Outils invité de la machine virtuelle" "$VM_DETECT" $VM_PKGS
|
||||
|
||||
# ── 10) Conteneurs ──────────────────────────────────────────────────────────
|
||||
# Requis par winboat-bin (applications Windows).
|
||||
# Moteur de conteneurs sans démon : applications isolées (Distrobox, images OCI).
|
||||
group containers "Conteneurs (Podman)" 1 podman
|
||||
|
||||
# ── Groupes À LA DEMANDE ────────────────────────────────────────────────────
|
||||
@@ -375,6 +378,10 @@ if [ "${#SELECTED[@]}" -gt 0 ]; then
|
||||
if [ -n "$VALID" ]; then
|
||||
log "installation :$VALID"
|
||||
if pacman -S --noconfirm --needed $VALID; then
|
||||
# polices : le cache fontconfig doit inclure la police emoji qui
|
||||
# vient d'être installée, sinon les applications déjà lancées ne la
|
||||
# voient qu'au prochain démarrage de session.
|
||||
command -v fc-cache >/dev/null 2>&1 && fc-cache -f >/dev/null 2>&1
|
||||
# MARQUEUR DE RÉUSSITE. C'est lui qui décide si la fenêtre « Pilotes
|
||||
# et matériel » s'ouvre au premier démarrage : posé, elle se tait ;
|
||||
# absent (typiquement : pas de réseau pendant l'installation, le cas
|
||||
@@ -439,9 +446,10 @@ if [ "$BROADCOM_WL" = 1 ] && [ "$_wifi_selected" = 1 ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# NB : winboat-bin (AUR) n'est PAS installé ici (fws-local n'existe pas sur la
|
||||
# NB : fws-pacmanage n'est PAS installé ici (fws-local n'existe pas sur la
|
||||
# cible) : il est intégré à l'image FWS via packages.x86_64 et recopié par le
|
||||
# payload LiveOS d'Anaconda → déjà présent sur le système installé.
|
||||
# payload LiveOS d'Anaconda → déjà présent sur le système installé, dans
|
||||
# /opt/fws-pacmanage (répertoire que son self-update réécrit).
|
||||
|
||||
# ── Vérification et réparation des services ─────────────────────────────────
|
||||
# Jouée après une installation, et seule avec « --check ». Chaque contrôle est
|
||||
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
#!/bin/sh
|
||||
# FWS — fond d'écran par défaut, posé au PREMIER démarrage graphique.
|
||||
#
|
||||
# L'image est EMBARQUÉE dans l'ISO (/usr/local/share/fws/wallpaper.png) au lieu
|
||||
# d'être téléchargée : aucun réseau requis au premier boot, même rendu sur
|
||||
# toutes les installations, et rien à héberger.
|
||||
#
|
||||
# Lancement :
|
||||
# - /etc/xdg/autostart/fws-wallpaper.desktop (KDE, GNOME, XFCE) → « une fois » ;
|
||||
# - Hyprland/i3 (pas d'autostart XDG) : la config de session appelle
|
||||
# « fws-wallpaper --session » à chaque session — ces bureaux n'ont pas de
|
||||
# réglage de fond persistant hors de leur config
|
||||
# (swaybg respawné / feh repose le pixmap racine).
|
||||
#
|
||||
# Marqueur ~/.config/fws/wallpaper-done (même dossier que fws-hello) : une fois
|
||||
# le fond posé, ce script ne touche PLUS à rien — le choix fait ensuite par
|
||||
# l'utilisateur est conservé.
|
||||
# fws-wallpaper --force réapplique le fond FWS par-dessus le choix actuel.
|
||||
#
|
||||
# Code retour : 0 = fond posé (ou déjà posé), 1 = rien à faire (session non
|
||||
# reconnue, outil absent, sans affichage) — l'échec est volontairement silencieux,
|
||||
# on ne casse jamais un démarrage de session pour un fond d'écran.
|
||||
set -u
|
||||
|
||||
[ -n "${HOME:-}" ] || exit 1
|
||||
WALL=/usr/local/share/fws/wallpaper.png
|
||||
STATE_DIR="${XDG_CONFIG_HOME:-$HOME/.config}/fws"
|
||||
FLAG="$STATE_DIR/wallpaper-done"
|
||||
|
||||
MODE=once # once = ignore si déjà posé ; session = repose à chaque
|
||||
# session (Hyprland/i3) ; force = réapplique maintenant
|
||||
for _arg in "$@"; do
|
||||
case "$_arg" in
|
||||
--session) MODE=session ;;
|
||||
--force) MODE=force ;;
|
||||
--autostart) ;; # entrée /etc/xdg/autostart : comportement par défaut
|
||||
-h|--help) awk 'NR > 1 { if ($0 !~ /^#/) exit; sub(/^# ?/, ""); print }' "$0"; exit 0 ;;
|
||||
*) echo "Usage : fws-wallpaper [--force|--session]" >&2; exit 1 ;;
|
||||
esac
|
||||
done
|
||||
|
||||
[ -r "$WALL" ] || exit 1
|
||||
# Pas de session graphique joignable (console, script lancé par un service) : rien à faire.
|
||||
if [ -z "${DISPLAY:-}" ] && [ -z "${WAYLAND_DISPLAY:-}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
[ "$MODE" = "once" ] && [ -e "$FLAG" ] && exit 0
|
||||
|
||||
# --- Détection du bureau ----------------------------------------------------
|
||||
# HYPRLAND_INSTANCE_SIGNATURE / I3SOCK sont les signatures FIABLES exportées aux
|
||||
# processus de session (XDG_CURRENT_DESKTOP n'est pas garanti pour i3).
|
||||
_lower() { printf '%s' "$1" | tr '[:upper:]' '[:lower:]'; }
|
||||
DE=""
|
||||
if [ -n "${HYPRLAND_INSTANCE_SIGNATURE:-}" ]; then
|
||||
DE=hyprland
|
||||
elif [ -n "${I3SOCK:-}" ]; then
|
||||
DE=i3
|
||||
else
|
||||
case "$(_lower "${XDG_CURRENT_DESKTOP:-}")" in
|
||||
*kde*|*plasma*) DE=kde ;;
|
||||
*xfce*) DE=xfce ;;
|
||||
*gnome*|*unity*) DE=gnome ;;
|
||||
*i3*) DE=i3 ;;
|
||||
esac
|
||||
fi
|
||||
[ -n "$DE" ] || exit 1
|
||||
|
||||
# --- KDE --------------------------------------------------------------------
|
||||
# plasma-apply-wallpaperimage passe par plasmashell (DBus) : au tout premier
|
||||
# login plasmashell peut ne pas être prêt → on réessaie ~20 s avant d'abandonner
|
||||
# (sans marqueur, le prochain démarrage retentera).
|
||||
_apply_kde() {
|
||||
command -v plasma-apply-wallpaperimage >/dev/null 2>&1 || return 1
|
||||
_i=0
|
||||
while [ "$_i" -lt 10 ]; do
|
||||
plasma-apply-wallpaperimage "$WALL" >/dev/null 2>&1 && return 0
|
||||
_i=$((_i + 1))
|
||||
sleep 2
|
||||
done
|
||||
return 1
|
||||
}
|
||||
|
||||
# --- GNOME ------------------------------------------------------------------
|
||||
_apply_gnome() {
|
||||
command -v gsettings >/dev/null 2>&1 || return 1
|
||||
gsettings set org.gnome.desktop.background picture-uri "file://$WALL" || return 1
|
||||
# Thème sombre (GNOME ≥ 42) : GNOME lit picture-uri-dark dans ce cas.
|
||||
gsettings set org.gnome.desktop.background picture-uri-dark "file://$WALL" 2>/dev/null || true
|
||||
return 0
|
||||
}
|
||||
|
||||
# --- XFCE ------------------------------------------------------------------
|
||||
# xfce4-desktop stocke une propriété « last-image » par moniteur × espace de
|
||||
# travail ; on remplit celles qui existent et, au tout premier login (propriétés
|
||||
# pas encore créées), on les crée pour chaque sortie de xrandr (xfconf nomme les
|
||||
# moniteurs par connecteur depuis XFCE 4.16 : monitorHDMI-1, monitoreDP-1…).
|
||||
_apply_xfce() {
|
||||
command -v xfconf-query >/dev/null 2>&1 || return 1
|
||||
_done=0
|
||||
for _p in $(xfconf-query -c xfce4-desktop -l 2>/dev/null | grep 'last-image$'); do
|
||||
if xfconf-query -c xfce4-desktop -p "$_p" -s "$WALL" >/dev/null 2>&1; then
|
||||
_done=1
|
||||
# 5 = « zoom » (remplit l'écran sans déformer l'image).
|
||||
xfconf-query -c xfce4-desktop -p "${_p%last-image}image-style" \
|
||||
-n -t int -s 5 >/dev/null 2>&1 || true
|
||||
fi
|
||||
done
|
||||
if [ "$_done" -eq 0 ] && command -v xrandr >/dev/null 2>&1; then
|
||||
for _out in $(xrandr --listmonitors 2>/dev/null | awk 'NR>1 {print $4}' | sed 's#.*/##'); do
|
||||
_base="/backdrop/screen0/monitor${_out}/workspace0"
|
||||
xfconf-query -c xfce4-desktop -p "$_base/last-image" \
|
||||
-n -t string -s "$WALL" >/dev/null 2>&1 && _done=1
|
||||
xfconf-query -c xfce4-desktop -p "$_base/image-style" \
|
||||
-n -t int -s 5 >/dev/null 2>&1 || true
|
||||
done
|
||||
fi
|
||||
[ "$_done" -eq 1 ]
|
||||
}
|
||||
|
||||
# --- Hyprland ---------------------------------------------------------------
|
||||
# swaybg (layer-shell) affiche le fond ; setsid le détache du script, qui se
|
||||
# termine tout de suite (sinon Hyprland attendrait un exec-once zombie).
|
||||
_apply_hyprland() {
|
||||
command -v swaybg >/dev/null 2>&1 || return 1
|
||||
pkill -x swaybg >/dev/null 2>&1 || true
|
||||
setsid swaybg -i "$WALL" -m fill >/dev/null 2>&1 &
|
||||
return 0
|
||||
}
|
||||
|
||||
# --- i3 --------------------------------------------------------------------
|
||||
_apply_i3() {
|
||||
command -v feh >/dev/null 2>&1 || return 1
|
||||
feh --bg-fill "$WALL" >/dev/null 2>&1
|
||||
}
|
||||
|
||||
case "$DE" in
|
||||
kde) _apply_kde ;;
|
||||
gnome) _apply_gnome ;;
|
||||
xfce) _apply_xfce ;;
|
||||
hyprland) _apply_hyprland ;;
|
||||
i3) _apply_i3 ;;
|
||||
*) exit 1 ;;
|
||||
esac || exit 1
|
||||
|
||||
# Marqueur seulement hors « --session » : sur Hyprland/i3 le fond est reposé à
|
||||
# chaque session par la config, le marqueur n'aurait aucun sens.
|
||||
if [ "$MODE" != "session" ]; then
|
||||
mkdir -p "$STATE_DIR" 2>/dev/null && : > "$FLAG" 2>/dev/null || true
|
||||
fi
|
||||
exit 0
|
||||
@@ -65,6 +65,10 @@ misc {
|
||||
# Démarrage de session : barre d'état, notifications, réseau dans le tray,
|
||||
# agent d'authentification GUI (indispensable pour les apps qui demandent
|
||||
# les droits admin : gestionnaire de disques, blueman…).
|
||||
# Fond d'écran FWS : image EMBARQUÉE dans l'ISO (aucun réseau requis) — swaybg
|
||||
# la repose à chaque session, Hyprland n'ayant pas de réglage de fond persistant
|
||||
# hors config. « background_color » ci-dessus reste le repli si swaybg manque.
|
||||
exec-once = fws-wallpaper --session
|
||||
exec-once = waybar
|
||||
exec-once = mako
|
||||
exec-once = nm-applet
|
||||
@@ -86,7 +90,7 @@ bindd = $mod SHIFT, Return, Terminal flottant, exec, kitty --class floating-term
|
||||
bindd = $mod, R, Menu des applications, exec, wofi --show drun
|
||||
bindd = $mod, E, Gestionnaire de fichiers, exec, dolphin
|
||||
bindd = $mod, B, Ouvrir Firefox, exec, firefox
|
||||
bindd = $mod, P, Gestionnaire de paquets (PacManager), exec, fws-pacmanage
|
||||
bindd = $mod, P, Gestionnaire de paquets (PacManager), exec, PacManager
|
||||
bindd = $mod, K, Afficher les raccourcis clavier, exec, fws-keys
|
||||
bindd = $mod, X, Menu d'alimentation (arrêt/redémarrage…), exec, fws-powermenu
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ bindsym $mod+b exec $browser
|
||||
# VR : installation des drivers/runtimes casque (HTC Vive, Index, Quest…)
|
||||
bindsym $mod+Shift+v exec kitty -e fws-vr-setup
|
||||
# Gestionnaire de paquets graphique (rechercher/installer/mettre à jour)
|
||||
bindsym $mod+p exec fws-pacmanage
|
||||
bindsym $mod+p exec PacManager
|
||||
# Panneau des raccourcis clavier (aussi via le bouton ⌌ de la barre)
|
||||
bindsym $mod+k exec fws-keys
|
||||
# Menu d'alimentation (verrouiller/déconnexion/redémarrer/éteindre)
|
||||
@@ -156,6 +156,9 @@ exec_always --no-startup-id sh -c 'pkill -x polybar; sleep 0.3; exec polybar -q
|
||||
# rate le repaint des fenêtres GTK → contenus noirs/artefacts. Les coins
|
||||
# arrondis sont sacrifiés en VM ; sur matériel réel picom se lance normalement.
|
||||
exec --no-startup-id sh -c 'systemd-detect-virt --quiet || exec picom --config ~/.config/picom.conf'
|
||||
# Fond d'écran FWS : image EMBARQUÉE dans l'ISO (aucun réseau requis) — feh
|
||||
# repose le pixmap racine à chaque session (i3 n'a pas de fond persistant).
|
||||
exec --no-startup-id fws-wallpaper --session
|
||||
exec --no-startup-id dunst
|
||||
exec --no-startup-id nm-applet
|
||||
exec --no-startup-id /usr/lib/polkit-gnome/polkit-gnome-authentication-agent-1
|
||||
|
||||
@@ -35,6 +35,8 @@ line-size = 0
|
||||
font-0 = Noto Sans:size=10;2
|
||||
font-1 = Symbols Nerd Font:size=12;3
|
||||
font-2 = Noto Sans:weight=bold:size=10;2
|
||||
; dernier recours = emoji (police par défaut, etc/fonts/conf.d/99-fws-emoji.conf)
|
||||
font-3 = Noto Color Emoji:size=10;2
|
||||
modules-left = i3 xwindow
|
||||
modules-center = date
|
||||
modules-right = updates keyhelp backlight pulseaudio network cpu memory tray power
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 263 KiB |
@@ -3,7 +3,9 @@
|
||||
(paquet ttf-nerd-fonts-symbols, installé avec le bureau Hyprland). */
|
||||
|
||||
* {
|
||||
font-family: "Noto Sans", "Symbols Nerd Font", sans-serif;
|
||||
/* Noto Color Emoji : dernier recours, pour les emoji des titres/notifications
|
||||
(police par défaut, cf. etc/fonts/conf.d/99-fws-emoji.conf). */
|
||||
font-family: "Noto Sans", "Symbols Nerd Font", "Noto Color Emoji", sans-serif;
|
||||
font-size: 13px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ window {
|
||||
background-color: rgba(30, 30, 46, 0.97);
|
||||
border: 2px solid #89b4fa;
|
||||
border-radius: 14px;
|
||||
font-family: "Noto Sans Mono", monospace;
|
||||
font-family: "Noto Sans Mono", "Noto Color Emoji", monospace;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ window {
|
||||
border-radius: 10px;
|
||||
margin: 12px;
|
||||
padding: 8px 12px;
|
||||
font-family: "Noto Sans", sans-serif;
|
||||
font-family: "Noto Sans", "Noto Color Emoji", sans-serif;
|
||||
}
|
||||
|
||||
#input image { color: #89b4fa; }
|
||||
|
||||
@@ -4,7 +4,7 @@ window {
|
||||
background-color: rgba(30, 30, 46, 0.96); /* base #1e1e2e */
|
||||
border: 2px solid #89b4fa;
|
||||
border-radius: 14px;
|
||||
font-family: "Noto Sans", sans-serif;
|
||||
font-family: "Noto Sans", "Noto Color Emoji", sans-serif;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
|
||||
@@ -133,6 +133,9 @@ bootloader --disabled
|
||||
# pacman, choix de bureau écrit par l'addon de sélection).
|
||||
# ============================================================================
|
||||
%post --nochroot --log=/tmp/fws-post-nochroot.log
|
||||
# FWS-TITLE: Préparation de l'installation (live)
|
||||
# Écran de progression : chaque phase publie son avancement (fws-install-step),
|
||||
# l'installeur affiche le script en cours, ce qu'il fait et un pourcentage.
|
||||
set -x
|
||||
|
||||
# Selon la version d'Anaconda la cible est sous /mnt/sysroot (récent) ou
|
||||
@@ -224,6 +227,23 @@ if [ -f /tmp/fws-keep-wifi ]; then
|
||||
cp -a /etc/NetworkManager/system-connections/. \
|
||||
"$SYSROOT/etc/NetworkManager/system-connections/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# --- Wi-Fi choisi sur l'écran « Connexion Internet » → système installé -----
|
||||
# La connexion est faite par NetworkManager sur le LIVE (spoke fws_network) :
|
||||
# son profil vit dans /etc/NetworkManager/system-connections du live — un
|
||||
# overlay TEMPORAIRE que le payload LiveOS (copie du squashfs) ne recopie PAS.
|
||||
# Si l'utilisateur s'est connecté à un Wi-Fi (marqueur /tmp/fws-keep-wifi posé
|
||||
# par le spoke), on copie donc les profils NM du live vers la cible : le Wi-Fi
|
||||
# fonctionnera au 1er démarrage du système installé SANS ressaisie du mot de
|
||||
# passe (et le %post chrooté, qui tourne sur la pile réseau du live, a déjà pu
|
||||
# installer le bureau).
|
||||
if [ -f /tmp/fws-keep-wifi ]; then
|
||||
install -d -m 700 "$SYSROOT/etc/NetworkManager/system-connections"
|
||||
cp -a /etc/NetworkManager/system-connections/. \
|
||||
"$SYSROOT/etc/NetworkManager/system-connections/" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
fws-install-step 6 "Système de base préparé — configuration"
|
||||
%end
|
||||
|
||||
|
||||
@@ -233,7 +253,9 @@ fi
|
||||
# Log persistant : /var/log/fws-post.log sur le système installé.
|
||||
# ============================================================================
|
||||
%post --log=/var/log/fws-post.log
|
||||
# FWS-TITLE: Configuration du système installé
|
||||
set -x
|
||||
fws-install-step 8 "Nettoyage des résidus du live"
|
||||
|
||||
# --- 0) initramfs PROPRE, AVANT TOUT pacman — L'ORDRE COMPTE (vu en réel) ----
|
||||
# Le live fournit /etc/mkinitcpio.d/linux.preset = preset « archiso » (pointe
|
||||
@@ -320,6 +342,8 @@ rm -f /etc/systemd/system/dbus-org.freedesktop.network1.service \
|
||||
/etc/systemd/system/sockets.target.wants/pcscd.socket \
|
||||
/etc/systemd/system/sound.target.wants/livecd-alsa-unmuter.service 2>/dev/null || true
|
||||
|
||||
fws-install-step 14 "Construction de l'initramfs"
|
||||
|
||||
# --- 2) mkinitcpio : noyau (rattrapage) + génération finale -----------------
|
||||
# mkinitcpio exige un noyau lisible : s'il manque (rattrapage de copie raté
|
||||
# dans le %post --nochroot), on tente de l'installer par pacman (réseau du
|
||||
@@ -344,6 +368,8 @@ else
|
||||
echo "[FWS] CRITIQUE : toujours aucun noyau — initramfs NON généré, le disque NE BOOTERA PAS."
|
||||
fi
|
||||
|
||||
fws-install-step 22 "Installation de GRUB"
|
||||
|
||||
# --- 3) GRUB installé à la main (cf. bootloader --disabled) ------------------
|
||||
install_grub() {
|
||||
if [ -d /sys/firmware/efi ]; then
|
||||
@@ -456,6 +482,8 @@ fi
|
||||
# d'activation n'est créé qu'ici, dans le système installé).
|
||||
systemctl enable fws-grub-finalize.service || true
|
||||
|
||||
fws-install-step 28 "Clavier et langue du système"
|
||||
|
||||
# --- 3bis) Clavier (X11) + LOCALE --------------------------------------------
|
||||
# CLAVIER : Anaconda passe par localed et n'écrit pas fiablement la disposition X
|
||||
# sur la CIBLE → SDDM / sessions X en QWERTY US. On CALCULE la disposition CHOISIE
|
||||
@@ -494,6 +522,8 @@ if [ -n "$FWSLANG" ]; then
|
||||
locale-gen || echo "[FWS] locale-gen a échoué pour $FWSLANG"
|
||||
fi
|
||||
|
||||
fws-install-step 32 "Installation du bureau (pacman)"
|
||||
|
||||
# --- 4) Bureau choisi : pacman -S du DE (non bloquant si pas de réseau) -------
|
||||
DESK="cli"
|
||||
[ -f /tmp/fws-desktop ] && DESK="$(tr -d '[:space:]' < /tmp/fws-desktop)"
|
||||
@@ -516,18 +546,21 @@ case "$DESK" in
|
||||
# (fws-setup-hardware les re-propose ensuite en --needed : sans effet
|
||||
# s'ils sont déjà là, filet de secours sinon).
|
||||
xfce) PKGS="xfce4 xfce4-goodies sddm noto-fonts pipewire pipewire-pulse wireplumber pavucontrol"; DM="sddm" ;;
|
||||
hyprland) PKGS="hyprland kitty wofi waybar sddm noto-fonts dolphin kio-extras udisks2 hyprlock grim slurp wl-clipboard playerctl mako libnotify polkit-gnome network-manager-applet xdg-desktop-portal-hyprland ttf-nerd-fonts-symbols pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;;
|
||||
hyprland) PKGS="hyprland kitty wofi waybar swaybg sddm noto-fonts dolphin kio-extras udisks2 hyprlock grim slurp wl-clipboard playerctl mako libnotify polkit-gnome network-manager-applet xdg-desktop-portal-hyprland ttf-nerd-fonts-symbols pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;;
|
||||
# i3 : session X11 → COMPATIBLE VR (SteamVR ne marche pas sous Wayland).
|
||||
# xorg-server est requis (SDDM ne le tire pas) ; maim+xclip = captures X11,
|
||||
# dunst = notifications X11 (équivalent de mako), i3lock = verrouillage.
|
||||
# fws-vr-setup (Super+Shift+V ou menu) installe les drivers du casque.
|
||||
i3) PKGS="i3-wm i3lock xorg-server polybar picom rofi kitty dolphin kio-extras udisks2 sddm noto-fonts ttf-nerd-fonts-symbols maim xclip dunst libnotify polkit-gnome network-manager-applet playerctl brightnessctl pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;;
|
||||
i3) PKGS="i3-wm i3lock xorg-server polybar picom feh rofi kitty dolphin kio-extras udisks2 sddm noto-fonts ttf-nerd-fonts-symbols maim xclip dunst libnotify polkit-gnome network-manager-applet playerctl brightnessctl pipewire pipewire-alsa pipewire-pulse wireplumber pavucontrol bluez bluez-utils blueman"; DM="sddm" ;;
|
||||
cli|*) PKGS="" ;;
|
||||
esac
|
||||
# Navigateur de base ajouté DÈS QU'un bureau est choisi (jamais en CLI).
|
||||
# + python-gobject : fenêtre de bienvenue fws-hello (GTK3 vient avec Firefox)
|
||||
# + pacman-contrib : checkupdates/paccache (indicateur de MàJ + fws-update)
|
||||
[ -n "$PKGS" ] && PKGS="$PKGS firefox python-gobject pacman-contrib"
|
||||
# + noto-fonts-emoji : police emoji par défaut, dans la MÊME transaction que le
|
||||
# bureau (règle fontconfig : etc/fonts/conf.d/99-fws-emoji.conf) — sans elle,
|
||||
# les emoji des notifications/menus s'affichent en carrés vides.
|
||||
[ -n "$PKGS" ] && PKGS="$PKGS firefox python-gobject pacman-contrib noto-fonts-emoji"
|
||||
if [ -n "$PKGS" ]; then
|
||||
pacman-key --init &>/dev/null || true
|
||||
pacman-key --populate archlinux &>/dev/null || true
|
||||
@@ -755,35 +788,14 @@ MOTD
|
||||
fi
|
||||
fi
|
||||
|
||||
# --- 4ter bis) PacManager : le gestionnaire de paquets graphique de FWS ------
|
||||
# Il n'est PAS dans packages.x86_64, donc absent du live : sur un système qu'on
|
||||
# s'apprête à remplacer, un gestionnaire de paquets ne sert à rien. build.sh
|
||||
# dépose son .pkg dans l'image et il est installé ICI, dans la cible seulement.
|
||||
# Conditionné à un bureau : c'est une application graphique, elle n'a aucun
|
||||
# moyen d'être lancée sur une install « ligne de commande ».
|
||||
if [ "$DESK" != "cli" ]; then
|
||||
_PM_PKG="$(ls /usr/local/share/fws/packages/fws-pacmanage-*.pkg.tar.* 2>/dev/null | head -1)"
|
||||
if [ -n "$_PM_PKG" ]; then
|
||||
# « -U » va chercher qt6-base sur le réseau ; avec un bureau KDE il est
|
||||
# déjà là. Non bloquant : pas de PacManager n'est pas une install ratée.
|
||||
if pacman -U --noconfirm "$_PM_PKG"; then
|
||||
echo "[FWS] PacManager installé"
|
||||
else
|
||||
echo "[FWS] PacManager NON installé (réseau, ou dépendance qt6-base absente)"
|
||||
fi
|
||||
else
|
||||
echo "[FWS] paquet PacManager absent de l'image (build.sh ne l'a pas embarqué)"
|
||||
fi
|
||||
fi
|
||||
# Le .pkg ne doit pas rester sur le disque de l'utilisateur.
|
||||
rm -rf /usr/local/share/fws/packages
|
||||
fws-install-step 62 "Bureau installé — pilotes et pile matérielle"
|
||||
|
||||
# --- 4quater) ADN FWS : détection matériel + drivers + stack « Windows » ------
|
||||
# Script dédié (NON bloquant ; réseau requis) : drivers GPU détectés via lspci +
|
||||
# outils invité VM, son/micro/casque (PipeWire), Bluetooth, Podman, et — si un
|
||||
# bureau est choisi — Steam, Wine, VR (Monado/SteamVR), winboat-bin (apps
|
||||
# Windows). C'est ce qui rend la machine utilisable IMMÉDIATEMENT, sans
|
||||
# configuration à faire soi-même — la promesse même de FWS.
|
||||
# Script dédié (NON bloquant ; réseau requis) : drivers GPU détectés via lspci
|
||||
# (+ ICD Vulkan 64/32 bits de chaque GPU, loader, vulkaninfo), outils invité VM,
|
||||
# son/micro/casque (PipeWire), Bluetooth, Podman, et — si un
|
||||
# bureau est choisi — Steam, Wine, VR (Monado/SteamVR), PacManager (gestionnaire
|
||||
# de paquets). C'est le cœur « remplacement de Windows » de FWS.
|
||||
if [ -x /usr/local/bin/fws-setup-hardware ]; then
|
||||
# « --unattended » : pilotes, son, Bluetooth, Wi-Fi, réseau — tout ce
|
||||
# sans quoi la machine ne marche pas. Les codecs, Steam/Wine et la VR
|
||||
@@ -792,6 +804,8 @@ if [ -x /usr/local/bin/fws-setup-hardware ]; then
|
||||
/usr/local/bin/fws-setup-hardware --unattended "$DESK" || true
|
||||
fi
|
||||
|
||||
fws-install-step 76 "Configuration du bureau (raccourcis, barres, thème)"
|
||||
|
||||
# --- Config Hyprland (si choisi) : clavier + apps + waybar -------------------
|
||||
# Hyprland (Wayland) NE lit PAS /etc/X11/xorg.conf.d/00-keyboard.conf : sa
|
||||
# disposition est dans SA config (input { kb_layout }). Sans config il démarre nu
|
||||
@@ -848,6 +862,8 @@ if [ "$DESK" = "i3" ] && [ -f /usr/local/share/fws/i3-config ]; then
|
||||
done < /etc/passwd
|
||||
fi
|
||||
|
||||
fws-install-step 84 "Droits administrateur et identité FWS"
|
||||
|
||||
# --- 4bis) Sudo : l'utilisateur créé doit pouvoir administrer -----------------
|
||||
# Arch laisse « %wheel » COMMENTÉ dans sudoers → même un membre de wheel ne peut
|
||||
# pas sudo. On active le groupe wheel (drop-in) ET on y ajoute tous les
|
||||
@@ -920,6 +936,8 @@ systemctl enable systemd-timesyncd.service 2>/dev/null || true
|
||||
# normal), la target le tire par Requires. Dans le bureau, le lanceur
|
||||
# « Récupération FWS » (fws-recovery.desktop, polkit) fait le même travail.
|
||||
|
||||
fws-install-step 92 "Sécurité et réseau du système installé"
|
||||
|
||||
# --- 5) Sécurité : verrouiller root s'il est resté SANS mot de passe ----------
|
||||
# L'airootfs live a souvent un root sans mot de passe ; si l'utilisateur n'en a
|
||||
# pas défini dans le GUI, on verrouille plutôt que de laisser le compte ouvert.
|
||||
@@ -942,6 +960,8 @@ ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
|
||||
systemctl enable systemd-resolved.service 2>/dev/null || true
|
||||
install -d /etc/NetworkManager/conf.d
|
||||
printf '[main]\ndns=systemd-resolved\n' > /etc/NetworkManager/conf.d/dns.conf
|
||||
|
||||
fws-install-step 99 "Finalisation"
|
||||
%end
|
||||
|
||||
|
||||
@@ -954,7 +974,9 @@ printf '[main]\ndns=systemd-resolved\n' > /etc/NetworkManager/conf.d/dns.conf
|
||||
# le disque va booter.
|
||||
# ============================================================================
|
||||
%post --nochroot
|
||||
# FWS-TITLE: Finalisation et copie des journaux
|
||||
SYSROOT=/mnt/sysroot
|
||||
[ -d "$SYSROOT" ] || SYSROOT=/mnt/sysimage
|
||||
cp -f "$SYSROOT/var/log/fws-post.log" /tmp/fws-post-chroot.log 2>/dev/null || true
|
||||
fws-install-step 100 "Installation terminée"
|
||||
%end
|
||||
@@ -100,20 +100,26 @@ xorg-xsetroot
|
||||
xorg-setxkbmap
|
||||
openbox
|
||||
ttf-dejavu
|
||||
# Emoji de l'installateur et du live (règle fontconfig :
|
||||
# etc/fonts/conf.d/99-fws-emoji.conf) — Anaconda affiche des emoji FWS.
|
||||
noto-fonts-emoji
|
||||
|
||||
# --- Agents VM (pratique pour tester l'ISO) ---
|
||||
qemu-guest-agent
|
||||
virtualbox-guest-utils-nox
|
||||
open-vm-tools
|
||||
|
||||
# Conteneurs : requis par winboat-bin (applications Windows) et par la
|
||||
# stack matérielle. fws-setup-hardware l'installait APRÈS coup, donc
|
||||
# Conteneurs : moteur sans démon pour les applications isolées, utilisé par
|
||||
# la stack matérielle. fws-setup-hardware l'installait APRÈS coup, donc
|
||||
# seulement si le réseau tenait pendant l'installation — dans l'image,
|
||||
# il est là quoi qu'il arrive.
|
||||
podman
|
||||
|
||||
# --- FWS (fws-local) ---
|
||||
winboat-bin
|
||||
# Gestionnaire de paquets graphique PacManager (Qt6). Installé dans un
|
||||
# répertoire dédié /opt/fws-pacmanage : son self-update réécrit CE dossier
|
||||
# (binaire + fichier version + plugins) sans toucher à /usr.
|
||||
fws-pacmanage
|
||||
|
||||
# --- Installateur Anaconda (fws-local) ---
|
||||
# 'anaconda' tire automatiquement anaconda-widgets + toutes ses dépendances
|
||||
|
||||
@@ -39,5 +39,7 @@ file_permissions=(
|
||||
["/usr/local/bin/fws-powermenu"]="0:0:755"
|
||||
["/usr/local/bin/fws-about"]="0:0:755"
|
||||
["/usr/local/bin/fws-bugreport"]="0:0:755"
|
||||
["/usr/local/bin/fws-wallpaper"]="0:0:755"
|
||||
["/usr/local/bin/fws-install-step"]="0:0:755"
|
||||
["/etc/grub.d/42_fws-recovery"]="0:0:755"
|
||||
)
|
||||
Reference in new issue
Block a user