From f8e3f42ec1b89a5bfe3116351b92280a9b29be2f Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Mon, 28 Mar 2022 16:14:44 +0200 Subject: [PATCH] s390: use KEXEC_ALL_OPTIONS Resolves: bz2060824 Upstream: git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git Conflicts: None commit 91a3d0e00a5c18ee9bdd2c6c03ac64a6471e2559 Author: Sven Schnelle Date: Thu Dec 16 12:43:53 2021 +0100 s390: use KEXEC_ALL_OPTIONS KEXEC_ALL_OPTIONS could be used instead defining the same array several times. This makes code easier to maintain when new options are added. Suggested-by: Alexander Egorenkov Signed-off-by: Sven Schnelle Reviewed-by: Alexander Egorenkov Signed-off-by: Simon Horman Signed-off-by: Philipp Rudo --- ...2.0.23-02-s390_use_KEXEC_ALL_OPTIONS.patch | 43 +++++++++++++++++++ kexec-tools.spec | 2 + 2 files changed, 45 insertions(+) create mode 100644 kexec-tools-2.0.23-02-s390_use_KEXEC_ALL_OPTIONS.patch diff --git a/kexec-tools-2.0.23-02-s390_use_KEXEC_ALL_OPTIONS.patch b/kexec-tools-2.0.23-02-s390_use_KEXEC_ALL_OPTIONS.patch new file mode 100644 index 0000000..5bbca90 --- /dev/null +++ b/kexec-tools-2.0.23-02-s390_use_KEXEC_ALL_OPTIONS.patch @@ -0,0 +1,43 @@ + commit 91a3d0e00a5c18ee9bdd2c6c03ac64a6471e2559 + Author: Sven Schnelle + Date: Thu Dec 16 12:43:53 2021 +0100 + + s390: use KEXEC_ALL_OPTIONS + + KEXEC_ALL_OPTIONS could be used instead defining the same + array several times. This makes code easier to maintain when + new options are added. + + Suggested-by: Alexander Egorenkov + Signed-off-by: Sven Schnelle + Reviewed-by: Alexander Egorenkov + Signed-off-by: Simon Horman + + diff --git a/kexec/arch/s390/kexec-image.c b/kexec/arch/s390/kexec-image.c + index a52399eafd2abd4a24142f0512251598ea812ca5..209ab77ddccbd60f10989e2d9fc273324aefa76d 100644 + --- a/kexec/arch/s390/kexec-image.c + +++ b/kexec/arch/s390/kexec-image.c + @@ -57,10 +57,7 @@ int image_s390_load_file(int argc, char **argv, struct kexec_info *info) + + static const struct option options[] = + { + - KEXEC_OPTIONS + - {"command-line", 1, 0, OPT_APPEND}, + - {"append", 1, 0, OPT_APPEND}, + - {"initrd", 1, 0, OPT_RAMDISK}, + + KEXEC_ALL_OPTIONS + {0, 0, 0, 0}, + }; + static const char short_options[] = KEXEC_OPT_STR ""; + @@ -111,10 +108,7 @@ image_s390_load(int argc, char **argv, const char *kernel_buf, + + static const struct option options[] = + { + - KEXEC_OPTIONS + - {"command-line", 1, 0, OPT_APPEND}, + - {"append", 1, 0, OPT_APPEND}, + - {"initrd", 1, 0, OPT_RAMDISK}, + + KEXEC_ALL_OPTIONS + {0, 0, 0, 0}, + }; + static const char short_options[] = KEXEC_OPT_STR ""; diff --git a/kexec-tools.spec b/kexec-tools.spec index 5ce60c8..cb34d11 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -105,6 +105,7 @@ Requires: systemd-udev%{?_isa} # Patches 401 through 500 are meant for s390 kexec-tools enablement # Patch401: ./kexec-tools-2.0.23-01-s390_add_variable_command_line_size.patch +Patch402: ./kexec-tools-2.0.23-02-s390_use_KEXEC_ALL_OPTIONS.patch # # Patches 501 through 600 are meant for ARM kexec-tools enablement @@ -136,6 +137,7 @@ tar -z -x -v -f %{SOURCE9} tar -z -x -v -f %{SOURCE19} %patch401 -p1 +%patch402 -p1 %patch601 -p1 %patch602 -p1 %patch603 -p1