Skip to contentSkip to conversation

Add DEVPATH env variable to hotplug helper call

PATCH Superseded Josef 'Jeff' Sipek 1 participant 1 message Sep 24, 2004 CPU hotplug

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add DEVPATH env variable to hotplug helper call

Add $DEVPATH to the environmental variables during /sbin/hotplug call.

Josef 'Jeff' Sipek.

kernel/cpu.c +4 -3
diff -Nru a/kernel/cpu.c b/kernel/cpu.c
@@ -61,13 +61,13 @@
  * cpu' with certain environment variables set.  */
 static int cpu_run_sbin_hotplug(unsigned int cpu, const char *action)
 {
-	char *argv[3], *envp[5], cpu_str[12], action_str[32];
+	char *argv[3], *envp[6], cpu_str[12], action_str[32], devpath_str[38];
 	int i;
 
 	sprintf(cpu_str, "CPU=%d", cpu);
 	sprintf(action_str, "ACTION=%s", action);
-	/* FIXME: Add DEVPATH. --RR */
-
+	sprintf(devpath_str, "DEVPATH=devices/system/cpu/cpu%d", cpu);
+	
 	i = 0;
 	argv[i++] = hotplug_path;
 	argv[i++] = "cpu";
@@ -79,6 +79,7 @@
 	envp[i++] = "PATH=/sbin:/bin:/usr/sbin:/usr/bin";
 	envp[i++] = cpu_str;
 	envp[i++] = action_str;
+	envp[i++] = devpath_str;
 	envp[i] = NULL;
 
 	return call_usermodehelper(argv[0], argv, envp, 0);