]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
docs: move /var/log/README to a tmpfiles.d symlink
authorLuca BRUNO <luca.bruno@coreos.com>
Thu, 8 Jul 2021 09:47:32 +0000 (09:47 +0000)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 21 Jul 2021 15:29:06 +0000 (17:29 +0200)
This moves the /var/log/README content out of /var and into the
docs location, replacing the previous file with a symlink
created through a tmpfiles.d entry.

TODO
docs/var-log/README.logs [moved from docs/var-log/README with 100% similarity]
docs/var-log/meson.build
meson.build
tmpfiles.d/legacy.conf.in [moved from tmpfiles.d/legacy.conf with 90% similarity]
tmpfiles.d/meson.build

diff --git a/TODO b/TODO
index 249f4a225705bbcd94a062a89fac6258ee46da7e..3a17a20c1ad55e18de43e87f6f3c8545dcaf7113 100644 (file)
--- a/TODO
+++ b/TODO
@@ -378,9 +378,8 @@ Features:
   https://docs.microsoft.com/en-us/windows-hardware/design/device-experiences/modern-standby-wake-sources
   at the end).
 
-* We should probably replace /var/log/README, /etc/rc.d/README with symlinks
-  that are linked to these places instead of copied. After all they are
-  constant vendor data.
+* We should probably replace /etc/rc.d/README with a symlink to doc
+  content. After all it is constant vendor data.
 
 * maybe add kernel cmdline params: to force random seed crediting
 
similarity index 100%
rename from docs/var-log/README
rename to docs/var-log/README.logs
index ba7957711dd6d955332a9f775756d7283a76affb..35f756cafec846cb4c239be41c1d9ce566a053e1 100644 (file)
@@ -1,6 +1,6 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
 if conf.get('HAVE_SYSV_COMPAT') == 1 and get_option('create-log-dirs')
-        install_data('README',
-                     install_dir : '/var/log')
+        install_data('README.logs',
+                     install_dir : docdir)
 endif
index a2ee15bf3205ea2e9f675d2fdbe28c78c6c7f6f5..815c223171b8943634c9239b18ddca1a1b428a02 100644 (file)
@@ -91,6 +91,7 @@ sysvinit_path = get_option('sysvinit-path')
 sysvrcnd_path = get_option('sysvrcnd-path')
 conf.set10('HAVE_SYSV_COMPAT', sysvinit_path != '' and sysvrcnd_path != '',
            description : 'SysV init scripts and rcN.d links are supported')
+conf.set10('CREATE_LOG_DIRS', get_option('create-log-dirs'))
 
 if get_option('hibernate') and not get_option('initrd')
         error('hibernate depends on initrd')
@@ -215,6 +216,7 @@ conf.set_quoted('BINFMT_DIR',                                 binfmtdir)
 conf.set_quoted('BOOTLIBDIR',                                 bootlibdir)
 conf.set_quoted('CATALOG_DATABASE',                           join_paths(catalogstatedir, 'database'))
 conf.set_quoted('CERTIFICATE_ROOT',                           get_option('certificate-root'))
+conf.set_quoted('DOC_DIR',                                    docdir)
 conf.set_quoted('DOCUMENT_ROOT',                              join_paths(pkgdatadir, 'gatewayd'))
 conf.set_quoted('ENVIRONMENT_DIR',                            environmentdir)
 conf.set_quoted('INCLUDE_DIR',                                includedir)
similarity index 90%
rename from tmpfiles.d/legacy.conf
rename to tmpfiles.d/legacy.conf.in
index 62e2ae0986234974d4bb89997f3ca73fda7144a6..4f2c0d7c4310aeea4d75b7c416c81ad63777cf37 100644 (file)
@@ -12,6 +12,9 @@
 
 d /run/lock 0755 root root -
 L /var/lock - - - - ../run/lock
+{% if CREATE_LOG_DIRS %}
+L /var/log/README - - - - ../..{{DOC_DIR}}/README.logs
+{% endif %}
 
 # /run/lock/subsys is used for serializing SysV service execution, and
 # hence without use on SysV-less systems.
index a8aaacaf29e9f67d08429acb5b1029dd39e86533..6f8ff09fc8cbd73b4df674e7358814d2b20462c8 100644 (file)
@@ -12,7 +12,6 @@ files = [['README',               ''],
          ['systemd-pstore.conf',  'ENABLE_PSTORE'],
          ['tmp.conf',             ''],
          ['x11.conf',             ''],
-         ['legacy.conf',          'HAVE_SYSV_COMPAT'],
         ]
 
 foreach pair : files
@@ -26,21 +25,30 @@ foreach pair : files
         endif
 endforeach
 
-in_files = ['etc.conf',
-            'static-nodes-permissions.conf',
-            'systemd.conf',
-            'var.conf']
+in_files = [['etc.conf',                      ''],
+            ['legacy.conf',                   'HAVE_SYSV_COMPAT'],
+            ['static-nodes-permissions.conf', ''],
+            ['systemd.conf',                  ''],
+            ['var.conf',                      ''],
+           ]
 
-foreach file : in_files
-        custom_target(
-                # XXX: workaround for old meson. Drop when upgrading.
-                'tmpfiles+' + file,
-                input : file + '.in',
-                output: file,
-                command : [meson_render_jinja2, config_h, '@INPUT@'],
-                capture : true,
-                install : enable_tmpfiles,
-                install_dir : tmpfilesdir)
+foreach pair : in_files
+        if not enable_tmpfiles
+                # do nothing
+        elif pair[1] == '' or conf.get(pair[1]) == 1
+                custom_target(
+                        # XXX: workaround for old meson. Drop when upgrading.
+                        'tmpfiles+' + pair[0],
+                        input : pair[0] + '.in',
+                        output: pair[0],
+                        command : [meson_render_jinja2, config_h, '@INPUT@'],
+                        capture : true,
+                        install : enable_tmpfiles,
+                        install_dir : tmpfilesdir)
+        else
+                message('Not installing tmpfiles.d/@0@ because @1@ is @2@'
+                        .format(pair[0], pair[1], conf.get(pair[1], 0)))
+        endif
 endforeach
 
 if enable_tmpfiles and install_sysconfdir