From bfc64d1cb8785de8a2762eacead51074a3915789 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 10 Mar 2024 20:08:45 +0100 Subject: [PATCH] Support pmb:systemd-never option (MR 2273) For UI packages that have pmb:systemd-never set: * do not ask in "pmbootstrap init" whether to use systemd or not * do not install systemd, even if the systemd option is set to "always" The point of this is to not add maintenance burden to Sxmo (and possibly other UIs who not wish to support systemd with postmarketOS), so users don't install with this unsupported use case and report issues with it. --- pmb/config/__init__.py | 1 + pmb/config/init.py | 5 +++++ pmb/config/other.py | 2 ++ 3 files changed, 8 insertions(+) diff --git a/pmb/config/__init__.py b/pmb/config/__init__.py index 28b5485c..b83c7de4 100644 --- a/pmb/config/__init__.py +++ b/pmb/config/__init__.py @@ -796,6 +796,7 @@ apkbuild_custom_valid_options = [ "pmb:gpu-accel", "pmb:strict", "pmb:systemd", + "pmb:systemd-never", ] # Variables from deviceinfo. Reference: diff --git a/pmb/config/init.py b/pmb/config/init.py index 2e43f88f..d80c1d2d 100644 --- a/pmb/config/init.py +++ b/pmb/config/init.py @@ -193,6 +193,11 @@ def ask_for_systemd(args, ui): if "systemd" not in pmb.config.pmaports.read_config_repos(args): return args.systemd + if pmb.helpers.ui.check_option(args, ui, "pmb:systemd-never"): + logging.info("Based on your UI selection, OpenRC will be used as init" + " system. This UI does not support systemd.") + return args.systemd + default_is_systemd = pmb.helpers.ui.check_option(args, ui, "pmb:systemd") not_str = " " if default_is_systemd else " not " logging.info("Based on your UI selection, 'default' will result" diff --git a/pmb/config/other.py b/pmb/config/other.py index 7a01e69d..43dbe635 100644 --- a/pmb/config/other.py +++ b/pmb/config/other.py @@ -4,6 +4,8 @@ import pmb.helpers.ui def is_systemd_selected(args): + if pmb.helpers.ui.check_option(args, args.ui, "pmb:systemd-never"): + return False if args.systemd == "always": return True if args.systemd == "never":