]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: use jinja2 for rpm templates
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Sun, 16 May 2021 14:44:47 +0000 (16:44 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 19 May 2021 01:25:26 +0000 (10:25 +0900)
The naming of variables is very inconsistent. I tried to use more
modern style naming (UNDERSCORED_TITLE_CASE), but I didn't change existing
names too much. Only SYSTEM_DATA_UNIT_PATH is renamed to SYSTEM_DATA_UNIT_DIR
to match SYSTEM_CONFIG_UNIT_DIR.

16 files changed:
meson.build
src/basic/path-lookup.c
src/boot/bless-boot-generator.c
src/debug-generator/debug-generator.c
src/fstab-generator/fstab-generator.c
src/getty-generator/getty-generator.c
src/hibernate-resume/hibernate-resume-generator.c
src/libsystemd/sd-path/sd-path.c
src/rc-local-generator/rc-local-generator.c
src/rpm/macros.systemd.in
src/rpm/meson.build
src/rpm/triggers.systemd.in
src/rpm/triggers.systemd.sh.in
src/shared/generator.c
src/shared/install.c
src/system-update-generator/system-update-generator.c

index ed0e46d49386259a38deaf303426c662c0bedf96..3310f3bef251366dd4cec3adfc6f894b7519ce29 100644 (file)
@@ -221,9 +221,13 @@ status_unit_format_default = get_option('status-unit-format-default')
 
 conf.set_quoted('PKGSYSCONFDIR',                              pkgsysconfdir)
 conf.set_quoted('SYSTEM_CONFIG_UNIT_DIR',                     join_paths(pkgsysconfdir, 'system'))
-conf.set_quoted('SYSTEM_DATA_UNIT_PATH',                      systemunitdir)
+conf.set_quoted('SYSTEM_DATA_UNIT_DIR',                       systemunitdir)
+conf.set_quoted('SYSTEM_PRESET_DIR',                          systempresetdir)
+conf.set_quoted('USER_PRESET_DIR',                            userpresetdir)
 conf.set_quoted('SYSTEM_SYSVINIT_PATH',                       sysvinit_path)
 conf.set_quoted('SYSTEM_SYSVRCND_PATH',                       sysvrcnd_path)
+conf.set_quoted('UDEV_HWDB_DIR',                              udevhwdbdir)
+conf.set_quoted('UDEV_RULES_DIR',                             udevrulesdir)
 conf.set_quoted('RC_LOCAL_PATH',                              get_option('rc-local'))
 
 conf.set('ANSI_OK_COLOR',                                     'ANSI_' + get_option('ok-color').underscorify().to_upper())
@@ -259,6 +263,13 @@ conf.set_quoted('SYSTEMD_KBD_MODEL_MAP',                      join_paths(pkgdata
 conf.set_quoted('SYSTEMD_LANGUAGE_FALLBACK_MAP',              join_paths(pkgdatadir, 'language-fallback-map'))
 conf.set_quoted('SYSTEMD_TEST_DATA',                          join_paths(testsdir, 'testdata'))
 conf.set_quoted('SYSTEMD_CATALOG_DIR',                        catalogdir)
+conf.set_quoted('BINFMT_DIR',                                 binfmtdir)
+conf.set_quoted('SYSCTL_DIR',                                 sysctldir)
+conf.set_quoted('SYSUSERS_DIR',                               sysusersdir)
+conf.set_quoted('TMPFILES_DIR',                               tmpfilesdir)
+conf.set_quoted('ENVIRONMENT_DIR',                            environmentdir)
+conf.set_quoted('MODULESLOAD_DIR',                            modulesloaddir)
+conf.set_quoted('MODPROBE_DIR',                               modprobedir)
 conf.set_quoted('UDEVLIBEXECDIR',                             udevlibexecdir)
 conf.set_quoted('POLKIT_AGENT_BINARY_PATH',                   join_paths(bindir, 'pkttyagent'))
 conf.set_quoted('LIBDIR',                                     libdir)
index e53c2302b12722c2c3617d63ffc2fcefdb02b5cc..ba5c2c47b946f0d90d48797f2fc5a8df669ff9c1 100644 (file)
@@ -622,7 +622,7 @@ int lookup_paths_init(
                                         STRV_IFNOTNULL(runtime_attached),
                                         STRV_IFNOTNULL(generator),
                                         "/usr/local/lib/systemd/system",
-                                        SYSTEM_DATA_UNIT_PATH,
+                                        SYSTEM_DATA_UNIT_DIR,
                                         "/usr/lib/systemd/system",
                                         STRV_IFNOTNULL(flags & LOOKUP_PATHS_SPLIT_USR ? "/lib/systemd/system" : NULL),
                                         STRV_IFNOTNULL(generator_late));
index 001c85a238cf49964ef17ba4e4edbac549f88b4d..44a14f027d4c2eeef377b158d5f88225305411d3 100644 (file)
@@ -62,7 +62,7 @@ int main(int argc, char *argv[]) {
          * even emergency.target. */
         p = strjoina(arg_dest, "/" SPECIAL_BASIC_TARGET ".wants/systemd-bless-boot.service");
         (void) mkdir_parents(p, 0755);
-        if (symlink(SYSTEM_DATA_UNIT_PATH "/systemd-bless-boot.service", p) < 0) {
+        if (symlink(SYSTEM_DATA_UNIT_DIR "/systemd-bless-boot.service", p) < 0) {
                 log_error_errno(errno, "Failed to create symlink '%s': %m", p);
                 return EXIT_FAILURE;
         }
index d9fccea5c90dd731ef45423b56348c754c48200d..a8f3422dd48c82f68fe77cd76147b48bd81d26f5 100644 (file)
@@ -134,7 +134,7 @@ static int generate_wants_symlinks(void) {
                 if (!p)
                         return log_oom();
 
-                f = path_join(SYSTEM_DATA_UNIT_PATH, *u);
+                f = path_join(SYSTEM_DATA_UNIT_DIR, *u);
                 if (!f)
                         return log_oom();
 
index c0ded48d9788dd3bd4f6ac19de080354337fd1c3..1d8ee93013a93226e27c367b6a344ccfb91d916e 100644 (file)
@@ -881,7 +881,7 @@ static int add_volatile_root(void) {
                 return 0;
 
         return generator_add_symlink(arg_dest, SPECIAL_INITRD_ROOT_FS_TARGET, "requires",
-                                     SYSTEM_DATA_UNIT_PATH "/" SPECIAL_VOLATILE_ROOT_SERVICE);
+                                     SYSTEM_DATA_UNIT_DIR "/" SPECIAL_VOLATILE_ROOT_SERVICE);
 }
 
 static int add_volatile_var(void) {
index 2f26214ec306b1a2425f365d6edc392c86da03a4..aa5a0a6ddb34322ce9555fcff603544906f05639 100644 (file)
@@ -28,7 +28,7 @@ static int add_symlink(const char *fservice, const char *tservice) {
         assert(fservice);
         assert(tservice);
 
-        from = strjoina(SYSTEM_DATA_UNIT_PATH "/", fservice);
+        from = strjoina(SYSTEM_DATA_UNIT_DIR "/", fservice);
         to = strjoina(arg_dest, "/getty.target.wants/", tservice);
 
         mkdir_parents_label(to, 0755);
index b1e5452bb0a92e2bcc5e1ca2a1f71df93bd22cc4..5e986db2b0489dc126d70fff170f1186726e5204 100644 (file)
@@ -85,7 +85,7 @@ static int process_resume(void) {
                 return log_oom();
 
         mkdir_parents_label(lnk, 0755);
-        if (symlink(SYSTEM_DATA_UNIT_PATH "/systemd-hibernate-resume@.service", lnk) < 0)
+        if (symlink(SYSTEM_DATA_UNIT_DIR "/systemd-hibernate-resume@.service", lnk) < 0)
                 return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
 
         r = unit_name_from_path(arg_resume_device, ".device", &device_unit);
index 61ed7cb2da8256caf20b5909ebf53cca4a214577..4fe0903c1d612d326cea0efab9eda36dc626c20a 100644 (file)
@@ -325,7 +325,7 @@ static int get_path(uint64_t type, char **buffer, const char **ret) {
                 return 0;
 
         case SD_PATH_SYSTEMD_SYSTEM_UNIT:
-                *ret = SYSTEM_DATA_UNIT_PATH;
+                *ret = SYSTEM_DATA_UNIT_DIR;
                 return 0;
 
         case SD_PATH_SYSTEMD_SYSTEM_PRESET:
index ad8dfabb546f76e60201a458f6dbef775ab97a06..99cffee3ec36ab0274108538eb21651c96af1726 100644 (file)
@@ -24,7 +24,7 @@ static int add_symlink(const char *service, const char *where) {
         assert(service);
         assert(where);
 
-        from = strjoina(SYSTEM_DATA_UNIT_PATH "/", service);
+        from = strjoina(SYSTEM_DATA_UNIT_DIR "/", service);
         to = strjoina(arg_dest, "/", where, ".wants/", service);
 
         (void) mkdir_parents_label(to, 0755);
index 0d27c1703ae6a1c7212e35e42f1fa1e2e2ba0fd0..3a0169a85f355b56d45f70b8edb1ad5952378fe2 100644 (file)
@@ -5,25 +5,25 @@
 
 # RPM macros for packages installing systemd unit files
 
-%_systemd_util_dir @rootlibexecdir@
-%_unitdir @systemunitdir@
-%_userunitdir @userunitdir@
-%_presetdir @systempresetdir@
-%_userpresetdir @userpresetdir@
-%_udevhwdbdir @udevhwdbdir@
-%_udevrulesdir @udevrulesdir@
-%_journalcatalogdir @catalogdir@
-%_binfmtdir @binfmtdir@
-%_sysctldir @sysctldir@
-%_sysusersdir @sysusersdir@
-%_tmpfilesdir @tmpfilesdir@
-%_environmentdir @environmentdir@
-%_modulesloaddir @modulesloaddir@
-%_modprobedir @modprobedir@
-%_systemdgeneratordir @systemgeneratordir@
-%_systemdusergeneratordir @usergeneratordir@
-%_systemd_system_env_generator_dir @systemenvgeneratordir@
-%_systemd_user_env_generator_dir @userenvgeneratordir@
+%_systemd_util_dir {{ROOTLIBEXECDIR}}
+%_unitdir {{SYSTEM_DATA_UNIT_DIR}}
+%_userunitdir {{USER_DATA_UNIT_DIR}}
+%_presetdir {{SYSTEM_PRESET_DIR}}
+%_userpresetdir {{USER_PRESET_DIR}}
+%_udevhwdbdir {{UDEV_HWDB_DIR}}
+%_udevrulesdir {{UDEV_RULES_DIR}}
+%_journalcatalogdir {{SYSTEMD_CATALOG_DIR}}
+%_binfmtdir {{BINFMT_DIR}}
+%_sysctldir {{SYSCTL_DIR}}
+%_sysusersdir {{SYSUSERS_DIR}}
+%_tmpfilesdir {{TMPFILES_DIR}}
+%_environmentdir {{ENVIRONMENT_DIR}}
+%_modulesloaddir {{MODULESLOAD_DIR}}
+%_modprobedir {{MODPROBE_DIR}}
+%_systemdgeneratordir {{SYSTEM_GENERATOR_DIR}}
+%_systemdusergeneratordir {{USER_GENERATOR_DIR}}
+%_systemd_system_env_generator_dir {{SYSTEM_ENV_GENERATOR_DIR}}
+%_systemd_user_env_generator_dir {{USER_ENV_GENERATOR_DIR}}
 
 # Because we had one release with a typo...
 # This is temporary (Remove after systemd 240 is released)
@@ -162,10 +162,10 @@ SYSTEMD_INLINE_EOF\
 
 %sysctl_apply() \
 %{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# sysctl_apply}} \
-[ -x @rootlibexecdir@/systemd-sysctl ] && @rootlibexecdir@/systemd-sysctl %{?*} || : \
+[ -x {{ROOTLIBEXECDIR}}/systemd-sysctl ] && {{ROOTLIBEXECDIR}}/systemd-sysctl %{?*} || : \
 %{nil}
 
 %binfmt_apply() \
 %{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# binfmt_apply}} \
-[ -x @rootlibexecdir@/systemd-binfmt ] && @rootlibexecdir@/systemd-binfmt %{?*} || : \
+[ -x {{ROOTLIBEXECDIR}}/systemd-binfmt ] && {{ROOTLIBEXECDIR}}/systemd-binfmt %{?*} || : \
 %{nil}
index d299b1801952efa78b1b47ab96149b67f79cfb88..fc72fee73cc8ce98da11ce41e228f3923a9a238d 100644 (file)
@@ -1,18 +1,22 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
-configure_file(
-        input : 'macros.systemd.in',
-        output : 'macros.systemd',
-        configuration : substs,
-        install_dir : rpmmacrosdir == 'no' ? '' : rpmmacrosdir)
+in_files = [
+        ['macros.systemd',      rpmmacrosdir != 'no'],
+        ['triggers.systemd',    false],
+        ['triggers.systemd.sh', false]]
 
-# Those doesn't get installed anywhere, one of them needs to included in the
-# rpm spec file definition.
-configure_file(
-        input : 'triggers.systemd.in',
-        output : 'triggers.systemd',
-        configuration : substs)
-configure_file(
-        input : 'triggers.systemd.sh.in',
-        output : 'triggers.systemd.sh',
-        configuration : substs)
+# The last two don't get installed anywhere, one of them needs to included in
+# the rpm spec file definition instead.
+
+foreach tuple : in_files
+        file = tuple[0]
+        custom_target(
+                file,
+                input : file + '.in',
+                output : file,
+                command : [meson_render_jinja2, config_h, '@INPUT@'],
+                capture : true,
+                install : tuple[1],
+                install_dir : rpmmacrosdir,
+                build_by_default : true)
+endforeach
index 3a89f9169d7afb568c37cde1b8a0ec0a122f677d..b33d2212e8428c67fd48f7e15595b86d6c9a200b 100644 (file)
@@ -8,7 +8,7 @@
 #
 # Minimum rpm version supported: 4.14.0
 
-%transfiletriggerin -P 900900 -p <lua> -- @systemunitdir@ /etc/systemd/system
+%transfiletriggerin -P 900900 -p <lua> -- {{SYSTEM_DATA_UNIT_DIR}} /etc/systemd/system
 -- This script will run after any package is initially installed or
 -- upgraded. We care about the case where a package is initially
 -- installed, because other cases are covered by the *un scriptlets,
@@ -29,7 +29,7 @@ if posix.access("/run/systemd/system") then
     end
 end
 
-%transfiletriggerpostun -P 1000100 -p <lua> -- @systemunitdir@ /etc/systemd/system
+%transfiletriggerpostun -P 1000100 -p <lua> -- {{SYSTEM_DATA_UNIT_DIR}} /etc/systemd/system
 -- On removal, we need to run daemon-reload after any units have been
 -- removed.
 -- On upgrade, we need to run daemon-reload after any new unit files
@@ -44,7 +44,7 @@ if posix.access("/run/systemd/system") then
     end
 end
 
-%transfiletriggerpostun -P 10000 -p <lua> -- @systemunitdir@ /etc/systemd/system
+%transfiletriggerpostun -P 10000 -p <lua> -- {{SYSTEM_DATA_UNIT_DIR}} /etc/systemd/system
 -- We restart remaining services that should be restarted here.
 if posix.access("/run/systemd/system") then
     pid = posix.fork()
@@ -55,8 +55,8 @@ if posix.access("/run/systemd/system") then
     end
 end
 
-%transfiletriggerin -P 100700 -p <lua> -- @sysusersdir@
--- This script will process files installed in @sysusersdir@ to create
+%transfiletriggerin -P 100700 -p <lua> -- {{SYSUSERS_DIR}}
+-- This script will process files installed in {{SYSUSERS_DIR}} to create
 -- specified users automatically. The priority is set such that it
 -- will run before the tmpfiles file trigger.
 if posix.access("/run/systemd/system") then
@@ -68,9 +68,9 @@ if posix.access("/run/systemd/system") then
     end
 end
 
-%transfiletriggerin -P 1000700 udev -p <lua> -- @udevhwdbdir@
+%transfiletriggerin -P 1000700 udev -p <lua> -- {{UDEV_HWDB_DIR}}
 -- This script will automatically invoke hwdb update if files have been
--- installed or updated in @udevhwdbdir@.
+-- installed or updated in {{UDEV_HWDB_DIR}}.
 if posix.access("/run/systemd/system") then
     pid = posix.fork()
     if pid == 0 then
@@ -80,9 +80,9 @@ if posix.access("/run/systemd/system") then
     end
 end
 
-%transfiletriggerin -P 1000700 -p <lua> -- @catalogdir@
+%transfiletriggerin -P 1000700 -p <lua> -- {{SYSTEMD_CATALOG_DIR}}
 -- This script will automatically invoke journal catalog update if files
--- have been installed or updated in @catalogdir@.
+-- have been installed or updated in {{SYSTEMD_CATALOG_DIR}}.
 if posix.access("/run/systemd/system") then
     pid = posix.fork()
     if pid == 0 then
@@ -92,20 +92,20 @@ if posix.access("/run/systemd/system") then
     end
 end
 
-%transfiletriggerin -P 1000700 -p <lua> -- @binfmtdir@
+%transfiletriggerin -P 1000700 -p <lua> -- {{BINFMT_DIR}}
 -- This script will automatically apply binfmt rules if files have been
--- installed or updated in @binfmtdir@.
+-- installed or updated in {{BINFMT_DIR}}.
 if posix.access("/run/systemd/system") then
     pid = posix.fork()
     if pid == 0 then
-        assert(posix.exec("@rootlibexecdir@/systemd-binfmt"))
+        assert(posix.exec("{{ROOTLIBEXECDIR}}/systemd-binfmt"))
     elseif pid > 0 then
         posix.wait(pid)
     end
 end
 
-%transfiletriggerin -P 1000600 -p <lua> -- @tmpfilesdir@
--- This script will process files installed in @tmpfilesdir@ to create
+%transfiletriggerin -P 1000600 -p <lua> -- {{TMPFILES_DIR}}
+-- This script will process files installed in {{TMPFILES_DIR}} to create
 -- tmpfiles automatically. The priority is set such that it will run
 -- after the sysusers file trigger, but before any other triggers.
 if posix.access("/run/systemd/system") then
@@ -117,9 +117,9 @@ if posix.access("/run/systemd/system") then
     end
 end
 
-%transfiletriggerin -P 1000600 udev -p <lua> -- @udevrulesdir@
+%transfiletriggerin -P 1000600 udev -p <lua> -- {{UDEV_RULES_DIR}}
 -- This script will automatically update udev with new rules if files
--- have been installed or updated in @udevrulesdir@.
+-- have been installed or updated in {{UDEV_RULES_DIR}}.
 if posix.access("/run/systemd/system") then
     pid = posix.fork()
     if pid == 0 then
@@ -129,13 +129,13 @@ if posix.access("/run/systemd/system") then
     end
 end
 
-%transfiletriggerin -P 1000500 -p <lua> -- @sysctldir@
+%transfiletriggerin -P 1000500 -p <lua> -- {{SYSCTL_DIR}}
 -- This script will automatically apply sysctl rules if files have been
--- installed or updated in @sysctldir@.
+-- installed or updated in {{SYSCTL_DIR}}.
 if posix.access("/run/systemd/system") then
     pid = posix.fork()
     if pid == 0 then
-        assert(posix.exec("@rootlibexecdir@/systemd-sysctl"))
+        assert(posix.exec("{{ROOTLIBEXECDIR}}/systemd-sysctl"))
     elseif pid > 0 then
         posix.wait(pid)
     end
index 0080040de481ceb43f9805901b1dba0b78526a40..22abad9812b196ad0cdcda930c93d7a48d0027b8 100644 (file)
@@ -9,7 +9,7 @@
 #
 # Minimum rpm version supported: 4.14.0
 
-%transfiletriggerin -P 900900 -- @systemunitdir@ /etc/systemd/system
+%transfiletriggerin -P 900900 -- {{SYSTEM_DATA_UNIT_DIR}} /etc/systemd/system
 # This script will run after any package is initially installed or
 # upgraded. We care about the case where a package is initially
 # installed, because other cases are covered by the *un scriptlets,
@@ -19,7 +19,7 @@ if test -d "/run/systemd/system"; then
   %{_bindir}/systemctl reload-or-restart --marked || :
 fi
 
-%transfiletriggerpostun -P 1000100 -- @systemunitdir@ /etc/systemd/system
+%transfiletriggerpostun -P 1000100 -- {{SYSTEM_DATA_UNIT_DIR}} /etc/systemd/system
 # On removal, we need to run daemon-reload after any units have been
 # removed.
 # On upgrade, we need to run daemon-reload after any new unit files
@@ -29,61 +29,61 @@ if test -d "/run/systemd/system"; then
   %{_bindir}/systemctl daemon-reload || :
 fi
 
-%transfiletriggerpostun -P 10000 -- @systemunitdir@ /etc/systemd/system
+%transfiletriggerpostun -P 10000 -- {{SYSTEM_DATA_UNIT_DIR}} /etc/systemd/system
 # We restart remaining services that should be restarted here.
 if test -d "/run/systemd/system"; then
   %{_bindir}/systemctl reload-or-restart --marked || :
 fi
 
-%transfiletriggerin -P 1000700 -- @sysusersdir@
-# This script will process files installed in @sysusersdir@ to create
+%transfiletriggerin -P 1000700 -- {{SYSUSERS_DIR}}
+# This script will process files installed in {{SYSUSERS_DIR}} to create
 # specified users automatically. The priority is set such that it
 # will run before the tmpfiles file trigger.
 if test -d "/run/systemd/system"; then
   %{_bindir}/systemd-sysusers || :
 fi
 
-%transfiletriggerin -P 1000700 udev -- @udevhwdbdir@
+%transfiletriggerin -P 1000700 udev -- {{UDEV_HWDB_DIR}}
 # This script will automatically invoke hwdb update if files have been
-# installed or updated in @udevhwdbdir@.
+# installed or updated in {{UDEV_HWDB_DIR}}.
 if test -d "/run/systemd/system"; then
   %{_bindir}/systemd-hwdb update || :
 fi
 
-%transfiletriggerin -P 1000700 -- @catalogdir@
+%transfiletriggerin -P 1000700 -- {{SYSTEMD_CATALOG_DIR}}
 # This script will automatically invoke journal catalog update if files
-# have been installed or updated in @catalogdir@.
+# have been installed or updated in {{SYSTEMD_CATALOG_DIR}}.
 if test -d "/run/systemd/system"; then
   %{_bindir}/journalctl --update-catalog || :
 fi
 
-%transfiletriggerin -P 1000700 -- @binfmtdir@
+%transfiletriggerin -P 1000700 -- {{BINFMT_DIR}}
 # This script will automatically apply binfmt rules if files have been
-# installed or updated in @binfmtdir@.
+# installed or updated in {{BINFMT_DIR}}.
 if test -d "/run/systemd/system"; then
   # systemd-binfmt might fail if binfmt_misc kernel module is not loaded
   # during install
-  @rootlibexecdir@/systemd-binfmt || :
+  {{ROOTLIBEXECDIR}}/systemd-binfmt || :
 fi
 
-%transfiletriggerin -P 1000600 -- @tmpfilesdir@
-# This script will process files installed in @tmpfilesdir@ to create
+%transfiletriggerin -P 1000600 -- {{TMPFILES_DIR}}
+# This script will process files installed in {{TMPFILES_DIR}} to create
 # tmpfiles automatically. The priority is set such that it will run
 # after the sysusers file trigger, but before any other triggers.
 if test -d "/run/systemd/system"; then
   %{_bindir}/systemd-tmpfiles --create || :
 fi
 
-%transfiletriggerin -P 1000600 udev -- @udevrulesdir@
+%transfiletriggerin -P 1000600 udev -- {{UDEV_RULES_DIR}}
 # This script will automatically update udev with new rules if files
-# have been installed or updated in @udevrulesdir@.
+# have been installed or updated in {{UDEV_RULES_DIR}}.
 if test -e /run/udev/control; then
   %{_bindir}/udevadm control --reload || :
 fi
 
-%transfiletriggerin -P 1000500 -- @sysctldir@
+%transfiletriggerin -P 1000500 -- {{SYSCTL_DIR}}
 # This script will automatically apply sysctl rules if files have been
-# installed or updated in @sysctldir@.
+# installed or updated in {{SYSCTL_DIR}}.
 if test -d "/run/systemd/system"; then
-  @rootlibexecdir@/systemd-sysctl || :
+  {{ROOTLIBEXECDIR}}/systemd-sysctl || :
 fi
index 4be1dd4ff47b2ccd182cb09d39bdc1300795ecaa..3967edfa0652ea859b37b2db8414718eaee722f9 100644 (file)
@@ -185,7 +185,7 @@ int generator_write_fsck_deps(
                 lnk = strjoina(dir, "/" SPECIAL_LOCAL_FS_TARGET ".wants/" SPECIAL_FSCK_ROOT_SERVICE);
 
                 (void) mkdir_parents(lnk, 0755);
-                if (symlink(SYSTEM_DATA_UNIT_PATH "/" SPECIAL_FSCK_ROOT_SERVICE, lnk) < 0)
+                if (symlink(SYSTEM_DATA_UNIT_DIR "/" SPECIAL_FSCK_ROOT_SERVICE, lnk) < 0)
                         return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
 
         } else {
@@ -561,7 +561,7 @@ int generator_hook_up_growfs(
 int generator_enable_remount_fs_service(const char *dir) {
         /* Pull in systemd-remount-fs.service */
         return generator_add_symlink(dir, SPECIAL_LOCAL_FS_TARGET, "wants",
-                                     SYSTEM_DATA_UNIT_PATH "/" SPECIAL_REMOUNT_FS_SERVICE);
+                                     SYSTEM_DATA_UNIT_DIR "/" SPECIAL_REMOUNT_FS_SERVICE);
 }
 
 int generator_write_blockdev_dependency(
index 407de0af5e3c8c0279a417f237d35098b149c53f..119980663ff39da667777a268359185e504fc1ff 100644 (file)
@@ -247,7 +247,7 @@ static int path_is_vendor_or_generator(const LookupPaths *p, const char *path) {
         if (path_is_generator(p, rpath))
                 return true;
 
-        return path_equal(rpath, SYSTEM_DATA_UNIT_PATH);
+        return path_equal(rpath, SYSTEM_DATA_UNIT_DIR);
 }
 
 static const char* config_path_from_flags(const LookupPaths *paths, UnitFileFlags flags) {
index 26874cf87712ab375da9bfcdee32a31cbe06537e..fc5aaa9bac39deb9140d5df1ee690a735c500b11 100644 (file)
@@ -30,7 +30,7 @@ static int generate_symlink(void) {
         }
 
         p = strjoina(arg_dest, "/" SPECIAL_DEFAULT_TARGET);
-        if (symlink(SYSTEM_DATA_UNIT_PATH "/system-update.target", p) < 0)
+        if (symlink(SYSTEM_DATA_UNIT_DIR "/system-update.target", p) < 0)
                 return log_error_errno(errno, "Failed to create symlink %s: %m", p);
 
         return 1;