mirror of
https://github.com/systemd/systemd
synced 2024-09-06 08:46:19 +00:00
meson: support both separate and merged sbin-bin directories
Follow-up forba7f4ae617
. By default, we detect if the real root has a separate /usr/sbin directory, but this can be overrides with -Dsplit-bin=true|false. The check assumes that /usr/sbin is split if it is not a symlink, so it'll return a false negative with some more complicated setups. But that's OK, in those cases this should be configured explicitly. This will copy the structure of the directories in the root file system to $DESTDIR. If a directory is a directory in $DESTDIR but a symlink in the root file system, this script will fail. This means that it's not possible to reuse a $DESTDIR from betweenba7f4ae61
and this patch.
This commit is contained in:
parent
2675413e39
commit
157baa87e4
|
@ -61,6 +61,12 @@ else
|
|||
endif
|
||||
conf.set10('HAVE_SPLIT_USR', split_usr)
|
||||
|
||||
if get_option('split-bin') == 'auto'
|
||||
split_bin = run_command('test', '-L', '/usr/sbin').returncode() != 0
|
||||
else
|
||||
split_bin = get_option('split-bin') == 'true'
|
||||
endif
|
||||
|
||||
rootprefixdir = get_option('rootprefix')
|
||||
# Unusual rootprefixdir values are used by some distros
|
||||
# (see https://github.com/systemd/systemd/pull/7461).
|
||||
|
@ -91,7 +97,7 @@ datadir = join_paths(prefixdir, get_option('datadir'))
|
|||
localstatedir = join_paths('/', get_option('localstatedir'))
|
||||
|
||||
rootbindir = join_paths(rootprefixdir, 'bin')
|
||||
rootsbindir = join_paths(rootprefixdir, 'sbin')
|
||||
rootsbindir = join_paths(rootprefixdir, split_bin ? 'sbin' : 'bin')
|
||||
rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
|
||||
|
||||
rootlibdir = get_option('rootlibdir')
|
||||
|
@ -2743,6 +2749,7 @@ status = [
|
|||
'@0@ @1@'.format(meson.project_name(), meson.project_version()),
|
||||
|
||||
'split /usr: @0@'.format(split_usr),
|
||||
'split bin-sbin: @0@'.format(split_bin),
|
||||
'prefix directory: @0@'.format(prefixdir),
|
||||
'rootprefix directory: @0@'.format(rootprefixdir),
|
||||
'sysconf directory: @0@'.format(sysconfdir),
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
|
||||
option('split-usr', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||
description : '''/bin, /sbin aren't symlinks into /usr''')
|
||||
option('split-bin', type : 'combo', choices : ['auto', 'true', 'false'],
|
||||
description : '''sbin is not a symlink to bin''')
|
||||
option('rootlibdir', type : 'string',
|
||||
description : '''[/usr]/lib/x86_64-linux-gnu or such''')
|
||||
option('rootprefix', type : 'string',
|
||||
|
|
Loading…
Reference in a new issue