Skip to content

Commit

Permalink
repart: add new systemd-repart tool
Browse files Browse the repository at this point in the history
  • Loading branch information
poettering committed Jan 20, 2020
1 parent 8435d91 commit 533ac98
Show file tree
Hide file tree
Showing 4 changed files with 3,146 additions and 0 deletions.
41 changes: 41 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -874,6 +874,17 @@ endif
libmount = dependency('mount',
version : fuzzer_build ? '>= 0' : '>= 2.30')

want_libfdisk = get_option('fdisk')
if want_libfdisk != 'false' and not skip_deps
libfdisk = dependency('fdisk',
required : want_libfdisk == 'true')
have = libfdisk.found()
else
have = false
libfdisk = []
endif
conf.set10('HAVE_LIBFDISK', have)

want_seccomp = get_option('seccomp')
if want_seccomp != 'false' and not skip_deps
libseccomp = dependency('libseccomp',
Expand Down Expand Up @@ -1280,6 +1291,18 @@ conf.set('DEFAULT_DNS_OVER_TLS_MODE',
'DNS_OVER_TLS_' + default_dns_over_tls.underscorify().to_upper())
substs.set('DEFAULT_DNS_OVER_TLS_MODE', default_dns_over_tls)

want_repart = get_option('repart')
if want_repart != 'false'
have = (conf.get('HAVE_OPENSSL') == 1 and
conf.get('HAVE_LIBFDISK') == 1)
if want_repart == 'true' and not have
error('repart support was requested, but dependencies are not available')
endif
else
have = false
endif
conf.set10('ENABLE_REPART', have)

want_importd = get_option('importd')
if want_importd != 'false'
have = (conf.get('HAVE_LIBCURL') == 1 and
Expand Down Expand Up @@ -1315,6 +1338,7 @@ foreach term : ['utmp',
'hibernate',
'environment-d',
'binfmt',
'repart',
'coredump',
'pstore',
'resolve',
Expand Down Expand Up @@ -1536,6 +1560,7 @@ subdir('src/coredump')
subdir('src/pstore')
subdir('src/hostname')
subdir('src/import')
subdir('src/partition')
subdir('src/kernel-install')
subdir('src/locale')
subdir('src/machine')
Expand Down Expand Up @@ -2382,6 +2407,21 @@ if conf.get('ENABLE_BINFMT') == 1
mkdir_p.format(join_paths(sysconfdir, 'binfmt.d')))
endif

if conf.get('ENABLE_REPART') == 1
executable('systemd-repart',
systemd_repart_sources,
include_directories : includes,
link_with : [libshared],
dependencies : [threads,
libcryptsetup,
libblkid,
libfdisk,
libopenssl],
install_rpath : rootlibexecdir,
install : true,
install_dir : rootbindir)
endif

if conf.get('ENABLE_VCONSOLE') == 1
executable('systemd-vconsole-setup',
'src/vconsole/vconsole-setup.c',
Expand Down Expand Up @@ -3277,6 +3317,7 @@ foreach tuple : [
['libiptc'],
['elfutils'],
['binfmt'],
['repart'],
['vconsole'],
['quotacheck'],
['tmpfiles'],
Expand Down
4 changes: 4 additions & 0 deletions meson_options.txt
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ option('environment-d', type : 'boolean',
description : 'support for environment.d')
option('binfmt', type : 'boolean',
description : 'support for custom binary formats')
option('repart', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'install the systemd-repart tool')
option('coredump', type : 'boolean',
description : 'install the coredump handler')
option('pstore', type : 'boolean',
Expand Down Expand Up @@ -260,6 +262,8 @@ option('audit', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'libaudit support')
option('blkid', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'libblkid support')
option('fdisk', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'libfdisk support')
option('kmod', type : 'combo', choices : ['auto', 'true', 'false'],
description : 'support for loadable modules')
option('pam', type : 'combo', choices : ['auto', 'true', 'false'],
Expand Down
5 changes: 5 additions & 0 deletions src/partition/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1+

systemd_repart_sources = files('''
repart.c
'''.split())

0 comments on commit 533ac98

Please sign in to comment.