HALF ECHO LEARN / REFERENCE COLLECTION

v262.2

units/meson.build

42,271 bytesGit mode 100644Download original fileLGPL-2.1-or-later

Git blob: 9f8f8d0e419593a0fab15890d9b5bdfb21180579

Lines 1001–1225 of 1,225

          'symlinks' : ['sysinit.target.wants/'],
          'install_tag' : 'udev',
        },
        {
          'file' : 'systemd-udevd-kernel.socket',
          'symlinks' : ['sockets.target.wants/'],
          'install_tag' : 'udev',
        },
        {
          'file' : 'systemd-udevd-varlink.socket',
          'symlinks' : ['sockets.target.wants/', 'systemd-udevd-control.socket'],
          'install_tag' : 'udev',
        },
        {
          'file' : 'systemd-udevd.service.in',
          'symlinks' : ['sysinit.target.wants/'],
          'install_tag' : 'udev',
        },
        {
          'file' : 'systemd-update-done.service.in',
          'symlinks' : ['sysinit.target.wants/'],
        },
        {
          'file' : 'systemd-update-utmp.service.in',
          'conditions' : ['ENABLE_UTMP'],
          'symlinks' : ['sysinit.target.wants/'],
        },
        {
          'file' : 'systemd-user-sessions.service.in',
          'conditions' : ['HAVE_PAM'],
          'symlinks' : ['multi-user.target.wants/'],
        },
        {
          'file' : 'systemd-userdb-load-credentials.service',
          'conditions' : ['ENABLE_USERDB'],
        },
        {
          'file' : 'systemd-userdbd.service.in',
          'conditions' : ['ENABLE_USERDB'],
        },
        {
          'file' : 'systemd-userdbd.socket',
          'conditions' : ['ENABLE_USERDB'],
        },
        {
          'file' : 'systemd-mountfsd.service.in',
          'conditions' : ['ENABLE_MOUNTFSD'],
        },
        {
          'file' : 'systemd-mountfsd.socket',
          'conditions' : ['ENABLE_MOUNTFSD'],
        },
        {
          'file' : 'systemd-nsresourced.service.in',
          'conditions' : ['ENABLE_NSRESOURCED'],
        },
        {
          'file' : 'systemd-nsresourced.socket.in',
          'conditions' : ['ENABLE_NSRESOURCED'],
        },
        {
          'file' : 'systemd-validatefs@.service.in',
          'conditions' : ['HAVE_BLKID'],
        },
        {
          'file' : 'systemd-vconsole-setup.service.in',
          'conditions' : ['ENABLE_VCONSOLE'],
        },
        {
          'file' : 'systemd-volatile-root.service.in',
          'conditions' : ['ENABLE_INITRD'],
        },
        { 'file' : 'time-set.target' },
        { 'file' : 'time-sync.target' },
        { 'file' : 'timers.target' },
        {
          'file' : 'tmp.mount',
          'symlinks' : ['local-fs.target.wants/'],
        },
        { 'file' : 'tpm2.target' },
        { 'file' : 'umount.target' },
        { 'file' : 'usb-gadget.target' },
        { 'file' : 'user-runtime-dir@.service.in' },
        { 'file' : 'user.slice' },
        { 'file' : 'user@.service.in' },
        {
          'file' : 'var-lib-machines.mount',
          'conditions' : ['ENABLE_MACHINED'],
          'symlinks' : ['remote-fs.target.wants/', 'machines.target.wants/'],
        },
        {
          'file' : 'veritysetup-pre.target',
          'conditions' : ['HAVE_LIBCRYPTSETUP'],
        },
        {
          'file' : 'veritysetup.target',
          'conditions' : ['HAVE_LIBCRYPTSETUP'],
          'symlinks' : ['sysinit.target.wants/'],
        },
]
 
# For the udev/hwdb aliases
udev_units = []
hwdb_units = []
 
# Unit files whose contents are embedded into the manager binary, so that it can
# fall back to a built-in copy when the file is not present on disk. Referenced
# from src/core/meson.build.
embedded_unit_names = [
        'basic.target',
        'exit.target',
        'final.target',
        'graphical.target',
        'halt.target',
        'kexec.target',
        'multi-user.target',
        'poweroff.target',
        'reboot.target',
        'shutdown.target',
        'sigpwr.target',
        'soft-reboot.target',
        'sysinit.target',
        'systemd-exit.service',
        'systemd-halt.service',
        'systemd-kexec.service',
        'systemd-poweroff.service',
        'systemd-reboot.service',
        'systemd-soft-reboot.service',
        'umount.target',
]
embedded_units = []
 
foreach unit : units
        source = unit.get('file')
 
        if source.endswith('.in')
                needs_jinja = true
                name = source.substring(0, -3)
                assert(name + '.in' == source)
        else
                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
        foreach cond : unit.get('conditions', [])
                if conf.get(cond) != 1
                        install = false
                        break
                endif
        endforeach
 
        if needs_jinja
                processed = custom_target(
                        input : source,
                        output : name,
                        command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
                        install : install,
                        install_dir : systemunitdir,
                        install_tag : unit.get('install_tag', ''))
                if unit.get('install_tag', '') == 'udev'
                        udev_units += processed
                elif unit.get('install_tag', '') == 'hwdb'
                        hwdb_units += processed
                endif
        elif install
                install_data(source,
                             rename : name,
                             install_dir : systemunitdir,
                             install_tag : unit.get('install_tag', ''))
        endif
 
        if name in embedded_unit_names
                # Embed either the processed output or the original file.
                embedded_units += needs_jinja ? processed : source
        endif
 
        if install
                foreach target : unit.get('symlinks', [])
                        if target.endswith('/')
                                # '/' is only allowed at the end of the target
                                assert(target.replace('/', '') + '/' == target)
                                install_symlink(name,
                                                pointing_to : '..' / name,
                                                install_dir : systemunitdir / target,
                                                install_tag : unit.get('install_tag', ''))
                        else
                                install_symlink(target,
                                                pointing_to : name,
                                                install_dir : systemunitdir,
                                                install_tag : unit.get('install_tag', ''))
                        endif
                endforeach
        endif
endforeach
 
install_data('user-.slice.d/10-defaults.conf',
             install_dir : systemunitdir + '/user-.slice.d')
 
install_data('user@.service.d/10-login-barrier.conf',
             install_dir : systemunitdir + '/user@.service.d')
install_data('user@0.service.d/10-login-barrier.conf',
             install_dir : systemunitdir + '/user@0.service.d')
 
############################################################
 
if meson.version().version_compare('>=1.3.0')
        install_symlink(
                'org.freedesktop.systemd1.service',
                pointing_to : fs.relative_to(dbussystemservicedir / 'org.freedesktop.systemd1.service',
                                             dbussessionservicedir),
                install_dir : dbussessionservicedir)
else
        install_emptydir(dbussessionservicedir)
        meson.add_install_script(sh, '-c',
                ln_s.format(dbussystemservicedir / 'org.freedesktop.systemd1.service',
                            dbussessionservicedir / 'org.freedesktop.systemd1.service'))
endif
 
subdir('user')