Skip to contentSkip to conversation

Fix wrong remove_parameter() calls

PATCH In review Bernhard Walle 2 participants 4 messages Jun 2, 2008 – Jun 13, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix wrong remove_parameter() calls

When --reuse-cmdline is specified, kexec automatically removes some command line parameter that are *known* to break the kexec'd target. That patch corrects that behaviour:

1. BOOT_IMAGE should be removed always when --reuse-cmdline is specified since it's likely that the kernel is not the same as the running kernel. As only lilo-like bootloaders (i.e. not GRUB) adds that parameter, there's no need to add a BOOT_IMAGE here.

2. crashkernel should be only removed when 'kexec -p' is called. For the normal kexec, the crashkernel parameter can be passed as in the running kernel.

The mistake has been introduced by commit 3c5bb06948881b3e31c783c19edef74275794280 by myself.

---
 kexec/kexec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kexec/kexec.c +2 -2
index 0a8ed32..fee895d 100644
@@ -871,10 +871,10 @@ char *get_command_line(int filtered)
 		*(line + strlen(line) - 1) = 0;
 
 		if (filtered) {
-			remove_parameter(line, "crashkernel");
+			remove_parameter(line, "BOOT_IMAGE");
 			if (kexec_flags & KEXEC_ON_CRASH) {
-				remove_parameter(line, "BOOT_IMAGE");
 				remove_parameter(line, "mem");
+				remove_parameter(line, "crashkernel");
 			}
 		}
 	} else
Signature · 7 lines
1.5.4.5


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#1 lore raw
Quoted 9 lines · Bernhard Walle

When --reuse-cmdline is specified, kexec automatically removes some command line parameter that are *known* to break the kexec'd target. That patch corrects that behaviour:

1. BOOT_IMAGE should be removed always when --reuse-cmdline is specified since it's likely that the kernel is not the same as the running kernel. As only lilo-like bootloaders (i.e. not GRUB) adds that parameter, there's no need to add a BOOT_IMAGE here.

Quoted 6 lines

2. crashkernel should be only removed when 'kexec -p' is called. For the normal kexec, the crashkernel parameter can be passed as in the running kernel.

The mistake has been introduced by commit 3c5bb06948881b3e31c783c19edef74275794280 by myself.

Hi Bernhard,

this change seems fine, however the patch requires your previous patch, "Implement support for mem command line parameter", which is still the point of some debate.

Could you rediff this change against the current code in git?

Quoted 32 lines
---
 kexec/kexec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kexec/kexec.c +2 -2
index 0a8ed32..fee895d 100644
@@ -871,10 +871,10 @@ char *get_command_line(int filtered)
 		*(line + strlen(line) - 1) = 0;
 
 		if (filtered) {
-			remove_parameter(line, "crashkernel");
+			remove_parameter(line, "BOOT_IMAGE");
 			if (kexec_flags & KEXEC_ON_CRASH) {
-				remove_parameter(line, "BOOT_IMAGE");
 				remove_parameter(line, "mem");
+				remove_parameter(line, "crashkernel");
 			}
 		}
 	} else
Signature · 7 lines
1.5.4.5


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
Signature · 7 lines
Horms


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#2 lore raw

PATCH 1/1 Fix wrong remove_parameter() calls

When --reuse-cmdline is specified, kexec automatically removes some command line parameter that are *known* to break the kexec'd target. That patch corrects that behaviour:

1. BOOT_IMAGE should be removed always when --reuse-cmdline is specified since it's likely that the kernel is not the same as the running kernel. As only lilo-like bootloaders (i.e. not GRUB) adds that parameter, there's no need to add a BOOT_IMAGE here.

2. crashkernel should be only removed when 'kexec -p' is called. For the normal kexec, the crashkernel parameter can be passed as in the running kernel.

The mistake has been introduced by commit 3c5bb06948881b3e31c783c19edef74275794280 by myself.

---
 kexec/kexec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
kexec/kexec.c +2 -2
index 1550d68..b831775 100644
@@ -869,9 +869,9 @@ char *get_command_line(void)
 		/* strip newline */
 		*(line + strlen(line) - 1) = 0;
 
-		remove_parameter(line, "crashkernel");
+		remove_parameter(line, "BOOT_IMAGE");
 		if (kexec_flags & KEXEC_ON_CRASH)
-			remove_parameter(line, "BOOT_IMAGE");
+			remove_parameter(line, "crashkernel");
 	} else
 		line = strdup("");
 
Signature · 7 lines
1.5.4.5


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec
#3 lore raw
Quoted 9 lines · Bernhard Walle

When --reuse-cmdline is specified, kexec automatically removes some command line parameter that are *known* to break the kexec'd target. That patch corrects that behaviour:

1. BOOT_IMAGE should be removed always when --reuse-cmdline is specified since it's likely that the kernel is not the same as the running kernel. As only lilo-like bootloaders (i.e. not GRUB) adds that parameter, there's no need to add a BOOT_IMAGE here.

Quoted 6 lines

2. crashkernel should be only removed when 'kexec -p' is called. For the normal kexec, the crashkernel parameter can be passed as in the running kernel.

The mistake has been introduced by commit 3c5bb06948881b3e31c783c19edef74275794280 by myself.

Thans Bernhard, applied.

Signature · 7 lines
Horms


_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec