diff --git "a/test/fuzz/fuzz-unit-file/dm-back\\x2dslash.swap" b/test/fuzz/fuzz-unit-file/dm-backslash.swap similarity index 100% rename from "test/fuzz/fuzz-unit-file/dm-back\\x2dslash.swap" rename to test/fuzz/fuzz-unit-file/dm-backslash.swap diff --git a/units/meson.build b/units/meson.build index d61138bf7b2..ab7989b4b9d 100644 --- a/units/meson.build +++ b/units/meson.build @@ -150,7 +150,10 @@ units = [ 'symlinks' : ['sockets.target.wants/'] }, { 'file' : 'systemd-mute-console@.service' }, - { 'file' : 'system-systemd\\x2dmute\\x2dconsole.slice' }, + { + 'file' : 'system-systemd-mute-console.slice', + 'name' : 'system-systemd\\x2dmute\\x2dconsole.slice', + }, { 'file' : 'network-online.target' }, { 'file' : 'network-pre.target' }, { 'file' : 'network.target' }, @@ -242,11 +245,13 @@ units = [ { 'file' : 'syslog.socket' }, { 'file' : 'system-install.target' }, { - 'file' : 'system-systemd\\x2dcryptsetup.slice', + 'file' : 'system-systemd-cryptsetup.slice', + 'name' : 'system-systemd\\x2dcryptsetup.slice', 'conditions' : ['HAVE_LIBCRYPTSETUP'], }, { - 'file' : 'system-systemd\\x2dveritysetup.slice', + 'file' : 'system-systemd-veritysetup.slice', + 'name' : 'system-systemd\\x2dveritysetup.slice', 'conditions' : ['HAVE_LIBCRYPTSETUP'], }, { 'file' : 'system-update-cleanup.service' }, @@ -1108,6 +1113,9 @@ foreach unit : units needs_jinja = false name = source endif + # Unit names that contain characters which are awkward in source file names (e.g. the + # backslash in \x2d escapes) are stored under a sanitized file name and renamed on install. + name = unit.get('name', name) source = files(source) install = true @@ -1133,6 +1141,7 @@ foreach unit : units endif elif install install_data(source, + rename : name, install_dir : systemunitdir, install_tag : unit.get('install_tag', '')) endif diff --git "a/units/system-systemd\\x2dcryptsetup.slice" b/units/system-systemd-cryptsetup.slice similarity index 100% rename from "units/system-systemd\\x2dcryptsetup.slice" rename to units/system-systemd-cryptsetup.slice diff --git "a/units/system-systemd\\x2dmute\\x2dconsole.slice" b/units/system-systemd-mute-console.slice similarity index 100% rename from "units/system-systemd\\x2dmute\\x2dconsole.slice" rename to units/system-systemd-mute-console.slice diff --git "a/units/system-systemd\\x2dveritysetup.slice" b/units/system-systemd-veritysetup.slice similarity index 100% rename from "units/system-systemd\\x2dveritysetup.slice" rename to units/system-systemd-veritysetup.slice