1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-23 17:34:00 +03:00

meson: make kernel-install a template file, add --version, add to tests

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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2022-04-05 18:18:56 +02:00
parent 8f04a1ca2b
commit 99d8cbceff
4 changed files with 24 additions and 8 deletions

View File

@ -166,6 +166,7 @@
</varlistentry> </varlistentry>
<xi:include href="standard-options.xml" xpointer="help" /> <xi:include href="standard-options.xml" xpointer="help" />
<xi:include href="standard-options.xml" xpointer="version" />
</variablelist> </variablelist>
</refsect1> </refsect1>

View File

@ -3655,6 +3655,15 @@ executable(
install : true, install : true,
install_dir : rootlibexecdir) 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( runtest_env = custom_target(

View File

@ -23,11 +23,12 @@ skip_remaining=77
usage() usage()
{ {
echo "Usage:" echo "Usage:"
echo " $0 [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE ...]" echo " kernel-install [OPTIONS...] add KERNEL-VERSION KERNEL-IMAGE [INITRD-FILE...]"
echo " $0 [OPTIONS...] remove KERNEL-VERSION" echo " kernel-install [OPTIONS...] remove KERNEL-VERSION"
echo " $0 [OPTIONS...] inspect" echo " kernel-install [OPTIONS...] inspect"
echo "Options:" 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" echo " -v, --verbose Increase verbosity"
} }
@ -59,6 +60,13 @@ for i; do
fi fi
done done
for i; do
if [ "$i" = "--version" ]; then
echo "kernel-install {{PROJECT_VERSION}} ({{GIT_VERSION}})"
exit 0
fi
done
export KERNEL_INSTALL_VERBOSE=0 export KERNEL_INSTALL_VERBOSE=0
if [ "$1" = "--verbose" ] || [ "$1" = "-v" ]; then if [ "$1" = "--verbose" ] || [ "$1" = "-v" ]; then
shift shift

View File

@ -1,10 +1,8 @@
# SPDX-License-Identifier: LGPL-2.1-or-later # SPDX-License-Identifier: LGPL-2.1-or-later
if want_kernel_install kernel_install_in = files('kernel-install.in')
install_data('kernel-install',
install_mode : 'rwxr-xr-x',
install_dir : bindir)
if want_kernel_install
install_data('50-depmod.install', install_data('50-depmod.install',
'90-loaderentry.install', '90-loaderentry.install',
install_mode : 'rwxr-xr-x', install_mode : 'rwxr-xr-x',