From 405b104df6978f1d3bed6c12c6cee93a215883bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 19 May 2019 11:31:19 +0200 Subject: [PATCH 1/6] bootclt: add missing column This got broken somehow in 44e6a5ef825. --- src/boot/bootctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 9df181a10c..57908641a0 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -326,7 +326,7 @@ static int boot_entry_file_check(const char *root, const char *p) { static void boot_entry_file_list(const char *field, const char *root, const char *p, int *ret_status) { int status = boot_entry_file_check(root, p); - printf("%13s%s", strempty(field), field ? ":" : " "); + printf("%13s%s ", strempty(field), field ? ":" : " "); if (status < 0) { errno = -status; printf("%s%s%s (%m)\n", ansi_highlight_red(), p, ansi_normal()); From fba4e9450602092c58f8676c454f8e534f4e50f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 19 May 2019 11:55:36 +0200 Subject: [PATCH 2/6] bootctl: add -x shortcut for --print-boot-path It's a quite useful option, let's match -p. --- man/bootctl.xml | 1 + src/boot/bootctl.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/man/bootctl.xml b/man/bootctl.xml index a80a37309c..3e1f9b588b 100644 --- a/man/bootctl.xml +++ b/man/bootctl.xml @@ -65,6 +65,7 @@ + This option modifies the behaviour of status. Prints only the path to the Extended Boot Loader partition if it exists, and the path to the ESP otherwise to diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index 57908641a0..c3ebdd7c4e 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -997,7 +997,7 @@ static int help(int argc, char *argv[], void *userdata) { " --esp-path=PATH Path to the EFI System Partition (ESP)\n" " --boot-path=PATH Path to the $BOOT partition\n" " -p --print-esp-path Print path to the EFI System Partition\n" - " --print-boot-path Print path to the $BOOT partition\n" + " -x --print-boot-path Print path to the $BOOT partition\n" " --no-variables Don't touch EFI variables\n" " --no-pager Do not pipe output into a pager\n" "\nBoot Loader Commands:\n" @@ -1020,7 +1020,6 @@ static int parse_argv(int argc, char *argv[]) { enum { ARG_ESP_PATH = 0x100, ARG_BOOT_PATH, - ARG_PRINT_BOOT_PATH, ARG_VERSION, ARG_NO_VARIABLES, ARG_NO_PAGER, @@ -1034,7 +1033,7 @@ static int parse_argv(int argc, char *argv[]) { { "boot-path", required_argument, NULL, ARG_BOOT_PATH }, { "print-esp-path", no_argument, NULL, 'p' }, { "print-path", no_argument, NULL, 'p' }, /* Compatibility alias */ - { "print-boot-path", no_argument, NULL, ARG_PRINT_BOOT_PATH }, + { "print-boot-path", no_argument, NULL, 'x' }, { "no-variables", no_argument, NULL, ARG_NO_VARIABLES }, { "no-pager", no_argument, NULL, ARG_NO_PAGER }, {} @@ -1045,7 +1044,7 @@ static int parse_argv(int argc, char *argv[]) { assert(argc >= 0); assert(argv); - while ((c = getopt_long(argc, argv, "hp", options, NULL)) >= 0) + while ((c = getopt_long(argc, argv, "hpx", options, NULL)) >= 0) switch (c) { case 'h': @@ -1071,7 +1070,7 @@ static int parse_argv(int argc, char *argv[]) { arg_print_esp_path = true; break; - case ARG_PRINT_BOOT_PATH: + case 'x': arg_print_dollar_boot_path = true; break; From aa467bcae16f7090813d6e549487e73a95157f69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 19 May 2019 12:01:32 +0200 Subject: [PATCH 3/6] bootctl: do not allow -x and -p to be used together -x already prints the path to ESP in some circumstances, and allowing both to be printed seems confusing. --- man/bootctl.xml | 14 +++++++------- src/boot/bootctl.c | 6 ++++++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/man/bootctl.xml b/man/bootctl.xml index 3e1f9b588b..46b9738b14 100644 --- a/man/bootctl.xml +++ b/man/bootctl.xml @@ -60,18 +60,18 @@ - This option modifies the behaviour of status. Prints only the - path to the EFI System Partition (ESP) to standard output and exits. + This option modifies the behaviour of status. Only prints the path + to the EFI System Partition (ESP) to standard output and exits. - This option modifies the behaviour of status. Prints only the - path to the Extended Boot Loader partition if it exists, and the path to the ESP otherwise to - standard output and exit. This command is useful to determine where to place boot loader entries, as - they are preferably placed in the Extended Boot Loader partition if it exists and in the ESP - otherwise. + This option modifies the behaviour of status. Only prints the path + to the Extended Boot Loader partition if it exists, and the path to the ESP otherwise to standard + output and exit. This command is useful to determine where to place boot loader entries, as they are + preferably placed in the Extended Boot Loader partition if it exists and in the ESP otherwise. + diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c index c3ebdd7c4e..55924adf06 100644 --- a/src/boot/bootctl.c +++ b/src/boot/bootctl.c @@ -1067,10 +1067,16 @@ static int parse_argv(int argc, char *argv[]) { break; case 'p': + if (arg_print_dollar_boot_path) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), + "--print-boot-path/-x cannot be combined with --print-esp-path/-p"); arg_print_esp_path = true; break; case 'x': + if (arg_print_esp_path) + return log_error_errno(SYNTHETIC_ERRNO(EINVAL), + "--print-boot-path/-x cannot be combined with --print-esp-path/-p"); arg_print_dollar_boot_path = true; break; From 95cff2a7942badfe7d3fbf12a644749c3dc76b1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 19 May 2019 12:05:21 +0200 Subject: [PATCH 4/6] test: search $BOOT for kernel+initrd $BOOT is the preferred location for kernel images. If $BOOT does not exist, -x will print the path to ESP, so well fall back to previous behaviour. --- test/test-functions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index 30b559097b..0394076f0a 100644 --- a/test/test-functions +++ b/test/test-functions @@ -14,7 +14,7 @@ NSPAWN_TIMEOUT="${NSPAWN_TIMEOUT:-infinity}" TIMED_OUT= # will be 1 after run_* if *_TIMEOUT is set and test timed out [[ "$LOOKS_LIKE_SUSE" ]] && FSTYPE="${FSTYPE:-btrfs}" || FSTYPE="${FSTYPE:-ext4}" UNIFIED_CGROUP_HIERARCHY="${UNIFIED_CGROUP_HIERARCHY:-default}" -EFI_MOUNT="$(bootctl -p 2>/dev/null || echo /boot)" +EFI_MOUNT="$(bootctl -x 2>/dev/null || echo /boot)" QEMU_MEM="${QEMU_MEM:-512M}" if ! ROOTLIBDIR=$(pkg-config --variable=systemdutildir systemd); then From 5c305ce2db2ce423bd04e4d4bfbc071ffcae04d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 19 May 2019 13:00:00 +0200 Subject: [PATCH 5/6] test: rename TEST-31-OOMPOLICY to TEST-32-OOMPOLICY TEST-31-DEVICE-ENUMERATION got merged first. --- test/{TEST-31-OOMPOLICY => TEST-32-OOMPOLICY}/Makefile | 0 test/{TEST-31-OOMPOLICY => TEST-32-OOMPOLICY}/test.sh | 0 test/{TEST-31-OOMPOLICY => TEST-32-OOMPOLICY}/testsuite.sh | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename test/{TEST-31-OOMPOLICY => TEST-32-OOMPOLICY}/Makefile (100%) rename test/{TEST-31-OOMPOLICY => TEST-32-OOMPOLICY}/test.sh (100%) rename test/{TEST-31-OOMPOLICY => TEST-32-OOMPOLICY}/testsuite.sh (100%) diff --git a/test/TEST-31-OOMPOLICY/Makefile b/test/TEST-32-OOMPOLICY/Makefile similarity index 100% rename from test/TEST-31-OOMPOLICY/Makefile rename to test/TEST-32-OOMPOLICY/Makefile diff --git a/test/TEST-31-OOMPOLICY/test.sh b/test/TEST-32-OOMPOLICY/test.sh similarity index 100% rename from test/TEST-31-OOMPOLICY/test.sh rename to test/TEST-32-OOMPOLICY/test.sh diff --git a/test/TEST-31-OOMPOLICY/testsuite.sh b/test/TEST-32-OOMPOLICY/testsuite.sh similarity index 100% rename from test/TEST-31-OOMPOLICY/testsuite.sh rename to test/TEST-32-OOMPOLICY/testsuite.sh From d04876b143cbdf7da7820b2b05e969c9e1af62fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 19 May 2019 13:03:21 +0200 Subject: [PATCH 6/6] TEST-32-OOMPOLICY: drop unneeded headers --- test/TEST-32-OOMPOLICY/test.sh | 2 -- test/TEST-32-OOMPOLICY/testsuite.sh | 2 -- 2 files changed, 4 deletions(-) diff --git a/test/TEST-32-OOMPOLICY/test.sh b/test/TEST-32-OOMPOLICY/test.sh index 55752e6a70..7e9431dd11 100755 --- a/test/TEST-32-OOMPOLICY/test.sh +++ b/test/TEST-32-OOMPOLICY/test.sh @@ -1,6 +1,4 @@ #!/bin/bash -# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -# ex: ts=8 sw=4 sts=4 et filetype=sh set -e TEST_DESCRIPTION="test OOM killer logic" TEST_NO_NSPAWN=1 diff --git a/test/TEST-32-OOMPOLICY/testsuite.sh b/test/TEST-32-OOMPOLICY/testsuite.sh index f0b1470d42..8aab487c6e 100755 --- a/test/TEST-32-OOMPOLICY/testsuite.sh +++ b/test/TEST-32-OOMPOLICY/testsuite.sh @@ -1,6 +1,4 @@ #!/bin/bash -# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*- -# ex: ts=8 sw=4 sts=4 et filetype=sh set -ex set -o pipefail