chiark / gitweb /
meson: support both separate and merged sbin-bin directories
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 1 Mar 2018 09:28:29 +0000 (10:28 +0100)
committerSven Eden <yamakuzure@gmx.net>
Wed, 30 May 2018 05:59:10 +0000 (07:59 +0200)
Follow-up for ba7f4ae6178309dc937e10cf7dce0eca9dafb8de.

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 between ba7f4ae61 and this patch.

meson.build
meson_options.txt

index a71cd2a0ca04d29d3a8b696c87a27f119cca3e40..a10499131f6c38cf8dea6488e64bc1a5e994ebe7 100644 (file)
@@ -77,6 +77,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).
@@ -109,7 +115,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')
 #if 0 /// elogind has a different default
 # rootlibexecdir = join_paths(rootprefixdir, 'lib/systemd')
 #else
@@ -3056,6 +3062,7 @@ status = [
         '@0@ @1@'.format(meson.project_name(), meson.project_version()),
 
         'split /usr:                        @0@'.format(split_usr),
+        'split bin-sbin:                    @0@'.format(split_bin),
 #if 0 /// UNSUPPORTED by elogind
 #         'prefix directory:                  @0@'.format(prefixdir),
 #         'rootprefix directory:              @0@'.format(rootprefixdir),
index e6696dea96c0ae4596cd7ced4ead9b777c1e67d7..6e3407414d4a34109fbd8a3b5ee681a56e899f0f 100644 (file)
@@ -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',