[BusyBox] [patch] incorrect paths in init.c

Andrew Clausen clausen at melbourne.sgi.com
Fri Feb 21 20:39:47 UTC 2003


Hi all,

init.c tries to mount swap partitions if the amount of memory available
is quite small.  Unfortunately, the commands don't work, since
only "swapon" and "mount" are supplied to run(), which doesn't search
the PATH environment variable.

My patch below gives the full path.  Perhaps a better solution would
be to search PATH instead... up to you...

BTW, why is mount in /bin and swapon in /sbin?  I'm getting this
from the Debian boot floppies initrd.

Cheers,
Andrew

diff -u busybox-0.60.2.orig/init.c busybox-dev/init.c
--- busybox-0.60.2.orig/init.c	Tue Nov 20 16:43:28 2001
+++ busybox-dev/init.c	Thu Feb 20 21:01:50 2003
@@ -608,9 +608,9 @@
 #if !defined(__UCLIBC__) || defined(__UCLIBC_HAS_MMU__)
 	if (stat("/etc/fstab", &statBuf) == 0) {
 		/* swapon -a requires /proc typically */
-		waitfor("mount proc /proc -t proc", console, FALSE);
+		waitfor("/bin/mount proc /proc -t proc", console, FALSE);
 		/* Try to turn on swap */
-		waitfor("swapon -a", console, FALSE);
+		waitfor("/sbin/swapon -a", console, FALSE);
 		if (check_free_memory() < 1000)
 			goto goodnight;
 	} else





More information about the busybox mailing list