Add a few more bypass environment variables

When we're building ParticleOS images, we don't want the package
manager (or mkosi) to run systemd-sysusers, systemd-tmpfiles or
systemctl preset so let's add a few more bypass environment
variables that we can set to have execution of these skipped like
we already have $SYSTEMD_HWDB_UPDATE_BYPASS and $KERNEL_INSTALL_BYPASS.
This commit is contained in:
Daan De Meyer
2025-03-01 16:22:53 +01:00
parent 38701809a8
commit daa2547e31
9 changed files with 54 additions and 20 deletions
+4
View File
@@ -9,6 +9,7 @@
#include "systemctl-sysv-compat.h"
#include "systemctl-util.h"
#include "systemctl.h"
#include "verbs.h"
static int normalize_link_paths(char **paths) {
int r;
@@ -75,6 +76,9 @@ int verb_enable(int argc, char *argv[], void *userdata) {
sd_bus *bus = NULL;
int r;
if (streq(verb, "preset") && should_bypass("SYSTEMD_PRESET"))
return 0;
const char *operation = strjoina("to ", verb);
r = mangle_names(operation, ASSERT_PTR(strv_skip(argv, 1)), &names);
if (r < 0)
+4
View File
@@ -6,10 +6,14 @@
#include "systemctl-preset-all.h"
#include "systemctl-util.h"
#include "systemctl.h"
#include "verbs.h"
int verb_preset_all(int argc, char *argv[], void *userdata) {
int r;
if (should_bypass("SYSTEMD_PRESET"))
return 0;
if (install_client_side()) {
InstallChange *changes = NULL;
size_t n_changes = 0;