repart: add new systemd-repart tool

Fixes: #14052
This commit is contained in:
Lennart Poettering 2019-12-10 21:31:41 +01:00
parent b57ebc6004
commit e594a3b154
4 changed files with 3145 additions and 0 deletions

View File

@ -873,6 +873,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',
@ -1279,6 +1290,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
@ -1535,6 +1558,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')
@ -2381,6 +2405,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',
@ -3276,6 +3315,7 @@ foreach tuple : [
['libiptc'],
['elfutils'],
['binfmt'],
['repart'],
['vconsole'],
['quotacheck'],
['tmpfiles'],

View File

@ -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',
@ -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'],

View File

@ -0,0 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1+
systemd_repart_sources = files('''
repart.c
'''.split())

3096
src/partition/repart.c Normal file

File diff suppressed because it is too large Load Diff