summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-01-01 05:38:06 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-01-19 07:04:19 +0900
commitbac11cd667cca5545ab90e472dff77baf68d8e0b (patch)
tree4bb5bd592f6ff25d5df12fe28995e80ec1cb2a9f /src
parent772e0a76f34914f6f81205e912e4744c6b23f704 (diff)
downloadsystemd-bac11cd667cca5545ab90e472dff77baf68d8e0b.tar.gz
core: move several source files to src/shared
As, the files are used by many executables, fstab-generator, remount-fs, machine-id-setup, and etc. With this change, the total size of the relevant executables and libshared slightly decreases. Before: ``` $ ll systemd-fstab-generator systemd-remount-fs systemd-machine-id-setup systemd-shutdown systemd-nspawn systemd src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 watanabe watanabe 7577800 Jan 5 13:35 src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 watanabe watanabe 4608360 Jan 5 13:35 systemd -rwxrwxr-x 1 watanabe watanabe 117240 Jan 5 13:35 systemd-fstab-generator -rwxrwxr-x 1 watanabe watanabe 61576 Jan 5 13:35 systemd-machine-id-setup -rwxrwxr-x 1 watanabe watanabe 853080 Jan 5 13:35 systemd-nspawn -rwxrwxr-x 1 watanabe watanabe 70600 Jan 5 13:35 systemd-remount-fs -rwxrwxr-x 1 watanabe watanabe 172624 Jan 5 13:35 systemd-shutdown ``` Total: 13461280 After: ``` $ ll systemd-fstab-generator systemd-remount-fs systemd-machine-id-setup systemd-shutdown systemd-nspawn systemd src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 watanabe watanabe 7658336 Jan 5 13:32 src/shared/libsystemd-shared-247.so -rwxrwxr-x 1 watanabe watanabe 4523560 Jan 5 13:32 systemd -rwxrwxr-x 1 watanabe watanabe 78288 Jan 5 13:32 systemd-fstab-generator -rwxrwxr-x 1 watanabe watanabe 30984 Jan 5 13:32 systemd-machine-id-setup -rwxrwxr-x 1 watanabe watanabe 840384 Jan 5 13:32 systemd-nspawn -rwxrwxr-x 1 watanabe watanabe 39104 Jan 5 13:32 systemd-remount-fs -rwxrwxr-x 1 watanabe watanabe 117160 Jan 5 13:32 systemd-shutdown ``` Total: 13287816
Diffstat (limited to 'src')
-rw-r--r--src/core/meson.build21
-rw-r--r--src/shared/killall.c (renamed from src/core/killall.c)0
-rw-r--r--src/shared/killall.h (renamed from src/core/killall.h)0
-rw-r--r--src/shared/loopback-setup.c (renamed from src/core/loopback-setup.c)0
-rw-r--r--src/shared/loopback-setup.h (renamed from src/core/loopback-setup.h)0
-rw-r--r--src/shared/machine-id-setup.c (renamed from src/core/machine-id-setup.c)0
-rw-r--r--src/shared/machine-id-setup.h (renamed from src/core/machine-id-setup.h)0
-rw-r--r--src/shared/meson.build8
-rw-r--r--src/shared/mount-setup.c (renamed from src/core/mount-setup.c)0
-rw-r--r--src/shared/mount-setup.h (renamed from src/core/mount-setup.h)0
-rw-r--r--src/test/meson.build3
11 files changed, 9 insertions, 23 deletions
diff --git a/src/core/meson.build b/src/core/meson.build
index 3482bd4472..1aaf7cd929 100644
--- a/src/core/meson.build
+++ b/src/core/meson.build
@@ -1,16 +1,5 @@
# SPDX-License-Identifier: LGPL-2.1-or-later
-libcore_shared_sources = '''
- killall.c
- killall.h
- loopback-setup.c
- loopback-setup.h
- machine-id-setup.c
- machine-id-setup.h
- mount-setup.c
- mount-setup.h
-'''.split()
-
libcore_sources = '''
apparmor-setup.c
apparmor-setup.h
@@ -151,22 +140,12 @@ load_fragment_gperf_nulstr_c = custom_target(
command : [awk, '-f', '@INPUT0@', '@INPUT1@'],
capture : true)
-# A convenience library to share code with other binaries:
-# systemd-shutdown, systemd-remount-fs, systemd-machine-id-setup, …
-libcore_shared = static_library(
- 'core-shared',
- libcore_shared_sources,
- include_directories : includes,
- dependencies : [versiondep,
- libmount])
-
libcore = static_library(
'core',
libcore_sources,
load_fragment_gperf_c,
load_fragment_gperf_nulstr_c,
include_directories : includes,
- link_whole : libcore_shared,
dependencies : [versiondep,
threads,
librt,
diff --git a/src/core/killall.c b/src/shared/killall.c
index d9fcfc21a9..d9fcfc21a9 100644
--- a/src/core/killall.c
+++ b/src/shared/killall.c
diff --git a/src/core/killall.h b/src/shared/killall.h
index d8ef96f7d1..d8ef96f7d1 100644
--- a/src/core/killall.h
+++ b/src/shared/killall.h
diff --git a/src/core/loopback-setup.c b/src/shared/loopback-setup.c
index 76022ce423..76022ce423 100644
--- a/src/core/loopback-setup.c
+++ b/src/shared/loopback-setup.c
diff --git a/src/core/loopback-setup.h b/src/shared/loopback-setup.h
index a7ee2dadb0..a7ee2dadb0 100644
--- a/src/core/loopback-setup.h
+++ b/src/shared/loopback-setup.h
diff --git a/src/core/machine-id-setup.c b/src/shared/machine-id-setup.c
index 6d15f9cd09..6d15f9cd09 100644
--- a/src/core/machine-id-setup.c
+++ b/src/shared/machine-id-setup.c
diff --git a/src/core/machine-id-setup.h b/src/shared/machine-id-setup.h
index cce58192e5..cce58192e5 100644
--- a/src/core/machine-id-setup.h
+++ b/src/shared/machine-id-setup.h
diff --git a/src/shared/meson.build b/src/shared/meson.build
index 3032a9efd1..6db9065794 100644
--- a/src/shared/meson.build
+++ b/src/shared/meson.build
@@ -145,6 +145,8 @@ shared_sources = files('''
json-internal.h
json.c
json.h
+ killall.c
+ killall.h
libcrypt-util.c
libcrypt-util.h
libfido2-util.c
@@ -165,6 +167,10 @@ shared_sources = files('''
logs-show.h
loop-util.c
loop-util.h
+ loopback-setup.c
+ loopback-setup.h
+ machine-id-setup.c
+ machine-id-setup.h
machine-image.c
machine-image.h
machine-pool.c
@@ -175,6 +181,8 @@ shared_sources = files('''
mkfs-util.c
mkfs-util.h
module-util.h
+ mount-setup.c
+ mount-setup.h
mount-util.c
mount-util.h
net-condition.c
diff --git a/src/core/mount-setup.c b/src/shared/mount-setup.c
index 1e4bbfb1ab..1e4bbfb1ab 100644
--- a/src/core/mount-setup.c
+++ b/src/shared/mount-setup.c
diff --git a/src/core/mount-setup.h b/src/shared/mount-setup.h
index 29bd62f6bf..29bd62f6bf 100644
--- a/src/core/mount-setup.h
+++ b/src/shared/mount-setup.h
diff --git a/src/test/meson.build b/src/test/meson.build
index 5d185eb77f..6ea4599791 100644
--- a/src/test/meson.build
+++ b/src/test/meson.build
@@ -775,8 +775,7 @@ tests += [
[['src/test/test-umount.c',
'src/shutdown/umount.c',
'src/shutdown/umount.h'],
- [libcore_shared,
- libshared],
+ [libshared],
[libmount]],
[['src/test/test-bus-util.c'],