1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-22 13:33:56 +03:00

sysext: new tool for managing "system extensions" for /usr/ + /opt/

This commit is contained in:
Lennart Poettering 2021-01-08 16:57:27 +01:00
parent 7b5ed18779
commit 9bca4ae4cd
6 changed files with 1046 additions and 11 deletions

View File

@ -1502,6 +1502,7 @@ foreach term : ['analyze',
'nss-myhostname', 'nss-myhostname',
'nss-systemd', 'nss-systemd',
'portabled', 'portabled',
'sysext',
'pstore', 'pstore',
'quotacheck', 'quotacheck',
'randomseed', 'randomseed',
@ -1745,6 +1746,7 @@ subdir('src/portable')
subdir('src/pstore') subdir('src/pstore')
subdir('src/resolve') subdir('src/resolve')
subdir('src/shutdown') subdir('src/shutdown')
subdir('src/sysext')
subdir('src/systemctl') subdir('src/systemctl')
subdir('src/timedate') subdir('src/timedate')
subdir('src/timesync') subdir('src/timesync')
@ -2202,6 +2204,17 @@ if conf.get('ENABLE_PORTABLED') == 1
install_dir : rootbindir) install_dir : rootbindir)
endif endif
if conf.get('ENABLE_SYSEXT') == 1
public_programs += executable(
'systemd-sysext',
systemd_sysext_sources,
include_directories : includes,
link_with : [libshared],
install_rpath : rootlibexecdir,
install : true,
install_dir : rootbindir)
endif
if conf.get('ENABLE_USERDB') == 1 if conf.get('ENABLE_USERDB') == 1
executable( executable(
'systemd-userwork', 'systemd-userwork',
@ -3735,6 +3748,7 @@ foreach tuple : [
['logind'], ['logind'],
['machined'], ['machined'],
['portabled'], ['portabled'],
['sysext'],
['userdb'], ['userdb'],
['homed'], ['homed'],
['importd'], ['importd'],

View File

@ -111,6 +111,8 @@ option('machined', type : 'boolean',
description : 'install the systemd-machined stack') description : 'install the systemd-machined stack')
option('portabled', type : 'boolean', option('portabled', type : 'boolean',
description : 'install the systemd-portabled stack') description : 'install the systemd-portabled stack')
option('sysext', type : 'boolean',
description : 'install the systemd-sysext stack')
option('userdb', type : 'boolean', option('userdb', type : 'boolean',
description : 'install the systemd-userdbd stack') description : 'install the systemd-userdbd stack')
option('homed', type : 'combo', choices : ['auto', 'true', 'false'], option('homed', type : 'combo', choices : ['auto', 'true', 'false'],

View File

@ -42,18 +42,24 @@
#include "xattr-util.h" #include "xattr-util.h"
static const char* const image_search_path[_IMAGE_CLASS_MAX] = { static const char* const image_search_path[_IMAGE_CLASS_MAX] = {
[IMAGE_MACHINE] = "/etc/machines\0" /* only place symlinks here */ [IMAGE_MACHINE] = "/etc/machines\0" /* only place symlinks here */
"/run/machines\0" /* and here too */ "/run/machines\0" /* and here too */
"/var/lib/machines\0" /* the main place for images */ "/var/lib/machines\0" /* the main place for images */
"/var/lib/container\0" /* legacy */ "/var/lib/container\0" /* legacy */
"/usr/local/lib/machines\0" "/usr/local/lib/machines\0"
"/usr/lib/machines\0", "/usr/lib/machines\0",
[IMAGE_PORTABLE] = "/etc/portables\0" /* only place symlinks here */ [IMAGE_PORTABLE] = "/etc/portables\0" /* only place symlinks here */
"/run/portables\0" /* and here too */ "/run/portables\0" /* and here too */
"/var/lib/portables\0" /* the main place for images */ "/var/lib/portables\0" /* the main place for images */
"/usr/local/lib/portables\0" "/usr/local/lib/portables\0"
"/usr/lib/portables\0", "/usr/lib/portables\0",
[IMAGE_EXTENSION] = "/etc/extensions\0" /* only place symlinks here */
"/run/extensions\0" /* and here too */
"/var/lib/extensions\0" /* the main place for images */
"/usr/local/lib/extensions\0"
"/usr/lib/extensions\0",
}; };
static Image *image_free(Image *i) { static Image *image_free(Image *i) {

View File

@ -16,6 +16,7 @@
typedef enum ImageClass { typedef enum ImageClass {
IMAGE_MACHINE, IMAGE_MACHINE,
IMAGE_PORTABLE, IMAGE_PORTABLE,
IMAGE_EXTENSION,
_IMAGE_CLASS_MAX, _IMAGE_CLASS_MAX,
_IMAGE_CLASS_INVALID = -1 _IMAGE_CLASS_INVALID = -1
} ImageClass; } ImageClass;

5
src/sysext/meson.build Normal file
View File

@ -0,0 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
systemd_sysext_sources = files('''
sysext.c
'''.split())

1007
src/sysext/sysext.c Normal file

File diff suppressed because it is too large Load Diff