SHA256
1
0
forked from pool/kdump
kdump/kdump-preserve-white-space.patch
Petr Tesařík 8c4cc920f8 Accepting request 757490 from home:ptesarik:branches:Kernel:kdump
- kdump-calibrate-Update-values.patch: calibrate: Update values.
- kdump-prefer-by-path-and-device-mapper.patch: Prefer by-path and
  device-mapper aliases over kernel device names (bsc#1101149,
  LTC#168532).
- kdump-powerpc-no-reload-on-CPU-removal.patch: powerpc: Do not
  reload on CPU hot removal (bsc#1133407, LTC#176111).
- kdump-Add-force-option-to-KDUMP_NETCONFIG.patch: Add ":force"
  option to KDUMP_NETCONFIG (bsc#1108919).
- kdump-Add-fence_kdump_send-when-fence-agents-installed.patch: Add
  fence_kdump_send when fence-agents installed (bsc#1108919).
- kdump-FENCE_KDUMP_SEND-variable.patch: Use var for path of
  fence_kdump_send and remove the unnecessary PRESCRIPT check
  (bsc#1108919).
- kdump-Document-fence_kdump_send.patch: Document kdump behaviour
  for fence_kdump_send (bsc#1108919).
- kdump-nss-modules.patch: Improve the handling of NSS
  (bsc#1021846).
- kdump-skip-mounts-if-no-proc-vmcore.patch: Skip kdump-related
  mounts if there is no /proc/vmcore (bsc#1102252, bsc#1125011).
- kdump-clean-up-kdump-mount-points.patch: Make sure that kdump
  mount points are cleaned up (bsc#1102252, bsc#1125011).
- kdump-Clean-up-the-use-of-current-vs-boot-network-iface.patch:
  Clean up the use of current vs. boot network interface names
  (bsc#1094444, bsc#1116463, bsc#1141064).
- kdump-Use-a-custom-namespace-for-physical-NICs.patch: Use a
  custom namespace for physical NICs (bsc#1094444, bsc#1116463,
  bsc#1141064).
- kdump-preserve-white-space.patch: Preserve white space when
  removing kernel command line options (bsc#1117652).

OBS-URL: https://build.opensuse.org/request/show/757490
OBS-URL: https://build.opensuse.org/package/show/Kernel:kdump/kdump?expand=0&rev=188
2019-12-17 10:11:52 +00:00

49 lines
1.6 KiB
Diff

From: Petr Tesarik <ptesarik@suse.com>
Date: Tue, Nov 12 2019 14:53:37 +0100
Subject: Preserve white space when removing kernel command line options
References: bsc#1117652
Upstream: merged
Git-commit: 23d593b54a9c97a204ea7412e53c60d3d3852cab
The function was originally designed to remove unwanted options
from the panic kernel command line. It is now also used to check
whether the current command line contains a fadump option or not,
but the check is broken, because remove_from_commandline() may
change the amount (and type) of white space. For example, it
always adds an extra space if the original string ends with a
space.
Modify the function to copy original separators verbatim, except
that any white space preceding the removed option is removed.
Fixes: a4718a2c7b714d0594903fc8dc5ae47252a9b9ba
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
---
init/load.sh | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
--- a/init/load.sh
+++ b/init/load.sh
@@ -17,15 +17,13 @@ function remove_from_commandline()
awk 'BEGIN { ORS="" }
{
while(length()) {
- sub(/^[[:space:]]+/,"");
- pstart=match($0,/("[^"]*"?|[^"[:space:]])+/);
- plength=RLENGTH;
- param=substr($0,pstart,plength);
- raw=param;
+ match($0,/^([[:space:]]*)(.*)/,w);
+ match(w[2],/(("[^"]*"?|[^"[:space:]])+)(.*)/,p);
+ raw=p[1];
gsub(/"/,"",raw);
if (raw !~ /^('"$option"')(=|$)/)
- print param " ";
- $0=substr($0,pstart+plength);
+ print w[1] p[1];
+ $0=p[3];
}
print "\n";
}'