[BusyBox] init nitpick
Jeff Mock
jeff at mock.com
Tue Jan 14 23:16:03 UTC 2003
I'm using busybox-0.60.5.
I'm running busybox on a Rio Receiver. It's an ARM7-based thin client sort
of device. The root filesystem is NFS mounted read-only. I'm using a
2.2.14 kernel, this is the kernel the guys that originally built
the box use and their drivers haven't been ported to 2.4 so I'm using
an older kernel.
I'm having a problem with busybox init caused by a difference in
semantics between access() on a 2.2 kernel and a 2.4 kernel. If
you call access() on a device on a read-only filesystem on a 2.2 kernel
it will return an error of EROFS (filesystem mounted read-only) even
though you can open the device for writing. This is probably the wrong
thing to do, but I think that's the way 2.2 works. On a 2.4 kernel no
error is returned. The problem in busybox shows up as init failing to
run any processes from /etc/inittab because it thinks that
the controlling ttys aren't writeable.
So, here's my patch for init.c to fix this problem. busybox-0.60.5 works
great on a 2.2 kernel otherwise...
jeff
-----------------
--- busybox-0.60.5-orig/init.c 2002-10-22 12:15:43.000000000 -0700
+++ busybox-0.60.5/init.c 2003-01-14 21:50:04.000000000 -0800
@@ -847,7 +847,7 @@
cons = console;
/* do not run entries if console device is not available */
- if (access(cons, R_OK|W_OK))
+ if (access(cons, R_OK|W_OK) && errno != EROFS)
return;
if (strcmp(cons, "/dev/null") == 0 && (action & ASKFIRST))
return;
More information about the busybox
mailing list