Skip to content

Commit ba7f4ae

Browse files
keszybzpoettering
authored andcommitted
meson: install compat symlinks for systemctl and systemd (systemd#8300)
v2: - init is a symlink to systemd, not systemctl!
1 parent bdad9e4 commit ba7f4ae

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

meson.build

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ conf.set10('HAVE_SPLIT_USR', split_usr)
6060
rootprefixdir = get_option('rootprefix')
6161
# Unusual rootprefixdir values are used by some distros
6262
# (see https://github.com/systemd/systemd/pull/7461).
63-
rootprefix_default = get_option('split-usr') ? '/' : '/usr'
63+
rootprefix_default = split_usr ? '/' : '/usr'
6464
if rootprefixdir == ''
6565
rootprefixdir = rootprefix_default
6666
endif
@@ -87,6 +87,7 @@ datadir = join_paths(prefixdir, get_option('datadir'))
8787
localstatedir = join_paths('/', get_option('localstatedir'))
8888

8989
rootbindir = join_paths(rootprefixdir, 'bin')
90+
rootsbindir = join_paths(rootprefixdir, 'sbin')
9091
rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
9192

9293
rootlibdir = get_option('rootlibdir')
@@ -1453,6 +1454,10 @@ executable('systemd',
14531454
install : true,
14541455
install_dir : rootlibexecdir)
14551456

1457+
meson.add_install_script(meson_make_symlink,
1458+
join_paths(rootlibexecdir, 'systemd'),
1459+
join_paths(rootsbindir, 'init'))
1460+
14561461
exe = executable('systemd-analyze',
14571462
systemd_analyze_sources,
14581463
include_directories : includes,
@@ -1712,6 +1717,12 @@ exe = executable('systemctl', 'src/systemctl/systemctl.c',
17121717
install_dir : rootbindir)
17131718
public_programs += [exe]
17141719

1720+
foreach alias : ['halt', 'poweroff', 'reboot', 'runlevel', 'shutdown', 'telinit']
1721+
meson.add_install_script(meson_make_symlink,
1722+
join_paths(rootbindir, 'systemctl'),
1723+
join_paths(rootsbindir, alias))
1724+
endforeach
1725+
17151726
if conf.get('ENABLE_BACKLIGHT') == 1
17161727
executable('systemd-backlight',
17171728
'src/backlight/backlight.c',

0 commit comments

Comments
 (0)