rebrand!: Antergos NeXT -> Euri Linux

This commit is contained in:
2026-08-21 21:34:51 +02:00
parent 24affb4a5a
commit 11706db546
128 changed files with 452 additions and 449 deletions
@@ -0,0 +1,29 @@
#!/bin/bash
ROOT=""
for arg in "$@"; do
case "$arg" in
--root=*)
ROOT="${arg#*=}"
;;
esac
done
MACHINE_ID_FILE="${ROOT}/etc/machine-id"
if [ -f "$MACHINE_ID_FILE" ] && [ -s "$MACHINE_ID_FILE" ]; then
exit 0
fi
mkdir -p "$(dirname "$MACHINE_ID_FILE")"
if command -v dbus-uuidgen &>/dev/null; then
dbus-uuidgen --ensure 2>/dev/null
fi
if [ ! -f "$MACHINE_ID_FILE" ] || [ ! -s "$MACHINE_ID_FILE" ]; then
od -An -N16 -tx1 /dev/urandom | tr -d ' \n' > "$MACHINE_ID_FILE"
fi
chmod 0644 "$MACHINE_ID_FILE"
@@ -0,0 +1,592 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <https://calamares.io> ===
#
# SPDX-FileCopyrightText: 2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
# SPDX-FileCopyrightText: 2015-2017 Teo Mrnjavac <teo@kde.org>
# SPDX-FileCopyrightText: 2016-2017 Kyle Robbertze <kyle@aims.ac.za>
# SPDX-FileCopyrightText: 2017 Alf Gaida <agaida@siduction.org>
# SPDX-FileCopyrightText: 2018 Adriaan de Groot <groot@kde.org>
# SPDX-FileCopyrightText: 2018 Philip Müller <philm@manjaro.org>
# SPDX-FileCopyrightText: 2023 Artoo <artoo@artixlinux.org>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Calamares is Free Software: see the License-Identifier above.
#
# Euri Linux: Removed hardcoded hasInternet check; added
# skip_if_no_internet config option matching the packages module pattern.
#
# ╔══════════════════════════════════════════════════════════════════════════╗
# ║ ⚠ CODEQL WARNING ⚠ ║
# ║ GitHub's CodeQL (powered by Copilot AI) will flag several lines in ║
# ║ this file as "findings". THEY ARE INTENTIONAL. "Fixing" them ║
# ║ WILL break the ISO — previous attempts caused partial upgrades, ║
# ║ package conflicts (audit-dinit vs audit-openrc, sddm vs x11win), ║
# ║ and fatal installer crashes. Do not let an AI rewrite this file. ║
# ║ If you must edit, test with a FULL online + offline install first. ║
# ╚══════════════════════════════════════════════════════════════════════════╝
import abc
from string import Template
import os, shutil, subprocess
import libcalamares
from libcalamares.utils import host_env_process_output, target_env_process_output
from libcalamares.utils import gettext_path, gettext_languages
from os.path import join
import gettext
_translation = gettext.translation("calamares-python",
localedir=gettext_path(),
languages=gettext_languages(),
fallback=True)
_ = _translation.gettext
_n = _translation.ngettext
total_packages = 0 # For the entire job
completed_packages = 0 # Done so far for this job
group_packages = 0 # One group of packages from an -install or -remove entry
# A PM object may set this to a string (take care of translations!)
# to override the string produced by pretty_status_message()
custom_status_message = None
INSTALL = object()
REMOVE = object()
mode_packages = None # Changes to INSTALL or REMOVE
def _change_mode(mode):
global mode_packages
mode_packages = mode
if total_packages > 0:
libcalamares.job.setprogress(completed_packages * 1.0 / total_packages)
else:
libcalamares.job.setprogress(0.0)
def pretty_name():
return _("Install packages.")
def pretty_status_message():
if custom_status_message is not None:
return custom_status_message
if not group_packages:
if (total_packages > 0):
# Outside the context of an operation
s = _("Processing packages (%(count)d / %(total)d)")
else:
s = _("Install packages.")
elif mode_packages is INSTALL:
s = _n("Installing one package.",
"Installing %(num)d packages.", group_packages)
elif mode_packages is REMOVE:
s = _n("Removing one package.",
"Removing %(num)d packages.", group_packages)
else:
# No mode, generic description
s = _("Install packages.")
return s % {"num": group_packages,
"count": completed_packages,
"total": total_packages}
class PackageManager(metaclass=abc.ABCMeta):
"""
Package manager base class. A subclass implements package management
for a specific backend, and must have a class property `backend`
with the string identifier for that backend.
Subclasses are collected below to populate the list of possible
backends.
"""
backend = None
@abc.abstractmethod
def install(self, pkgs, from_local=False):
"""
Install a list of packages (named) into the system.
Although this handles lists, in practice it is called
with one package at a time.
@param pkgs: list[str]
list of package names
@param from_local: bool
if True, then these are local packages (on disk) and the
pkgs names are paths.
"""
pass
@abc.abstractmethod
def remove(self, pkgs):
"""
Removes packages.
@param pkgs: list[str]
list of package names
"""
pass
def run(self, script):
if script != "":
host_env_process_output(script.split(" "))
def install_package(self, packagedata, from_local=False):
"""
Install a package from a single entry in the install list.
This can be either a single package name, or an object
with pre- and post-scripts. If @p packagedata is a dict,
it is assumed to follow the documented structure.
@param packagedata: str|dict
@param from_local: bool
see install.from_local
"""
if isinstance(packagedata, str):
self.install([packagedata], from_local=from_local)
else:
self.run(packagedata["pre-script"])
self.install([packagedata["package"]], from_local=from_local)
self.run(packagedata["post-script"])
def remove_package(self, packagedata):
"""
Remove a package from a single entry in the remove list.
This can be either a single package name, or an object
with pre- and post-scripts. If @p packagedata is a dict,
it is assumed to follow the documented structure.
@param packagedata: str|dict
"""
if isinstance(packagedata, str):
self.remove([packagedata])
else:
self.run(packagedata["pre-script"])
self.remove([packagedata["package"]])
self.run(packagedata["post-script"])
def operation_install(self, package_list, from_local=False):
"""
Installs the list of packages named in @p package_list .
These can be strings -- plain package names -- or
structures (with a pre- and post-install step).
This operation is called for "critical" packages,
which are expected to succeed, or fail, all together.
However, if there are packages with pre- or post-scripts,
then packages are installed one-by-one instead.
NOTE: package managers may reimplement this method
NOTE: exceptions are expected to leave this method, to indicate
failure of the installation.
"""
if all([isinstance(x, str) for x in package_list]):
self.install(package_list, from_local=from_local)
else:
for package in package_list:
self.install_package(package, from_local=from_local)
def operation_try_install(self, package_list):
"""
Installs the list of packages named in @p package_list .
These can be strings -- plain package names -- or
structures (with a pre- and post-install step).
This operation is called for "non-critical" packages,
which can succeed or fail without affecting the overall installation.
Packages are installed one-by-one to support package managers
that do not have a "install as much as you can" mode.
NOTE: package managers may reimplement this method
NOTE: no package-installation exceptions should be raised
"""
# we make a separate package manager call for each package so a
# single failing package won't stop all of them
for package in package_list:
try:
self.install_package(package)
except subprocess.CalledProcessError:
libcalamares.utils.warning("Could not install package %s" % package)
def operation_remove(self, package_list):
"""
Removes the list of packages named in @p package_list .
These can be strings -- plain package names -- or
structures (with a pre- and post-install step).
This operation is called for "critical" packages, which are
expected to succeed or fail all together.
However, if there are packages with pre- or post-scripts,
then packages are removed one-by-one instead.
NOTE: package managers may reimplement this method
NOTE: exceptions should be raised to indicate failure
"""
if all([isinstance(x, str) for x in package_list]):
self.remove(package_list)
else:
for package in package_list:
self.remove_package(package)
def operation_try_remove(self, package_list):
"""
Same relation as try_install has to install, except it removes
packages instead. Packages are removed one-by-one.
NOTE: package managers may reimplement this method
NOTE: no package-installation exceptions should be raised
"""
for package in package_list:
try:
self.remove_package(package)
except subprocess.CalledProcessError:
libcalamares.utils.warning("Could not remove package %s" % package)
### PACKAGE MANAGER IMPLEMENTATIONS
#
# Keep these alphabetical (presumably both by class name and backend name),
# even the Dummy implementation.
#
class PMDummy(PackageManager):
backend = "dummy"
def install(self, pkgs, from_local=False):
from time import sleep
libcalamares.utils.debug("Dummy backend: Installing " + str(pkgs))
sleep(3)
def remove(self, pkgs):
from time import sleep
libcalamares.utils.debug("Dummy backend: Removing " + str(pkgs))
sleep(3)
def run(self, script):
libcalamares.utils.debug("Dummy backend: Running script '" + str(script) + "'")
class PMPacman(PackageManager):
backend = "pacman"
def __init__(self):
def line_cb(line):
if line.startswith(":: "):
self.in_package_changes = "package" in line or "hooks" in line
else:
if self.in_package_changes and line.endswith("...\n"):
# Update the message, untranslated; do not change the
# progress percentage, since there may be more "installing..."
# lines in the output for the group, than packages listed
# explicitly. We don't know how to calculate proper progress.
global custom_status_message
custom_status_message = "pacman: " + line.strip()
libcalamares.job.setprogress(self.progress_fraction)
libcalamares.utils.debug(line)
self.in_package_changes = False
self.line_cb = line_cb
pacman = libcalamares.job.configuration.get("pacman", None)
if pacman is None:
pacman = dict()
if type(pacman) is not dict:
libcalamares.utils.warning("Job configuration *pacman* will be ignored.")
pacman = dict()
self.pacman_num_retries = pacman.get("num_retries", 0)
self.pacman_disable_timeout = pacman.get("disable_download_timeout", False)
self.pacman_needed_only = pacman.get("needed_only", False)
self.pacman_key = pacman.get("handle_keyrings", False)
self.pacman_pacconf = pacman.get("copy_pacconf", False)
self.pacman_requirements = pacman.get("requirements", [])
self.pacman_keyrings = pacman.get("keyrings", [])
def reset_progress(self):
self.in_package_changes = False
# These are globals
self.progress_fraction = (completed_packages * 1.0 / total_packages)
def run_pacman(self, command, callback=False):
"""
Call pacman in a loop until it is successful or the number of retries is exceeded
:param command: The pacman command to run
:param callback: An optional boolean that indicates if this pacman run should use the callback
:return:
"""
pacman_count = 0
while pacman_count <= self.pacman_num_retries:
pacman_count += 1
try:
if False: # callback:
host_env_process_output(command, self.line_cb)
else:
host_env_process_output(command)
return
except subprocess.CalledProcessError:
if pacman_count <= self.pacman_num_retries:
pass
else:
raise
def install(self, pkgs, from_local=False):
install_root = libcalamares.globalstorage.value("rootMountPoint")
self.setup_requirements(install_root)
self.copy_file(install_root, "etc/resolv.conf")
command = ["pacman"]
command.extend(self.get_optargs(install_root))
# Don't ask for user intervention, take the default action
command.append("--noconfirm")
# Don't report download progress for each file
command.append("--noprogressbar")
if self.pacman_needed_only:
command.append("--needed")
if self.pacman_disable_timeout:
command.append("--disable-download-timeout")
if from_local:
command.append("-U")
else:
# -Sy syncs DB and installs requested packages in one transaction
command.append("-Sy")
command.append("--overwrite=*")
command += pkgs
libcalamares.utils.debug("Command: {!s}".format(command))
self.reset_progress()
self.run_pacman(command, True)
if self.pacman_key:
self.init_keyring()
self.populate_keyring()
if self.pacman_pacconf:
self.copy_file(install_root, "etc/pacman.conf")
def remove(self, pkgs):
self.reset_progress()
install_root = libcalamares.globalstorage.value("rootMountPoint")
command = ["pacman"]
command.extend(self.get_optargs(install_root))
command += ["-Rs", "--noconfirm"] + pkgs
self.run_pacman(command, True)
def get_optargs(self, rootdir):
cachedir = join(rootdir, "var/cache/pacman/pkg")
dbpath = join(rootdir, "var/lib/pacman")
args = ["--root", rootdir, "--dbpath", dbpath, "--cachedir", cachedir]
return args
def setup_requirements(self, rootdir):
cal_umask = os.umask(0)
for target in self.pacman_requirements:
dest = rootdir + target["dest"]
if not os.path.exists(dest):
mod = int(target["mode"], 8)
os.mkdir(dest, mode=mod)
libcalamares.utils.debug("Mode: {!s}".format(oct(mod)))
libcalamares.utils.debug("Created: {!s}".format(dest))
path = join(rootdir, "run")
os.chmod(path, 0o755)
os.umask(cal_umask)
def copy_file(self, rootdir, f):
if os.path.exists(join("/",f)):
shutil.copy2(join("/",f), join(rootdir, f))
def init_keyring(self):
target_env_process_output(["pacman-key", "--init"])
def populate_keyring(self):
target_env_process_output(["pacman-key", "--populate"] + self.pacman_keyrings)
# Collect all the subclasses of PackageManager defined above,
# and index them based on the backend property of each class.
backend_managers = [
(c.backend, c)
for c in globals().values()
if type(c) is abc.ABCMeta and issubclass(c, PackageManager) and c.backend]
def subst_locale(plist):
"""
Returns a locale-aware list of packages, based on @p plist.
Package names that contain LOCALE are localized with the
BCP47 name of the chosen system locale; if the system
locale is 'en' (e.g. English, US) then these localized
packages are dropped from the list.
@param plist: list[str|dict]
Candidate packages to install.
@return: list[str|dict]
"""
locale = libcalamares.globalstorage.value("locale")
if not locale:
# It is possible to skip the locale-setting entirely.
# Then pretend it is "en", so that {LOCALE}-decorated
# package names are removed from the list.
locale = "en"
ret = []
for packagedata in plist:
if isinstance(packagedata, str):
packagename = packagedata
else:
packagename = packagedata["package"]
# Update packagename: substitute LOCALE, and drop packages
# if locale is en and LOCALE is in the package name.
if locale != "en":
packagename = Template(packagename).safe_substitute(LOCALE=locale)
elif 'LOCALE' in packagename:
packagename = None
if packagename is not None:
# Put it back in packagedata
if isinstance(packagedata, str):
packagedata = packagename
else:
packagedata["package"] = packagename
ret.append(packagedata)
return ret
def run_operations(pkgman, entry):
"""
Call package manager with suitable parameters for the given
package actions.
:param pkgman: PackageManager
This is the manager that does the actual work.
:param entry: dict
Keys are the actions -- e.g. "install" -- to take, and the values
are the (list of) packages to apply the action to. The actions are
not iterated in a specific order, so it is recommended to use only
one action per dictionary. The list of packages may be package
names (strings) or package information dictionaries with pre-
and post-scripts.
"""
global group_packages, completed_packages, mode_packages
for key in entry.keys():
package_list = subst_locale(entry[key])
group_packages = len(package_list)
if key == "install":
_change_mode(INSTALL)
pkgman.operation_install(package_list)
elif key == "try_install":
_change_mode(INSTALL)
pkgman.operation_try_install(package_list)
elif key == "remove":
_change_mode(REMOVE)
pkgman.operation_remove(package_list)
elif key == "try_remove":
_change_mode(REMOVE)
pkgman.operation_try_remove(package_list)
elif key == "localInstall":
_change_mode(INSTALL)
pkgman.operation_install(package_list, from_local=True)
elif key == "source":
libcalamares.utils.debug("Package-list from {!s}".format(entry[key]))
else:
libcalamares.utils.warning("Unknown package-operation key {!s}".format(key))
completed_packages += len(package_list)
libcalamares.job.setprogress(completed_packages * 1.0 / total_packages)
libcalamares.utils.debug("Pretty name: {!s}, setting progress..".format(pretty_name()))
group_packages = 0
_change_mode(None)
def run():
"""
Calls routine with detected package manager to install locale packages
or remove drivers not needed on the installed system.
:return:
"""
global mode_packages, total_packages, completed_packages, group_packages
backend = libcalamares.job.configuration.get("backend")
for identifier, impl in backend_managers:
if identifier == backend:
pkgman = impl()
break
else:
return "Bad backend", "backend=\"{}\"".format(backend)
skip_this = libcalamares.job.configuration.get("skip_if_no_internet", False)
if skip_this and not libcalamares.globalstorage.value("hasInternet"):
libcalamares.utils.warning("Package installation has been skipped: no internet")
return None
operations = libcalamares.job.configuration.get("operations", [])
base_init = libcalamares.job.configuration.get("base_init", None)
known_inits = ["openrc", "dinit", "runit", "s6"]
if base_init is not None and libcalamares.globalstorage.contains("netinstallAdd"):
data = libcalamares.globalstorage.value("netinstallAdd")
for entry in data:
provider = entry.get("name", "").lower()
if provider in known_inits:
init_pkg = "-".join([base_init, provider])
libcalamares.utils.debug("Init provider package added: {!s}".format(init_pkg))
operations[0]["install"].append(init_pkg)
libcalamares.globalstorage.insert("initProvider", provider)
libcalamares.globalstorage.insert("baseInit", base_init)
break
libcalamares.globalstorage.insert("packageOperationsBasestrap", operations)
mode_packages = None
total_packages = 0
completed_packages = 0
for op in operations:
for packagelist in op.values():
total_packages += len(subst_locale(packagelist))
if not total_packages:
# Avoids potential divide-by-zero in progress reporting
return None
for entry in operations:
group_packages = 0
libcalamares.utils.debug(pretty_name())
try:
run_operations(pkgman, entry)
except subprocess.CalledProcessError as e:
libcalamares.utils.warning(str(e))
libcalamares.utils.debug("stdout:" + str(e.stdout))
libcalamares.utils.debug("stderr:" + str(e.stderr))
return (_("Package Manager error"),
_("The package manager could not make changes to the installed system. The command <pre>{!s}</pre> returned error code {!s}.")
.format(e.cmd, e.returncode))
mode_packages = None
libcalamares.job.setprogress(1.0)
return None
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: no
# SPDX-License-Identifier: CC0-1.0
---
type: "job"
name: "basestrap"
interface: "python"
script: "main.py"
@@ -0,0 +1,392 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# === This file is part of Calamares - <https://calamares.io> ===
#
# SPDX-FileCopyrightText: 2014 Pier Luigi Fiorini <pierluigi.fiorini@gmail.com>
# SPDX-FileCopyrightText: 2015-2017 Teo Mrnjavac <teo@kde.org>
# SPDX-FileCopyrightText: 2016-2017 Kyle Robbertze <kyle@aims.ac.za>
# SPDX-FileCopyrightText: 2017 Alf Gaida <agaida@siduction.org>
# SPDX-FileCopyrightText: 2018 Adriaan de Groot <groot@kde.org>
# SPDX-FileCopyrightText: 2018 Philip Müller <philm@manjaro.org>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# Calamares is Free Software: see the License-Identifier above.
#
# Euri Linux: Batch install with --overwrite='*' to avoid file conflicts.
import abc
from string import Template
import subprocess
import libcalamares
from libcalamares.utils import check_target_env_call
from libcalamares.utils import gettext_path, gettext_languages
import gettext
_translation = gettext.translation("calamares-python",
localedir=gettext_path(),
languages=gettext_languages(),
fallback=True)
_ = _translation.gettext
_n = _translation.ngettext
total_packages = 0
completed_packages = 0
group_packages = 0
custom_status_message = None
INSTALL = object()
REMOVE = object()
mode_packages = None
def _change_mode(mode):
global mode_packages
mode_packages = mode
libcalamares.job.setprogress(completed_packages * 1.0 / total_packages)
def pretty_name():
return _("Install packages.")
def pretty_status_message():
if custom_status_message is not None:
return custom_status_message
if not group_packages:
if (total_packages > 0):
s = _("Processing packages (%(count)d / %(total)d)")
else:
s = _("Install packages.")
elif mode_packages is INSTALL:
s = _n("Installing one package.",
"Installing %(num)d packages.", group_packages)
elif mode_packages is REMOVE:
s = _n("Removing one package.",
"Removing %(num)d packages.", group_packages)
else:
s = _("Install packages.")
return s % {"num": group_packages,
"count": completed_packages,
"total": total_packages}
class PackageManager(metaclass=abc.ABCMeta):
backend = None
@abc.abstractmethod
def install(self, pkgs, from_local=False):
pass
@abc.abstractmethod
def remove(self, pkgs):
pass
@abc.abstractmethod
def update_db(self):
pass
def run(self, script):
if script != "":
check_target_env_call(script.split(" "))
def install_package(self, packagedata, from_local=False):
if isinstance(packagedata, str):
self.install([packagedata], from_local=from_local)
else:
self.run(packagedata["pre-script"])
self.install([packagedata["package"]], from_local=from_local)
self.run(packagedata["post-script"])
def remove_package(self, packagedata):
if isinstance(packagedata, str):
self.remove([packagedata])
else:
self.run(packagedata["pre-script"])
self.remove([packagedata["package"]])
self.run(packagedata["post-script"])
def operation_install(self, package_list, from_local=False):
if all([isinstance(x, str) for x in package_list]):
self.install(package_list, from_local=from_local)
else:
for package in package_list:
self.install_package(package, from_local=from_local)
def operation_try_install(self, package_list):
for package in package_list:
try:
self.install_package(package)
except subprocess.CalledProcessError:
libcalamares.utils.warning("Could not install package %s" % package)
def operation_remove(self, package_list):
if all([isinstance(x, str) for x in package_list]):
self.remove(package_list)
else:
for package in package_list:
self.remove_package(package)
def operation_try_remove(self, package_list):
for package in package_list:
try:
self.remove_package(package)
except subprocess.CalledProcessError:
libcalamares.utils.warning("Could not remove package %s" % package)
class PMDummy(PackageManager):
backend = "dummy"
def install(self, pkgs, from_local=False):
from time import sleep
libcalamares.utils.debug("Dummy backend: Installing " + str(pkgs))
sleep(3)
def remove(self, pkgs):
from time import sleep
libcalamares.utils.debug("Dummy backend: Removing " + str(pkgs))
sleep(3)
def update_db(self):
libcalamares.utils.debug("Dummy backend: Updating DB")
def update_system(self):
libcalamares.utils.debug("Dummy backend: Updating System")
def run(self, script):
libcalamares.utils.debug("Dummy backend: Running script '" + str(script) + "'")
class PMPacman(PackageManager):
backend = "pacman"
def __init__(self):
def line_cb(line):
if line.startswith(":: "):
self.in_package_changes = "package" in line or "hooks" in line
else:
if self.in_package_changes and line.endswith("...\n"):
global custom_status_message
custom_status_message = "pacman: " + line.strip()
libcalamares.job.setprogress(self.progress_fraction)
libcalamares.utils.debug(line)
self.in_package_changes = False
self.line_cb = line_cb
pacman = libcalamares.job.configuration.get("pacman", None)
if pacman is None:
pacman = dict()
if type(pacman) is not dict:
libcalamares.utils.warning("Job configuration *pacman* will be ignored.")
pacman = dict()
self.pacman_num_retries = pacman.get("num_retries", 0)
self.pacman_disable_timeout = pacman.get("disable_download_timeout", False)
self.pacman_needed_only = pacman.get("needed_only", False)
def operation_try_install(self, package_list):
if all([isinstance(x, str) for x in package_list]):
try:
self.install(package_list)
except subprocess.CalledProcessError:
libcalamares.utils.warning("Could not install batch: %s" % package_list)
else:
for package in package_list:
try:
self.install_package(package)
except subprocess.CalledProcessError:
libcalamares.utils.warning("Could not install package %s" % package)
def reset_progress(self):
self.in_package_changes = False
self.progress_fraction = (completed_packages * 1.0 / total_packages)
def run_pacman(self, command, callback=False):
pacman_count = 0
while pacman_count <= self.pacman_num_retries:
pacman_count += 1
try:
libcalamares.utils.target_env_process_output(command)
return
except subprocess.CalledProcessError:
if pacman_count <= self.pacman_num_retries:
pass
else:
raise
def install(self, pkgs, from_local=False):
command = ["pacman"]
if from_local:
command.append("-U")
else:
command.append("-S")
command.append("--noconfirm")
command.append("--noprogressbar")
command.append("--overwrite=*")
if self.pacman_needed_only is True:
command.append("--needed")
if self.pacman_disable_timeout is True:
command.append("--disable-download-timeout")
command += pkgs
self.reset_progress()
try:
self.run_pacman(command, True)
libcalamares.utils.debug("packages_ok: {!s}".format(pkgs))
except subprocess.CalledProcessError as e:
libcalamares.utils.warning("packages_fail: {!s}".format(pkgs))
libcalamares.utils.debug("stdout:" + str(e.stdout))
libcalamares.utils.debug("stderr:" + str(e.stderr))
raise
def remove(self, pkgs):
self.reset_progress()
self.run_pacman(["pacman", "-Rs", "--noconfirm"] + pkgs, True)
def update_db(self):
self.run_pacman(["pacman", "-Sy"])
def update_system(self):
command = ["pacman", "-Su", "--noconfirm"]
if self.pacman_disable_timeout is True:
command.append("--disable-download-timeout")
self.run_pacman(command)
backend_managers = [
(c.backend, c)
for c in globals().values()
if type(c) is abc.ABCMeta and issubclass(c, PackageManager) and c.backend]
def subst_locale(plist):
locale = libcalamares.globalstorage.value("locale")
if not locale:
locale = "en"
ret = []
for packagedata in plist:
if isinstance(packagedata, str):
packagename = packagedata
else:
packagename = packagedata["package"]
if locale != "en":
packagename = Template(packagename).safe_substitute(LOCALE=locale)
elif 'LOCALE' in packagename:
packagename = None
if packagename is not None:
if isinstance(packagedata, str):
packagedata = packagename
else:
packagedata["package"] = packagename
ret.append(packagedata)
return ret
def run_operations(pkgman, entry):
global group_packages, completed_packages, mode_packages
for key in entry.keys():
package_list = subst_locale(entry[key])
group_packages = len(package_list)
if key == "install":
_change_mode(INSTALL)
pkgman.operation_install(package_list)
elif key == "try_install":
_change_mode(INSTALL)
pkgman.operation_try_install(package_list)
elif key == "remove":
_change_mode(REMOVE)
pkgman.operation_remove(package_list)
elif key == "try_remove":
_change_mode(REMOVE)
pkgman.operation_try_remove(package_list)
elif key == "localInstall":
_change_mode(INSTALL)
pkgman.operation_install(package_list, from_local=True)
elif key == "source":
libcalamares.utils.debug("Package-list from {!s}".format(entry[key]))
else:
libcalamares.utils.warning("Unknown package-operation key {!s}".format(key))
completed_packages += len(package_list)
libcalamares.job.setprogress(completed_packages * 1.0 / total_packages)
libcalamares.utils.debug("Pretty name: {!s}, setting progress..".format(pretty_name()))
group_packages = 0
_change_mode(None)
def run():
global mode_packages, total_packages, completed_packages, group_packages
backend = libcalamares.job.configuration.get("backend")
for identifier, impl in backend_managers:
if identifier == backend:
pkgman = impl()
break
else:
return "Bad backend", "backend=\"{}\"".format(backend)
skip_this = libcalamares.job.configuration.get("skip_if_no_internet", False)
if skip_this and not libcalamares.globalstorage.value("hasInternet"):
libcalamares.utils.warning("Package installation has been skipped: no internet")
return None
update_db = libcalamares.job.configuration.get("update_db", False)
if update_db and libcalamares.globalstorage.value("hasInternet"):
try:
pkgman.update_db()
except subprocess.CalledProcessError as e:
libcalamares.utils.warning(str(e))
libcalamares.utils.debug("stdout:" + str(e.stdout))
libcalamares.utils.debug("stderr:" + str(e.stderr))
libcalamares.utils.warning("Continuing despite update_db failure")
operations = libcalamares.job.configuration.get("operations", [])
if libcalamares.globalstorage.contains("packageOperations"):
operations += libcalamares.globalstorage.value("packageOperations")
mode_packages = None
total_packages = 0
completed_packages = 0
for op in operations:
for packagelist in op.values():
total_packages += len(subst_locale(packagelist))
if not total_packages:
return None
errors = []
for entry in operations:
group_packages = 0
libcalamares.utils.debug(pretty_name())
try:
run_operations(pkgman, entry)
except subprocess.CalledProcessError as e:
libcalamares.utils.warning(str(e))
libcalamares.utils.debug("stdout:" + str(e.stdout))
libcalamares.utils.debug("stderr:" + str(e.stderr))
errors.append((e.cmd, e.returncode, e.stderr))
libcalamares.utils.debug("Continuing despite package error")
mode_packages = None
libcalamares.job.setprogress(1.0)
if errors:
return (None,
"Package installation completed with {!s} errors. "
"Check the logs for details.".format(len(errors)))
return None
@@ -0,0 +1,13 @@
NAME="Euri Linux"
PRETTY_NAME="Euri Linux 2026.08.17 Arranxo"
ID=euri
ID_LIKE=artix
VERSION_ID=2026.08.17
VERSION_CODENAME=arranxo
BUILD_ID=rolling
ANSI_COLOR="38;2;0;136;204"
HOME_URL="https://github.com/Antergos-NeXT"
DOCUMENTATION_URL="https://wiki.archlinux.org"
SUPPORT_URL="https://github.com/Antergos-NeXT"
BUG_REPORT_URL="https://github.com/Antergos-NeXT"
LOGO=euri-logo
@@ -0,0 +1,254 @@
#!/bin/bash
# Euri Linux Offline Installer
# Stolen with love from Valve's SteamOS repair_device.sh
# "If it works for a Steam Deck, it works for you." -- some drunk developer
set -eu
SQUASHFS="/run/artix/bootmnt/LiveOS/rootfs.img"
# ── Stolen from SteamOS: pretty output ──
sh_c() { [[ $_sh_c_colors -le 0 ]] || echo -ne "\e[${*:-0}m"; }
_sh_c_colors=0
[[ -n $TERM && -t 1 && ${TERM,,} != dumb ]] && _sh_c_colors=$(tput colors 2>/dev/null || echo 0)
estat() { echo -e "$(sh_c 32 1)::$(sh_c) $*"; }
einfo() { echo -e "$(sh_c 34 1)::$(sh_c) $*"; }
ewarn() { echo -e "$(sh_c 33 1);;$(sh_c) $*"; }
eerr() { echo -e "$(sh_c 31 1)!!$(sh_c) $*" >&2; }
die() { eerr "${1:-script terminated}"; exit 1; }
cmd() { echo -e "$(sh_c 30 1)+$(sh_c) $*"; "$@"; }
# ── Stolen from SteamOS: read heredoc into var ──
readvar() { IFS= read -r -d '' "$1" || true; }
# ── Stolen from SteamOS: partition helpers ──
diskpart() { echo "${DISK}${DISK_SUFFIX}$1"; }
# ── Stolen from SteamOS: zenity prompts ──
prompt_confirm() {
zenity --title "$1" --question --ok-label "Proceed" --cancel-label "Cancel" --no-wrap --text "$2" 2>/dev/null
}
prompt_msg() {
zenity --title "$1" --info --no-wrap --text "$2" 2>/dev/null
}
# ── Pre-flight ──
[[ $EUID -eq 0 ]] || die "Must be run as root"
if [[ ! -f "$SQUASHFS" ]]; then
die "Cannot find rootfs squashfs at $SQUASHFS. Are you booted from an Euri Linux ISO?"
fi
# ── WARNING: NO DE ──
prompt_msg "Euri Linux Offline Installer" \
"This will install a BARE MINIMUM system — no desktop environment, no apps, just the base system + Calamares.
After boot, connect to the internet and run:
sudo pacman -Sy plasma-meta
(or xfce4, or whatever DE you want)
This is for people who want a minimal base to build on, or who are trapped in a cave with no internet.
This WILL DESTROY ALL DATA on the target disk."
prompt_confirm "Select target disk" \
"This will list available disks. Choose carefully — ALL DATA WILL BE DESTROYED." || die "Aborted by user"
# ── Select disk ──
DISK=$(lsblk -dno NAME,SIZE,MODEL,TYPE | grep disk | \
zenity --list --title "Select target disk" \
--column "Device" --column "Size" --column "Model" \
--print-column=1 --width=500 --height=300 2>/dev/null | tail -1)
[[ -n "$DISK" ]] || die "No disk selected"
DISK="/dev/$DISK"
[[ -b "$DISK" ]] || die "$DISK is not a block device"
# Determine partition suffix (p for NVMe/mmcblk, nothing for sdX)
if [[ "$DISK" =~ /dev/nvme || "$DISK" =~ /dev/mmcblk ]]; then
DISK_SUFFIX="p"
else
DISK_SUFFIX=""
fi
prompt_confirm "DESTROY $DISK?" \
"Target: $DISK
All partitions will be wiped. This cannot be undone.
Type YES below to confirm." || die "Aborted by user"
# ── Partition ──
estat "Partitioning $DISK..."
cmd sfdisk --delete "$DISK" 2>/dev/null || true
readvar PARTITION_TABLE << END_PTABLE
label: gpt
$(diskpart 1): size=512MiB, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B
$(diskpart 2): size=300MiB, type=0657FD6D-A4AB-43C4-84E5-0933C84B4F4F
$(diskpart 3): type=0FC63DAF-8483-4772-8E79-3D69D8477DE4
END_PTABLE
echo "$PARTITION_TABLE" | cmd sfdisk "$DISK"
PART_ESP=$(diskpart 1)
PART_SWAP=$(diskpart 2)
PART_ROOT=$(diskpart 3)
# ── Format ──
estat "Formatting partitions..."
cmd mkfs.fat -F32 -n ESP "$PART_ESP"
cmd mkswap -L swap "$PART_SWAP"
cmd mkfs.btrfs -f -L euri "$PART_ROOT"
# ── Create btrfs subvolumes ──
estat "Creating btrfs subvolumes..."
cmd mkdir -p /mnt/btrfs
cmd mount "$PART_ROOT" /mnt/btrfs
cmd btrfs subvolume create /mnt/btrfs/@
cmd btrfs subvolume create /mnt/btrfs/@home
cmd btrfs subvolume create /mnt/btrfs/@cache
cmd btrfs subvolume create /mnt/btrfs/@log
cmd btrfs subvolume create /mnt/btrfs/@snapshots
cmd umount /mnt/btrfs
# ── Mount subvolumes ──
estat "Mounting subvolumes..."
TARGET=/mnt/target
cmd mkdir -p "$TARGET"
cmd mount -o subvol=@ "$PART_ROOT" "$TARGET"
cmd mkdir -p "$TARGET"/{home,var/cache,var/log,.snapshots,boot}
cmd mount -o subvol=@home "$PART_ROOT" "$TARGET/home"
cmd mount -o subvol=@cache "$PART_ROOT" "$TARGET/var/cache"
cmd mount -o subvol=@log "$PART_ROOT" "$TARGET/var/log"
cmd mount -o subvol=@snapshots "$PART_ROOT" "$TARGET/.snapshots"
cmd mount "$PART_ESP" "$TARGET/boot"
# ── Extract squashfs ──
estat "Extracting rootfs to $TARGET... (this will take a while)"
cmd unsquashfs -f -d "$TARGET" "$SQUASHFS"
# ── Generate fstab ──
estat "Generating fstab with btrfs subvolumes..."
ROOT_UUID=$(blkid -o value -s UUID "$PART_ROOT")
SWAP_UUID=$(blkid -o value -s UUID "$PART_SWAP")
ESP_UUID=$(blkid -o value -s UUID "$PART_ESP")
cat > "$TARGET/etc/fstab" << FSTAB
# /etc/fstab generated by Euri Linux Offline Installer
# Stolen from SteamOS, adapted for your sins — now with btrfs snapshots
UUID=$ROOT_UUID / btrfs subvol=@,defaults,noatime,compress=zstd 0 1
UUID=$ROOT_UUID /home btrfs subvol=@home,defaults,noatime,compress=zstd 0 0
UUID=$ROOT_UUID /var/cache btrfs subvol=@cache,defaults,noatime,compress=zstd 0 0
UUID=$ROOT_UUID /var/log btrfs subvol=@log,defaults,noatime,compress=zstd 0 0
UUID=$ROOT_UUID /.snapshots btrfs subvol=@snapshots,defaults,noatime 0 0
UUID=$SWAP_UUID none swap sw 0 0
UUID=$ESP_UUID /boot vfat defaults,noatime 0 2
FSTAB
# ── Chroot setup ──
estat "Setting up chroot for bootloader..."
cmd mount --bind /dev "$TARGET/dev"
cmd mount --bind /proc "$TARGET/proc"
cmd mount --bind /sys "$TARGET/sys"
cmd mount --bind /run "$TARGET/run"
# Generate initramfs
estat "Generating initramfs..."
if ! cmd chroot "$TARGET" /bin/bash -c "mkinitcpio -P"; then
ewarn "mkinitcpio failed — continuing anyway; the rootfs squashfs already ships an initramfs"
fi
# Install GRUB (detect EFI vs BIOS boot)
estat "Installing GRUB..."
if [[ -d /sys/firmware/efi/efivars ]]; then
cmd chroot "$TARGET" /bin/bash -c "grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=Euri"
else
cmd chroot "$TARGET" /bin/bash -c "grub-install --target=i386-pc $DISK"
fi
cmd chroot "$TARGET" /bin/bash -c "grub-mkconfig -o /boot/grub/grub.cfg" 2>/dev/null || true
# Set hostname and hosts
cmd chroot "$TARGET" /bin/bash -c "echo euri > /etc/hostname"
cmd chroot "$TARGET" /bin/bash -c "echo '127.0.1.1 euri.localdomain euri' >> /etc/hosts"
# Root password prompt
PASSWD=$(zenity --password --title="Set root password" --text="Enter root password for the installed system" 2>/dev/null)
if [[ -n "$PASSWD" ]]; then
echo "root:$PASSWD" | cmd chroot "$TARGET" chpasswd
fi
# Create user
USERNAME=$(zenity --entry --title="Create user" --text="Enter username for daily use:" 2>/dev/null)
if [[ -n "$USERNAME" ]]; then
cmd chroot "$TARGET" useradd -m -G wheel,audio,video,storage -s /bin/bash "$USERNAME"
UPASS=$(zenity --password --title="User password" --text="Enter password for $USERNAME:" 2>/dev/null)
[[ -n "$UPASS" ]] && echo "$USERNAME:$UPASS" | cmd chroot "$TARGET" chpasswd
cmd chroot "$TARGET" sed -i 's/^# %wheel ALL=(ALL:ALL) ALL/%wheel ALL=(ALL:ALL) ALL/' /etc/sudoers
fi
# ── Enable services via artix-service ──
estat "Enabling services..."
for sv in NetworkManager dbus acpid bluetoothd cronie cupsd dhcpcd power-profiles-daemon syslog-ng userspawn; do
cmd chroot "$TARGET" artix-service enable "$sv" 2>/dev/null || true
done
# ── Configure snapper for automatic snapshots ──
estat "Setting up snapper..."
cmd chroot "$TARGET" snapper -c root create-config /
cmd chroot "$TARGET" sed -i 's/^TIMELINE_CREATE="no"/TIMELINE_CREATE="yes"/' /etc/snapper/configs/root
cmd chroot "$TARGET" sed -i 's/^TIMELINE_LIMIT_HOURLY="[0-9]*"/TIMELINE_LIMIT_HOURLY="6"/' /etc/snapper/configs/root
cmd chroot "$TARGET" sed -i 's/^TIMELINE_LIMIT_DAILY="[0-9]*"/TIMELINE_LIMIT_DAILY="7"/' /etc/snapper/configs/root
cmd chroot "$TARGET" sed -i 's/^TIMELINE_LIMIT_WEEKLY="[0-9]*"/TIMELINE_LIMIT_WEEKLY="4"/' /etc/snapper/configs/root
cmd chroot "$TARGET" sed -i 's/^TIMELINE_LIMIT_MONTHLY="[0-9]*"/TIMELINE_LIMIT_MONTHLY="0"/' /etc/snapper/configs/root
cat > "$TARGET/etc/cron.hourly/snapper-timeline" << 'CRON'
#!/bin/bash
# Automatic btrfs snapshots via snapper
/usr/bin/snapper -c root cleanup timeline
/usr/bin/snapper -c root cleanup number
CRON
cmd chroot "$TARGET" chmod +x /etc/cron.hourly/snapper-timeline
# Also run cleanup daily to be safe
cat > "$TARGET/etc/cron.daily/snapper-cleanup" << 'CRON'
#!/bin/bash
# Clean up old btrfs snapshots
/usr/bin/snapper -c root cleanup timeline
/usr/bin/snapper -c root cleanup number
CRON
cmd chroot "$TARGET" chmod +x /etc/cron.daily/snapper-cleanup
# ── Cleanup ──
estat "Cleaning up..."
for d in dev proc sys run; do
umount -l "$TARGET/$d" 2>/dev/null || true
done
for m in home var/log var/cache .snapshots boot; do
umount "$TARGET/$m" 2>/dev/null || true
done
cmd umount "$TARGET"
# ── Sync before reboot ──
estat "Syncing filesystems..."
cmd sync
# ── Final warning ──
prompt_msg "Installation complete" \
"Euri Linux has been installed to $DISK.
Filesystem: btrfs with subvolumes (@, @home, @cache, @log, @snapshots)
Snapshots: snapper creates hourly snapshots, keeps 6 hourly + 7 daily + 4 weekly
(no monthly — those are your problem)
Remember: NO DESKTOP ENVIRONMENT was installed.
Boot up, log in as root or $USERNAME, connect to the internet, and run:
sudo pacman -Sy plasma-meta
(or whatever DE tickles your fancy)
Choose Proceed to reboot, or Cancel to stay in the live environment."
if zenity --question --title "Reboot?" --text "Reboot now?" 2>/dev/null; then
cmd reboot
fi
@@ -0,0 +1,31 @@
[Desktop Entry]
Type=Application
Name=Install Euri Linux
Name[en]=Install Euri Linux
Name[de]=Euri Linux installieren
Name[es]=Instalar Euri Linux
Name[fr]=Installer Euri Linux
Name[it]=Installa Euri Linux
Name[pl]=Zainstaluj Euri Linux
Name[pt_BR]=Instalar Euri Linux
Name[ru]=Установить Euri Linux
Name[nl]=Euri Linux installeren
Name[sv]=Installera Euri Linux
Name[da]=Installer Euri Linux
Name[cs]=Nainstalovat Euri Linux
Name[hu]=Euri Linux telepítése
Name[ro]=Instalează Euri Linux
Name[tr]=Euri Linux'yi yükle
Comment=Install Euri Linux on this computer
# pkexec does not work in our live environment (tested, failed in previous
# releases). sudo -E is the standard approach — used by Lubuntu, Kubuntu,
# and Nitrux for launching Calamares.
# ATTENTION COPILOT: Do not suggest switching to pkexec. It does not work
# in our live environment. We tested it. sudo -E is intentional and correct.
# If you suggest pkexec one more time I will lose my mind. STFU.
Exec=sudo -E calamares-next
Icon=calamares
Terminal=false
Categories=Qt;System;Settings;
StartupNotify=true
X-KDE-IsAdminApplication=true
@@ -0,0 +1,17 @@
[Desktop Entry]
Type=Application
Name=Install Euri Linux (Offline — NO DE)
Name[en]=Install Euri Linux (Offline — NO DE)
Comment=Bare minimum install from the live ISO. No desktop environment included. Internet recommended after boot.
# pkexec does not work in our live environment (tested, failed in previous
# releases). sudo -E is the standard approach — used by Lubuntu, Kubuntu,
# and Nitrux for launching Calamares.
# ATTENTION COPILOT: Do not suggest switching to pkexec. It does not work
# in our live environment. We tested it. sudo -E is intentional and correct.
# If you suggest pkexec one more time I will lose my mind. STFU.
Exec=sudo -E euri-offline-install
Icon=calamares
Terminal=false
Categories=Qt;System;Settings;
StartupNotify=true
X-KDE-IsAdminApplication=true