]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
meson: make kernel-install a template file, add --version, add to tests 22980/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 Apr 2022 16:18:56 +0000 (18:18 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 Apr 2022 20:18:31 +0000 (22:18 +0200)
In --help output, change "$0" → "kernel-install". We generally don't include
the full path in --help output, and let's not do this here either.

kernel-install is now in build/ directly, not in the subdirectory.

man/kernel-install.xml
meson.build
src/kernel-install/kernel-install.in [moved from src/kernel-install/kernel-install with 95% similarity]
src/kernel-install/meson.build

index 974d6984de32dd6c1ca79ff0e26c3867ba66e419..5ae86aca1801c0f53520e10dc5764d6def78a24d 100644 (file)
       </varlistentry>
 
       <xi:include href="standard-options.xml" xpointer="help" />
+      <xi:include href="standard-options.xml" xpointer="version" />
     </variablelist>
   </refsect1>
 
index ce54b1045db622f62f5cd4af5ead9fbe9f509d45..4a154850db10c9c552739a0b6da0219e566679ea 100644 (file)
@@ -3655,6 +3655,15 @@ executable(
         install : true,
         install_dir : rootlibexecdir)
 
+public_programs += custom_target(
+        'kernel-install',
+        input : kernel_install_in,
+        output : 'kernel-install',
+        command : [jinja2_cmdline, '@INPUT@', '@OUTPUT@'],
+        install : want_kernel_install,
+        install_mode : 'rwxr-xr-x',
+        install_dir : bindir)
+
 ############################################################
 
 runtest_env = custom_target(
similarity index 95%
rename from src/kernel-install/kernel-install
rename to src/kernel-install/kernel-install.in
index a09b998362195a788ef6b6f07cc2973847abb29d..f6d262f5226bc40d17d502ca504b86767d3f948a 100755 (executable)
@@ -23,11 +23,12 @@ skip_remaining=77
 usage()
 {
     echo "Usage:"
-    echo "  $0 [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE ...]"
-    echo "  $0 [OPTIONS...] remove KERNEL-VERSION"
-    echo "  $0 [OPTIONS...] inspect"
+    echo "  kernel-install [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE...]"
+    echo "  kernel-install [OPTIONS...] remove KERNEL-VERSION"
+    echo "  kernel-install [OPTIONS...] inspect"
     echo "Options:"
-    echo "  -h, --help     Print this help"
+    echo "  -h, --help     Print this help and exit"
+    echo "      --version  Print version string and exit"
     echo "  -v, --verbose  Increase verbosity"
 }
 
@@ -59,6 +60,13 @@ for i; do
     fi
 done
 
+for i; do
+    if [ "$i" = "--version" ]; then
+        echo "kernel-install {{PROJECT_VERSION}} ({{GIT_VERSION}})"
+        exit 0
+    fi
+done
+
 export KERNEL_INSTALL_VERBOSE=0
 if [ "$1" = "--verbose" ] || [ "$1" = "-v" ]; then
     shift
index abc3520b6257d5326adcec18b831f855a9395d08..06c1c3aafb02ea78360ea344f72ea7a39d32a506 100644 (file)
@@ -1,10 +1,8 @@
 # SPDX-License-Identifier: LGPL-2.1-or-later
 
-if want_kernel_install
-        install_data('kernel-install',
-                     install_mode : 'rwxr-xr-x',
-                     install_dir : bindir)
+kernel_install_in = files('kernel-install.in')
 
+if want_kernel_install
         install_data('50-depmod.install',
                      '90-loaderentry.install',
                      install_mode : 'rwxr-xr-x',